mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 16:49:50 +00:00
Fix bug in CwCheat icache invalidation. Fixes #7430
This commit is contained in:
parent
fef70c528b
commit
2f6216d787
@ -392,11 +392,11 @@ void CWCheatEngine::Run() {
|
||||
int data = code[0];
|
||||
int dataAdd = code[1];
|
||||
|
||||
int maxAddr = (arg >> 16) & 0xFFFF;
|
||||
int count = (arg >> 16) & 0xFFFF;
|
||||
int stepAddr = (arg & 0xFFFF) * 4;
|
||||
|
||||
InvalidateICache(addr, maxAddr - addr);
|
||||
for (int a = 0; a < maxAddr; a++) {
|
||||
InvalidateICache(addr, count * stepAddr);
|
||||
for (int a = 0; a < count; a++) {
|
||||
if (Memory::IsValidAddress(addr)) {
|
||||
Memory::Write_U32((u32) data, addr);
|
||||
}
|
||||
@ -471,7 +471,6 @@ void CWCheatEngine::Run() {
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateICache((base + offset) & ~3, 4);
|
||||
switch (type) {
|
||||
case 0: // 8 bit write
|
||||
Memory::Write_U8((u8) arg, base + offset);
|
||||
|
@ -593,6 +593,11 @@ void JitBlockCache::InvalidateICache(u32 address, const u32 length) {
|
||||
const u32 pAddr = address & 0x1FFFFFFF;
|
||||
const u32 pEnd = pAddr + length;
|
||||
|
||||
if (pEnd < pAddr) {
|
||||
ERROR_LOG(JIT, "Bad InvalidateICache: %08x with len=%d", address, length);
|
||||
return;
|
||||
}
|
||||
|
||||
// Blocks may start and end in overlapping ways, and destroying one invalidates iterators.
|
||||
// So after destroying one, we start over.
|
||||
do {
|
||||
|
Loading…
Reference in New Issue
Block a user