mirror of https://github.com/mgba-emu/mgba.git
GB I/O: Fix incrementing SGB controller when P14 is low (fixes #2202)
This commit is contained in:
parent
f2f75b3b00
commit
337ca2cfaf
1
CHANGES
1
CHANGES
|
@ -10,6 +10,7 @@ Features:
|
||||||
- Discord Rich Presence now supports time elapsed
|
- Discord Rich Presence now supports time elapsed
|
||||||
- Additional scaling shaders
|
- Additional scaling shaders
|
||||||
Emulation fixes:
|
Emulation fixes:
|
||||||
|
- GB I/O: Fix incrementing SGB controller when P14 is low (fixes mgba.io/i/2202)
|
||||||
- GB Memory: Add cursory cartridge open bus emulation (fixes mgba.io/i/2032)
|
- GB Memory: Add cursory cartridge open bus emulation (fixes mgba.io/i/2032)
|
||||||
- GB Video: Render SGB border when unmasking with ATTR/PAL_SET (fixes mgba.io/i/2261)
|
- GB Video: Render SGB border when unmasking with ATTR/PAL_SET (fixes mgba.io/i/2261)
|
||||||
- GBA: Improve timing when not booting from BIOS
|
- GBA: Improve timing when not booting from BIOS
|
||||||
|
|
14
src/gb/io.c
14
src/gb/io.c
|
@ -119,19 +119,15 @@ static void _writeSGBBits(struct GB* gb, int bits) {
|
||||||
if (bits == gb->currentSgbBits) {
|
if (bits == gb->currentSgbBits) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (bits) {
|
if (bits & 2) {
|
||||||
case 0:
|
|
||||||
case 1:
|
|
||||||
if (gb->currentSgbBits & 2) {
|
|
||||||
gb->sgbIncrement = !gb->sgbIncrement;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
if (gb->sgbIncrement) {
|
if (gb->sgbIncrement) {
|
||||||
gb->sgbIncrement = false;
|
gb->sgbIncrement = false;
|
||||||
gb->sgbCurrentController = (gb->sgbCurrentController + 1) & gb->sgbControllers;
|
gb->sgbCurrentController = (gb->sgbCurrentController + 1) & gb->sgbControllers;
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
|
if (gb->currentSgbBits & 2) {
|
||||||
|
gb->sgbIncrement = !gb->sgbIncrement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gb->currentSgbBits = bits;
|
gb->currentSgbBits = bits;
|
||||||
if (gb->sgbBit == 128 && bits == 2) {
|
if (gb->sgbBit == 128 && bits == 2) {
|
||||||
|
|
Loading…
Reference in New Issue