Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
input: fix a couple bugs with halt-until-next-input
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Lord committed Jan 21, 2018
1 parent 42c2cbe commit c616886
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,22 @@ int main(int argc, char* argv[]) {
for (int i = 0; i < NUMBER_OF_KEYS; i++) {
if (event.key.code == KEYMAP[i]) {
cpu.keyInput(i);
break;
}
}
}
}
}

if (cpu.state.running) {
if (delayTimer.getElapsedTime().asSeconds() > TIMER_FREQUENCY) {
if (delayTimer.getElapsedTime().asSeconds() > TIMER_FREQUENCY) {
if (cpu.state.running) {
cpu.tickTimers();
display.draw(cpu.state.vram);
delayTimer.restart();
}
display.draw(cpu.state.vram);
delayTimer.restart();
}

if (cpu.state.running) {
if (cpuTimer.getElapsedTime().asSeconds() > CPU_FREQUENCY) {
try {
for (int i = 0; i < NUMBER_OF_KEYS; i++) {
Expand Down

0 comments on commit c616886

Please sign in to comment.