kopia lustrzana https://github.com/maccasoft/z80-tools
Source format and cleanup
rodzic
c3ef85490a
commit
1d97d7b121
|
@ -10,6 +10,7 @@ package z80core;
|
|||
* @author jsanchez
|
||||
*/
|
||||
public class MemIoOps {
|
||||
|
||||
private byte z80Ram[] = null;
|
||||
private byte z80Ports[] = null;
|
||||
private long tstates = 0;
|
||||
|
@ -20,15 +21,17 @@ public class MemIoOps {
|
|||
}
|
||||
|
||||
public MemIoOps(int ramSize, int portSize) {
|
||||
if (ramSize < 0 || ramSize > 0x10000)
|
||||
if (ramSize < 0 || ramSize > 0x10000) {
|
||||
throw new IndexOutOfBoundsException("ramSize Out of Range [0x0000 - 0x10000");
|
||||
}
|
||||
|
||||
if (ramSize > 0) {
|
||||
z80Ram = new byte[ramSize];
|
||||
}
|
||||
|
||||
if (portSize < 0 || portSize > 0x10000)
|
||||
if (portSize < 0 || portSize > 0x10000) {
|
||||
throw new IndexOutOfBoundsException("portSize Out of Range [0x0000 - 0x10000");
|
||||
}
|
||||
|
||||
if (portSize > 0) {
|
||||
z80Ports = new byte[portSize];
|
||||
|
@ -56,7 +59,7 @@ public class MemIoOps {
|
|||
|
||||
public void poke8(int address, int value) {
|
||||
tstates += 3; // 3 clocks for write byte to RAM
|
||||
z80Ram[address] = (byte)value;
|
||||
z80Ram[address] = (byte) value;
|
||||
}
|
||||
|
||||
public int peek16(int address) {
|
||||
|
@ -77,7 +80,7 @@ public class MemIoOps {
|
|||
|
||||
public void outPort(int port, int value) {
|
||||
tstates += 4; // 4 clocks for write byte to bus
|
||||
z80Ports[port] = (byte)value;
|
||||
z80Ports[port] = (byte) value;
|
||||
}
|
||||
|
||||
public void addressOnBus(int address, int tstates) {
|
||||
|
@ -103,4 +106,5 @@ public class MemIoOps {
|
|||
public void reset() {
|
||||
tstates = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,9 @@ package z80core;
|
|||
* @author jsanchez
|
||||
*/
|
||||
public interface NotifyOps {
|
||||
|
||||
int breakpoint(int address, int opcode);
|
||||
|
||||
void execDone();
|
||||
|
||||
}
|
||||
|
|
1820
src/z80core/Z80.java
1820
src/z80core/Z80.java
Plik diff jest za duży
Load Diff
|
@ -11,6 +11,7 @@ import z80core.Z80.IntMode;
|
|||
* @author jsanchez
|
||||
*/
|
||||
public class Z80State {
|
||||
|
||||
// Acumulador y resto de registros de 8 bits
|
||||
private int regA, regB, regC, regD, regE, regH, regL;
|
||||
// Flags sIGN, zERO, 5, hALFCARRY, 3, pARITY y ADDSUB (n), carryFlag
|
||||
|
@ -72,10 +73,10 @@ public class Z80State {
|
|||
* Shit yourself, little parrot.
|
||||
*/
|
||||
private int memptr;
|
||||
|
||||
|
||||
public Z80State() {
|
||||
}
|
||||
|
||||
|
||||
// Acceso a registros de 8 bits
|
||||
public final int getRegA() {
|
||||
return regA;
|
||||
|
@ -84,7 +85,7 @@ public class Z80State {
|
|||
public final void setRegA(int value) {
|
||||
regA = value & 0xff;
|
||||
}
|
||||
|
||||
|
||||
public final int getRegF() {
|
||||
return regF;
|
||||
}
|
||||
|
@ -149,7 +150,7 @@ public class Z80State {
|
|||
public final void setRegAx(int value) {
|
||||
regAx = value & 0xff;
|
||||
}
|
||||
|
||||
|
||||
public final int getRegFx() {
|
||||
return regFx;
|
||||
}
|
||||
|
@ -337,7 +338,7 @@ public class Z80State {
|
|||
public final void setMemPtr(int word) {
|
||||
memptr = word & 0xffff;
|
||||
}
|
||||
|
||||
|
||||
// Acceso a los flip-flops de interrupción
|
||||
public final boolean isIFF1() {
|
||||
return ffIFF1;
|
||||
|
@ -358,7 +359,7 @@ public class Z80State {
|
|||
public final boolean isNMI() {
|
||||
return activeNMI;
|
||||
}
|
||||
|
||||
|
||||
public final void setNMI(boolean nmi) {
|
||||
activeNMI = nmi;
|
||||
}
|
||||
|
@ -372,7 +373,7 @@ public class Z80State {
|
|||
public final boolean isINTLine() {
|
||||
return activeINT;
|
||||
}
|
||||
|
||||
|
||||
public final void setINTLine(boolean intLine) {
|
||||
activeINT = intLine;
|
||||
}
|
||||
|
@ -393,11 +394,11 @@ public class Z80State {
|
|||
public void setHalted(boolean state) {
|
||||
halted = state;
|
||||
}
|
||||
|
||||
|
||||
public final boolean isPendingEI() {
|
||||
return pendingEI;
|
||||
}
|
||||
|
||||
|
||||
public final void setPendingEI(boolean state) {
|
||||
pendingEI = state;
|
||||
}
|
||||
|
@ -415,4 +416,5 @@ public class Z80State {
|
|||
public void setFlagQ(boolean flagQ) {
|
||||
this.flagQ = flagQ;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue