Skip to content

Commit

Permalink
Removed increment of register I in opcode 0xF055 and 0xF065.
Browse files Browse the repository at this point in the history
The original CHIP-8 design incremented I. However, on current implementations I is left unchanged.
Reference: https://en.wikipedia.org/wiki/CHIP-8#cite_note-memi-4
  • Loading branch information
Lee Morgan committed Jun 25, 2015
1 parent e9417cd commit 9c9735c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Chip8/Chip8.c
Expand Up @@ -44,7 +44,7 @@
The Chip8 system has a HEX based keypad (0x0 - 0xF).
Opcode Table
• NNN address
• NNN 12-bit address
• NN 8-bit constant
• N 4-bit constant
• X and Y 4-bit register identifier
Expand Down Expand Up @@ -562,15 +562,13 @@ void emulateCycle() {
for (unsigned char r = 0; r <= X; r++) {
memory[I+r] = V[r];
}
I = I + X + 1;
pc += 2;
}
else if (submaskedOpcode == 0x0065) {
unsigned char X = GetX(opcode);
for (unsigned char r = 0; r <= X; r++) {
V[r] = memory[I+r];
}
I = I + X + 1;
pc += 2;
}
else {
Expand Down

1 comment on commit 9c9735c

@coocos
Copy link

@coocos coocos commented on 9c9735c Oct 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into the exact same problem as you and I was slowly going crazy trying to isolate the cause. Thankfully I ran into your blog post. Thanks a lot!

Please sign in to comment.