Skip to content

Commit 10ad804

Browse files
committed
Reset ARM object on system reset instead of recreating it
1 parent 68eccad commit 10ad804

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

core/coproc.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ coproc_state_t coproc;
1111

1212
void coproc_reset(void) {
1313
gui_console_printf("[CEmu] Reset Coprocessor Interface...\n");
14-
arm_destroy(coproc.arm);
15-
memset(&coproc, 0, sizeof(coproc));
16-
if (asic.python) {
14+
if (asic.python && !coproc.arm) {
1715
coproc.arm = arm_create();
1816
}
17+
if (coproc.arm) {
18+
if (asic.python) {
19+
arm_reset(coproc.arm);
20+
} else {
21+
arm_destroy(coproc.arm);
22+
memset(&coproc, 0, sizeof(coproc));
23+
}
24+
}
1925
}
2026

2127
bool coproc_load(const char *path) {

0 commit comments

Comments
 (0)