CPU/CodeCache: Fix DMA writes not invalidating code blocks

Fixes Crash Team Racing and Spyro in Cached Interpreter/Recompiler
modes.
This commit is contained in:
Connor McLaughlin
2019-11-26 19:45:36 +10:00
parent 47cbe75b48
commit 519dbc818d
3 changed files with 11 additions and 6 deletions

View File

@ -357,7 +357,7 @@ void CodeCache::AddBlockToPageMap(CodeBlock* block)
const u32 start_page = block->GetStartPageIndex();
const u32 end_page = block->GetEndPageIndex();
for (u32 page = start_page; page < end_page; page++)
for (u32 page = start_page; page <= end_page; page++)
{
m_ram_block_map[page].push_back(block);
m_bus->SetRAMCodePage(page);
@ -371,7 +371,7 @@ void CodeCache::RemoveBlockFromPageMap(CodeBlock* block)
const u32 start_page = block->GetStartPageIndex();
const u32 end_page = block->GetEndPageIndex();
for (u32 page = start_page; page < end_page; page++)
for (u32 page = start_page; page <= end_page; page++)
{
auto& page_blocks = m_ram_block_map[page];
auto page_block_iter = std::find(page_blocks.begin(), page_blocks.end(), block);