Bus: Protect main RAM buffer

Get rid of write-time checks.
This commit is contained in:
Stenzek
2023-10-07 18:10:09 +10:00
parent 79e1ae3e54
commit a062b00c1a
12 changed files with 82 additions and 99 deletions

View File

@ -38,16 +38,4 @@ void InvalidateBlocksWithPageIndex(u32 page_index);
/// Invalidates all blocks in the cache.
void InvalidateAllRAMBlocks();
/// Invalidates any code pages which overlap the specified range.
ALWAYS_INLINE void InvalidateCodePages(PhysicalMemoryAddress address, u32 word_count)
{
const u32 start_page = address / HOST_PAGE_SIZE;
const u32 end_page = (address + word_count * sizeof(u32) - sizeof(u32)) / HOST_PAGE_SIZE;
for (u32 page = start_page; page <= end_page; page++)
{
if (Bus::g_ram_code_bits[page])
CPU::CodeCache::InvalidateBlocksWithPageIndex(page);
}
}
} // namespace CPU::CodeCache