OBJ file

From NeoGeo Development Wiki
Revision as of 10:38, 8 December 2013 by Razoola (talk | contribs)
Jump to navigation Jump to search

OBJ files contain the sprites graphics (equivalent to the C ROMs on cartridge systems). Data is compressed however using a simple RLE compression removing runs with a value of 0x00000000. Once decompressed the format is described here: sprite graphics format.

RLE compression.

  • First long word value is the compressed file length (/4-1).
  • The system works by checking single long words at a time.
  • When a zero value is found it is stored and the next value is checked. A fill of zero is created to match the value read unless it is zero.


Example.

compressed:

0x00000007, 0x11111111, 0x00000000, 0x00000003, 0x22222222, 0x00000000, 0x00000000, 0x33333333, 0x44444444

decompressed:

0x11111111, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x22222222, 0x00000000, 0x33333333, 0x44444444


This system will not compress data very well unless there are large areas of zero data within the decompressed sprite data. This is due to a single zero value run being inflated by 100% (single long word to double long word) to let the compresser know its not a run.

To my current knowledge only Art of Fighting uses the OBJ format.