From 75573190158247a7e56589c3d6568ed70faf7fef Mon Sep 17 00:00:00 2001 From: Brendan Fletcher Date: Sun, 15 Sep 2024 01:19:14 -0400 Subject: [PATCH] Reset ARM object on system reset instead of recreating it --- core/coproc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/coproc.c b/core/coproc.c index 8b2723d52..d5079396c 100644 --- a/core/coproc.c +++ b/core/coproc.c @@ -11,11 +11,17 @@ coproc_state_t coproc; void coproc_reset(void) { gui_console_printf("[CEmu] Reset Coprocessor Interface...\n"); - arm_destroy(coproc.arm); - memset(&coproc, 0, sizeof(coproc)); - if (asic.python) { + if (asic.python && !coproc.arm) { coproc.arm = arm_create(); } + if (coproc.arm) { + if (asic.python) { + arm_reset(coproc.arm); + } else { + arm_destroy(coproc.arm); + memset(&coproc, 0, sizeof(coproc)); + } + } } bool coproc_load(const char *path) {