Why is this not working please game

main
Astoria 7 months ago
parent 273add3a38
commit 5b4b61d96b

@ -1 +1 @@
Subproject commit c6de658396d537fd0c1fc0046d5222c2dc44de3d
Subproject commit e82ee867d35793695a3d5013f654c1732c06b74c

@ -0,0 +1,9 @@
package net.brokenmoon.redcontrol.api;
import com.simon816.j65el02.device.RedBus;
public class FakeBus extends RCBus{
public FakeBus(RedBus redBus) {
super(redBus);
}
}

@ -1,18 +1,37 @@
package net.brokenmoon.redcontrol.api;
import com.simon816.j65el02.Bus;
import com.simon816.j65el02.Cpu;
import com.simon816.j65el02.CpuState;
import net.brokenmoon.redcontrol.blockentities.CpuEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public class RCCpu extends Cpu {
private final World world;
private final BlockPos pos;
private CpuEntity cpuEntity;
public RCCpu(World world, BlockPos pos) {
this.world = world;
this.pos = pos;
public RCCpu(CpuEntity cpuEntity) {
this.cpuEntity = cpuEntity;
}
public void setInterrupt(boolean val){
state.intWait = val;
}
@Override
private int readByte(int address) {
return this.cpuEntity.getBus().read(address, true);
}
@Override
private void writeMemory(int address, int value, boolean x) {
this.getBus().write(address, value);
boolean flag = x ? this.state.indexWidthFlag : this.state.mWidthFlag;
if (!this.state.emulationFlag && !flag) {
this.cpuEntity.getBus().write(address + 1, value >>> 8);
}
}
@Override
}

@ -3,6 +3,7 @@ package net.brokenmoon.redcontrol.blockentities;
import com.simon816.j65el02.Bus;
import com.simon816.j65el02.device.*;
import net.brokenmoon.redcontrol.RedControl;
import net.brokenmoon.redcontrol.api.FakeBus;
import net.brokenmoon.redcontrol.api.RCBus;
import net.brokenmoon.redcontrol.api.RCCpu;
import net.minecraft.block.BlockState;
@ -39,9 +40,9 @@ public class CpuEntity extends Peripheral{
public static void tick(World world, BlockPos pos, BlockState state, CpuEntity be) {
if(be.notTicked) {
be.cpu = new RCCpu(world, pos);
be.cpu = new RCCpu(be);
be.setRCBus(new RCBus(new RedBus()));
be.cpu.setBus(be.getRCBus());
be.cpu.setBus((FakeBus)be.getRCBus());
be.cpu.setBus(be.getRCBus());
Memory ram = new Memory(0x0000, 0x2000);
try {

Loading…
Cancel
Save