diff --git a/src/game/text_save.inc.h b/src/game/text_save.inc.h index 1325f0a5..a9ce6c2a 100644 --- a/src/game/text_save.inc.h +++ b/src/game/text_save.inc.h @@ -4,8 +4,9 @@ #include "course_table.h" #include "pc/ini.h" #include "pc/platform.h" +#include "pc/fs/fs.h" -#define FILENAME_FORMAT "%s\\sm64_save_file_%d.sav" +#define FILENAME_FORMAT "%s/sm64_save_file_%d.sav" #define NUM_COURSES 15 #define NUM_BONUS_COURSES 10 #define NUM_FLAGS 21 @@ -79,10 +80,10 @@ static s32 write_text_save(s32 fileIndex) { struct SaveFile *savedata; struct MainMenuSaveData *menudata; char filename[SYS_MAX_PATH] = { 0 }; - char *value; + char value[64]; u32 i, bit, flags, coins, stars, starFlags; - if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, sys_save_path(), fileIndex) < 0) + if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, fs_writepath, fileIndex) < 0) return -1; file = fopen(filename, "wt"); @@ -210,7 +211,7 @@ static s32 read_text_save(s32 fileIndex) { u32 i, flag, coins, stars, starFlags; u32 capArea; - if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, sys_save_path(), fileIndex) < 0) + if (snprintf(filename, sizeof(filename), FILENAME_FORMAT, fs_writepath, fileIndex) < 0) return -1; savedata = ini_load(filename); diff --git a/src/pc/fs/fs.h b/src/pc/fs/fs.h index e479cfbf..c7765144 100644 --- a/src/pc/fs/fs.h +++ b/src/pc/fs/fs.h @@ -21,8 +21,7 @@ #define FS_SOUNDDIR "sound" extern char fs_gamedir[]; -extern char fs_userdir[]; -extern const char *fs_ropaths[]; +extern char fs_writepath[]; // receives the full path // should return `true` if traversal should continue