Game file format
From Sp305x wiki
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:
| header | executable code |
| 128 bytes | remaining bytes |
Header
Values taken from Mp4-pong header.
| header/file info? | |||||||||||
| 'NGame1.0' | ? | ||||||||||
| 0x4e | 0x47 | 0x61 | 0x6d | 0x65 | 0x31 | 0x2e | 0x30 | 0x80 | 0x00 | 0x00 | 0x00 |
| unknown | |
| ... | 0x00 |
| "SPCA556" ? | |||||||
| 0x53 | 0x50 | 0x43 | 0x41 | 0x35 | 0x35 | 0x36 | 0x00 |
| name of the game | |
| ... | 0x00 |
| maker of the game | |||||||
| ... | 0x00 | ||||||
| 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.

