kopia lustrzana https://github.com/maccasoft/z80-tools
Removed unused I/O array
rodzic
af731530de
commit
a77a4d354a
|
@ -2441,7 +2441,7 @@ public class Application {
|
||||||
debugTMS9918.redraw();
|
debugTMS9918.redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
memIoOps = new MemIoOps(65536, 256) {
|
memIoOps = new MemIoOps(65536) {
|
||||||
|
|
||||||
public final static int SIOA_D = 0x81;
|
public final static int SIOA_D = 0x81;
|
||||||
public final static int SIOA_C = 0x80;
|
public final static int SIOA_C = 0x80;
|
||||||
|
@ -2491,7 +2491,7 @@ public class Application {
|
||||||
return tms9918.inReg();
|
return tms9918.inReg();
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.inPort(port & 0xFF);
|
return super.inPort(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2515,7 +2515,7 @@ public class Application {
|
||||||
if ((port & 0xFF) == preferences.getTms9918Register()) {
|
if ((port & 0xFF) == preferences.getTms9918Register()) {
|
||||||
tms9918.outReg(value);
|
tms9918.outReg(value);
|
||||||
}
|
}
|
||||||
super.outPort(port & 0xFF, value);
|
super.outPort(port, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -126,13 +126,13 @@ public class TMS9918 {
|
||||||
public int inRam() {
|
public int inRam() {
|
||||||
int result = ram[ramPtr] & 0xFF;
|
int result = ram[ramPtr] & 0xFF;
|
||||||
ramPtr = (ramPtr + 1) & 0x3FFF;
|
ramPtr = (ramPtr + 1) & 0x3FFF;
|
||||||
return result;
|
return result & 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int inReg() {
|
public int inReg() {
|
||||||
int result = status;
|
int result = status;
|
||||||
status &= ~0x80;
|
status &= ~0x80;
|
||||||
return result;
|
return result & 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processFrame(long elapsedTimeNs) {
|
public void processFrame(long elapsedTimeNs) {
|
||||||
|
|
|
@ -12,7 +12,6 @@ package z80core;
|
||||||
public class MemIoOps {
|
public class MemIoOps {
|
||||||
|
|
||||||
private byte[] z80Ram;
|
private byte[] z80Ram;
|
||||||
private byte[] z80Ports;
|
|
||||||
|
|
||||||
protected long tstates = 0;
|
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) {
|
if (ramSize < 0 || ramSize > 0x10000) {
|
||||||
throw new IndexOutOfBoundsException("ramSize Out of Range [0x0000 - 0x10000");
|
throw new IndexOutOfBoundsException("ramSize Out of Range [0x0000 - 0x10000");
|
||||||
}
|
}
|
||||||
|
@ -28,14 +27,6 @@ public class MemIoOps {
|
||||||
if (ramSize > 0) {
|
if (ramSize > 0) {
|
||||||
z80Ram = new byte[ramSize];
|
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() {
|
public byte[] getRam() {
|
||||||
|
@ -79,12 +70,11 @@ public class MemIoOps {
|
||||||
|
|
||||||
public int inPort(int port) {
|
public int inPort(int port) {
|
||||||
tstates += 4; // 4 clocks for read byte from bus
|
tstates += 4; // 4 clocks for read byte from bus
|
||||||
return z80Ports[port & 0xFFFF] & 0xff;
|
return port & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void outPort(int port, int value) {
|
public void outPort(int port, int value) {
|
||||||
tstates += 4; // 4 clocks for write byte to bus
|
tstates += 4; // 4 clocks for write byte to bus
|
||||||
z80Ports[port & 0xFFFF] = (byte) value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addressOnBus(int address, int tstates) {
|
public void addressOnBus(int address, int tstates) {
|
||||||
|
|
Ładowanie…
Reference in New Issue