mirror of
https://github.com/libretro/mgba.git
synced 2024-11-24 00:20:05 +00:00
GB: Fix SGB controller incrementing
This commit is contained in:
parent
74e09675ce
commit
22c55f21dc
2
CHANGES
2
CHANGES
@ -55,7 +55,7 @@ Other fixes:
|
||||
- GBA Cheats: Fix value incrementing in CB slide codes (fixes mgba.io/i/1501)
|
||||
- Qt: Only show emulator restart warning once per settings saving
|
||||
- Qt: Improve cheat view UX
|
||||
- GB: Fix SGB controller selection initialization (fixes mgba.io/i/1104)
|
||||
- GB: Fix SGB controller incrementing (fixes mgba.io/i/1104)
|
||||
Misc:
|
||||
- GBA Savedata: EEPROM performance fixes
|
||||
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash
|
||||
|
@ -435,7 +435,7 @@ void GBReset(struct LR35902Core* cpu) {
|
||||
|
||||
gb->sgbBit = -1;
|
||||
gb->sgbControllers = 0;
|
||||
gb->sgbCurrentController = 3;
|
||||
gb->sgbCurrentController = 0;
|
||||
gb->currentSgbBits = 0;
|
||||
memset(gb->sgbPacket, 0, sizeof(gb->sgbPacket));
|
||||
|
||||
|
@ -119,14 +119,11 @@ static void _writeSGBBits(struct GB* gb, int bits) {
|
||||
if (gb->sgbBit > 128) {
|
||||
switch (bits) {
|
||||
case 1:
|
||||
gb->sgbBit |= 2;
|
||||
break;
|
||||
case 2:
|
||||
gb->sgbBit |= 4;
|
||||
gb->sgbBit ^= 2;
|
||||
break;
|
||||
case 3:
|
||||
if (gb->sgbBit == 135) {
|
||||
gb->sgbBit &= ~6;
|
||||
if (gb->sgbBit == 131) {
|
||||
gb->sgbBit &= ~2;
|
||||
gb->sgbCurrentController = (gb->sgbCurrentController + 1) & gb->sgbControllers;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user