Path: blob/main/misc/emulator/xnes/snes9x/docs/snapshots.txt
28798 views
***** Important notice ********************************************************1This document describes the snapshot file format for Snes9x 1.52 and later,2not compatible with 1.51.3*******************************************************************************45Snes9x snapshot file format: (may be gzip-compressed)67Begins with fixed length signature, consisting of a string, ':', a 4-digit8decimal version, and a '\n'.910#!s9xsnp:0006 <-- '\n' after the 61112Then we have various blocks. The block format is: 3-character block name,13':', 6-digit length, ':', then the data. Blocks are written in a defined14order. Structs are written packed with their members in a defined order, in15big-endian order where applicable.1617NAM:000019:Chrono Trigger.zip1819Currently defined blocks (in order) are:2021Essential parts:22NAM - ROM filename, from Memory.ROMFilename. 0-terminated string.23CPU - struct SCPUState, CPU internal state variables.24REG - struct SRegisters, emulated CPU registers.25PPU - struct SPPU, PPU internal variables. Note that IPPU is never saved.26DMA - struct SDMA, DMA/HDMA state variables.27VRA - Memory.VRAM, 0x10000 bytes.28RAM - Memory.RAM, 0x20000 bytes (WRAM).29SRA - Memory.SRAM, 0x20000 bytes.30FIL - Memory.FillRAM, 0x8000 bytes (register backing store).31SND - All of sound emulated registers and state valiables.32CTL - struct SControlSnapshot, controller emulation.33TIM - struct STimings, variables about timings between emulated events.3435Optional parts:36SFX - struct FxRegs_s, Super FX.37SA1 - struct SSA1, SA1 internal state variables.38SAR - struct SSA1Registers, SA1 emulated registers.39DP1 - struct SDSP1, DSP-1.40DP2 - struct SDSP2, DSP-2.41DP4 - struct SDSP4, DSP-4.42CX4 - Memory.C4RAM, 0x2000 bytes.43ST0 - struct SST010, ST-010.44OBC - struct SOBC1, OBC1 internal state variables.45OBM - Memory.OBC1RAM, 0x2000 byts.46S71 - struct SSPC7110Snapshot, SPC7110.47SRT - struct SSRTCSnapshot, S-RTC internal state variables.48CLK - struct SRTCData, S-RTC emulated registers.49BSX - struct SBSX, BS-X.50SHO - rendered SNES screen.51MOV - struct SnapshotMovieInfo.52MID - Some block of data the movie subsystem.5354==================5556Without changing the snapshot version number:57---------------------------------------------5859Blocks may be safely added at the END of the file, as anything after the last60block is ignored. Blocks may not be moved or removed.6162Blocks may not decrease in size. Say you decrease from 10 bytes to 5. Then63later you increase back to 8. The only way you could safely do this is if64bytes 5-7 still mean the same thing they meant when the block was 10 bytes65long.6667Blocks may increase in size as you wish, as long as you can handle old68savestates with the old shorter size.6970Struct members may not change in interpretation. New struct members may be71added (at the END!) only if you can cope with them being binary-0 in older72savestates. Struct members may not be removed or changed in size/type.7374With changing the snapshot version number:75------------------------------------------7677Blocks may be added, moved, or removed at will.7879Blocks may decrease in size.8081Struct members may be added, moved, or deleted, and their82interpretations/types may be changed. Use the 'debuted_in' and 'deleted_in'83fields to indicate when the new member debuted or the old member went away.848586