Skip to content

Commit 7d2224b

Browse files
committed
Pause emulator when opening Pokes/Cheats
Until this fix the first time the user opened Pokes/Cheats in a session the emulator kept running. Visible symptoms, in order of how likely the user is to notice them: * Memory Browser open, then Pokes/Cheats: closing Pokes/Cheats resumed the emulator with Memory Browser still on screen, and the browser's snapshot started drifting against live memory. * Pokes/Cheats opened alone: z80 kept executing while the user enabled cheats, so a poke could be partially overwritten by the game's own code before it stuck. * Once Pokes/Cheats had been opened and closed once, subsequent utility windows (Memory Browser, Rollback, etc.) stopped pausing the emulator — they opened normally but showed a live, drifting view instead of the expected snapshot. The defect persisted until the next app launch. Root cause: PokeMemory.xib was the only utility xib without visibleAtLaunch="NO" (the attribute defaults to YES when omitted). PokeMemoryController.init touches [self window] to register a close-notification observer, which lazy-loads the xib; with visibleAtLaunch=YES, NSNib orders the window front during the load. By the time showWindow: ran, isVisible was already YES, so its early-return guard returned without calling pause. The close block still called unpause unconditionally, walking the pause counter down by one each cycle. Adding visibleAtLaunch="NO" to PokeMemory.xib lines it up with the other utility xibs. releasedWhenClosed="NO" is added for the same consistency; NSWindowController already forces it at runtime.
1 parent 9b55875 commit 7d2224b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fusepb/xibs/PokeMemory.xib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
1515
<customObject id="-3" userLabel="Application"/>
1616
<arrayController id="18" userLabel="Pokes"/>
17-
<window title="POKEs/Cheats" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" frameAutosaveName="PokeMemory" animationBehavior="default" id="1" userLabel="PokeMem" customClass="NSPanel">
17+
<window title="POKEs/Cheats" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="PokeMemory" animationBehavior="default" id="1" userLabel="PokeMem" customClass="NSPanel">
1818
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
1919
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
2020
<rect key="contentRect" x="196" y="240" width="480" height="270"/>

0 commit comments

Comments
 (0)