MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / _rcntFireInterrupt

Function _rcntFireInterrupt

pcsx2/IopCounters.cpp:207–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207static void _rcntFireInterrupt(int i, bool isOverflow)
208{
209 bool updateIntr = psxCounters[i].currentIrqMode.repeatInterrupt;
210
211 if (psxCounters[i].mode.intrEnable)
212 {
213 bool already_set = isOverflow ? psxCounters[i].mode.overflowFlag : psxCounters[i].mode.targetFlag;
214 if (updateIntr || !already_set)
215 {
216 // IRQ fired
217 //DevCon.Warning("Counter %d %s IRQ Fired count %x target %x psx Cycle %d", i, isOverflow ? "Overflow" : "Target", psxCounters[i].count, psxCounters[i].target, psxRegs.cycle);
218 psxHu32(HW_ISTAT) |= psxCounters[i].interrupt;
219 iopTestIntc();
220 }
221
222 updateIntr |= psxCounters[i].currentIrqMode.toggleInterrupt;
223 }
224
225 if (updateIntr)
226 {
227 if (psxCounters[i].currentIrqMode.toggleInterrupt)
228 {
229 // Toggle mode
230 psxCounters[i].mode.intrEnable ^= true; // Interrupt flag inverted
231 }
232 else
233 {
234 psxCounters[i].mode.intrEnable = false; // Interrupt flag set low
235 }
236 }
237}
238
239static void _rcntTestTarget(int i)
240{

Callers 2

_rcntTestTargetFunction · 0.85
_rcntTestOverflowFunction · 0.85

Calls 1

iopTestIntcFunction · 0.85

Tested by

no test coverage detected