Skip to content

Commit

Permalink
add 00FD opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
btimofeev committed Apr 7, 2012
1 parent 12aeb9d commit 4832498
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/chip_emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void ChipEmu::init()
for (int i=0; i < 8; i++)
hp48_flags[i] = 0;

stop = false;

mode = 0;
}

Expand Down Expand Up @@ -237,6 +239,11 @@ void ChipEmu::executeNextOpcode()
screen[127][y] = 0;
}
break;

case 0xFD: // 00FD - Quit the emulator
stop = true;
cout << "Quit the emulator" << endl;
break;

case 0xFE: // 00FE - disable extended screen mode *SCHIP*
mode = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/chip_emu.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class ChipEmu
unsigned char key[16]; // 0 - KEY_RELEASED
// 1 - KEY_PRESSED

bool stop; // for 00FD opcode

ChipEmu();
void init();
bool loadGame(const char *filename);
Expand Down
2 changes: 2 additions & 0 deletions src/sdl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ int main(int argc, char *argv[])

opcode_count = 0;
}

if (emu.stop) done = true;
}
}

Expand Down

0 comments on commit 4832498

Please sign in to comment.