From 72ba068beb92ebc723e3fdccb9f2304c535ad340 Mon Sep 17 00:00:00 2001 From: Maik Merten Date: Sat, 23 Aug 2014 16:50:34 +0200 Subject: [PATCH] mask all bits beyond bits 0 to 7 on bus reads to ensure no surplus bits cause unpredictable system behavior. --- src/main/java/com/loomcom/symon/Bus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/loomcom/symon/Bus.java b/src/main/java/com/loomcom/symon/Bus.java index 2266031..f4d4da0 100644 --- a/src/main/java/com/loomcom/symon/Bus.java +++ b/src/main/java/com/loomcom/symon/Bus.java @@ -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));