diff --git a/plugins/cpu/z80-cpu/src/main/java/net/emustudio/plugins/cpu/zilogZ80/EmulatorEngine.java b/plugins/cpu/z80-cpu/src/main/java/net/emustudio/plugins/cpu/zilogZ80/EmulatorEngine.java index 0830c5d99..fcea0966f 100644 --- a/plugins/cpu/z80-cpu/src/main/java/net/emustudio/plugins/cpu/zilogZ80/EmulatorEngine.java +++ b/plugins/cpu/z80-cpu/src/main/java/net/emustudio/plugins/cpu/zilogZ80/EmulatorEngine.java @@ -420,7 +420,7 @@ private void writeWord(int address, int value) { } private void incrementR() { - R = (R & 0x80) | (((R & 0x7F) + 1) & 0x7F); + R = (R & 0x80) | ((R + 1) & 0x7F); } void I_NOP() { @@ -910,9 +910,9 @@ void I_PUSH_IX() { void I_PUSH_IY() { // pc:5,sp-1:3,sp-2:3 SP = (SP - 2) & 0xFFFF; - memory.write((SP + 1) & 0xFFFF, (byte) (IY & 0xFF)); + memory.write((SP + 1) & 0xFFFF, (byte) (IY >>> 8)); advanceCycles(3); - memory.write(SP, (byte) (IY >>> 8)); + memory.write(SP, (byte) (IY & 0xFF)); advanceCycles(3); } diff --git a/plugins/device/cassette-player/src/main/java/net/emustudio/plugins/device/cassette_player/loaders/TzxLoader.java b/plugins/device/cassette-player/src/main/java/net/emustudio/plugins/device/cassette_player/loaders/TzxLoader.java index 351ea6fe3..fda5aa436 100644 --- a/plugins/device/cassette-player/src/main/java/net/emustudio/plugins/device/cassette_player/loaders/TzxLoader.java +++ b/plugins/device/cassette-player/src/main/java/net/emustudio/plugins/device/cassette_player/loaders/TzxLoader.java @@ -72,7 +72,6 @@ private void interpret(byte[] content, TapePlayback listener) throws IOException while (buffer.position() < buffer.limit()) { int id = buffer.get() & 0xFF; // 16 for ROM-saved block - System.out.println(id); int pause = buffer.getShort() & 0xFFFF; // pause after this block int blockLength = buffer.getShort() & 0xFFFF;