fix: Create Pro machine profile directories

This commit is contained in:
voidderef
2026-09-13 19:53:44 +02:00
parent 06a2eebfc5
commit 7db85f1f8e
3 changed files with 36 additions and 4 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ You need two main folders:
* `game` folder with the following contents
* All data zip files (e.g. `data0.zip`, `data1.zip`, ..., `encore.zip`)
* An empty file `FX` (if you run this on a FX or other cabinet with a widescreen monitor)
* `save` folder and `MachineProfile` inside of it . You must create these folders manually, rest of the files will populate themselves. **Without doing so the game will not save settings or high scores between boots.**
* `save` folder. The hook creates it and the required `MachineProfile` folder automatically; the game populates the remaining files.
## USB thumb drive/profile support
Without any patches, the game's way of handling USB thumb drives is incompatible to the kernels of the last years.
+16
View File
@@ -27,6 +27,7 @@
#include "util/fs.h"
#include "util/glibc.h"
#include "util/log.h"
#include "util/str.h"
#include "util/sys-info.h"
#include "options.h"
@@ -81,6 +82,21 @@ static void prohook_fs_redir_settings(struct prohook_options *options)
}
}
char *machine_profile_path =
util_str_merge(options->game.settings, "/MachineProfile");
if (!util_fs_path_exists(machine_profile_path)) {
log_info(
"Machine profile path %s does not exist, creating",
machine_profile_path);
if (!util_fs_mkdir(machine_profile_path)) {
log_error("Creating directory %s failed", machine_profile_path);
}
}
free(machine_profile_path);
char *abs_path = util_fs_get_abs_path(options->game.settings);
cnh_redir_add("/data", abs_path);
+16
View File
@@ -26,6 +26,7 @@
#include "util/glibc.h"
#include "util/log.h"
#include "util/patch.h"
#include "util/str.h"
#include "util/sys-info.h"
#include "options.h"
@@ -110,6 +111,21 @@ static void pro2hook_fs_redir_data(struct pro2hook_options *options)
log_assert(options);
if (options->game.data) {
char *machine_profile_path =
util_str_merge(options->game.data, "/Save/MachineProfile");
if (!util_fs_path_exists(machine_profile_path)) {
log_info(
"Machine profile path %s does not exist, creating",
machine_profile_path);
if (!util_fs_mkdir(machine_profile_path)) {
log_error("Creating directory %s failed", machine_profile_path);
}
}
free(machine_profile_path);
char *abs_path = util_fs_get_abs_path(options->game.data);
cnh_redir_add("/pro2", abs_path);