Fix alignment when reading values from the write-map
This commit is contained in:
parent
902c678081
commit
32692cc50e
1 changed files with 14 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue