Commit 7d2224b
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments