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 <[email protected]>
|
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 <[email protected]>
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.