mask all bits beyond bits 0 to 7 on bus reads to ensure no surplus bits cause unpredictable system behavior.
This commit is contained in:
1 parent
4796b65390
commit
72ba068beb
1 file changed
+1
-1
@@ -170,7 +170,7 @@ public class Bus {
|
|||||||
if(d != null) {
|
if(d != null) {
|
||||||
MemoryRange range = d.getMemoryRange();
|
MemoryRange range = d.getMemoryRange();
|
||||||
int devAddr = address - range.startAddress();
|
int devAddr = address - range.startAddress();
|
||||||
return d.read(devAddr);
|
return d.read(devAddr) & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new MemoryAccessException("Bus read failed. No device at address " + String.format("$%04X", address));
|
throw new MemoryAccessException("Bus read failed. No device at address " + String.format("$%04X", address));
|
||||||
|
|||||||
Reference in new issue
Block a user