Repository navigation
Conversation
988a7af to
52ce0ed
Compare
… and iOS (PR #650) GameController names a Switch Pro Controller's and Joy-Con's face buttons by their printed labels, every other pad's by position, so the host's position mapping swapped A/B and X/Y on Nintendo pads. pad_apple.h holds the rule for both front ends (dm_pad_face), with a test; a single Joy-Con held sideways is matched too and is untested (open, in the header). Co-authored-by: Peter Kmet <55005408+peterkmet@users.noreply.github.com>
|
Thanks! Landed in 90eca2f with you as co-author. Your detection and label mapping are kept as they were. The rule now lives in one shared header, One open point: |
With each controller a player of its own on iOS (fdea829), a pair of Joy-Con still could not be held sideways as two players, as on a Switch: iPadOS hands the pair over as one combined controller ("Joy-Con (L/R)") and does not offer the halves separately. There was also no way to see or change which controller is which player before the game starts. Held sideways, the pair now becomes two players: the left half on the controller's own player, the right half on the next free one (a second slot in pad_slots.h, freed with the controller). Each half's stick is turned a quarter and its four buttons are read by their new positions. GameController names a Joy-Con's face buttons by their printed labels (pad_apple.h, PR seedds#650) and does not turn them with the pair: a button log on the iPad gave buttonY, buttonX, buttonA and buttonB for the right half's top, right, bottom and left. So its X, A, Y and B are its right, bottom, top and left buttons. SL and SR are not in the combined profile, so each half's own shoulder buttons stand in: L or R is L, ZL or ZR is R. The pair's gyro goes to the left half's player. The launcher's new Players section (LauncherControllers.swift) lists the players as the game will get them. It lets the player hold each pair upright or sideways (players.joyconSideways.<pair>) and change the order (players.order); DmGamepad.m takes the controllers in that order. After a run it greys out the controllers past what the game takes: hle_hid.c's new dm_pad_players_accepted counts that from SetSupportedNpadIdType, and the app keeps it as players.max. DM_JOYCON_SIDEWAYS=0|1 in the environment overrides the hold. A pair held upright maps its face buttons through dm_pad_face (pad_apple.h), as any other Nintendo pad. Checked: make -C dm/host/tests run (t_hid gains t_accepted, 123 checks), dm/tools/tests test_docs and test_env_switches, DmGamepad.m with -Wall -Wextra -Werror and the launcher's Swift files for iOS. On an iPad Air 13-inch (M3), iPadOS 27.2, with Super Mario Bros. Wonder 1.2.1: one Joy-Con pair held sideways as players 1 and 2.
|
Thanks! I have Switch Joy-Cons and will test a single Joy-Con held sideways over the weekend. |
… and iOS (PR seedds#650) GameController names a Switch Pro Controller's and Joy-Con's face buttons by their printed labels, every other pad's by position, so the host's position mapping swapped A/B and X/Y on Nintendo pads. pad_apple.h holds the rule for both front ends (dm_pad_face), with a test; a single Joy-Con held sideways is matched too and is untested (open, in the header). Co-authored-by: Peter Kmet <55005408+peterkmet@users.noreply.github.com>
The host maps face buttons by position, as on a Switch controller (right A, bottom B, top X, left Y), on every pad but Nintendo's, so on a pad lettered as an Xbox pad the button marked X presses the game's Y: in Ocarina of Time (0400486024DEC000, v131072) with a Steam Controller, X swung the sword and Y jumped. That is by design (PR seedds#650) and keeps the game's prompts pointing at the right place; the only way to the letters was swapping buttons in the Mac's Game Controllers settings, which changes every app and does not reach a controller GameController does not list. A new setting, Buttons by letter (DM_PAD_LETTERS=1, off by default), makes a pad with an Xbox pad's letters press the Switch button of the letter it shows (dm_face_by_letter, dm_input.h): GameController's pads other than Nintendo's by the names GameController gives their buttons (pad_apple.h, Mac and iOS), raw HID pads in the default and Xbox 360 maps by usage (pad_hid.h; DM_HID_MAP entries still replace them), and the Steam Controller (pad_steam.h). Nintendo's controllers, report 0x3F and the Switch wired layout keep their maps. New reference entry: Face buttons by position, not by an Xbox pad's letters; playing.md points to the setting. regress.py impact maps pad_hid.h to the games' hid functions (dm/tools/impact_map.tsv). Checked: t_pad_apple (an Xbox, a DualSense and a generic pad by letter, a Pro Controller unchanged, 0 by position), t_pad_hid (the default and Xbox 360 maps, DM_HID_MAP over them, Nintendo's report and the Switch wired layout unchanged), t_pad_steam, make run in dm/host/tests, the Mac host build, test_docs, test_env_switches, test_launcher_settings, test_usage. With the setting on, the Steam Controller's A reached Ocarina of Time as A (DM_HID_LOG), over Bluetooth LE too each face button pressed its letter's Switch button, and the player reported its face buttons by letter. Not run: iOS, an Xbox pad or a DualSense, regress.py check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host maps face buttons by position, as on a Switch controller (right A, bottom B, top X, left Y), on every pad but Nintendo's, so on a pad lettered as an Xbox pad the button marked X presses the game's Y: in Ocarina of Time (0400486024DEC000, v131072) with a Steam Controller, X swung the sword and Y jumped. That is by design (PR seedds#650) and keeps the game's prompts pointing at the right place; the only way to the letters was swapping buttons in the Mac's Game Controllers settings, which changes every app and does not reach a controller GameController does not list. A new setting, Buttons by letter (DM_PAD_LETTERS=1, off by default), makes a pad with an Xbox pad's letters press the Switch button of the letter it shows (dm_face_by_letter, dm_input.h): GameController's pads other than Nintendo's by the names GameController gives their buttons (pad_apple.h, Mac and iOS), raw HID pads in the default and Xbox 360 maps by usage (pad_hid.h; DM_HID_MAP entries still replace them), and the Steam Controller (pad_steam.h). Nintendo's controllers, report 0x3F and the Switch wired layout keep their maps. New reference entry: Face buttons by position, not by an Xbox pad's letters; playing.md points to the setting. regress.py impact maps pad_hid.h to the games' hid functions (dm/tools/impact_map.tsv). Checked: t_pad_apple (an Xbox, a DualSense and a generic pad by letter, a Pro Controller unchanged, 0 by position), t_pad_hid (the default and Xbox 360 maps, DM_HID_MAP over them, Nintendo's report and the Switch wired layout unchanged), t_pad_steam, make run in dm/host/tests, the Mac host build, test_docs, test_env_switches, test_launcher_settings, test_usage. With the setting on, the Steam Controller's A reached Ocarina of Time as A (DM_HID_LOG), over Bluetooth LE too each face button pressed its letter's Switch button, and the player reported its face buttons by letter. Not run: iOS, an Xbox pad or a DualSense, regress.py check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
macOS and iOS name the face buttons of a Switch Pro Controller or Joy-Con by their labels, not by their position. The host mapped every pad by position, so A/B and X/Y were swapped on Nintendo pads.
pad_nintendo()detects these pads byproductCategoryand maps their buttons by label; other pads keep the position mapping. Checked with a Pro Controller on the Mac and on iOS.