Skip to content

Commit

Permalink
[#314] z80-cpu: fixed push IY
Browse files Browse the repository at this point in the history
  • Loading branch information
vbmacher committed May 29, 2023
1 parent cbac842 commit 9b7a3d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9b7a3d5

Please sign in to comment.