From 511edc3388bb3b8285af8c818af27235773d4bce Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Sat, 7 Aug 2010 23:52:44 +0000 Subject: refactored the interrupt scheduling code a bit to make it a little more readable than using those "magic" numbers. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@55866 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/cdrom.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'libpcsxcore/cdrom.c') diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 92e4b7f2..27ea971e 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -92,14 +92,16 @@ static struct CdrStat stat; static struct SubQ *subq; #define CDR_INT(eCycle) { \ - psxRegs.interrupt |= 0x4; \ - psxRegs.intCycle[2 + 1] = eCycle; \ - psxRegs.intCycle[2] = psxRegs.cycle; } + psxRegs.interrupt |= (1 << PSXINT_CDR); \ + psxRegs.intCycle[PSXINT_CDR].cycle = eCycle; \ + psxRegs.intCycle[PSXINT_CDR].sCycle = psxRegs.cycle; \ +} #define CDREAD_INT(eCycle) { \ - psxRegs.interrupt |= 0x40000; \ - psxRegs.intCycle[2 + 16 + 1] = eCycle; \ - psxRegs.intCycle[2 + 16] = psxRegs.cycle; } + psxRegs.interrupt |= (1 << PSXINT_CDREAD); \ + psxRegs.intCycle[PSXINT_CDREAD].cycle = eCycle; \ + psxRegs.intCycle[PSXINT_CDREAD].sCycle = psxRegs.cycle; \ +} #define StartReading(type, eCycle) { \ cdr.Reading = type; \ @@ -111,7 +113,7 @@ static struct SubQ *subq; #define StopReading() { \ if (cdr.Reading) { \ cdr.Reading = 0; \ - psxRegs.interrupt &= ~0x40000; \ + psxRegs.interrupt &= ~(1 << PSXINT_CDREAD); \ } \ cdr.StatP &= ~0x20;\ } -- cgit v1.2.3