Move hard reset handling to the pc thread to avoid thread safety issues with GUI-triggered hard resets

This commit is contained in:
RichardG867
2021-04-14 16:13:40 -03:00
parent b2dd4fde07
commit fc50bd9bad

View File

@@ -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);