diff --git a/src/86box.c b/src/86box.c index 16c99851a..6fb7541a7 100644 --- a/src/86box.c +++ b/src/86box.c @@ -175,6 +175,7 @@ int scrnsz_y = SCREEN_RES_Y; /* current screen size, Y */ int config_changed; /* config has changed */ int title_update; int framecountx = 0; +int hard_reset_pending = 0; int unscaled_size_x = SCREEN_RES_X; /* current unscaled size X */ @@ -856,9 +857,7 @@ pc_reset_hard_init(void) void pc_reset_hard(void) { - pc_reset_hard_close(); - - pc_reset_hard_init(); + hard_reset_pending = 1; } @@ -936,6 +935,13 @@ pc_run(void) { wchar_t temp[200]; + /* Trigger a hard reset if one is pending. */ + if (hard_reset_pending) { + hard_reset_pending = 0; + pc_reset_hard_close(); + pc_reset_hard_init(); + } + /* Run a block of code. */ startblit(); cpu_exec(cpu_s->rspeed / 100);