Expand save system with data access framework

- Add Hashes struct for known save file offsets
- Add Float union for type conversion
- Implement placeholder functions for:
  * Reading u32/float from addresses
  * Writing float to addresses
  * Save file writing
- Add player position hash constant
This commit is contained in:
badblocks 2023-05-18 14:52:57 -07:00
parent 8ddd30bbb4
commit 91898b81fb
No known key found for this signature in database
2 changed files with 34 additions and 1 deletions

View file

@ -4,6 +4,7 @@
#include "save_basic.h"
static gameDataSav save_data = {0};
static Hashes HASHES = {.PLAYER_POSITION = 0xa40ba103};
void openSave() {
Result rc = 0;
@ -37,7 +38,26 @@ void openSave() {
printf("Save data mounted successfully!\n");
}
u32 readU32FromAddr(u32 addr) {
// TODO: Implement reading u32 from save file address
return 0;
}
float readF32FromAddr(u32 addr) {
// TODO: Implement reading float from save file address
return 0.0f;
}
void writeF32ToAddr(u32 addr, float value) {
// TODO: Implement writing float to save file address
}
void processSave() {
printf("Processing save data...\n");
// TODO: Implement actual save processing
// TODO: Load save file into memory for processing
}
void writeSave() {
printf("Writing save data...\n");
// TODO: Write modified data back to save file
}