From 5a868589f048e8e6fda9e2d29a0b19891df33035 Mon Sep 17 00:00:00 2001 From: Astoria Date: Wed, 10 Apr 2024 19:02:16 -0500 Subject: [PATCH] ITS WORKING FINALLYYYYY --- J65el02 | 2 +- src/main/java/net/brokenmoon/redcontrol/api/Emulator.java | 1 + .../net/brokenmoon/redcontrol/blockentities/CpuEntity.java | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/J65el02 b/J65el02 index b439ab1..f95fe5e 160000 --- a/J65el02 +++ b/J65el02 @@ -1 +1 @@ -Subproject commit b439ab12a1be69b8eb7da404c17e9c0db30f641d +Subproject commit f95fe5ec0c8afb9a179376117a0f601b35e15f99 diff --git a/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java b/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java index 84362c0..ac481cc 100644 --- a/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java +++ b/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java @@ -33,6 +33,7 @@ public class Emulator { ram.write(0, 2, ((CpuAccessor)cpu).getRedBusState()); ram.write(1, 1, ((CpuAccessor)cpu).getRedBusState()); System.out.println("Emulator made"); + System.out.println("Current PC position: " + this.cpu.getCpuState().pc); } public RedBus getBus() { diff --git a/src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java b/src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java index 8eb5f9e..9200c8a 100644 --- a/src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java +++ b/src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java @@ -27,10 +27,13 @@ public class CpuEntity extends Peripheral{ public static void tick(World world, BlockPos pos, BlockState state, CpuEntity be) { if(be.notTicked) { + System.out.println("Ticking pre reset, PC at " + be.core.cpu.getCpuState().pc); be.reset(); + System.out.println("Ticking post reset, PC at " + be.core.cpu.getCpuState().pc); be.notTicked = false; } for(int i = 0; i < 500; i++) + System.out.println("Stepping, PC at " + be.core.cpu.getCpuState().pc); be.step(); if(be.core.isWaitingOnInterrupt()){ be.core.setWaitingOnInterrupt();