From 2548242da8412a6f3f081aa13db484a8871f5b86 Mon Sep 17 00:00:00 2001 From: Data Archivist Date: Wed, 9 Jan 2019 18:36:33 -0500 Subject: [PATCH 1/5] Updated dependencies --- Plugin Cubot/Plugin Cubot.iml | 55 +++++++++++++++---------------- Plugin Misc HW/Plugin Misc HW.iml | 55 +++++++++++++++---------------- Plugin NPC/Plugin NPC.iml | 55 +++++++++++++++---------------- Plugin Plant/Plugin Plant.iml | 55 +++++++++++++++---------------- Server/Server.iml | 55 +++++++++++++++---------------- Server/pom.xml | 8 ++--- 6 files changed, 134 insertions(+), 149 deletions(-) diff --git a/Plugin Cubot/Plugin Cubot.iml b/Plugin Cubot/Plugin Cubot.iml index 664a89e..51cbabd 100644 --- a/Plugin Cubot/Plugin Cubot.iml +++ b/Plugin Cubot/Plugin Cubot.iml @@ -17,44 +17,41 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/Plugin Misc HW/Plugin Misc HW.iml b/Plugin Misc HW/Plugin Misc HW.iml index 888dbdd..0fced4a 100644 --- a/Plugin Misc HW/Plugin Misc HW.iml +++ b/Plugin Misc HW/Plugin Misc HW.iml @@ -16,44 +16,41 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/Plugin NPC/Plugin NPC.iml b/Plugin NPC/Plugin NPC.iml index ef4c8cd..670fb69 100644 --- a/Plugin NPC/Plugin NPC.iml +++ b/Plugin NPC/Plugin NPC.iml @@ -16,46 +16,43 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/Plugin Plant/Plugin Plant.iml b/Plugin Plant/Plugin Plant.iml index ef4c8cd..670fb69 100644 --- a/Plugin Plant/Plugin Plant.iml +++ b/Plugin Plant/Plugin Plant.iml @@ -16,46 +16,43 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/Server/Server.iml b/Server/Server.iml index 09d7783..2a7aaea 100644 --- a/Server/Server.iml +++ b/Server/Server.iml @@ -16,45 +16,42 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/Server/pom.xml b/Server/pom.xml index 07c5697..67f82ba 100644 --- a/Server/pom.xml +++ b/Server/pom.xml @@ -102,7 +102,7 @@ org.apache.commons commons-text - 1.2 + 1.6 org.mongodb @@ -112,12 +112,12 @@ org.springframework.security spring-security-core - 5.0.5.RELEASE + 5.1.2.RELEASE com.sparkjava spark-core - 2.7.2 + 2.8.0 com.sparkjava @@ -127,7 +127,7 @@ org.slf4j slf4j-simple - 1.7.21 + 1.7.25 From f9898f57f4a0b1ec61ab07fcc9f16cd08ebeecc3 Mon Sep 17 00:00:00 2001 From: simon987 Date: Wed, 9 Jan 2019 18:36:33 -0500 Subject: [PATCH 2/5] Updated dependencies --- Plugin Cubot/Plugin Cubot.iml | 55 +++++++++++++++---------------- Plugin Misc HW/Plugin Misc HW.iml | 55 +++++++++++++++---------------- Plugin NPC/Plugin NPC.iml | 55 +++++++++++++++---------------- Plugin Plant/Plugin Plant.iml | 55 +++++++++++++++---------------- Server/Server.iml | 55 +++++++++++++++---------------- Server/pom.xml | 8 ++--- 6 files changed, 134 insertions(+), 149 deletions(-) diff --git a/Plugin Cubot/Plugin Cubot.iml b/Plugin Cubot/Plugin Cubot.iml index 664a89e..51cbabd 100644 --- a/Plugin Cubot/Plugin Cubot.iml +++ b/Plugin Cubot/Plugin Cubot.iml @@ -17,44 +17,41 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/Plugin Misc HW/Plugin Misc HW.iml b/Plugin Misc HW/Plugin Misc HW.iml index 888dbdd..0fced4a 100644 --- a/Plugin Misc HW/Plugin Misc HW.iml +++ b/Plugin Misc HW/Plugin Misc HW.iml @@ -16,44 +16,41 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/Plugin NPC/Plugin NPC.iml b/Plugin NPC/Plugin NPC.iml index ef4c8cd..670fb69 100644 --- a/Plugin NPC/Plugin NPC.iml +++ b/Plugin NPC/Plugin NPC.iml @@ -16,46 +16,43 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/Plugin Plant/Plugin Plant.iml b/Plugin Plant/Plugin Plant.iml index ef4c8cd..670fb69 100644 --- a/Plugin Plant/Plugin Plant.iml +++ b/Plugin Plant/Plugin Plant.iml @@ -16,46 +16,43 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/Server/Server.iml b/Server/Server.iml index 09d7783..2a7aaea 100644 --- a/Server/Server.iml +++ b/Server/Server.iml @@ -16,45 +16,42 @@ - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/Server/pom.xml b/Server/pom.xml index 07c5697..67f82ba 100644 --- a/Server/pom.xml +++ b/Server/pom.xml @@ -102,7 +102,7 @@ org.apache.commons commons-text - 1.2 + 1.6 org.mongodb @@ -112,12 +112,12 @@ org.springframework.security spring-security-core - 5.0.5.RELEASE + 5.1.2.RELEASE com.sparkjava spark-core - 2.7.2 + 2.8.0 com.sparkjava @@ -127,7 +127,7 @@ org.slf4j slf4j-simple - 1.7.21 + 1.7.25 From ff4f6c23eb04ee3ebeee4ef9eb482e9d42164011 Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Mon, 14 Jan 2019 18:32:27 +0100 Subject: [PATCH 3/5] adjust source code so all instructions use the same patterns --- .../simon987/server/assembly/instruction/BrkInstruction.java | 4 +++- .../simon987/server/assembly/instruction/DecInstruction.java | 2 +- .../simon987/server/assembly/instruction/IncInstruction.java | 2 +- .../simon987/server/assembly/instruction/NopInstruction.java | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Server/src/main/java/net/simon987/server/assembly/instruction/BrkInstruction.java b/Server/src/main/java/net/simon987/server/assembly/instruction/BrkInstruction.java index cf2e92f..e0c4ed0 100755 --- a/Server/src/main/java/net/simon987/server/assembly/instruction/BrkInstruction.java +++ b/Server/src/main/java/net/simon987/server/assembly/instruction/BrkInstruction.java @@ -9,8 +9,10 @@ import net.simon987.server.assembly.Status; */ public class BrkInstruction extends Instruction { + public static final int OPCODE = 0; + public BrkInstruction() { - super("brk", 0); + super("brk", OPCODE); } @Override diff --git a/Server/src/main/java/net/simon987/server/assembly/instruction/DecInstruction.java b/Server/src/main/java/net/simon987/server/assembly/instruction/DecInstruction.java index 29a3ddb..d04cd59 100644 --- a/Server/src/main/java/net/simon987/server/assembly/instruction/DecInstruction.java +++ b/Server/src/main/java/net/simon987/server/assembly/instruction/DecInstruction.java @@ -7,7 +7,7 @@ import net.simon987.server.assembly.Util; public class DecInstruction extends Instruction { - public static final int OPCODE = 0x2B; + public static final int OPCODE = 43; public DecInstruction() { super("dec", OPCODE); diff --git a/Server/src/main/java/net/simon987/server/assembly/instruction/IncInstruction.java b/Server/src/main/java/net/simon987/server/assembly/instruction/IncInstruction.java index 05c5fa4..952a1d2 100644 --- a/Server/src/main/java/net/simon987/server/assembly/instruction/IncInstruction.java +++ b/Server/src/main/java/net/simon987/server/assembly/instruction/IncInstruction.java @@ -7,7 +7,7 @@ import net.simon987.server.assembly.Util; public class IncInstruction extends Instruction { - public static final int OPCODE = 0x2A; + public static final int OPCODE = 43; public IncInstruction() { super("inc", OPCODE); diff --git a/Server/src/main/java/net/simon987/server/assembly/instruction/NopInstruction.java b/Server/src/main/java/net/simon987/server/assembly/instruction/NopInstruction.java index a0c8b95..be687bd 100755 --- a/Server/src/main/java/net/simon987/server/assembly/instruction/NopInstruction.java +++ b/Server/src/main/java/net/simon987/server/assembly/instruction/NopInstruction.java @@ -8,7 +8,9 @@ import net.simon987.server.assembly.Instruction; */ public class NopInstruction extends Instruction { + public static final int OPCODE = 63; + public NopInstruction() { - super("nop", 63); + super("nop", OPCODE); } } From 4f8eb2725e9e11ffb05a3e3ea100708ebd0e939f Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Mon, 14 Jan 2019 18:37:42 +0100 Subject: [PATCH 4/5] fix typo --- .../simon987/server/assembly/instruction/IncInstruction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/src/main/java/net/simon987/server/assembly/instruction/IncInstruction.java b/Server/src/main/java/net/simon987/server/assembly/instruction/IncInstruction.java index 952a1d2..23a5403 100644 --- a/Server/src/main/java/net/simon987/server/assembly/instruction/IncInstruction.java +++ b/Server/src/main/java/net/simon987/server/assembly/instruction/IncInstruction.java @@ -7,7 +7,7 @@ import net.simon987.server.assembly.Util; public class IncInstruction extends Instruction { - public static final int OPCODE = 43; + public static final int OPCODE = 42; public IncInstruction() { super("inc", OPCODE); From 993838651f9465627026b3208a64d9454db0ed9b Mon Sep 17 00:00:00 2001 From: simon987 Date: Mon, 14 Jan 2019 18:24:34 -0500 Subject: [PATCH 5/5] Fixes #185 --- .../net/simon987/server/assembly/DefaultInstructionSet.java | 4 +--- .../main/java/net/simon987/server/assembly/Instruction.java | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java b/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java index 445db18..a87f8ee 100755 --- a/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java +++ b/Server/src/main/java/net/simon987/server/assembly/DefaultInstructionSet.java @@ -95,9 +95,7 @@ public class DefaultInstructionSet implements InstructionSet { if (instructionMap.containsKey(instruction.getOpCode())) { LogManager.LOGGER.fine(instruction.getMnemonic() + " instruction is an alias for " + instructionMap.get(instruction.getOpCode()).getMnemonic()); - } else { - instructionMap.put(instruction.getOpCode(), instruction); - } + instructionMap.put(instruction.getOpCode(), instruction); } } diff --git a/Server/src/main/java/net/simon987/server/assembly/Instruction.java b/Server/src/main/java/net/simon987/server/assembly/Instruction.java index 1f81546..eb393c5 100755 --- a/Server/src/main/java/net/simon987/server/assembly/Instruction.java +++ b/Server/src/main/java/net/simon987/server/assembly/Instruction.java @@ -133,7 +133,7 @@ public abstract class Instruction { * * @param out encoded bytes will be written here */ - void encode(ByteArrayOutputStream out, int currentLine) throws IllegalOperandException { + public void encode(ByteArrayOutputStream out, int currentLine) throws IllegalOperandException { if (!noOperandsValid()) { throw new IllegalOperandException("This instruction must have operand(s)!", currentLine); @@ -147,7 +147,7 @@ public abstract class Instruction { } } - void encode(ByteArrayOutputStream out, Operand o1, Operand o2, int currentLine) + public void encode(ByteArrayOutputStream out, Operand o1, Operand o2, int currentLine) throws IllegalOperandException { MachineCode code = new MachineCode(); code.writeOpcode(opCode); @@ -182,7 +182,7 @@ public abstract class Instruction { } } - void encode(ByteArrayOutputStream out, Operand o1, int currentLine) + public void encode(ByteArrayOutputStream out, Operand o1, int currentLine) throws IllegalOperandException { MachineCode code = new MachineCode(); code.writeOpcode(opCode);