Files
Thomas MartinandClaude Opus 5.5 dfc80d2af0 Save states: DC's section, command-line options and window slots
BozoEngine saves the runtime; DC's "dc" section (runtime/dc_state.cpp) adds
what that does not hold: the compiled sound modules' IOP host, the MDT copies
(the only model left once the game reuses a static piece's MDT memory) and
their bindings, pinned and patched pictures, GS place ownership, water
objects, frame identities, the haze seeds, the fishing strip and the native
Options pages. Images are written once in a table. On load the caches of the
old guest memory are dropped (decoded textures, render places, CLUT
overrides, shadow queues, the partial frame) and so are the cheats' mirrors
and queued edits. Unsaveable mid debug-font composition.

--save-state FILE --save-state-at N, --load-state FILE [--load-state-at N],
--dump-ram FILE; F5 / F7 / F6 slots and F2's Save states tab in the window.
Engine pinned to c853ec0 (BozoEngine #101) until the save-state commit is on
master.

Checked: headless Matataki (saved 6500) and dungeon (5000) states loaded in a
new process and mid-run give EE RAM identical to the uninterrupted runs;
windowed save + load gives identical captures at seven frames and identical
RAM. 135/135 suites, CI build 66/66, seven routes unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 20:42:32 +01:00

37 lines
1.0 KiB
C++

// Dark Cloud's save-state section (dc_state.h): the parts the engine's own sections do not hold.
#include "dc_state.h"
#include "dc_cheats.h"
#include "dc_ingame_cheats.h"
#include "bozo/runtime.h"
#include "bozo/state.h"
namespace dc
{
void audioState(bozo::state::Archive &);
std::string audioUnsaveable();
namespace native
{
void state(bozo::state::Archive &, Runtime &);
std::string unsaveable();
}
}
namespace dc::state
{
void serialize(bozo::state::Archive &a, Runtime &runtime)
{
dc::audioState(a); // the compiled sound modules' IOP host
dc::native::state(a, runtime); // the renderer's and asset builders' facts; caches dropped on load
dc::cheats::menuState(a, runtime.memory.ram());
if (a.loading())
dc::cheats::stateLoaded();
}
std::string unsaveable()
{
if (std::string why = dc::audioUnsaveable(); !why.empty())
return why;
return dc::native::unsaveable();
}
}