From 542164dc99a8c72daaa0ad179af1df4a434abdff Mon Sep 17 00:00:00 2001 From: WizzardSK <42868978+WizzardSK@users.noreply.github.com> Date: Sun, 20 Sep 2026 22:57:34 +0200 Subject: [PATCH] Close an SMD ROM's file once, and report the version this core is built from (#71) * Close an SMD ROM's file once, not twice Upstream d22b34e78040, "Fix regression in SMD ROM loading", and it is a real one here too: load_smd_rom() closes the handle itself at its end, and load_media() then closed the same handle again in the tail both paths share. Every .smd ROM went through that, and .smd is in the core's valid_extensions. The close moves into the branch that still has the file open, which is what upstream did, so each path closes exactly once. * Report the version this core is actually built from The core told the frontend 0.6.3-pre. Upstream cut 1.0.0 - Mega CD, 32X, Pico, Game Gear, SC-3000, Colecovision, the Nuklear UI rework, all of it - and its tip is 1.0.1-pre, so this tree carries that work under a version string from two releases ago. A user reading "BlastEm 0.6.3-pre" in the core information screen has no way to tell which of those systems the core is even supposed to run. DM noticed it. Nothing else to take from that report: the 32X BIOS paths he mentioned are already here, with the laseractive and TMSS ones beside them, and upstream has only now caught up with that. --- system.c | 5 ++++- version.inc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/system.c b/system.c index deb4344..9e5225e 100644 --- a/system.c +++ b/system.c @@ -293,6 +293,10 @@ uint32_t load_media(char * filename, system_media *dst, system_type *stype) } while (read > 0); dst->buffer = buf; ret = (uint32_t)readsize; + // Only this path still has the file open: load_smd_rom() above closes + // it itself, and closing it again below was a second close of the same + // handle for every .smd ROM. Upstream d22b34e78040. + romclose(f); } dst->dir = path_dirname(filename); if (!dst->dir) { @@ -301,7 +305,6 @@ uint32_t load_media(char * filename, system_media *dst, system_type *stype) dst->name = basename_no_extension(filename); dst->extension = ext; dst->size = ret; - romclose(f); if (!strcasecmp(dst->extension, "cue")) { if (parse_cue(dst)) { ret = dst->size; diff --git a/version.inc b/version.inc index ae5686b..63e4637 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -#define BLASTEM_VERSION "0.6.3-pre" +#define BLASTEM_VERSION "1.0.1-pre"