@@ -115,39 +115,39 @@ void psxBranchTest() {
115
115
psxRcntUpdate ();
116
116
117
117
if (psxRegs .interrupt ) {
118
- if ((psxRegs .interrupt & 0x80 ) && !Config .Sio ) { // sio
119
- if ((psxRegs .cycle - psxRegs .intCycle [7 ] ) >= psxRegs .intCycle [7 + 1 ] ) {
120
- psxRegs .interrupt &= ~0x80 ;
118
+ if ((psxRegs .interrupt & ( 1 << PSXINT_SIO ) ) && !Config .Sio ) { // sio
119
+ if ((psxRegs .cycle - psxRegs .intCycle [PSXINT_SIO ]. sCycle ) >= psxRegs .intCycle [PSXINT_SIO ]. cycle ) {
120
+ psxRegs .interrupt &= ~( 1 << PSXINT_SIO ) ;
121
121
sioInterrupt ();
122
122
}
123
123
}
124
- if (psxRegs .interrupt & 0x04 ) { // cdr
125
- if ((psxRegs .cycle - psxRegs .intCycle [2 ] ) >= psxRegs .intCycle [2 + 1 ] ) {
126
- psxRegs .interrupt &= ~0x04 ;
124
+ if (psxRegs .interrupt & ( 1 << PSXINT_CDR ) ) { // cdr
125
+ if ((psxRegs .cycle - psxRegs .intCycle [PSXINT_CDR ]. sCycle ) >= psxRegs .intCycle [PSXINT_CDR ]. cycle ) {
126
+ psxRegs .interrupt &= ~( 1 << PSXINT_CDR ) ;
127
127
cdrInterrupt ();
128
128
}
129
129
}
130
- if (psxRegs .interrupt & 0x040000 ) { // cdr read
131
- if ((psxRegs .cycle - psxRegs .intCycle [2 + 16 ] ) >= psxRegs .intCycle [2 + 16 + 1 ] ) {
132
- psxRegs .interrupt &= ~0x040000 ;
130
+ if (psxRegs .interrupt & ( 1 << PSXINT_CDREAD ) ) { // cdr read
131
+ if ((psxRegs .cycle - psxRegs .intCycle [PSXINT_CDREAD ]. sCycle ) >= psxRegs .intCycle [PSXINT_CDREAD ]. cycle ) {
132
+ psxRegs .interrupt &= ~( 1 << PSXINT_CDREAD ) ;
133
133
cdrReadInterrupt ();
134
134
}
135
135
}
136
- if (psxRegs .interrupt & 0x01000000 ) { // gpu dma
137
- if ((psxRegs .cycle - psxRegs .intCycle [3 + 24 ] ) >= psxRegs .intCycle [3 + 24 + 1 ] ) {
138
- psxRegs .interrupt &= ~0x01000000 ;
136
+ if (psxRegs .interrupt & ( 1 << PSXINT_GPUDMA ) ) { // gpu dma
137
+ if ((psxRegs .cycle - psxRegs .intCycle [PSXINT_GPUDMA ]. sCycle ) >= psxRegs .intCycle [PSXINT_GPUDMA ]. cycle ) {
138
+ psxRegs .interrupt &= ~( 1 << PSXINT_GPUDMA ) ;
139
139
gpuInterrupt ();
140
140
}
141
141
}
142
- if (psxRegs .interrupt & 0x02000000 ) { // mdec out dma
143
- if ((psxRegs .cycle - psxRegs .intCycle [5 + 24 ] ) >= psxRegs .intCycle [5 + 24 + 1 ] ) {
144
- psxRegs .interrupt &= ~0x02000000 ;
142
+ if (psxRegs .interrupt & ( 1 << PSXINT_MDECOUTDMA ) ) { // mdec out dma
143
+ if ((psxRegs .cycle - psxRegs .intCycle [PSXINT_MDECOUTDMA ]. sCycle ) >= psxRegs .intCycle [PSXINT_MDECOUTDMA ]. cycle ) {
144
+ psxRegs .interrupt &= ~( 1 << PSXINT_MDECOUTDMA ) ;
145
145
mdec1Interrupt ();
146
146
}
147
147
}
148
- if (psxRegs .interrupt & 0x04000000 ) { // spu dma
149
- if ((psxRegs .cycle - psxRegs .intCycle [1 + 24 ] ) >= psxRegs .intCycle [1 + 24 + 1 ] ) {
150
- psxRegs .interrupt &= ~0x04000000 ;
148
+ if (psxRegs .interrupt & ( 1 << PSXINT_SPUDMA ) ) { // spu dma
149
+ if ((psxRegs .cycle - psxRegs .intCycle [PSXINT_SPUDMA ]. sCycle ) >= psxRegs .intCycle [PSXINT_SPUDMA ]. cycle ) {
150
+ psxRegs .interrupt &= ~( 1 << PSXINT_SPUDMA ) ;
151
151
spuInterrupt ();
152
152
}
153
153
}
0 commit comments