- Add account initialization and user handling - Mount save data using BOTW Application ID - Proper error handling with Result codes - Foundation for save file manipulation
43 lines
No EOL
1 KiB
C
43 lines
No EOL
1 KiB
C
#include <string.h>
|
|
#include <stdio.h>
|
|
#include <switch.h>
|
|
#include "save_basic.h"
|
|
|
|
static gameDataSav save_data = {0};
|
|
|
|
void openSave() {
|
|
Result rc = 0;
|
|
AccountUid uid = {0};
|
|
u64 application_id = 0x01007ef00011e000; // BOTW Application ID
|
|
|
|
printf("Opening BOTW save data...\n");
|
|
|
|
// 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() {
|
|
printf("Processing save data...\n");
|
|
// TODO: Implement actual save processing
|
|
} |