mirror of https://github.com/mgba-emu/mgba.git
GB: SGB controller cleanup
This commit is contained in:
parent
22c55f21dc
commit
d6e9315ff5
|
@ -532,13 +532,13 @@ void GBIOWrite(struct GB* gb, unsigned address, uint8_t value) {
|
|||
|
||||
static uint8_t _readKeys(struct GB* gb) {
|
||||
uint8_t keys = *gb->keySource;
|
||||
if (gb->sgbCurrentController & gb->sgbControllers) {
|
||||
if (gb->sgbCurrentController != 0) {
|
||||
keys = 0;
|
||||
}
|
||||
uint8_t joyp = gb->memory.io[REG_JOYP];
|
||||
switch (joyp & 0x30) {
|
||||
case 0x30:
|
||||
keys = gb->sgbCurrentController & gb->sgbControllers;
|
||||
keys = gb->sgbCurrentController;
|
||||
break;
|
||||
case 0x20:
|
||||
keys >>= 4;
|
||||
|
|
|
@ -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 &= video->p->sgbControllers;
|
||||
video->p->sgbCurrentController = 0;
|
||||
return;
|
||||
case SGB_MASK_EN:
|
||||
video->renderer->sgbRenderMode = video->sgbPacketBuffer[1] & 0x3;
|
||||
|
|
Loading…
Reference in New Issue