Permalink
Browse files

GB I/O: SGB multiplayer cleanup (fixes #1067)

  • Loading branch information...
endrift committed Apr 25, 2018
1 parent 5d0bbcd commit 773151638842e8a91cf0f4b2661322719fc3abb9
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/gb/io.c
View
@@ -113,10 +113,6 @@ static void _writeSGBBits(struct GB* gb, int bits) {
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,13 +122,17 @@ static void _writeSGBBits(struct GB* gb, int bits) {
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 @@ static uint8_t _readKeys(struct GB* gb) {
}
switch (gb->memory.io[REG_JOYP] & 0x30) {
case 0x30:
- keys = 0xF - gb->sgbCurrentController;
+ keys = gb->sgbCurrentController;
break;
case 0x20:
keys >>= 4;

0 comments on commit 7731516

Please sign in to comment.