diff --git a/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java b/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java index 9034f05..a843ae7 100644 --- a/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java +++ b/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java @@ -21,6 +21,7 @@ public class Emulator { public Emulator(RedBus bus){ this.bus = bus; cpu = new Cpu(); + cpu.setLogCallback(new LogConsumer()); cpu.setBus(new Bus(bus)); ram = new Memory(0x0000, 0x2000 - 1, ((CpuAccessor)cpu).getRedBusState()); try { diff --git a/src/main/java/net/brokenmoon/redcontrol/api/LogConsumer.java b/src/main/java/net/brokenmoon/redcontrol/api/LogConsumer.java new file mode 100644 index 0000000..facf7ff --- /dev/null +++ b/src/main/java/net/brokenmoon/redcontrol/api/LogConsumer.java @@ -0,0 +1,12 @@ +package net.brokenmoon.redcontrol.api; + +import net.brokenmoon.redcontrol.RedControl; + +import java.util.function.IntConsumer; + +public class LogConsumer implements IntConsumer { + @Override + public void accept(int value) { + RedControl.LOGGER.info("Cpu MMU Logger: " + value); + } +}