Game file format

From Sp305x wiki

Jump to: navigation, search

Game files (.BIN ending) are special executable files supported by some of the mp4 players. See the List of units "support .BIN" column.

A game-file consists of 2 parts: the 128-byte header and the actual executable code:

.bin game file format overview
header executable code
128 bytes remaining bytes


Header

Values taken from Mp4-pong header.


byte 0 to 11 (12 bytes)
header/file info?
'NGame1.0'  ?
0x4e 0x47 0x61 0x6d 0x65 0x31 0x2e 0x30 0x80 0x00 0x00 0x00


byte 12 to 27 (16 bytes, string, zero terminated)
unknown
... 0x00


byte 28 to 43 (16 bytes, string, zero terminated)
"SPCA556" ?
0x53 0x50 0x43 0x41 0x35 0x35 0x36 0x00


byte 44 to 75 (32 bytes, string, zero terminated)
name of the game
... 0x00


byte 76 to 107 (32 bytes, string, zero terminated)
maker of the game
... 0x00


byte 108 to 127 (20 bytes)
unknown / flags? (e.g. screen rotation)
0x03 0x05 0x03 0x00 0x02 0x00 0x01 0x00 0x00 0x31 0x30 0x30 0x39 0x59 0x00 0x00 0x40 0x00 0x40 0x00


Executable code

Code from here is copied from nand/SD to RAM at position 0x24C00000. Then the game is called as a subroutine with entry point 0x24C00000. Returning to the os happens using a standard mov pc,lr-instruction. The code the game consists of is standard little-endian ARM9 machine code. It can call OS-calls to ask the OS to do stuff like play music, get keys, etc.

Personal tools