diff --git a/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java b/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java index 4d14d66..84caa27 100644 --- a/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java +++ b/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java @@ -56,7 +56,9 @@ public class Emulator { public void step() { if(!isWaitingOnInterrupt()) { CpuState state = ((CpuAccessor)this.cpu).getState(); - System.out.println(state.toTraceEvent()); + if (state.pc != state.brk) { + RedControl.LOGGER.trace(state.toTraceEvent()); + } this.cpu.step(); this.cpu.getBus().update(((CpuAccessor)cpu).getRedBusState()); } diff --git a/src/main/java/net/brokenmoon/redcontrol/blocks/CpuBlock.java b/src/main/java/net/brokenmoon/redcontrol/blocks/CpuBlock.java index dcdac96..1563007 100644 --- a/src/main/java/net/brokenmoon/redcontrol/blocks/CpuBlock.java +++ b/src/main/java/net/brokenmoon/redcontrol/blocks/CpuBlock.java @@ -46,11 +46,10 @@ public class CpuBlock extends NetworkCarrier { if (!world.isClient) { CpuEntity peripheral = (CpuEntity) world.getBlockEntity(pos); player.sendMessage(Text.literal("Cpu Debug: "), false); - player.sendMessage(Text.literal(String.valueOf(peripheral.getBus().hashCode())), false); - player.sendMessage(Text.literal(String.valueOf(peripheral.core.cpu.getBus().getRedBus().hashCode())), false); - player.sendMessage(Text.literal(String.valueOf(peripheral.i)), false); - player.sendMessage(Text.literal(String.valueOf(peripheral.core.isWaitingOnInterrupt())), false); - player.sendMessage(Text.literal(String.valueOf(peripheral.core.isWaitingOnInterrupt())), false); + player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().hashCode())), false); + player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.core.cpu.getBus().getRedBus().hashCode())), false); + player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.i)), false); + player.sendMessage(Text.literal(" " + peripheral.core.isWaitingOnInterrupt()), false); } return ActionResult.SUCCESS; diff --git a/src/main/java/net/brokenmoon/redcontrol/blocks/NetworkCarrier.java b/src/main/java/net/brokenmoon/redcontrol/blocks/NetworkCarrier.java index 8e03ac8..3ce9e6f 100644 --- a/src/main/java/net/brokenmoon/redcontrol/blocks/NetworkCarrier.java +++ b/src/main/java/net/brokenmoon/redcontrol/blocks/NetworkCarrier.java @@ -85,12 +85,13 @@ public abstract class NetworkCarrier extends BlockWithEntity implements BlockEnt if (!world.isClient) { Peripheral peripheral = (Peripheral) world.getBlockEntity(pos); player.sendMessage(Text.literal("Network Carrier Debug: "), false); - player.sendMessage(Text.literal(String.valueOf(peripheral.getBus().hashCode())), false); - player.sendMessage(Text.literal(String.valueOf(peripheral.getBus().getRedBus().hashCode())), false); + player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().hashCode())), false); + player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().getRedBus().hashCode())), false); + player.sendMessage(Text.literal(" Peripherals on RedBus: "), false); RedBus.Peripheral[] peripherals = ((RedBusAccessor)peripheral.getBus().getRedBus()).getPeripherals(); for (RedBus.Peripheral value : peripherals) { if (value != null) { - player.sendMessage(Text.literal(String.valueOf(value)), false); + player.sendMessage(Text.literal(" " + value.getClass().toString()), false); } } }