Skip to content

Commit

Permalink
Launcher: No longer include ROM extension in PNG filenames
Browse files Browse the repository at this point in the history
Before: `/roms/nes/Super Mario.nes` => `/covers/nes/Super Mario.nes.png`

Now: `/roms/nes/Super Mario.nes` => `/covers/nes/Super Mario.png`

The change is mainly made to accommodate support for zip files.

But this is also how other emulation frontends name their art by default, as well as tools like Skraper.

This is a breaking change but filename-based art was only recently advertised so few people should be using it. (We could also check for the old format, but sd card access is very slow and I don't think it's worth the few ms it would add for everybody).
  • Loading branch information
ducalex committed Jul 22, 2024
1 parent a733865 commit e2ff8dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ This method is intended to be used when .fw support isn't available (when portin
Game covers should be placed in the `romart` folder at the base of your sd card. You can obtain a pre-made pack [here](https://github.com/ducalex/retro-go-covers). Retro-Go is also compatible with the older Go-Play romart pack.

You can add missing cover art by creating a PNG image (160x168, 8bit). Two naming schemes are supported:
- Filename-based: `/romart/nes/Super Mario.nes.png` (notice the rom extension is included)
- Filename-based: `/romart/nes/Super Mario.png` (notice the rom extension is *not* included)
- CRC32-based: `/romart/nes/A/ABCDE123.png` where `nes` is the same as the rom folder, and `ABCDE123` is the CRC32 of the game (press A -> Properties in the launcher to find it), and `A` is the first character of the CRC32

_Note: CRC32-based, which is what is used in the pre-made pack, is much slower than name-based! This type is useful because filenames vary greatly despite having identical CRCs, but if you generate your own art I suggest you use filename-based format and delete all CRC-based art from your SD Card to improve responsiveness._
Expand Down
6 changes: 5 additions & 1 deletion launcher/main/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,11 @@ void gui_load_preview(tab_t *tab)
else if (type == 0x2 && app->use_crc_covers && application_get_file_crc32(file)) // Game cover (png)
path_len = snprintf(path, RG_PATH_MAX, "%s/%X/%08X.png", app->paths.covers, (int)(file->checksum >> 28), (int)file->checksum);
else if (type == 0x3) // Game cover (based on filename)
path_len = snprintf(path, RG_PATH_MAX, "%s/%s.png", app->paths.covers, file->name);
{
path_len = snprintf(path, RG_PATH_MAX, "%s/%s", app->paths.covers, file->name);
if (path_len < RG_PATH_MAX - 3) // Don't bother if we already have an overflow
strcpy(path + path_len - strlen(rg_extension(file->name)), "png");
}
else if (type == 0x4) // Save state screenshot (png)
{
rg_emu_states_t *savestates = rg_emu_get_states(path, 4);
Expand Down

0 comments on commit e2ff8dc

Please sign in to comment.