From f2ebd52fb7cd001f29c7fe7c48f5f46f1512913e Mon Sep 17 00:00:00 2001 From: Astoria Date: Fri, 12 Apr 2024 22:03:10 -0500 Subject: [PATCH] Speed increase, less copyright infringing BASIC instead of forth! --- .../net/brokenmoon/redcontrol/api/Emulator.java | 2 +- .../redcontrol/blockentities/CpuEntity.java | 2 +- .../redcontrol/blockentities/DriveEntity.java | 2 +- .../resources/data/redcontrol/image/basic.img | Bin 0 -> 15232 bytes 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/data/redcontrol/image/basic.img diff --git a/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java b/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java index b36289d..6df81ef 100644 --- a/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java +++ b/src/main/java/net/brokenmoon/redcontrol/api/Emulator.java @@ -26,7 +26,7 @@ public class Emulator { cpu = new Cpu(); cpu.setLogCallback(new LogConsumer()); cpu.setBus(new Bus(bus)); - ram = new Memory(0x0000, 0x2000 - 1, ((CpuAccessor)cpu).getRedBusState()); + ram = new Memory(0x0000, 0x4000 - 1, ((CpuAccessor)cpu).getRedBusState()); ram.loadFromBytes(RedControl.images.get("rpcboot.bin"),0x400,0x100); cpu.getBus().addDevice(ram, ((CpuAccessor)cpu).getRedBusState()); cpu.reset(); diff --git a/src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java b/src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java index e2d19c5..42574c4 100644 --- a/src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java +++ b/src/main/java/net/brokenmoon/redcontrol/blockentities/CpuEntity.java @@ -42,7 +42,7 @@ public class CpuEntity extends Peripheral{ be.notTicked = false; } if(be.isRunning) { - for (int i = 0; i < 500; i++) + for (int i = 0; i < 1000; i++) be.step(); } else{ if (be.isResetting && !be.isReset && be.resetTimer > 0){ diff --git a/src/main/java/net/brokenmoon/redcontrol/blockentities/DriveEntity.java b/src/main/java/net/brokenmoon/redcontrol/blockentities/DriveEntity.java index 92f8a81..d5ed751 100644 --- a/src/main/java/net/brokenmoon/redcontrol/blockentities/DriveEntity.java +++ b/src/main/java/net/brokenmoon/redcontrol/blockentities/DriveEntity.java @@ -27,7 +27,7 @@ public class DriveEntity extends Peripheral{ public DriveEntity(BlockPos pos, BlockState state) { super(RedControl.DRIVE_BLOCK_ENTITY, pos, state, 2); - this.driver = new ByteDiskDriver(RedControl.images.get("redforth.img"), "Forth", "FORTH"); + this.driver = new ByteDiskDriver(RedControl.images.get("basic.img"), "Forth", "FORTH"); this.buffer = ByteBuffer.allocateDirect(SECTOR_SIZE); byte[] name = driver.getDriveName(); byte[] serial = driver.getDriveSerial(); diff --git a/src/main/resources/data/redcontrol/image/basic.img b/src/main/resources/data/redcontrol/image/basic.img new file mode 100644 index 0000000000000000000000000000000000000000..d3223182c3820a049a7e5e235370d17c909cd38c GIT binary patch literal 15232 zcmeHu3wRUPnds5WFEAE3#4^u=5m*KRV<3q!O%vIck%+Jy+a!dht%xO%cyJd;RKQY1B7|Tc|kg-D^n50W6I3{hwq%;qpt?z$ilBTU z-u>?V*5H{l=kcHa{WvpL-Mz}(lzOY%nU-CO14z=66?XthySkJj?@(<2q2wy#O~qxB zqZ<^-8x$hL$CE^BLTy5T-?b~DCqYmq#cqjJyAt{mg-<#YIdl`XGdz;OS`(6b5iIs* znOxGMHLLM6Yu2n=^2|ybwmP2uwGu7JFD#Aq;qo*NWHLo_!WCS-l>w zu&u}I*5I`^Soiy)HQ2h=@w{zDnPZi0&2zD5$FnPDl-QPBGe5TuuUU#$*;cJtdmG!< zu3hsx^NL^GWJw$+xrr<}YE=R@N{&cmEe=IO*5Qxfic8QFOgEcUJzg)IoAvgK6!Mjj4|^s!9J12g6t@gk)(F)LF%DQO6Sm{Qdu}5I5jty$Rm+vsca|QI+EO9 zRI6-qB8MR*EZ88t0Sqq$o|%vWTC=p?OszK!mq@&iQbtm4Viyd`(Ld;C;4gmu^bdmi z{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