Skip to content

Give the Win32 render window a File/View menu and hotkeys - #12

Merged
siahisaforker merged 4 commits into
moderngekko-vendorfrom
fix/pr-8-savestate-paths
Aug 10, 2026
Merged

Give the Win32 render window a File/View menu and hotkeys#12
siahisaforker merged 4 commits into
moderngekko-vendorfrom
fix/pr-8-savestate-paths

Conversation

@siahisaforker

Copy link
Copy Markdown

Replacement for #8 because its head repository is a sibling fork and GitHub does not permit maintainer pushes to it.

Includes the original PR plus fixes for UTF-8 Windows paths, stable savestate sorting, and same-second save-name collisions.

Validation: savestate layout smoke test and diff checks passed.

dougchansan and others added 4 commits August 4, 2026 13:15
unknown_instruction reads g_static_recomp_core and ppc_state, but the
translation unit includes neither the header that declares the former nor
a binding for the latter, so core does not compile:

  Interpreter.cpp(294): error C2065: 'g_static_recomp_core': undeclared identifier
  Interpreter.cpp(299): error C2065: 'ppc_state': undeclared identifier

It is not reached through the PCH either -- pch.h does not pull in
StaticRecompCore.h.

The ppc_state binding already existed further down the same function, past
the first use. Moving it to the top serves both uses rather than adding a
second one, which would be a redefinition.
DolphinNoGUI's window had no way to save or load a state, and Esc as the
only key. Getting back to a scene meant booting and playing in.

File carries Save State (F1), a Load State submenu, and Pause. View
carries Fullscreen (F11 or Alt+Enter) and Mute Audio. Space held is
fast-forward.

All of it goes through Core, State and Config directly rather than new
Host_* hooks, so no frontend has to implement anything to pick this up.

States are written to and listed from Dolphin's own StateSaves directory,
named by wall clock rather than by slot, so repeated saves accumulate
instead of overwriting each other and sort meaningfully by name. The Load
State list is rebuilt whenever the menu opens, because states appear
while it is closed; it is newest-first with a filename tiebreak so the
order does not shuffle between opens on a filesystem with coarse
timestamps.

F1 ignores auto-repeat -- bit 30 of lParam -- or holding it down would
write a state every few milliseconds. Fast-forward is also cancelled on
WM_KILLFOCUS, so alt-tabbing mid-hold cannot leave emulation stuck at 2x
with the key-up delivered elsewhere.
Where savestates live, what they are called, and what order they list in
are facts more than one thing has to agree about: the emulator writes and
lists them from its own menu, and a frontend offers the same set before
boot. Stated twice they drift, and the symptom is the same directory
coming back in a different order depending on where you look -- confusing
to chase, and easy to cause by editing one copy.

Core/SavestateLayout.h holds the extension, the automatic-state prefix,
the timestamped name, and the newest-first-with-filename-tiebreak order.
It depends on nothing but the standard library, so a frontend can include
it without linking any of Dolphin. The menu added in this branch now
takes all four from it rather than restating them.

The rules are tested where they are defined -- eight cases, including
that pruning never removes a player's own saves, that slot saves in the
same directory are not listed, and that equal timestamps fall back to
filename so the order cannot shuffle between reads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants