mirror of https://github.com/mgba-emu/mgba.git
GBA SIO: Fix SIOCNT SI pin value after attaching player 2 (fixes #2805)
This commit is contained in:
parent
7c4a7796f8
commit
1331788b6e
1
CHANGES
1
CHANGES
|
@ -2,6 +2,7 @@
|
||||||
Emulation fixes:
|
Emulation fixes:
|
||||||
- GBA Audio: Fix improperly deserializing GB audio registers (fixes mgba.io/i/2793)
|
- GBA Audio: Fix improperly deserializing GB audio registers (fixes mgba.io/i/2793)
|
||||||
- GBA Memory: Make VRAM access stalls only apply to BG RAM
|
- GBA Memory: Make VRAM access stalls only apply to BG RAM
|
||||||
|
- GBA SIO: Fix SIOCNT SI pin value after attaching player 2 (fixes mgba.io/i/2805)
|
||||||
Other fixes:
|
Other fixes:
|
||||||
- Core: Allow sending thread requests to a crashed core (fixes mgba.io/i/2784)
|
- Core: Allow sending thread requests to a crashed core (fixes mgba.io/i/2784)
|
||||||
- Qt: Fix crash when attempting to use OpenGL 2.1 to 3.1 (fixes mgba.io/i/2794)
|
- Qt: Fix crash when attempting to use OpenGL 2.1 to 3.1 (fixes mgba.io/i/2794)
|
||||||
|
|
|
@ -111,6 +111,18 @@ bool GBASIOLockstepNodeLoad(struct GBASIODriver* driver) {
|
||||||
if (node->id) {
|
if (node->id) {
|
||||||
node->d.p->rcnt |= 4;
|
node->d.p->rcnt |= 4;
|
||||||
node->d.p->siocnt = GBASIOMultiplayerFillSlave(node->d.p->siocnt);
|
node->d.p->siocnt = GBASIOMultiplayerFillSlave(node->d.p->siocnt);
|
||||||
|
|
||||||
|
int try;
|
||||||
|
for (try = 0; try < 3; ++try) {
|
||||||
|
uint16_t masterSiocnt;
|
||||||
|
ATOMIC_LOAD(masterSiocnt, node->p->players[0]->d.p->siocnt);
|
||||||
|
if (ATOMIC_CMPXCHG(node->p->players[0]->d.p->siocnt, masterSiocnt, GBASIOMultiplayerClearSlave(masterSiocnt))) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
node->d.p->rcnt &= ~4;
|
||||||
|
node->d.p->siocnt = GBASIOMultiplayerClearSlave(node->d.p->siocnt);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SIO_NORMAL_8:
|
case SIO_NORMAL_8:
|
||||||
|
|
Loading…
Reference in New Issue