From 5a994fe43715c1cfcbffac4a8baf41cb68b31fe3 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 3 Jan 2018 18:36:18 +1100 Subject: [PATCH] Update to address issue #101 --- .../java/net/simon987/cubotplugin/CubotComPort.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotComPort.java b/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotComPort.java index 237da0d..b62cb68 100644 --- a/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotComPort.java +++ b/Plugin Cubot/src/main/java/net/simon987/cubotplugin/CubotComPort.java @@ -18,10 +18,11 @@ public class CubotComPort extends CpuHardware { private Cubot cubot; - private static final int COMPORT_SELF_CLEAR = 0; + private static final int COMPORT_BUFFER_CLEAR = 0; private static final int COMPORT_POLL = 1; private static final int COMPORT_FRONT_PORT_OUT = 2; private static final int COMPORT_SELF_OUT = 3; + private static final int COMPORT_CONSOLE_CLEAR = 4; public CubotComPort(Cubot cubot) { this.cubot = cubot; @@ -34,11 +35,14 @@ public class CubotComPort extends CpuHardware { int a = getCpu().getRegisterSet().getRegister("A").getValue(); - if (a == COMPORT_SELF_CLEAR) { + if (a == COMPORT_BUFFER_CLEAR) { cubot.getConsoleMessagesBuffer().clear(); + + } else if (a == COMPORT_CONSOLE_CLEAR) { + cubot.setConsoleMode(Cubot.ConsoleMode.CLEAR); - + } else if (a == COMPORT_POLL) { if (cubot.spendEnergy(4)) {