mirror of
https://github.com/simh/simh.git
synced 2026-01-11 23:52:58 +00:00
Fix off-by-one in reading cache address from memory
Commit a9ac7c153 properly avoided writing past the end of cache_line, but in doing so introduced an error as to the first memory address that should be written. This fix avoids writing past the cache_line by simply reading the previous memory location. Fixes the CP/M 68K simulation example and issue #181
This commit is contained in:
parent
f0f3176c78
commit
af713b78e1
@ -269,7 +269,7 @@ static t_stat ReadICache(t_addr tpc)
|
||||
t_stat rc;
|
||||
uint8* mem;
|
||||
|
||||
ASSERT_OKRET(Mem((tpc+CACHE_SIZE)&addrmask,&mem));
|
||||
ASSERT_OKRET(Mem((tpc+CACHE_SIZE-1)&addrmask,&mem));
|
||||
|
||||
/* 68000/08/10 do not like unaligned access */
|
||||
if (cputype < 3 && (tpc & 1)) return STOP_ERRADR;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user