summaryrefslogtreecommitdiff
path: root/libpcsxcore/cdrom.c
diff options
context:
space:
mode:
authorSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-08-07 23:52:44 +0000
committerSND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2010-08-07 23:52:44 +0000
commit511edc3388bb3b8285af8c818af27235773d4bce (patch)
tree6a85923804b898760bee47aa64c0ecf5c6eb9dc7 /libpcsxcore/cdrom.c
parent3c9ffdf13c4c017a2865e5c584df3151677f6788 (diff)
downloadpcsxr-511edc3388bb3b8285af8c818af27235773d4bce.tar.gz
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
Diffstat (limited to 'libpcsxcore/cdrom.c')
-rw-r--r--libpcsxcore/cdrom.c16
1 files changed, 9 insertions, 7 deletions
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;\
}