prettify some logging

main
Walker Fowlkes 7 months ago
parent c4767236a2
commit 9af436282f

@ -56,7 +56,9 @@ public class Emulator {
public void step() { public void step() {
if(!isWaitingOnInterrupt()) { if(!isWaitingOnInterrupt()) {
CpuState state = ((CpuAccessor)this.cpu).getState(); 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.step();
this.cpu.getBus().update(((CpuAccessor)cpu).getRedBusState()); this.cpu.getBus().update(((CpuAccessor)cpu).getRedBusState());
} }

@ -46,11 +46,10 @@ public class CpuBlock extends NetworkCarrier {
if (!world.isClient) { if (!world.isClient) {
CpuEntity peripheral = (CpuEntity) world.getBlockEntity(pos); CpuEntity peripheral = (CpuEntity) world.getBlockEntity(pos);
player.sendMessage(Text.literal("Cpu Debug: "), false); player.sendMessage(Text.literal("Cpu Debug: "), false);
player.sendMessage(Text.literal(String.valueOf(peripheral.getBus().hashCode())), false); player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().hashCode())), false);
player.sendMessage(Text.literal(String.valueOf(peripheral.core.cpu.getBus().getRedBus().hashCode())), false); player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.core.cpu.getBus().getRedBus().hashCode())), false);
player.sendMessage(Text.literal(String.valueOf(peripheral.i)), false); player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.i)), false);
player.sendMessage(Text.literal(String.valueOf(peripheral.core.isWaitingOnInterrupt())), false); player.sendMessage(Text.literal(" " + peripheral.core.isWaitingOnInterrupt()), false);
player.sendMessage(Text.literal(String.valueOf(peripheral.core.isWaitingOnInterrupt())), false);
} }
return ActionResult.SUCCESS; return ActionResult.SUCCESS;

@ -85,12 +85,13 @@ public abstract class NetworkCarrier extends BlockWithEntity implements BlockEnt
if (!world.isClient) { if (!world.isClient) {
Peripheral peripheral = (Peripheral) world.getBlockEntity(pos); Peripheral peripheral = (Peripheral) world.getBlockEntity(pos);
player.sendMessage(Text.literal("Network Carrier Debug: "), false); player.sendMessage(Text.literal("Network Carrier Debug: "), false);
player.sendMessage(Text.literal(String.valueOf(peripheral.getBus().hashCode())), false); player.sendMessage(Text.literal(" " + Integer.toHexString(peripheral.getBus().hashCode())), false);
player.sendMessage(Text.literal(String.valueOf(peripheral.getBus().getRedBus().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(); RedBus.Peripheral[] peripherals = ((RedBusAccessor)peripheral.getBus().getRedBus()).getPeripherals();
for (RedBus.Peripheral value : peripherals) { for (RedBus.Peripheral value : peripherals) {
if (value != null) { if (value != null) {
player.sendMessage(Text.literal(String.valueOf(value)), false); player.sendMessage(Text.literal(" " + value.getClass().toString()), false);
} }
} }
} }

Loading…
Cancel
Save