Implement BOTW save data mounting
- Add account initialization and user handling - Mount save data using BOTW Application ID - Proper error handling with Result codes - Foundation for save file manipulation
This commit is contained in:
parent
0ccd79677d
commit
af46e93a5e
1 changed files with 29 additions and 2 deletions
|
|
@ -6,11 +6,38 @@
|
||||||
static gameDataSav save_data = {0};
|
static gameDataSav save_data = {0};
|
||||||
|
|
||||||
void openSave() {
|
void openSave() {
|
||||||
|
Result rc = 0;
|
||||||
|
AccountUid uid = {0};
|
||||||
|
u64 application_id = 0x01007ef00011e000; // BOTW Application ID
|
||||||
|
|
||||||
printf("Opening BOTW save data...\n");
|
printf("Opening BOTW save data...\n");
|
||||||
// TODO: Implement save file reading
|
|
||||||
|
// Get user account
|
||||||
|
rc = accountInitialize(AccountServiceType_Application);
|
||||||
|
if (R_FAILED(rc)) {
|
||||||
|
printf("accountInitialize() failed: 0x%x\n", rc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = accountGetPreselectedUser(&uid);
|
||||||
|
accountExit();
|
||||||
|
|
||||||
|
if (R_FAILED(rc)) {
|
||||||
|
printf("accountGetPreselectedUser() failed: 0x%x\n", rc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mount save data
|
||||||
|
rc = fsdevMountSaveData("save", application_id, uid);
|
||||||
|
if (R_FAILED(rc)) {
|
||||||
|
printf("fsdevMountSaveData() failed: 0x%x\n", rc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Save data mounted successfully!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void processSave() {
|
void processSave() {
|
||||||
printf("Processing save data...\n");
|
printf("Processing save data...\n");
|
||||||
// TODO: Implement save processing logic
|
// TODO: Implement actual save processing
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue