Write unique game info to /tmp/GAMENAME (#1045)

* Write unique game info to /tmp/GAMENAME

* Remove CD product code lookup, and crc32

* Remove product codes

/tmp/GAMENAME only uses file path and crc32

* Clean up

* Cleanup

* Only write CRC32 and or Product Code to /tmp/GAMEID

Realizing we already have the file path, this change writes the already calculated CRC32 and or game ID (N64 and PSX only) to /tmp/GAMEID. This ignores boot*.rom and cd_bios*.rom

CRC32: XXXXXXXX
Product Code: XXXXXXXXXXXX

* Clean up

* Update neogeo_loader.cpp

* Skip GAMEID for all BIOS files

* Guard behind log_file_entry ini option and clean up print statements

* Add MRA GAMEID support and improve GAMEID writing

MRA files use setname as serial

* Add MGL handling for /tmp/ STARTPATH, FULLPATH, CURRENTPATH, and FILESELECT

* Update mgl /tmp/ file handling
This commit is contained in:
misteraddons
2025-10-22 05:54:43 -06:00
committed by GitHub
parent 9fc5a2b212
commit 2efa6a87a8
6 changed files with 113 additions and 2 deletions

View File

@@ -2393,6 +2393,15 @@ void HandleUI(void)
{
if(mgl->item[mgl->current].path[0] == '/') snprintf(selPath, sizeof(selPath), "%s", mgl->item[mgl->current].path);
else snprintf(selPath, sizeof(selPath), "%s/%s", HomeDir(), mgl->item[mgl->current].path);
// Update /tmp/ files to reflect the actual file being loaded by MGL
if (cfg.log_file_entry)
{
const char *fname = strrchr(selPath, '/');
MakeFile("/tmp/FULLPATH", selPath);
MakeFile("/tmp/CURRENTPATH", fname ? fname + 1 : selPath);
MakeFile("/tmp/FILESELECT", "selected");
}
}
MenuHide();
@@ -2457,6 +2466,15 @@ void HandleUI(void)
{
if (mgl->item[mgl->current].path[0] == '/') snprintf(selPath, sizeof(selPath), "%s", mgl->item[mgl->current].path);
else snprintf(selPath, sizeof(selPath), "%s/%s", HomeDir(((is_pce() && !strncasecmp(fs_pFileExt, "CUE", 3)) ? PCECD_DIR : NULL)), mgl->item[mgl->current].path);
// Update /tmp/ files to reflect the actual image being loaded by MGL
if (cfg.log_file_entry)
{
const char *fname = strrchr(selPath, '/');
MakeFile("/tmp/FULLPATH", selPath);
MakeFile("/tmp/CURRENTPATH", fname ? fname + 1 : selPath);
MakeFile("/tmp/FILESELECT", "selected");
}
}
if (store_name)
@@ -5687,7 +5705,18 @@ void HandleUI(void)
break;
case MENU_MINIMIG_ADFFILE_SELECTED:
if (!mgl->done) snprintf(selPath, sizeof(selPath), "%s/%s", HomeDir(), mgl->item[mgl->current].path);
if (!mgl->done)
{
snprintf(selPath, sizeof(selPath), "%s/%s", HomeDir(), mgl->item[mgl->current].path);
// Update /tmp/ files to reflect the actual file being loaded by MGL
if (cfg.log_file_entry)
{
const char *fname = strrchr(selPath, '/');
MakeFile("/tmp/FULLPATH", selPath);
MakeFile("/tmp/CURRENTPATH", fname ? fname + 1 : selPath);
MakeFile("/tmp/FILESELECT", "selected");
}
}
memcpy(Selected_F[menusub], selPath, sizeof(Selected_F[menusub]));
if (mgl->done) recent_update(SelectedDir, selPath, SelectedLabel, 0);
InsertFloppy(&df[menusub], selPath);