flag handling
This commit is contained in:
parent
50e9905415
commit
e5dd0105af
3 changed files with 12 additions and 3 deletions
|
@ -98,6 +98,9 @@ std::string console::read_line(const std::string & prompt)
|
|||
for(;;) {
|
||||
char c = wait_char(500);
|
||||
|
||||
if (*terminate || stop_thread_flag)
|
||||
return "";
|
||||
|
||||
if (c == -1)
|
||||
continue;
|
||||
|
||||
|
@ -193,7 +196,7 @@ void console::operator()()
|
|||
continue;
|
||||
|
||||
if (c == 3) // ^c
|
||||
*terminate = true;
|
||||
*interrupt_emulation = *terminate = true;
|
||||
else if (c == 5) // ^e
|
||||
*interrupt_emulation = true;
|
||||
else if (c == 12) // ^l
|
||||
|
|
|
@ -170,7 +170,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_bool *const interru
|
|||
|
||||
c->emulation_start();
|
||||
|
||||
while(!event && !terminate && !*interrupt_emulation) {
|
||||
while(!event && !*interrupt_emulation) {
|
||||
if (tracing || single_step)
|
||||
disassemble(c, single_step ? cnsl : nullptr, c->getPC(), false);
|
||||
|
||||
|
|
8
main.cpp
8
main.cpp
|
@ -274,9 +274,15 @@ int main(int argc, char *argv[])
|
|||
else {
|
||||
c->emulation_start(); // for statistics
|
||||
|
||||
while(!event && !terminate)
|
||||
while(!event) {
|
||||
if (interrupt_emulation) {
|
||||
if (terminate)
|
||||
break;
|
||||
}
|
||||
|
||||
c->step();
|
||||
}
|
||||
}
|
||||
|
||||
*running = false;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue