GBA SIO: Some lockstep fixes
Jeffrey Pfau jeffrey@endrift.com
Mon, 08 Jun 2015 22:49:15 -0700
1 files changed,
6 insertions(+),
4 deletions(-)
jump to
M
src/gba/sio/lockstep.c
→
src/gba/sio/lockstep.c
@@ -118,17 +118,19 @@ struct GBASIOLockstepNode* node = (struct GBASIOLockstepNode*) driver;
if (address == REG_SIOCNT) { GBALog(node->d.p->p, GBA_LOG_SIO, "Lockstep %i: SIOCNT <- %04x", node->id, value); if (value & 0x0080) { - value &= ~0x0080; if (!node->id) { GBALog(node->d.p->p, GBA_LOG_SIO, "Lockstep %i: Transfer initiated", node->id); MutexLock(&node->p->mutex); node->p->transferActive = true; node->p->transferCycles = GBASIOCyclesPerTransfer[node->d.p->multiplayerControl.baud][node->p->attached - 1]; + node->multiSend = node->d.p->p->memory.io[REG_SIOMLT_SEND >> 1]; MutexUnlock(&node->p->mutex); + } else { + value &= ~0x0080; } } - value &= 0xFF03; - value |= driver->p->siocnt & 0x007C; + value &= 0xFF83; + value |= driver->p->siocnt & 0x00FC; } else if (address == REG_SIOMLT_SEND) { GBALog(node->d.p->p, GBA_LOG_SIO, "Lockstep %i: SIOMLT_SEND <- %04x", node->id, value); }@@ -186,8 +188,8 @@ node->d.p->p->memory.io[REG_SIOMULTI1 >> 1] = 0xFFFF;
node->d.p->p->memory.io[REG_SIOMULTI2 >> 1] = 0xFFFF; node->d.p->p->memory.io[REG_SIOMULTI3 >> 1] = 0xFFFF; node->d.p->rcnt &= ~1; - node->multiSend = node->d.p->p->memory.io[REG_SIOMLT_SEND >> 1]; if (node->id) { + node->multiSend = node->d.p->p->memory.io[REG_SIOMLT_SEND >> 1]; node->d.p->multiplayerControl.busy = 1; } }