Skip to main content

Module save

Module save 

Source
Expand description

The four on-cartridge save backends (SRAM, FlashRAM, EEPROM, Controller Pak). The four on-cartridge save backends + the Controller Pak.

Two access paths (docs/cart.md, ref-docs/research-report.md §6):

  • PI-bus (DOM2 @ 0x0800_0000): SRAM (flat) and FlashRAM (a command state machine). Driven through SaveDevice::pi_read/pi_write.
  • Joybus (SI/PIF): EEPROM 4k/16k and the Controller Pak (flat blocks). Driven through SaveDevice::eeprom_read_block etc. by the joybus module.

Every backend round-trips a write and reload byte-for-byte — the accuracy oracle (the RustyNES battery-save analog). FlashRAM is modeled as its real erase/program/status machine (n64brew Flash.md), not a flat buffer, because a game that issues an erase-then-program sequence corrupts a flat store.

Structs§

FlashRam
The FlashRAM state machine.

Enums§

SaveDevice
A cartridge save backend, sized + typed from the resolved SaveType.

Constants§

FLASH_CIR
FlashRAM Command Internal Register, at base + 0x10000.
SAVE_PI_BASE
PI base of the DOM2 save window (SRAM / FlashRAM).