Tuesday, June 5, 2012

Stats and stuff

Playing around with numeric data.

Also, added editing capabilities to the title screen stuff.

Tile editor:

Placement of tiles on the title screen:

Saturday, June 2, 2012

More title screen stuff

So back to what I was doing earlier..now this stuff loads too.

Friday, June 1, 2012

Thursday, May 31, 2012

Getting closer.

Suspicion confirmed.  SOM is processing 16x16 JPEG blocks one at a time from almost the time you load the ROM.  The Y channel is stored at $1600 (upper left 8x8 block), $1700 (lower left), $1800 (lower right), and $1900 (upper right).  At $1A00 and 1B00 you find the downsampled Cb and Cr, respectively.

I wrote a little MATLAB script to generate an RGB image from data I found at these locations for the first block to test my theory.  Here's the result compared against a zoomed-in screenshot of the game:

The colors are slightly off; I attribute this to one of three possible things.. one, the most likely, I fucked something up.  Two, the game uses an 8-bit palette in the end (haven't gotten that far yet) and these color shifts are an artifact of paletting.  Three, it's a difference between 16-bit and 24-bit color.  I'd call three unlikely.

Anyway, it shouldn't be long before the editor can load this image, because (with minor bugs) the processing up to this point, including the Huffman tree lookup from the ROM data, Quantization matrix processing, and DCT are all implemented.  Dropping a new image in as the title screen background will be interesting to implement.

Oh, could it really be that simple?

http://en.wikipedia.org/wiki/JPEG#Encoding is not something I've ever been especially familiar with, but as I poke further into the code that processes the title screen "tree" image, the two are looking strikingly similar.  Could this entire mess simply be an off-the-shelf JPEG processing algorithm tweaked for SNES? 

It sure would explain the JPEG-like artifacts visible if you zoom into the image.

Wednesday, May 23, 2012

Title screen

Compressed title screen tiles have been loading for a while, but I'm currently working on how they are assembled into the actual title screen and Squaresoft logo.  Looks pretty simple, actually.

See?  See?  I'm doing things.

Edit: I'm also checking out the tree graphic behind the title screen, since it's been somewhat of a mystery for a while now.  Looks like they're doing some sort of peculiar matrix math on 8x8 blocks of data derived (somehow) from around D2E63B in the ROM, which end up becoming the tiles that go off to VRAM.

Funny how slow this loading is - they start doing it while the Squaresoft logo is up, and are still working on it while the little black window opens up and shows part of the background, which loads from the bottom up.  Once it finishes (~20 seconds later), it opens up and shows the rest.  They pass it off as a stylish little window into the background, but it's really just there to allow you to see the part of the image that's been loaded without revealing the part where the little blocks are still being filled in.  Corrupting the data in certain ways will slow the algorithm down enough that I can watch it populate the tiles while they're being shown.

Kind of interesting though, that they managed to set up sort of a "background task" like this in an SNES program, that will sit there and load tiles while the rest of the title screen is running.  I'm betting they tried like hell to make it load real-time before they finally gave up and had to go this route.

Oh, and this code is largely runtime-generated and run off of RAM addresses, which makes it even more fun to follow.

Needless to say, making this thing "editable" should be quite the task.

Saturday, January 28, 2012

Boss rendering

Finally! I got him to render on his host map correctly. It took like a week's worth of screwing around to get everything straightened out with this.

The other ones are not so healthy looking. But they should be close.

Edit: when I say "not so healthy".. here's Spring Beak as an example.

This is just a matter of reading the wrong value as an offset to the sprite construction data. Once I straighten that out, a bunch of these should look good.

Sunday, January 22, 2012

Super Mantis Ant

Found a setting that seems to make bosses move significantly faster.

Friday, January 20, 2012


As it turns out, Mantis Ant and Tropicallo aren't meant to be in the same place at the same time.

Also, I'm working on bosses and other sprite stuff at the moment. Here are Tropicallo's tiles, shown here with the wrong palette. Thanks to Flow and Enker for bits and pieces of the compression algorithm for these things. Now to figure out how they're all strung together into boss sprites.

Friday, January 13, 2012

Wednesday, January 11, 2012

Sprite loading

Working on loading sprites for build 2. They can sort-of display on maps now.

Saturday, January 7, 2012

Map piece filtering

Something I just added - view the map in a particular state by adjusting event flags. These are used to do stuff like this when you step on switches:

Overlapping map pieces

Finally fixed the issue with overlapping map pieces. Most maps should look close to correct now.

..And by "now" I mean the next build.

Build 0106

Some fixes, and a new screen for misc. game engine changes and fixes.


Friday, January 6, 2012

New Board

ACMLM has been kind enough to give me a discussion board for this editor. The proboards one will be discontinued for general discussion, but I'll keep using it for bug tracking.

See http://acmlm.kafuka.org/board/forum.php?id=132 for the new board.

Tuesday, January 3, 2012

Monday, January 2, 2012

Build 0105 soon

This will have a lot of new stuff and bugfixes. Probably lots of new bugs too.

Just finished up editing & rewriting for door definitions and "display settings" structure which sets up transparency settings, mosaic, and the map's background color. An example of screwing around with one:

(Map 128 with modified transparency type, mosaic on layer 2, and background color changed to blue)

(Running in ZSnes)

All that's left is to finish the re-write code for composite map stuff, which includes all the tileset/palette/etc settings, trigger/door definitions, and objects. This build might be a little short on object details until I start getting into sprite stuff, which I have planned next.