Skip to content

Commit

Permalink
Improve compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
JustDoom committed Dec 8, 2024
1 parent d423cef commit 41fc3fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/emulator/Cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void Cpu::runInstruction(uint16_t opcode) {
this->registers[x] ^= this->registers[y];
break;
case 0x4: {
const uint16_t sum = this->registers[x] += this->registers[y];
const uint16_t sum = (this->registers[x] += this->registers[y]);

this->registers[0xF] = 0;

Expand All @@ -152,15 +152,16 @@ void Cpu::runInstruction(uint16_t opcode) {

this->registers[x] = sum;
}
case 0x5: {
break;
case 0x5:
this->registers[0xF] = 0;

if (this->registers[x] > this->registers[y]) {
this->registers[0xF] = 1;
}

this->registers[x] -= this->registers[y];
}
break;
case 0x6:
this->registers[0xF] = (this->registers[x] & 0x1);

Expand Down

0 comments on commit 41fc3fd

Please sign in to comment.