I-RAM

August 12, 2018 ยท View on GitHub

I-RAM is the SA-1 internal memory. 2 kB (2048 bytes) big, it's clocked at 10.74 MHz and can be accessed though addresses $3000-\$37FF on the S-CPU and $0000-\$07FF or $3000-\$37FF on the C-CPU though banks $00-\$3F and $80-$BF.

Being the fastest memory available, it's used mainly to hold the SMW's Direct Page, as cache/scratch memory, some sprite tables as well C-CPU's stack and Character Conversion DMA buffer.

The I-RAM has unrestricted memory access. C-CPU always accesses it at 10.74 MHz and S-CPU accesses at 2.68 MHz. The memory also offers write protection, useful for preventing data loss in case of a game crash. See SA-1 registers $2229 and $222A for more information.


I-RAM Memory Map

Page in this document refers to a block of 0x100 or 256 bytes.

Page 0
StartEndDescription
$3000$30FFSMW's$7E:0000-\$7E:00FF-- the Direct Page.
Page 1
StartEndDescription
$3100$313FExtended scratch memory for the SA-1. Sometimes$00-\$07is used in part of the boost patches, for sharing information between C-CPU and S-CPU.
$3140$317EEmpty. Cleared on reset.
$317F-Total character conversions to be done during NMI. If non-zero, the CC-DMA is executed on the next V-Blank period.
$3180$3182SA-1 Code Pointer (from S-CPU to C-CPU).
$3183$3185SNES Code Pointer (from C-CPU to S-CPU).
$3186$3188SA-1 Parallel Mode Pointer.
$3189-SA-1 done flag (sets when the code pointed at $3080-\$3082returns).
$318A-SNES done flag (sets when the code pointed at $3083-\$3085returns).
$318B-Parallel Mode flag (set to start SA-1 Parallel Mode).
$318C-SA-1 DMA done flag (sets when finished).
$318D-Character Conversion DMA flag (sets when enabled).
$318E-Special Flags (zw------)
  • w: Sets to 1 when the emulator (usually Snes9x) swaps the lower and upper part of a 6 or 8MB ROM, altering the behavior of the Super MMC registers$2220-\$2223.
  • z: ZSNES flag, which is used by certain parts of the patch to correct eventual emulator-specific issues.
$318F-Copy of the register$2225. If you change$2225, make sure to change this too. It's used to preserve the register value on SA-1 IRQs.
$3190$31DFCharacter Conversion DMA table. The table is 80 bytes long and allows up to 10 slots. See also $317F.
$31E0$31FFMemory reserved and dedicated for the Parallel Mode.
Page 2
StartEndDescription
$3200$3215SMW's$7E:009E (used to be Direct Page)
$3216$322BSMW's$7E:00D8 (used to be Direct Page)
$322C$3241SMW's$7E:00E4 (used to be Direct Page)
$3242$3257SMW's$7E:14C8
$3258$326DSMW's$7E:14D4
$326E$3283SMW's$7E:14E0
$3284$3299SMW's$7E:151C
$329A$32AFSMW's$7E:1528
$32B0$32C5SMW's$7E:1534
$32C6$32DBSMW's$7E:1540
$32DC$32F1SMW's$7E:154C
$32F2$3307SMW's$7E:1558
Page 3
StartEndDescription
$3308$331DSMW's$7E:1564
$331E$3333SMW's$7E:1570
$3334$3349SMW's$7E:157C
$334A$335FSMW's$7E:1588
$3360$3375SMW's$7E:1594
$3376$338BSMW's$7E:15A0
$338C$33A1SMW's$7E:15AC
$33A2$33B7SMW's$7E:15EA
$33B8$33CDSMW's$7E:15F6
$33CE$33E3SMW's$7E:1602
$33E4$33F9SMW's$7E:160E
$33FA$340FSMW's$7E:163E
Page 4
StartEndDescription
$3410$3425SMW's$7E:187B
$3426$34FFEmpty. Cleared on reset.
Page 5
StartEndDescription
$3500$35FFEmpty. Cleared on reset.
Page 6
StartEndDescription
$3600$36FFEmpty. Cleared on reset.
Page 7
StartEndDescription
$3700$377FCharacter Conversion output. This memory region is used by the hardware either as a buffer during the Character Conversion 1 DMA operation or as the character output during the Character Conversion 2 operation. Uses 32 bytes for 2BPP mode, 64 bytes for 4BPP mode and 128 bytes for 8BPP mode. See the SNES development book II, Section 1, Chapter 6 for more information.
$3780$37FFReserved for the SA-1 CPU stack.