GB I/O: SGB multiplayer cleanup (fixes #1067)
Vicki Pfau vi@endrift.com
Tue, 24 Apr 2018 21:31:53 -0700
1 files changed,
6 insertions(+),
6 deletions(-)
jump to
M
src/gb/io.c
→
src/gb/io.c
@@ -113,10 +113,6 @@ if (bits == gb->currentSgbBits) {
return; } gb->currentSgbBits = bits; - if (gb->sgbBit == 128 && bits == 2) { - GBVideoWriteSGBPacket(&gb->video, gb->sgbPacket); - ++gb->sgbBit; - } if (gb->sgbBit > 128) { switch (bits) { case 1:@@ -126,12 +122,16 @@ case 2:
gb->sgbBit |= 4; break; case 3: - if (gb->sgbBit == 135 && bits == 3 && !(gb->video.sgbCommandHeader & 7)) { + if (gb->sgbBit == 135) { gb->sgbBit &= ~6; gb->sgbCurrentController = (gb->sgbCurrentController + 1) & gb->sgbControllers; } break; } + } + if (gb->sgbBit == 128 && bits == 2) { + GBVideoWriteSGBPacket(&gb->video, gb->sgbPacket); + ++gb->sgbBit; } if (gb->sgbBit >= 128) { return;@@ -524,7 +524,7 @@ keys = 0;
} switch (gb->memory.io[REG_JOYP] & 0x30) { case 0x30: - keys = 0xF - gb->sgbCurrentController; + keys = gb->sgbCurrentController; break; case 0x20: keys >>= 4;