Default Wii saves to SD card, store saves next to dusk.dsk/EBOOT.PBP

Wii NAND save storage is blocked by Dolphin's IOS ticket-rights check for
homebrew (documented earlier this session as a known, non-code limitation),
so Wii now defaults DUSK_SAVE_WII_METHOD to SD instead of NAND.

Also: asset_t gains ASSET.baseDirectory, populated by each platform's asset
loader with the real directory dusk.dsk was opened from (or, on PSP, the
directory EBOOT.PBP itself lives in, since dusk.dsk is embedded inside it).
Wii SD and PSP now write their single combined save file directly into
that directory instead of a separate hardcoded path, and no longer need to
create it (it's already known to exist). Linux now uses a `saves/`
subdirectory of that same directory instead of ~/.dusk/saves, since it
keeps multiple files (settings + one per slot). Wii NAND and GameCube/Wii
memory-card storage are unaffected - neither has a real filesystem-path
concept this applies to.

Built and verified on Linux, PSP (Docker), GameCube (Docker) and Wii
(Docker) - confirmed via the compiler invocation that Wii now compiles
with DUSK_SAVE_WII_METHOD_SD.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-09-04 09:43:00 -05:00
co-authored by Claude Sonnet 5
parent f9820bd226
commit 3c3dc35e1d
11 changed files with 70 additions and 49 deletions
+4 -3
View File
@@ -23,9 +23,10 @@
#define saveDeviceDataWritePlatform saveDevicePSPDataWrite
#define saveDeviceDataReadPlatform saveDevicePSPDataRead
#ifndef SAVE_DEVICE_PSP_DIRECTORY_NAME
#define SAVE_DEVICE_PSP_DIRECTORY_NAME "ms0:/DUSK"
#endif
// Data file lives directly in ASSET.baseDirectory (the directory EBOOT.PBP
// was launched from - see its own comment) rather than a separate fixed
// directory, so it doesn't need creating: that directory is already known
// to exist, since the running EBOOT.PBP lives there.
#ifndef SAVE_DEVICE_PSP_DATA_FILENAME
#define SAVE_DEVICE_PSP_DATA_FILENAME "save.dat"
#endif
+2 -4
View File
@@ -7,6 +7,7 @@
#include "save/savedevice.h"
#include "save/savedevicepsp.h"
#include "asset/asset.h"
#include "assert/assert.h"
#include "util/memory.h"
#include "util/string.h"
@@ -64,7 +65,7 @@ errorret_t saveDevicePSPGetDataPath(
stringFormat(
dest, destSize, "%s/%s",
SAVE_DEVICE_PSP_DIRECTORY_NAME, SAVE_DEVICE_PSP_DATA_FILENAME
ASSET.baseDirectory, SAVE_DEVICE_PSP_DATA_FILENAME
);
errorOk();
@@ -78,9 +79,6 @@ errorret_t saveDevicePSPDataWrite(
assertNotNull(device, "device cannot be null");
assertNotNull(buffer, "buffer cannot be null");
// Best-effort create - a fresh memory stick won't have this directory yet.
sceIoMkdir(SAVE_DEVICE_PSP_DIRECTORY_NAME, 0777);
char_t finalPath[SAVE_DEVICE_PSP_PATH_MAX];
errorChain(saveDevicePSPGetDataPath(finalPath, sizeof(finalPath)));