Bus Progress
parent
9721848c4e
commit
520c9fe3c2
@ -1,10 +1,28 @@
|
||||
package net.brokenmoon.redcontrol.api;
|
||||
|
||||
import com.simon816.j65el02.Bus;
|
||||
import com.simon816.j65el02.device.Device;
|
||||
import com.simon816.j65el02.device.RedBus;
|
||||
import net.brokenmoon.redcontrol.blockentities.Peripheral;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class RCBus extends Bus {
|
||||
|
||||
boolean isValid = true;
|
||||
|
||||
Peripheral[] peripherals = new Peripheral[256];
|
||||
public RCBus(RedBus redBus) {
|
||||
super(redBus);
|
||||
}
|
||||
|
||||
public void write(int address, int data) {
|
||||
Peripheral peripheral = peripherals[address];
|
||||
peripheral.getBus().write(address, data);
|
||||
}
|
||||
|
||||
public int read(int address, boolean cpuAccess) {
|
||||
Peripheral peripheral = peripherals[address];
|
||||
return peripheral.getBus().getRedBus().read(address, cpuAccess) & 0xff;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue