Repository navigation
The Mac settings window starts the game with a controller's A and quits with its B, so couch play needs no mouse; the press that starts the game does not reach it and A never answers the cloud-save question - #2460
Open
PucaVaz wants to merge 1 commit into
Conversation
…ts with its B, so couch play needs no mouse; the press that starts the game does not reach it and A never answers the cloud-save question ## What and why The Mac settings window (`dm/mac/Launcher.swift`) could only be answered with the mouse or the keyboard (Play / Return, Quit / closing the window). With a controller only, the player had to reach for the Mac to start the game. Now a controller's A is Play and its B is Quit. They are GameController's `buttonA` and `buttonB` on any controller, as the host's own quit and player prompts take them (`front_mac.m` `hq_buttons`, `cp_buttons`); main has no A/B layout setting (seedds#634 is open), so none is added. The decisions are a small pure struct, `LauncherPad`, which a 60 Hz timer in common run-loop modes feeds with the buttons of every controller GameController lists: - A button counts on its **release**, after a press the window took. The settings go into the environment and the host is spawned only after that (`launcher.c`), in a new process whose GameController reads the controllers from scratch (`pads_changed` reads each one's state at its connection; with `DM_PAD_PRESS_TO_JOIN` a controller joins on a value change). The button is up by then, so the press that started the game reaches it neither as a button nor as a join. - A button already down when the window starts taking input (held at launch, or through an alert) counts only after it was seen up. - The window takes no button while it is not key, while an alert or a panel is modal (`NSApp.modalWindow`), with a sheet attached, or while a menu tracks (`RunLoop.current.currentMode == .eventTracking`). A press is dropped when any of these starts. So A never picks a save: the save-sync conflict alert keeps no default button on purpose (`SaveCheck.ask`), and it stays a mouse or keyboard choice. - A follows the Play button's state: it does nothing during the cloud-save check (Play disabled); B works then, as the Quit button does. - Play from A goes through the same `start()` as the button, so the cloud-save check and its questions still come first. The window logs `launcher: Play from a controller (A)` / `launcher: Quit from a controller (B)`. Mac only. The iPhone/iPad launcher (`dm/ios/Sources/Launcher.swift`) runs the host in the same process, whose `DmGamepad.m` handlers take the controllers when the game starts, and an iOS app has no Quit. It needs its own check of those handlers and a device test, which an unsigned IPA cannot get from this change, so it is left for a separate PR. Moving through the settings rows with the d-pad is not part of this change either. Not covered: controllers the host reads outside GameController (raw HID pads, `pad_hid_mac.h`; Switch 2 controllers over the host's own transport) are not seen by the window. ## Checked - Tests: `dm/ios/tests/test_launcher_storage.py` now also compiles `launcher_pad_check.swift`: 14 decisions (release, not press; B; a button held at the start; after it is let go; a press across an alert, in an alert, held after it; a new press after an alert; the first sample after an alert; A while Play is disabled; B during the cloud-save check; a Play disabled before the release; A and B together; each button its own click). On main the check does not compile (`LauncherPad` does not exist), so all 14 fail. `test_docs.py` (6), `test_nsp_mac_app.py` (63), `test_launcher_settings.py` (17), every `dm/ios/tests/test_*.py`: pass. The launcher sources typecheck with no warning in Swift 5 mode. - The Mac launcher built with `pack_app.py`'s `build_launcher` (macOS 26.6 target), in a copy of Ocarina of Time's app (0400486024DEC000) with its own bundle ID and home folder: the window opens (`launcher: 18 settings shown`, a 560 × 737 window on screen), and the idle timer costs about 0.4 % of a core while the window is not key and about 0.5 % while it is key and in front (CPU time over 10 s). Return and Play were not pressed in this run: keys posted to the app from a script were not delivered (the script has no accessibility permission), so the game was not started from the window. The Play button and its Return shortcut are unchanged lines. - **Not tested: a real controller press.** No controller was connected to this Mac (an 8BitDo and a DualSense are paired but not connected), and macOS has no `GCVirtualController`. A press on a real controller, and the host seeing nothing of it, still have to be tried. - Devices and OS: Apple silicon Mac, macOS 27.2. - regress.py: not run; the change is in the Mac app's settings window and its packer only, which no game run in `regress.py` goes through. - Lint: not run. ## Docs - `docs/settings.md` (The Mac settings window): A is Play, B is Quit, on release; held buttons and the cloud-save question; what it does not do. - `docs/playing.md` (On the Mac): one line.
PucaVaz
marked this pull request as ready for review
November 12, 2026 12:33
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.
What and why
The Mac settings window (
dm/mac/Launcher.swift) could only be answered with the mouse or the keyboard (Play / Return, Quit / closing the window). With a controller only, the player had to reach for the Mac to start the game.Now a controller's A is Play and its B is Quit. They are GameController's
buttonAandbuttonBon any controller, as the host's own quit and player prompts take them (front_mac.mhq_buttons,cp_buttons); main has no A/B layout setting (#634 is open), so none is added. The decisions are a small pure struct,LauncherPad, which a 60 Hz timer in common run-loop modes feeds with the buttons of every controller GameController lists:launcher.c), in a new process whose GameController reads the controllers from scratch (pads_changedreads each one's state at its connection; withDM_PAD_PRESS_TO_JOINa controller joins on a value change). The button is up by then, so the press that started the game reaches it neither as a button nor as a join.NSApp.modalWindow), with a sheet attached, or while a menu tracks (RunLoop.current.currentMode == .eventTracking). A press is dropped when any of these starts. So A never picks a save: the save-sync conflict alert keeps no default button on purpose (SaveCheck.ask), and it stays a mouse or keyboard choice.start()as the button, so the cloud-save check and its questions still come first.The window logs
launcher: Play from a controller (A)/launcher: Quit from a controller (B).Mac only. The iPhone/iPad launcher (
dm/ios/Sources/Launcher.swift) runs the host in the same process, whoseDmGamepad.mhandlers take the controllers when the game starts, and an iOS app has no Quit. It needs its own check of those handlers and a device test, which an unsigned IPA cannot get from this change, so it is left for a separate PR. Moving through the settings rows with the d-pad is not part of this change either.Not covered: controllers the host reads outside GameController (raw HID pads,
pad_hid_mac.h; Switch 2 controllers over the host's own transport) are not seen by the window.Checked
dm/ios/tests/test_launcher_storage.pynow also compileslauncher_pad_check.swift: 14 decisions (release, not press; B; a button held at the start; after it is let go; a press across an alert, in an alert, held after it; a new press after an alert; the first sample after an alert; A while Play is disabled; B during the cloud-save check; a Play disabled before the release; A and B together; each button its own click). On main the check does not compile (LauncherPaddoes not exist), so all 14 fail.test_docs.py(6),test_nsp_mac_app.py(63),test_launcher_settings.py(17), everydm/ios/tests/test_*.py: pass. The launcher sources typecheck with no warning in Swift 5 mode.pack_app.py'sbuild_launcher(macOS 26.6 target), in a copy of Ocarina of Time's app (0400486024DEC000) with its own bundle ID and home folder: the window opens (launcher: 18 settings shown, a 560 × 737 window on screen), and the idle timer costs about 0.4 % of a core while the window is not key and about 0.5 % while it is key and in front (CPU time over 10 s). Return and Play were not pressed in this run: keys posted to the app from a script were not delivered (the script has no accessibility permission), so the game was not started from the window. The Play button and its Return shortcut are unchanged lines.regress.pygoes through.Docs
docs/settings.md(The Mac settings window): A is Play, B is Quit, on release; held buttons and the cloud-save question; what it does not do.docs/playing.md(On the Mac): one line.