fix text saves

This commit is contained in:
fgsfds 2020-06-07 22:00:23 +03:00
parent 5c4d895fec
commit 8e70c7c9b0
2 changed files with 6 additions and 6 deletions

View File

@ -4,8 +4,9 @@
#include "course_table.h" #include "course_table.h"
#include "pc/ini.h" #include "pc/ini.h"
#include "pc/platform.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_COURSES 15
#define NUM_BONUS_COURSES 10 #define NUM_BONUS_COURSES 10
#define NUM_FLAGS 21 #define NUM_FLAGS 21
@ -79,10 +80,10 @@ static s32 write_text_save(s32 fileIndex) {
struct SaveFile *savedata; struct SaveFile *savedata;
struct MainMenuSaveData *menudata; struct MainMenuSaveData *menudata;
char filename[SYS_MAX_PATH] = { 0 }; char filename[SYS_MAX_PATH] = { 0 };
char *value; char value[64];
u32 i, bit, flags, coins, stars, starFlags; 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; return -1;
file = fopen(filename, "wt"); file = fopen(filename, "wt");
@ -210,7 +211,7 @@ static s32 read_text_save(s32 fileIndex) {
u32 i, flag, coins, stars, starFlags; u32 i, flag, coins, stars, starFlags;
u32 capArea; 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; return -1;
savedata = ini_load(filename); savedata = ini_load(filename);

View File

@ -21,8 +21,7 @@
#define FS_SOUNDDIR "sound" #define FS_SOUNDDIR "sound"
extern char fs_gamedir[]; extern char fs_gamedir[];
extern char fs_userdir[]; extern char fs_writepath[];
extern const char *fs_ropaths[];
// receives the full path // receives the full path
// should return `true` if traversal should continue // should return `true` if traversal should continue