quit if the HALT_WANTOQUIT is set (ie, win32 closing the window)

This commit is contained in:
Kelvin Sherlock 2019-03-05 21:53:28 -05:00
parent 87499819e5
commit f863c4cfa0
2 changed files with 11 additions and 3 deletions

View File

@ -1186,6 +1186,9 @@ int debug_shell(int code) {
char *cp;
int control_d_count = 0;
fflush(stderr);
fflush(stdout);
if (!g_templates_loaded) {
char *path;
g_templates_loaded = 1;
@ -1286,6 +1289,8 @@ void do_go() {
for(;;) {
ret = run_prog();
if (halt_sim & HALT_WANTTOQUIT) return;
if (ret || g_stepping) {
g_config_control_panel = 1;
ok = debug_shell(ret);

View File

@ -1613,9 +1613,12 @@ int run_prog() {
ret = 0;
break;
}
if(halt_sim & 0x07) {
halt_sim &= ~0x07;
ret = RET_HALT;
if (halt_sim & ~HALT_EVENT) {
if(halt_sim & 0x07) {
/* halt_printf() */
halt_sim &= ~0x07;
ret = RET_HALT;
}
break;
}