Skip to content

Gameplay input exchange

Lockstep F8 frames swap controller state every frame so both consoles simulate identically. The core of the protocol.

Frames

P2 → P1 :  F8 00 <P2 input & 7F>          offer
P1 → P2 :  F8 <P1 input & 7F> <P2 input>  combined reply
either  :  F8 FE FE                        reset / termination
sequenceDiagram
    participant P2 as Player 2
    participant P1 as Player 1
    loop ~33.4 ms
      P2->>P1: F8 00 <p2>
      P1->>P2: F8 <p1> <p2>
    end

The reply echoes the offered <p2>, so a capture shows one direction mirroring the other ~100% — that mirror is the combined reply.

Controller bitmap

7-bit mask (top bit masked off):

Mask Button Mask Button
01 Up 10 A
02 Down 20 B
04 Left 40 Option
08 Right

Combos: 18=Right+A, 14=Left+A, 30=A+B. Full table: controller bitmap.

RAM

Address Holds
0x56ed local input to offer (& 7F)
0x570d / 0x5711 P1 input — current / previous
0x5715 / 0x5719 P2 input — current / previous

New presses = current & ~previous.

Entering gameplay

The active handler (0x206f68) branches on bit 7:

bit 7,(0x564d) ; jrl Z,0x207447    ; bit7 CLEAR → F8 branch

So gameplay = bit 7 clear + bit 3 set (routine 0x20da5a does this after the phase barrier 0x5651==0x5652==1). The offer sends when 0x564f == 01.

Counter-intuitive

Bit 7 set = normal transport; clear + bit 3 = gameplay. The opposite of what the name suggests — only found by executing the ROM.

Confirmed 3 ways

Offer Reply Slots
Capture ✓ Ch6 ✓ Ch2
Disassembly
Emulation ✓ live