diff --git a/src/cpu/core_dyn_x86/cache.h b/src/cpu/core_dyn_x86/cache.h index 9dce4baf..3134da5a 100644 --- a/src/cpu/core_dyn_x86/cache.h +++ b/src/cpu/core_dyn_x86/cache.h @@ -137,8 +137,10 @@ public: addr&=4095; if (host_readw(hostmem+addr)==(Bit16u)val) return; host_writew(hostmem+addr,val); - if (!*(Bit16u*)&write_map[addr]) { - if (active_blocks) return; + const uint16_t is_mapped = host_readw(write_map + addr); + if (!is_mapped) { + if (active_blocks) + return; active_count--; if (!active_count) Release(); return; @@ -160,8 +162,10 @@ public: addr&=4095; if (host_readd(hostmem+addr)==(Bit32u)val) return; host_writed(hostmem+addr,val); - if (!*(Bit32u*)&write_map[addr]) { - if (active_blocks) return; + const uint32_t is_mapped = host_readd(write_map + addr); + if (!is_mapped) { + if (active_blocks) + return; active_count--; if (!active_count) Release(); return; @@ -211,7 +215,9 @@ public: } addr&=4095; if (host_readw(hostmem+addr)==(Bit16u)val) return false; - if (!*(Bit16u*)&write_map[addr]) { + + const uint16_t is_mapped = host_readw(write_map + addr); + if (!is_mapped) { if (!active_blocks) { active_count--; if (!active_count) Release(); @@ -240,7 +246,9 @@ public: } addr&=4095; if (host_readd(hostmem+addr)==(Bit32u)val) return false; - if (!*(Bit32u*)&write_map[addr]) { + + const uint32_t is_mapped = host_readd(write_map + addr); + if (!is_mapped) { if (!active_blocks) { active_count--; if (!active_count) Release();