X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2Fcomponents%2FGUIram5_12.java;h=7a1409e8b198cc9b40aa8a3997f2a5c0c7c046de;hb=bfd483ea32de08383550ba6903f77c11c33ea36d;hp=d1871f452f4132a8ea6e2a50c1655365f3c2a01c;hpb=d07d97764c8f41ff26f76e59d4d2f1789c2bcc9e;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIram5_12.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIram5_12.java index d1871f45..7a1409e8 100644 --- a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIram5_12.java +++ b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/GUIram5_12.java @@ -81,7 +81,6 @@ public class GUIram5_12 extends SimpleRectangularHardcodedGUIComponent for (int i = 0; i < 3; i++) if (bits[i] == Z) return -1; - // TODO maybe this is the wrong way around return (bits[0] == ONE ? 4 : 0) + (bits[1] == ONE ? 2 : 0) + (bits[2] == ONE ? 1 : 0); } @@ -106,7 +105,9 @@ public class GUIram5_12 extends SimpleRectangularHardcodedGUIComponent BitVector newHighLevelStateCasted = (BitVector) newHighLevelState; if (newHighLevelStateCasted.length() != 12) throw new IllegalArgumentException("Expected BitVector of length 12, not " + newHighLevelStateCasted.length()); - return ((BitVector[]) lastState)[addr] = newHighLevelStateCasted; + BitVector[] memC = (BitVector[]) lastState; + memC[addr] = newHighLevelStateCasted; + return memC; } return super.setHighLevelState(lastState, stateID, newHighLevelState); }