mods: save service (#2256)

* initial save service updated from encounter's impl

* Review cleanup

---------

Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
TakaRikka
2026-08-03 19:58:09 -07:00
committed by GitHub
parent 519305b7d4
commit 76079b6294
15 changed files with 701 additions and 8 deletions
+11 -5
View File
@@ -25,8 +25,9 @@
#ifdef TARGET_PC
#include "dusk/logging.h"
#include "dusk/version.hpp"
#include "dusk/main.h"
#include "dusk/mods/svc/save.hpp"
#include "dusk/version.hpp"
#include "m_Do/m_Do_MemCard.h"
#endif
@@ -771,15 +772,20 @@ void dScnLogo_c::nextSceneChange() {
status = mDoMemCd_LoadSync(buf, sizeof(buf), 0);
// Wait until the card is loaded
} while (status == 0);
const uint32_t saveSlot = dusk::SaveRequested - 1;
if (status == 1) {
dComIfGs_setCardToMemory(buf, dusk::SaveRequested - 1);
dComIfGs_setCardToMemory(buf, saveSlot);
} else {
dComIfGs_init();
}
dComIfGs_setNoFile(dusk::SaveRequested);
dComIfGs_setDataNum(dusk::SaveRequested-1);
dComIfGs_setDataNum(saveSlot);
if (status == 1) {
dusk::mods::svc::save_slot_loaded(
saveSlot, buf + saveSlot * SAVEDATA_SIZE);
}
dComIfGs_gameStart();