Removed unused I/O array

master
Marco Maccaferri 2020-08-08 12:17:09 +02:00
rodzic af731530de
commit a77a4d354a
3 zmienionych plików z 7 dodań i 17 usunięć

Wyświetl plik

@ -2441,7 +2441,7 @@ public class Application {
debugTMS9918.redraw();
}
memIoOps = new MemIoOps(65536, 256) {
memIoOps = new MemIoOps(65536) {
public final static int SIOA_D = 0x81;
public final static int SIOA_C = 0x80;
@ -2491,7 +2491,7 @@ public class Application {
return tms9918.inReg();
}
return super.inPort(port & 0xFF);
return super.inPort(port);
}
@Override
@ -2515,7 +2515,7 @@ public class Application {
if ((port & 0xFF) == preferences.getTms9918Register()) {
tms9918.outReg(value);
}
super.outPort(port & 0xFF, value);
super.outPort(port, value);
}
};

Wyświetl plik

@ -126,13 +126,13 @@ public class TMS9918 {
public int inRam() {
int result = ram[ramPtr] & 0xFF;
ramPtr = (ramPtr + 1) & 0x3FFF;
return result;
return result & 0xFF;
}
public int inReg() {
int result = status;
status &= ~0x80;
return result;
return result & 0xFF;
}
public void processFrame(long elapsedTimeNs) {

Wyświetl plik

@ -12,7 +12,6 @@ package z80core;
public class MemIoOps {
private byte[] z80Ram;
private byte[] z80Ports;
protected long tstates = 0;
@ -20,7 +19,7 @@ public class MemIoOps {
}
public MemIoOps(int ramSize, int portSize) {
public MemIoOps(int ramSize) {
if (ramSize < 0 || ramSize > 0x10000) {
throw new IndexOutOfBoundsException("ramSize Out of Range [0x0000 - 0x10000");
}
@ -28,14 +27,6 @@ public class MemIoOps {
if (ramSize > 0) {
z80Ram = new byte[ramSize];
}
if (portSize < 0 || portSize > 0x10000) {
throw new IndexOutOfBoundsException("portSize Out of Range [0x0000 - 0x10000");
}
if (portSize > 0) {
z80Ports = new byte[portSize];
}
}
public byte[] getRam() {
@ -79,12 +70,11 @@ public class MemIoOps {
public int inPort(int port) {
tstates += 4; // 4 clocks for read byte from bus
return z80Ports[port & 0xFFFF] & 0xff;
return port & 0xff;
}
public void outPort(int port, int value) {
tstates += 4; // 4 clocks for write byte to bus
z80Ports[port & 0xFFFF] = (byte) value;
}
public void addressOnBus(int address, int tstates) {