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

Function rcntWrite32

pcsx2/Counters.cpp:999–1030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

997
998template <uint page>
999__fi bool rcntWrite32(u32 mem, mem32_t& value)
1000{
1001 pxAssume(mem >= RCNT0_COUNT && mem < 0x10002000);
1002
1003 // [TODO] : counters should actually just use the EE's hw register space for storing
1004 // count, mode, target, and hold. This will allow for a simplified handler for register
1005 // reads.
1006
1007 switch( mem )
1008 {
1009 case(RCNT0_COUNT): return rcntWcount(0, value), false;
1010 case(RCNT0_MODE): return rcntWmode(0, value), false;
1011 case(RCNT0_TARGET): return rcntWtarget(0, value), false;
1012 case(RCNT0_HOLD): return rcntWhold(0, value), false;
1013
1014 case(RCNT1_COUNT): return rcntWcount(1, value), false;
1015 case(RCNT1_MODE): return rcntWmode(1, value), false;
1016 case(RCNT1_TARGET): return rcntWtarget(1, value), false;
1017 case(RCNT1_HOLD): return rcntWhold(1, value), false;
1018
1019 case(RCNT2_COUNT): return rcntWcount(2, value), false;
1020 case(RCNT2_MODE): return rcntWmode(2, value), false;
1021 case(RCNT2_TARGET): return rcntWtarget(2, value), false;
1022
1023 case(RCNT3_COUNT): return rcntWcount(3, value), false;
1024 case(RCNT3_MODE): return rcntWmode(3, value), false;
1025 case(RCNT3_TARGET): return rcntWtarget(3, value), false;
1026 }
1027
1028 // unhandled .. do memory writeback.
1029 return true;
1030}
1031
1032template u16 rcntRead32<0x00>(u32 mem);
1033template u16 rcntRead32<0x01>(u32 mem);

Callers

nothing calls this directly

Calls 4

rcntWcountFunction · 0.85
rcntWmodeFunction · 0.85
rcntWtargetFunction · 0.85
rcntWholdFunction · 0.85

Tested by

no test coverage detected