Skip to content

Link RAM variables

The communication subsystem occupies roughly 0x206c34–0x2077ff (code) and keeps its state in a block of RAM starting at 0x564d. Addresses below are from Samurai Shodown 2; the layout is game-specific but the roles are representative.

Session / dispatcher

Address Role
0x564d session status bits
0x564e dispatcher state (×4 table offset: FF/00/04/08/0C/10/14/18/1C/20)
0x564f public status (00 active, 01 request, FE reset, FF error)

The state table (0x206cd0) maps state → handler:

State Handler State Handler
00 0x206cf4 14 0x206f68
04 0x206d31 18 0x206ed0
08 0x206e8b 1C 0x206f32
0C 0x206ed1 20 0x206d0c
10 0x206f25

Normal transport

Address Role
0x5651 local phase-ready snapshot
0x5652 received phase-ready snapshot
0x5653 locally generated base control (F0 / F1)
0x5654 short activity/resend countdown (15 / 30)
0x5655 peer event state (bit 0); pending local event (bit 7)
0x5656 60-tick event/watchdog countdown
0x5659 transmit queued count (bit 7 = transfer in progress)
0x565b transmit ring write index
0x565d receive queued count
0x565e receive ring write index
0x565f payload receive substate (00, FF, FE, or count)
0x566d 64-byte transmit ring
0x56ad 64-byte receive ring

Gameplay inputs

Address Role
0x56ed local input source for the F8 offer (& 0x7f)
0x570d current Player 1 input
0x5711 previous Player 1 input
0x5715 current Player 2 input
0x5719 previous Player 2 input

Newly-pressed edges are computed as current & ~previous.

Entry points

Address Routine
0x206c34 comms init (called from game init 0x200289)
0x206c8f comms tick (called once per frame from main loop 0x2001a7)
0x2304cd BIOS COM call wrapper
0x207447 F8 gameplay branch
0x20da5a game-state phase barrier → enter gameplay