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:
Maik Merten committed 2014-08-23 16:50:34 +02:00
1 parent 4796b65390
commit 72ba068beb
1 file changed
+1 -1
+1 -1
View File
@@ -170,7 +170,7 @@ public class Bus {
if(d != null) {
MemoryRange range = d.getMemoryRange();
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));