Save DraCo nvram file only if in DraCo mode.

This commit is contained in:
Toni Wilen 2024-01-27 15:26:43 +02:00
parent 63c2118c05
commit d9c5870280

View File

@ -1435,6 +1435,7 @@ static void x86_irq(int irq, bool state)
void draco_free(void) void draco_free(void)
{ {
if (currprefs.cs_compatible == CP_DRACO || currprefs.cs_compatible == CP_CASABLANCA) {
TCHAR path[MAX_DPATH]; TCHAR path[MAX_DPATH];
cfgfile_resolve_path_out_load(currprefs.flashfile, path, MAX_DPATH, PATH_ROM); cfgfile_resolve_path_out_load(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
struct zfile *draco_flashfile = zfile_fopen(path, _T("wb"), ZFD_NORMAL); struct zfile *draco_flashfile = zfile_fopen(path, _T("wb"), ZFD_NORMAL);
@ -1445,6 +1446,7 @@ void draco_free(void)
zfile_fwrite(draco_1wire_sram, sizeof(draco_1wire_sram), 1, draco_flashfile); zfile_fwrite(draco_1wire_sram, sizeof(draco_1wire_sram), 1, draco_flashfile);
zfile_fclose(draco_flashfile); zfile_fclose(draco_flashfile);
} }
}
xfree(draco_mouse_base); xfree(draco_mouse_base);
draco_mouse_base = NULL; draco_mouse_base = NULL;
xfree(dracorom); xfree(dracorom);