mirror of https://github.com/sm64pc/sm64pc.git
fix text saves
This commit is contained in:
parent
4feacc0065
commit
b9c94ad57d
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue