From 6d6492ddc1ad316be5a3e7f35652161d81b8a429 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Wed, 13 Mar 2019 17:17:08 +0100 Subject: [PATCH] mmu: flush tables when MMUCR.TI is written --- core/hw/sh4/modules/ccn.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/hw/sh4/modules/ccn.cpp b/core/hw/sh4/modules/ccn.cpp index 8f58476e3..fbac293fd 100644 --- a/core/hw/sh4/modules/ccn.cpp +++ b/core/hw/sh4/modules/ccn.cpp @@ -8,7 +8,7 @@ #include "../sh4_core.h" #include "hw/pvr/pvr_mem.h" #include "hw/mem/_vmem.h" - +#include "mmu.h" //Types @@ -51,9 +51,15 @@ void CCN_MMUCR_write(u32 addr, u32 value) // printf("<*******>MMU Enabled , ONLY SQ remaps work<*******>\n"); // } - if (temp.TI) + if (temp.TI != 0) { - temp.TI=0; + for (u32 i = 0; i < 4; i++) + ITLB[i].Data.V = 0; + + for (u32 i = 0; i < 64; i++) + UTLB[i].Data.V = 0; + + temp.TI = 0; } CCN_MMUCR=temp; }