Fixed a bug in Am2900; created dlatch8/80; relayouted some components
[Mograsim.git] / net.mograsim.logic.model.am2900 / src / net / mograsim / logic / model / am2900 / components / am2910 / ModelAm2910RegCntr.java
index 534dea4..0c101bb 100644 (file)
@@ -11,7 +11,7 @@ import net.mograsim.logic.core.types.Bit;
 import net.mograsim.logic.core.types.BitVector;
 import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
 import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
-import net.mograsim.logic.model.model.ViewModelModifiable;
+import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.atomic.SimpleRectangularHardcodedModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.model.wires.PinUsage;
@@ -20,16 +20,18 @@ import net.mograsim.logic.model.snippets.symbolrenderers.PinNamesSymbolRenderer.
 
 public class ModelAm2910RegCntr extends SimpleRectangularHardcodedModelComponent
 {
-       public ModelAm2910RegCntr(ViewModelModifiable model, String name)
+       public ModelAm2910RegCntr(LogicModelModifiable model, String name)
        {
-               super(model, "Am2910RegCntr", name, "Register/\nCounter");
+               super(model, "Am2910RegCntr", name, "Register/\nCounter", false);
                setSize(40, 40);
-               addPin(new Pin(this, "D", 12, PinUsage.INPUT, 20, 0), Position.BOTTOM);
-               addPin(new Pin(this, "_RLD", 1, PinUsage.INPUT, 0, 5), Position.RIGHT);
-               addPin(new Pin(this, "WE", 1, PinUsage.INPUT, 0, 20), Position.RIGHT);
-               addPin(new Pin(this, "DEC", 1, PinUsage.INPUT, 0, 30), Position.RIGHT);
-               addPin(new Pin(this, "C", 1, PinUsage.INPUT, 40, 20), Position.LEFT);
-               addPin(new Pin(this, "Y", 12, PinUsage.OUTPUT, 20, 40), Position.TOP);
+               addPin(new Pin(model, this, "D", 12, PinUsage.INPUT, 20, 0), Position.BOTTOM);
+               addPin(new Pin(model, this, "_RLD", 1, PinUsage.INPUT, 0, 5), Position.RIGHT);
+               addPin(new Pin(model, this, "WE", 1, PinUsage.INPUT, 0, 20), Position.RIGHT);
+               addPin(new Pin(model, this, "DEC", 1, PinUsage.INPUT, 0, 30), Position.RIGHT);
+               addPin(new Pin(model, this, "C", 1, PinUsage.INPUT, 40, 20), Position.LEFT);
+               addPin(new Pin(model, this, "Y", 12, PinUsage.OUTPUT, 20, 40), Position.TOP);
+
+               init();
        }
 
        @Override
@@ -60,7 +62,7 @@ public class ModelAm2910RegCntr extends SimpleRectangularHardcodedModelComponent
                        else if (WE.getValue() == ONE)
                        {
                                Bit carry = Bit.ZERO;
-                               // TODO extract to helper. This code almost also exists in Modelinc12.
+                               // TODO extract to helper. This code almost also exists in Modelinc.
                                for (int i = 11; i >= 0; i--)
                                {
                                        Bit a = QC[i];