From ce71c3cd4ee17072582e9e6e7d2a33d6b6244b20 Mon Sep 17 00:00:00 2001 From: Fiora Date: Mon, 3 Nov 2014 15:46:13 -0800 Subject: [PATCH] JIT: fix valid_block marking This caused invalidations that only affected the last portion of a JIT block to fail, breaking Wii64's block linking. It might affect a bunch of other games too; I haven't tested. --- Source/Core/Core/PowerPC/JitCommon/JitCache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp index 08bbb1474d..abcdfcd656 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp @@ -143,8 +143,8 @@ using namespace Gen; // Convert the logical address to a physical address for the block map u32 pAddr = b.originalAddress & 0x1FFFFFFF; - for (u32 i = 0; i < (b.originalSize + 7) / 8; ++i) - valid_block.Set(pAddr / 32 + i); + for (u32 block = pAddr / 32; block <= (pAddr + (b.originalSize - 1) * 4) / 32; ++block) + valid_block.Set(block); block_map[std::make_pair(pAddr + 4 * b.originalSize - 1, pAddr)] = block_num; if (block_link)