MCPcopy Create free account
hub / github.com/TASEmulators/fceux / CallRegisteredLuaMemHook

Function CallRegisteredLuaMemHook

src/lua-engine.cpp:2287–2301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2285// }
2286}
2287void CallRegisteredLuaMemHook(unsigned int address, int size, unsigned int value, LuaMemHookType hookType)
2288{
2289 // performance critical! (called VERY frequently)
2290 // I suggest timing a large number of calls to this function in Release if you change anything in here,
2291 // before and after, because even the most innocent change can make it become 30% to 400% slower.
2292 // a good amount to test is: 100000000 calls with no hook set, and another 100000000 with a hook set.
2293 // (on my system that consistently took 200 ms total in the former case and 350 ms total in the latter case)
2294 if(hookedRegions[hookType].NotEmpty())
2295 {
2296 //if((hookType <= LUAMEMHOOK_EXEC) && (address >= 0xE00000))
2297 // address |= 0xFF0000; // account for mirroring of RAM
2298 if(hookedRegions[hookType].Contains(address, size))
2299 CallRegisteredLuaMemHook_LuaMatch(address, size, value, hookType); // something has hooked this specific address
2300 }
2301}
2302
2303void CallRegisteredLuaFunctions(LuaCallID calltype)
2304{

Callers 7

RdMemFunction · 0.85
WrMemFunction · 0.85
RdRAMFunction · 0.85
WrRAMFunction · 0.85
X6502_DMRFunction · 0.85
X6502_DMWFunction · 0.85
X6502_RunFunction · 0.85

Calls 3

NotEmptyMethod · 0.80
ContainsMethod · 0.45

Tested by

no test coverage detected