Skip to content

Commit

Permalink
Partially revert "GB: Fix execution state and HALT getting out of sync"
Browse files Browse the repository at this point in the history
This reverts commit 5d9e4d2.
  • Loading branch information
endrift committed Nov 19, 2017
1 parent e104b46 commit c9145e1
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/gb/gb.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,6 @@ void GBProcessEvents(struct LR35902Core* cpu) {
}
if (cpu->halted) {
cpu->cycles = cpu->nextEvent;
cpu->executionState += cpu->nextEvent;
cpu->executionState &= 3;
if (!gb->memory.ie || !gb->memory.ime) {
break;
}
Expand Down Expand Up @@ -681,8 +679,6 @@ static void _enableInterrupts(struct mTiming* timing, void* user, uint32_t cycle
void GBHalt(struct LR35902Core* cpu) {
struct GB* gb = (struct GB*) cpu->master;
if (!(gb->memory.ie & gb->memory.io[REG_IF])) {
cpu->executionState += cpu->nextEvent - cpu->cycles;
cpu->executionState &= 3;
cpu->cycles = cpu->nextEvent;
cpu->halted = true;
} else if (gb->model < GB_MODEL_CGB) {
Expand Down

0 comments on commit c9145e1

Please sign in to comment.