| 125 | |
| 126 | |
| 127 | static __fi void cpuRcntSet() |
| 128 | { |
| 129 | int i; |
| 130 | |
| 131 | // Default to next VBlank |
| 132 | nextStartCounter = cpuRegs.cycle; |
| 133 | nextDeltaCounter = vsyncCounter.deltaCycles - (cpuRegs.cycle - vsyncCounter.startCycle); |
| 134 | |
| 135 | // Also check next HSync |
| 136 | s32 nextHsync = hsyncCounter.deltaCycles - (cpuRegs.cycle - hsyncCounter.startCycle); |
| 137 | if (nextHsync < nextDeltaCounter) |
| 138 | nextDeltaCounter = nextHsync; |
| 139 | |
| 140 | for (i = 0; i < 4; i++) |
| 141 | _rcntSet(i); |
| 142 | |
| 143 | // sanity check! |
| 144 | if (nextDeltaCounter < 0) |
| 145 | nextDeltaCounter = 0; |
| 146 | |
| 147 | cpuSetNextEvent(nextStartCounter, nextDeltaCounter); // Need to update on counter resets/target changes |
| 148 | } |
| 149 | |
| 150 | |
| 151 | struct vSyncTimingInfo |
no test coverage detected