Give the Win32 render window a File/View menu and hotkeys - #8
Open
dougchansan wants to merge 2 commits into
Open
Give the Win32 render window a File/View menu and hotkeys#8dougchansan wants to merge 2 commits into
dougchansan wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The DolphinNoGUI window has no way to save or load a state, and
Escas its only key. Getting back to a scene means booting and playing in, every time.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.
No new frontend obligations
All of it goes through
Core,StateandConfigdirectly rather than newHost_*hooks. Adding hooks would oblige every frontend to implement them before it could build; this way nothing outside this file has to change.Details worth flagging
States are written to and listed from Dolphin's own
StateSavesdirectory, named by wall clock (state-YYYYmmdd-HHMMSS.sav) rather than by slot, so repeated saves accumulate instead of overwriting one another 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 whose timestamps are coarse enough for two states to share a write time. The range of command ids is bounded and the list truncated to it, rather than running past the end.
F1 ignores auto-repeat — bit 30 of
lParamis the previous key state — or holding it down would write a state every few milliseconds.Fast-forward is cancelled on
WM_KILLFOCUS. Without that, alt-tabbing mid-hold delivers the key-up to another window and leaves emulation stuck at 2x.Pause and Mute read their checked state from the core when the menu opens, so the tick cannot drift out of step with an emulation that was paused or muted some other way.
Fullscreen hides the menu bar and restores the previous window style and rect on the way back, rather than assuming a default.
Testing
Built with MSVC/Ninja Release and exercised against a running game (Pokémon Colosseum, booted into a savestate), driving each command by posting it to the window and then checking it had an effect:
state-20260804-231457.savappearedOne measurement note, since it nearly produced a wrong answer: the window title is not a usable pause signal. When the core pauses, the title stops being updated and keeps whatever FPS it last showed, so a paused run reads identical to a running one — my first attempt "failed" Pause on that basis. Process CPU time cannot be faked that way.