Decoding Aflh Resources
By Ron Tigat

The filmstrip contains the images used by the game to display a breed's egg. On both the Macintosh and Windows, the raw graphical data is stored in one large chunk. The Aflh resource (or the "32516" resource if you are using eXescope to examine an ODD file in Windows) contains the width, height and offset of each frame. Decoding this information takes a little bit of work, however.


The method displayed here will work fine (as far as I know) on both Mac and Windows versions of Oddballz. However, getting to the actual Aflh resource is not the same technique between the two, and I leave it up to you to find it. This particular hex block was taken from the Windows version of Zott.

00009030: 00 00 00 00 B6 00 8A 00 DC 00 BD 00 00 00 00 00 ............
00009040: 90 01 40 01 47 72 61 62 62 65 64 41 00 00 00 00 .@.GrabbedA....
00009050: 00 00 00 00 06 00 00 00 44 04 00 00 B3 00 88 00 ........D.....
00009060: DF 00 BD 00 00 00 00 00 90 01 40 01 44 72 6F 70 .......@.Drop
00009070: 70 65 64 41 00 00 00 00 00 00 00 00 02 00 00 00 pedA............

Divide the Aflh resource into 52-byte pieces. The first 28 bytes of a block overlap with the last 28 bytes of the previous block, but that's because some of the information is a little jumbled. This is the second one (DroppedA), because the first has no offset and is therefore a bit confusing to work with. "GrabbedA" belongs to the first one, but the highlighted width and height bytes belong to "DroppedA." I admit the arrangement is confusing, so it may be worth your while to make a chart of each frame and its properties. I'm not sure why they chose to do it so, but my guess would be that when PF.Magic made a new breed, the data was stored in this order by whatever equivalent they had to Eggz Scrambler.

Width: Subtract the hexadecimal value of the first highlighted byte from the second highlighted byte (In C++ notation, that would be 0xDC - 0xB6, in BASIC it's &hDC - &hB6, HTML has #DC - #B6, but I'm sure you understand.)

Height: Once again, subtract the first hexadecimal value from the second value to get the height of the filmstrip frame.

Offset: This is where in the Aflm resource this frame starts (0x444 bytes from the beginning). To get 444 out of 44 04, you have to convert it from Little Endian format to the format used by humans (most of the time), Big Endian. To do this, switch the bytes. You end up with 04 44 which is, of course, 444.

Some of the frames do not have names coded into them, just null (0x00) bytes where it would go.



The width and height data are also stored as WORD (2-bytes long, in little endian format) values, but I have yet to find any filmstrip frames larger than FF in either dimension. However, if you come across such a frame, be sure to do the little-to-big endian conversion so you get the right sized image.