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

Function rcntSyncCounter

pcsx2/Counters.cpp:736–750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 7

rcntUpdateFunction · 0.85
rcntStartGateFunction · 0.85
rcntEndGateFunction · 0.85
rcntWmodeFunction · 0.85
rcntWcountFunction · 0.85
rcntWtargetFunction · 0.85
rcntRcountFunction · 0.85

Calls 1

rcntCanCountFunction · 0.85

Tested by

no test coverage detected