mirror of https://github.com/mgba-emu/mgba.git
GB: Yet more SGB cleanup
This commit is contained in:
parent
34529398bb
commit
e925148573
|
@ -115,10 +115,12 @@ static void _writeSGBBits(struct GB* gb, int bits) {
|
|||
if (bits == gb->currentSgbBits) {
|
||||
return;
|
||||
}
|
||||
gb->currentSgbBits = bits;
|
||||
switch (bits) {
|
||||
case 0:
|
||||
case 1:
|
||||
gb->sgbIncrement = !gb->sgbIncrement;
|
||||
if (gb->currentSgbBits & 2) {
|
||||
gb->sgbIncrement = !gb->sgbIncrement;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (gb->sgbIncrement) {
|
||||
|
@ -127,6 +129,7 @@ static void _writeSGBBits(struct GB* gb, int bits) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
gb->currentSgbBits = bits;
|
||||
if (gb->sgbBit == 128 && bits == 2) {
|
||||
GBVideoWriteSGBPacket(&gb->video, gb->sgbPacket);
|
||||
++gb->sgbBit;
|
||||
|
|
|
@ -702,7 +702,7 @@ void GBVideoWriteSGBPacket(struct GBVideo* video, uint8_t* data) {
|
|||
break;
|
||||
case SGB_MLT_REQ:
|
||||
video->p->sgbControllers = video->sgbPacketBuffer[1] & 0x3;
|
||||
video->p->sgbCurrentController = 0;
|
||||
video->p->sgbCurrentController &= video->p->sgbControllers;
|
||||
return;
|
||||
case SGB_MASK_EN:
|
||||
video->renderer->sgbRenderMode = video->sgbPacketBuffer[1] & 0x3;
|
||||
|
|
Loading…
Reference in New Issue