MCPcopy Create free account
hub / github.com/cemu-project/Cemu / codeGenHandleICBI

Function codeGenHandleICBI

src/Cafe/OS/libs/coreinit/coreinit_CodeGen.cpp:97–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 void codeGenHandleICBI(uint32 ea)
98 {
99 cemu_assert_debug((ea & 0x1F) == 0);
100 if (coreinitCodeGen.rangeIsAllocated == false)
101 return;
102 cemu_assert_debug((coreinitCodeGen.rangeStart & 0x1F) == 0);
103 cemu_assert_debug((coreinitCodeGen.rangeSize & 0x1F) == 0);
104 if (ea >= coreinitCodeGen.rangeStart && ea < (coreinitCodeGen.rangeStart + coreinitCodeGen.rangeSize))
105 {
106 uint8* cacheCopy = coreinitCodeGen.cacheStateCopy + (ea - coreinitCodeGen.rangeStart);
107 uint8* currentState = memory_getPointerFromVirtualOffset(ea);
108 if (memcmp(currentState, cacheCopy, 32) != 0)
109 {
110 // instructions changed
111 // flush cache
112 PPCRecompiler_invalidateRange(ea, ea+0x20);
113 // update icache copy
114 memcpy(cacheCopy, currentState, 32);
115 }
116 }
117 }
118
119 bool _avoidCodeGenJIT = false;
120

Callers 4

PPCInterpreter_ICBIFunction · 0.85
ICInvalidateRangeFunction · 0.85

Calls 3

cemu_assert_debugFunction · 0.85

Tested by

no test coverage detected