From b7cbd942328564da75f42439c4cd7baeea538533 Mon Sep 17 00:00:00 2001 From: Michael Schubmehl Date: Sat, 8 Feb 2014 14:01:35 -0600 Subject: [PATCH 1/2] fix small chip compile bug that wired dummy signals to each other --- src/com/droidquest/chipstuff/ChipCompiler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/droidquest/chipstuff/ChipCompiler.java b/src/com/droidquest/chipstuff/ChipCompiler.java index e6562d9..50ea4bc 100644 --- a/src/com/droidquest/chipstuff/ChipCompiler.java +++ b/src/com/droidquest/chipstuff/ChipCompiler.java @@ -99,7 +99,7 @@ public ChipCompiler(PrototypeChip pc, SmallChip sc) for (int ap=1; ap<4; ap++) // For every output Signal in the Node { Signal s1 = gate1.portSignals[ap].externalSignal; - if (s1!= null) + if (s1!= null && s1!=dummy) { for (int b=0; b Date: Sat, 8 Feb 2014 14:04:23 -0600 Subject: [PATCH 2/2] fix chip compiler type.endsWith('ORGate') check that matched XOR gates too --- src/com/droidquest/chipstuff/ChipCompiler.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/droidquest/chipstuff/ChipCompiler.java b/src/com/droidquest/chipstuff/ChipCompiler.java index 50ea4bc..fa059e4 100644 --- a/src/com/droidquest/chipstuff/ChipCompiler.java +++ b/src/com/droidquest/chipstuff/ChipCompiler.java @@ -48,22 +48,22 @@ public ChipCompiler(PrototypeChip pc, SmallChip sc) Device device = (Device) item; Gate gate=null; String type = item.getClass().toString(); - if (type.endsWith("ANDGate")) + if (device instanceof com.droidquest.devices.ANDGate) gate = new Gate("AND"); - if (type.endsWith("ORGate")) + if (device instanceof com.droidquest.devices.ORGate) gate = new Gate("OR"); - if (type.endsWith("NOTGate")) + if (device instanceof com.droidquest.devices.NOTGate) gate = new Gate("NOT"); - if (type.endsWith("XORGate")) + if (device instanceof com.droidquest.devices.XORGate) gate = new Gate("XOR"); - if (type.endsWith("FlipFlop")) + if (device instanceof com.droidquest.devices.FlipFlop) { gate = new Gate("FF"); gate.state = ((FlipFlop)device).state; } - if (type.endsWith("Node")) + if (device instanceof com.droidquest.devices.Node) gate = new Gate("NODE"); - if (type.endsWith("SmallChip")) + if (device instanceof com.droidquest.devices.SmallChip) gate = new Gate((SmallChip)device); if (gate != null) {