System: Implement SaveDataAccessFunction (#960)

This commit is contained in:
guymakinggames 2026-03-22 20:42:11 +00:00 committed by GitHub
parent 1c03272015
commit bd787b53c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 148 additions and 26 deletions

View file

@ -151057,55 +151057,55 @@ System/SaveDataAccessFunction.o:
- offset: 0x539674
size: 8
label: _ZN22SaveDataAccessFunction17startSaveDataInitEP14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x53967c
size: 8
label: _ZN22SaveDataAccessFunction21startSaveDataInitSyncEP14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x539684
size: 40
label: _ZN22SaveDataAccessFunction21startSaveDataLoadFileEP14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x5396ac
size: 8
label: _ZN22SaveDataAccessFunction21startSaveDataReadSyncEP14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x5396b4
size: 8
label: _ZN22SaveDataAccessFunction20startSaveDataReadAllEP14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x5396bc
size: 8
label: _ZN22SaveDataAccessFunction18startSaveDataWriteEP14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x5396c4
size: 40
label: _ZN22SaveDataAccessFunction28startSaveDataWriteWithWindowEP14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x5396ec
size: 64
label: _ZN22SaveDataAccessFunction27startSaveDataCopyWithWindowEP14GameDataHolderii
status: NotDecompiled
status: Matching
- offset: 0x53972c
size: 48
label: _ZN22SaveDataAccessFunction29startSaveDataDeleteWithWindowEP14GameDataHolderi
status: NotDecompiled
status: Matching
- offset: 0x53975c
size: 8
label: _ZN22SaveDataAccessFunction22startSaveDataWriteSyncEP14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x539764
size: 8
label: _ZN22SaveDataAccessFunction20updateSaveDataAccessEP14GameDataHolderb
status: NotDecompiled
status: Matching
- offset: 0x53976c
size: 8
label: _ZN22SaveDataAccessFunction12isEnableSaveEPK14GameDataHolder
status: NotDecompiled
status: Matching
- offset: 0x539774
size: 8
label: _ZN22SaveDataAccessFunction10isDoneSaveEP14GameDataHolder
status: NotDecompiled
status: Matching
System/SaveDataAccessSequence.o:
'.text':
- offset: 0x53977c

View file

@ -281,6 +281,8 @@ public:
GameConfigData* getGameConfigData() const { return mGameConfigData; }
SaveDataAccessSequence* getSaveDataAccessSequence() const { return mSaveDataAccessSequence; }
private:
al::MessageSystem* mMessageSystem;
GameDataFile** mFiles;

View file

@ -0,0 +1,64 @@
#include "System/SaveDataAccessFunction.h"
#include "System/GameDataHolder.h"
#include "System/SaveDataAccessSequence.h"
namespace SaveDataAccessFunction {
void startSaveDataInit(GameDataHolder* holder) {
holder->getSaveDataAccessSequence()->startInit();
}
void startSaveDataInitSync(GameDataHolder* holder) {
holder->getSaveDataAccessSequence()->startInitSync();
}
void startSaveDataLoadFile(GameDataHolder* holder) {
holder->getSaveDataAccessSequence()->setWindowSwitch();
holder->getSaveDataAccessSequence()->startWrite();
}
void startSaveDataReadSync(GameDataHolder* holder) {
holder->getSaveDataAccessSequence()->startReadSync();
}
void startSaveDataReadAll(GameDataHolder* holder) {
holder->getSaveDataAccessSequence()->startReadAll();
}
void startSaveDataWrite(GameDataHolder* holder) {
holder->getSaveDataAccessSequence()->startWrite();
}
void startSaveDataWriteWithWindow(GameDataHolder* holder) {
holder->getSaveDataAccessSequence()->setWindowSave();
holder->getSaveDataAccessSequence()->startWriteWithWindow();
}
void startSaveDataCopyWithWindow(GameDataHolder* holder, s32 srcFileIndex, s32 destFileIndex) {
holder->getSaveDataAccessSequence()->setWindowSave();
holder->getSaveDataAccessSequence()->startCopyWithWindow(srcFileIndex, destFileIndex);
}
void startSaveDataDeleteWithWindow(GameDataHolder* holder, s32 fileIndex) {
holder->getSaveDataAccessSequence()->setWindowDelete();
holder->getSaveDataAccessSequence()->startDeleteWithWindow(fileIndex);
}
void startSaveDataWriteSync(GameDataHolder* holder) {
holder->getSaveDataAccessSequence()->startWriteSync();
}
bool updateSaveDataAccess(GameDataHolder* holder, bool _unused) {
return holder->getSaveDataAccessSequence()->update();
}
bool isEnableSave(const GameDataHolder* holder) {
return holder->getSaveDataAccessSequence()->isEnableSave();
}
bool isDoneSave(GameDataHolder* holder) {
return holder->getSaveDataAccessSequence()->isDoneSave();
}
} // namespace SaveDataAccessFunction

View file

@ -5,17 +5,17 @@
class GameDataHolder;
namespace SaveDataAccessFunction {
void startSaveDataInit(GameDataHolder*);
void startSaveDataInitSync(GameDataHolder*);
void startSaveDataLoadFile(GameDataHolder*);
void startSaveDataReadSync(GameDataHolder*);
void startSaveDataReadAll(GameDataHolder*);
void startSaveDataWrite(GameDataHolder*);
void startSaveDataWriteWithWindow(GameDataHolder*);
void startSaveDataCopyWithWindow(GameDataHolder*, s32, s32);
void startSaveDataDeleteWithWindow(GameDataHolder*, s32);
void startSaveDataWriteSync(GameDataHolder*);
bool updateSaveDataAccess(GameDataHolder*, bool);
bool isEnableSave(const GameDataHolder*);
bool isDoneSave(GameDataHolder*);
void startSaveDataInit(GameDataHolder* holder);
void startSaveDataInitSync(GameDataHolder* holder);
void startSaveDataLoadFile(GameDataHolder* holder);
void startSaveDataReadSync(GameDataHolder* holder);
void startSaveDataReadAll(GameDataHolder* holder);
void startSaveDataWrite(GameDataHolder* holder);
void startSaveDataWriteWithWindow(GameDataHolder* holder);
void startSaveDataCopyWithWindow(GameDataHolder* holder, s32 srcFileIndex, s32 destFileIndex);
void startSaveDataDeleteWithWindow(GameDataHolder* holder, s32 fileIndex);
void startSaveDataWriteSync(GameDataHolder* holder);
bool updateSaveDataAccess(GameDataHolder* holder, bool _unused);
bool isEnableSave(const GameDataHolder* holder);
bool isDoneSave(GameDataHolder* holder);
} // namespace SaveDataAccessFunction

View file

@ -0,0 +1,56 @@
#pragma once
#include <basis/seadTypes.h>
#include <prim/seadSafeString.h>
#include "Library/Nerve/NerveExecutor.h"
class GameDataHolder;
class SaveDataAccessor;
namespace al {
class LayoutInitInfo;
}
class SaveDataAccessSequence : public al::NerveExecutor {
public:
SaveDataAccessSequence(GameDataHolder*, const al::LayoutInitInfo&);
bool update();
bool isDone() const;
void startInit();
void startInitSync();
void startReadSync();
void startReadAll();
void addRequest(sead::FixedSafeString<32>*, sead::FixedSafeString<32>*, s32);
sead::FixedSafeString<32>* getFileNamePtrByIndex(s32) const;
void startWrite();
sead::FixedSafeString<32>* getPlayingFileNamePtr() const;
sead::FixedSafeString<32>* getFileNameCommon() const;
void startWriteSync();
void startWriteWithWindow();
void startCopyWithWindow(s32, s32);
void startDeleteWithWindow(s32);
void exeIdle();
void exeInit();
void exeWaitLayout();
void exeWrite();
void clearAllRequest();
bool isNextFileCommon() const;
const char* getNextFileNameSrc() const;
const char* getNextFileNameDest() const;
void clearCurrentRequest();
bool tryChangeNextNerve();
void exeFlush();
void exeRead();
bool isEnableSave() const;
bool isDoneSave() const;
void setWindowSave();
void setWindowSwitch();
void setWindowDelete();
bool isExistRequest() const;
private:
char filler_8[0x50];
};
static_assert(sizeof(SaveDataAccessSequence) == 0x60);