From 1ded87749140a481e382ea9156bc39fad67a2b50 Mon Sep 17 00:00:00 2001 From: KrahJohlito Date: Fri, 20 Dec 2024 11:53:34 +1030 Subject: [PATCH] clean --- src/supportbase.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/supportbase.c b/src/supportbase.c index 242f0a758..c196b5ece 100644 --- a/src/supportbase.c +++ b/src/supportbase.c @@ -304,8 +304,6 @@ static int scanForISO(char *path, char type, struct game_list_t **glist) int cacheLoaded = loadISOGameListCache(path, &cache) == 0; if ((dir = opendir(path)) != NULL) { - //struct stat statbuf; - size_t base_path_len = strlen(path); strcpy(fullpath, path); fullpath[base_path_len] = '/'; @@ -363,11 +361,6 @@ static int scanForISO(char *path, char type, struct game_list_t **glist) game->parts = 1; game->media = type; game->format = format; - - - /*if (stat(fullpath, &statbuf) == 0) { - game->sizeMB = statbuf.st_size >> 20; - } else {*/ game->sizeMB = 0; count++; @@ -778,13 +771,11 @@ config_set_t *sbPopulateConfig(base_game_info_t *game, const char *prefix, const config_set_t *config = configAlloc(0, NULL, path); configRead(config); // Does not matter if the config file could be loaded or not. - char gamepath[256]; // Get game size if not already set - if (game->sizeMB == 0) { - if (game->format == GAME_FORMAT_OLD_ISO) - snprintf(gamepath, sizeof(gamepath), "%s%s%s%s%s%s", prefix, sep, game->media == SCECdPS2CD ? "CD" : "DVD", sep, game->startup, game->extension); - else - snprintf(gamepath, sizeof(gamepath), "%s%s%s%s%s%s", prefix, sep, game->media == SCECdPS2CD ? "CD" : "DVD", sep, game->name, game->extension); + if ((game->sizeMB == 0) && (game->format == GAME_FORMAT_OLD_ISO)) { + char gamepath[256]; + + snprintf(gamepath, sizeof(gamepath), "%s%s%s%s%s%s", prefix, sep, game->media == SCECdPS2CD ? "CD" : "DVD", sep, game->name, game->extension); if (stat(gamepath, &st) == 0) game->sizeMB = st.st_size >> 20; @@ -792,8 +783,6 @@ config_set_t *sbPopulateConfig(base_game_info_t *game, const char *prefix, const game->sizeMB = 0; } - LOG("GAMEPATH=%s\n", gamepath); - configSetStr(config, CONFIG_ITEM_NAME, game->name); configSetInt(config, CONFIG_ITEM_SIZE, game->sizeMB); @@ -806,6 +795,7 @@ config_set_t *sbPopulateConfig(base_game_info_t *game, const char *prefix, const configSetStr(config, CONFIG_ITEM_FORMAT, "UL"); configSetStr(config, CONFIG_ITEM_MEDIA, game->media == SCECdPS2CD ? "CD" : "DVD"); + configSetStr(config, CONFIG_ITEM_STARTUP, game->startup); return config;