1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2025-01-31 20:15:20 +01:00

New filename (without version string) for the new save files

This commit is contained in:
ahnada 2023-12-27 22:25:13 -08:00 committed by icex2
parent d1525a98dd
commit 1379c1e11b
2 changed files with 15 additions and 5 deletions

View File

@ -25,10 +25,20 @@ static volatile long input_init_count;
static FILE *mapper_config_open(const char *game_type, const char *mode) static FILE *mapper_config_open(const char *game_type, const char *mode)
{ {
char path[MAX_PATH]; char path[MAX_PATH];
FILE *f;
str_format(path, sizeof(path), "%s_v5_00a07.bin", game_type); str_format(path, sizeof(path), "%s.bin", game_type);
f = fopen_appdata("DJHACKERS", path, mode);
return fopen_appdata("DJHACKERS", path, mode); // Try to load the old save file only if we're loading
if (f == NULL) {
if (strchr(mode, 'r') != NULL) {
str_format(path, sizeof(path), "%s_v5_00a07.bin", game_type);
f = fopen_appdata("DJHACKERS", path, mode);
}
}
return f;
} }
void input_set_loggers( void input_set_loggers(

View File

@ -7,7 +7,7 @@
#include "util/mem.h" #include "util/mem.h"
enum mapper_config_version { enum mapper_config_version {
MAPPER_VERSION_BEFORE_VERSIONING, MAPPER_VERSION_BEFORE_VERSIONING = 0,
MAPPER_VERSION_INVERT_AXIS, MAPPER_VERSION_INVERT_AXIS,
// --- Add new versions above this line --- // // --- Add new versions above this line --- //
@ -32,7 +32,7 @@ static void mapper_impl_config_save_lights(struct mapper *m, FILE *f);
struct mapper *mapper_impl_config_load(FILE *f) struct mapper *mapper_impl_config_load(FILE *f)
{ {
struct mapper *m; struct mapper *m;
uint32_t version = 0; uint32_t version = MAPPER_VERSION_BEFORE_VERSIONING;
hid_mgr_lock(); /* Need to convert from HID objects to /dev nodes */ hid_mgr_lock(); /* Need to convert from HID objects to /dev nodes */
@ -55,7 +55,7 @@ struct mapper *mapper_impl_config_load(FILE *f)
static uint32_t mapper_impl_config_load_version(FILE *f) static uint32_t mapper_impl_config_load_version(FILE *f)
{ {
uint32_t fourcc = 0; uint32_t fourcc = 0;
uint32_t version = 0; uint32_t version = MAPPER_VERSION_BEFORE_VERSIONING;
if (!read_u32(f, &fourcc)) { if (!read_u32(f, &fourcc)) {
return 0; return 0;