-> vSNES source/uS9X.pas
Files are usually compressed via gzip, can be extracted with WinRAR etc.
The gzip library can also read transparently from uncompressed files.
file header:
- Signature (8 chars)
- Colon (1 char )
- Version (4 chars)
- Delimiter (1 char )
Files are organized in blocks which come after the header.
block structure:
- Name (3 chars )
- Colon1 (1 char )
- Size (6 chars )
- Colon2 (1 char )
- Data ([Size] bytes)
Required block order:
"NAM" (cartridge name)
"CPU" (CPU status)
"REG" (CPU registers)
"PPU" (PPU status, basically registers $2100+ with some modifications)
"DMA" (DMA registers)
"VRA" (VRAM)
"RAM" (WRAM)
"SRA" (SRAM, always $20000 bytes)
"FIL" (FillRAM, 32 KB storing the last values of the registers $xx:0000..$xx:7FFF, regardless if mapped or not)
"APU" (APU status, optional)
"ARE" (only if "APU" is present: APU registers)
"ARA" (only if "APU" is present: APU RAM)
"SOU" (only if "APU" is present: other sound data)
"SA1" (SA-1 status, optional)
"SAR" (only if "SA1" is present: SA-1 registers)
"SP7" (SPC7110 status)
"RTC" (S7RTC status)