| 734 | } |
| 735 | |
| 736 | __fi void rcntSyncCounter(int i) |
| 737 | { |
| 738 | if (counters[i].mode.ClockSource != 0x3) // don't count hblank sources |
| 739 | { |
| 740 | const u32 change = (cpuRegs.cycle - counters[i].startCycle) / counters[i].rate; |
| 741 | counters[i].startCycle += change * counters[i].rate; |
| 742 | |
| 743 | counters[i].startCycle &= ~((u64)counters[i].rate - 1); |
| 744 | |
| 745 | if (rcntCanCount(i)) |
| 746 | counters[i].count += change; |
| 747 | } |
| 748 | else |
| 749 | counters[i].startCycle = cpuRegs.cycle; |
| 750 | } |
| 751 | |
| 752 | // forceinline note: this method is called from two locations, but one |
| 753 | // of them is the interpreter, which doesn't count. ;) So might as |
no test coverage detected