X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2Fcomponents%2Fam2910%2FGUIAm2910RegCntr.java;fp=net.mograsim.logic.model.am2900%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fam2900%2Fcomponents%2Fam2910%2FGUIAm2910RegCntr.java;h=3db7b9d77b43da13ba26535254d9c2cfc37b3f1d;hb=af730951db57d13d0b25671991f5bac36daabb85;hp=ec900c0846bbc41c78b7cbb67af634b61167a9b5;hpb=aeb37a7bcc75c673fd0dd00743cf90227583db18;p=Mograsim.git diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/GUIAm2910RegCntr.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/GUIAm2910RegCntr.java index ec900c08..3db7b9d7 100644 --- a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/GUIAm2910RegCntr.java +++ b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/am2900/components/am2910/GUIAm2910RegCntr.java @@ -49,13 +49,17 @@ public class GUIAm2910RegCntr extends SimpleRectangularHardcodedGUIComponent Bit oldCVal = QC[12]; Bit CVal = C.getValue(); - if (oldCVal == ZERO && CVal == ONE && _RLD.getValue() == ZERO && RWE.getValue() == ONE) + // TODO handle U/X/Z + if (oldCVal == ZERO && CVal == ONE) { - if (RDEC.getValue() == ONE) + if ((RDEC.getValue() == ZERO && RWE.getValue() == ONE) || _RLD.getValue() == ZERO) + System.arraycopy(D.getValues().getBits(), 0, QC, 0, 12); + else if (RWE.getValue() == ONE) { Bit carry = Bit.ZERO; + // TODO extract to helper. This code almost also exists in GUIinc12. // TODO maybe invert loop direction - for (int i = 12; i >= 0; i--) + for (int i = 11; i >= 0; i--) { Bit a = QC[i]; Bit z; @@ -72,8 +76,7 @@ public class GUIAm2910RegCntr extends SimpleRectangularHardcodedGUIComponent } QC[i] = z; } - } else - System.arraycopy(D.getValues().getBits(), 0, QC, 0, 12); + } } QC[12] = CVal; Y.feedSignals(Arrays.copyOfRange(QC, 0, 12));