Alley Cat Sprite Table Format

From ModdingWiki
Jump to navigation Jump to search
Alley Cat Sprite Table Format
There is no example of an image in this format — upload one!
Format typeImage
HardwareCGA
Colour depth2-bit (CGA)
Minimum size (pixels)Unknown
Maximum size (pixels)Unknown
PaletteShared
Plane count1
Transparent pixels?Palette-based
Hitmap pixels?No
Games

Many animated sprites in Alley Cat are selected through little-endian pointer tables embedded in the executable. Each pointer refers to a headerless packed image. The frame count is supplied by the calling code; it is not a count field at the start of the table.

File format

A fixed-size animation uses UINT16LE pointers[count]. Each value is a DS-relative address. Width and height are known to the caller.

Variable-size animations use a separate, parallel UINT16LE sizes[count] table. It is not interleaved with the pointer table:

Size-word component Meaning
Low byte Width in 16-bit words; multiply by 8 for pixels
High byte Height in rows
source = read16(pointerTable + 2 * frame)
size = read16(sizeTable + 2 * frame)
width = (size & 255) * 8
height = size >> 8
byteLength = 2 * (size & 255) * height

Frame tables

The following catalogue entries use IBM DS offsets. A dash means that the dimensions are fixed in the caller. The drawing modes are those used by the viewer catalogue.

Group Pointers Frames Size table or fixed dimensions Mode
Cat walking 0x0F7A 12 24×11 AND
Cat idle upper 0x0F92 8 16×6 AND
Cat idle lower 0x0FA2 4 16×6 AND
Cat airborne 0x0FAA 6 0x0FB6 AND
Cat poses 0x0FC2 8 0x0FD2 AND
Dog 0x15C8 8 32×15 Overlay
Thrown objects 0x17C9 4 0x17D1 Overlay
Alley decorations 0x584C 6 0x5858 Copy
Title blink 0x6A8F 2 80×12 Copy
Ending frames 0x5012 2 32×35 Copy
Ending bursts 0x4D92 3 0x4DC2 Overlay
Room 1 object 0x35D0 4 16×10 Copy
Room 4 animation 0x3DE0 2 16×12 AND
Room 7 creatures 0x4A60 16 24×12 Overlay
Room 7 tiles 0x2E20 2 16×8 Copy
Mice overlay 0x1F5F 3 16×8 Overlay

Some groups have two adjacent image variants at each pointer: room 6 cat frames use 12 pointers at DS:44A5, with 24×10 images at pointer and pointer + 60; room 5 runners use four pointers at DS:40C0, with 8×5 images at pointer and pointer + 30. These variants are stored pixels, not an instruction to mirror an image.

Notes

  • There is no universal sprite number or global sprite-directory record. Different routines index different tables; some images are addressed directly.
  • In the Tandy edition, map the table address as described in Alley Cat Executable Format. Values read from the table are already Tandy pointers.
  • Scenery-list widths are in bytes, unlike the word-based sizes above. Do not use this dimension decoder for scenery headers.
  • The listed tables reproduce the viewer's named table groups, not a claim that all game animation data is catalogued.

Source code

From re-alleycat, the open-source HTML5 port (revision b003aa63ffbb):

Credits

This file format was reverse engineered by VorticonCmdr. Please credit the original research when using this information in your own project, and include a link back to this wiki.