SWTP: Fixes to segfault issue described in #103 (from Gene Irwin)
The simulated memory address block from 0x8000 thru 0x8FFF is defined to have address 0x8000 - 0x801F mapped to I/O ports and 0x8020 - 0x8FFF as NO RAM ALLOWED. Code has been added to behave reasonably when references are made to 0x8020 - 0x8FFF.
This commit is contained in:
parent
eaae19463c
commit
d0cee0f6b6
1 changed files with 7 additions and 2 deletions
|
@ -214,7 +214,10 @@ int32 MB_get_mbyte(int32 addr)
|
||||||
} else
|
} else
|
||||||
return 0xFF;
|
return 0xFF;
|
||||||
case 0x8000:
|
case 0x8000:
|
||||||
val = (dev_table[addr - 0x8000].routine(0, 0)) & 0xFF;
|
if (addr < 0x8020)
|
||||||
|
val = (dev_table[addr - 0x8000].routine(0, 0)) & 0xFF;
|
||||||
|
else
|
||||||
|
val = 0xFF;
|
||||||
if (MB_dev.dctrl & DEBUG_read)
|
if (MB_dev.dctrl & DEBUG_read)
|
||||||
printf("MB_get_mbyte: I/O addr=%04X val=%02X\n", addr, val);
|
printf("MB_get_mbyte: I/O addr=%04X val=%02X\n", addr, val);
|
||||||
return val;
|
return val;
|
||||||
|
@ -290,7 +293,8 @@ void MB_put_mbyte(int32 addr, int32 val)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case 0x8000:
|
case 0x8000:
|
||||||
dev_table[addr - 0x8000].routine(1, val);
|
if (addr < 0x8020)
|
||||||
|
dev_table[addr - 0x8000].routine(1, val);
|
||||||
return;
|
return;
|
||||||
case 0xA000:
|
case 0xA000:
|
||||||
case 0xB000:
|
case 0xB000:
|
||||||
|
@ -320,3 +324,4 @@ void MB_put_mword(int32 addr, int32 val)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* end of mp-b2.c */
|
/* end of mp-b2.c */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue