Sonic Advance 1/2 work now with NO_LINK defined

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1216 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
kode54 2013-09-21 16:18:54 +00:00
parent e4894d2ea2
commit 297b01ff8c
1 changed files with 10 additions and 0 deletions

View File

@ -2966,6 +2966,7 @@ void CPUUpdateRegister(u32 address, u16 value)
break; break;
#ifndef NO_LINK
case COMM_SIOCNT: case COMM_SIOCNT:
StartLink(value); StartLink(value);
break; break;
@ -2973,6 +2974,7 @@ void CPUUpdateRegister(u32 address, u16 value)
case COMM_SIODATA8: case COMM_SIODATA8:
UPDATE_REG(COMM_SIODATA8, value); UPDATE_REG(COMM_SIODATA8, value);
break; break;
#endif
case 0x130: case 0x130:
P1 |= (value & 0x3FF); P1 |= (value & 0x3FF);
@ -2983,6 +2985,7 @@ void CPUUpdateRegister(u32 address, u16 value)
UPDATE_REG(0x132, value & 0xC3FF); UPDATE_REG(0x132, value & 0xC3FF);
break; break;
#ifndef NO_LINK
case COMM_RCNT: case COMM_RCNT:
StartGPLink(value); StartGPLink(value);
break; break;
@ -3018,6 +3021,7 @@ void CPUUpdateRegister(u32 address, u16 value)
case COMM_JOYSTAT: case COMM_JOYSTAT:
UPDATE_REG(COMM_JOYSTAT, (READ16LE(&ioMem[COMM_JOYSTAT]) & 0xf) | (value & 0xf0)); UPDATE_REG(COMM_JOYSTAT, (READ16LE(&ioMem[COMM_JOYSTAT]) & 0xf) | (value & 0xf0));
break; break;
#endif
case 0x200: case 0x200:
IE = value & 0x3FFF; IE = value & 0x3FFF;
@ -3584,9 +3588,11 @@ void CPULoop(int ticks)
// variable used by the CPU core // variable used by the CPU core
cpuTotalTicks = 0; cpuTotalTicks = 0;
#ifndef NO_LINK
// shuffle2: what's the purpose? // shuffle2: what's the purpose?
if(gba_link_enabled) if(gba_link_enabled)
cpuNextEvent = 1; cpuNextEvent = 1;
#endif
cpuBreakLoop = false; cpuBreakLoop = false;
cpuNextEvent = CPUUpdateTicks(); cpuNextEvent = CPUUpdateTicks();
@ -4037,8 +4043,10 @@ void CPULoop(int ticks)
if (gba_joybus_enabled) if (gba_joybus_enabled)
JoyBusUpdate(clockTicks); JoyBusUpdate(clockTicks);
#ifndef NO_LINK
if (gba_link_enabled) if (gba_link_enabled)
LinkUpdate(clockTicks); LinkUpdate(clockTicks);
#endif
cpuNextEvent = CPUUpdateTicks(); cpuNextEvent = CPUUpdateTicks();
@ -4053,9 +4061,11 @@ void CPULoop(int ticks)
goto updateLoop; goto updateLoop;
} }
#ifndef NO_LINK
// shuffle2: what's the purpose? // shuffle2: what's the purpose?
if(gba_link_enabled) if(gba_link_enabled)
cpuNextEvent = 1; cpuNextEvent = 1;
#endif
if(IF && (IME & 1) && armIrqEnable) { if(IF && (IME & 1) && armIrqEnable) {
int res = IF & IE; int res = IF & IE;