Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -43,14 +43,14 @@ tests/Info.plist tests/PARAM.SFO tests/big_dictionary_msgpack_gz.m tests/boot.dol tests/gamecontroller/boot.dol -tests/gamecontroller/gamecontroller_tests -tests/gamecontroller/gamecontroller_tests.3dsx -tests/gamecontroller/gamecontroller_tests.arm9 -tests/gamecontroller/gamecontroller_tests.nds +tests/gamecontroller/tests +tests/gamecontroller/tests.3dsx +tests/gamecontroller/tests.arm9 +tests/gamecontroller/tests.nds tests/iOS.xcodeproj/*.pbxuser tests/iOS.xcodeproj/project.xcworkspace tests/iOS.xcodeproj/xcuserdata tests/objc_sync/objc_sync tests/plugin/Info.plist Index: src/hid/Makefile ================================================================== --- src/hid/Makefile +++ src/hid/Makefile @@ -26,12 +26,12 @@ OHEvdevDualShock4.m \ OHEvdevExtendedGamepad.m \ OHEvdevGameController.m \ OHEvdevPlayStationExtendedGamepad.m \ OHEvdevStadiaExtendedGamepad.m -SRCS_NINTENDO_3DS = OHNintendo3DSGameController.m \ - OHNintendo3DSExtendedGamepad.m +SRCS_NINTENDO_3DS = OHNintendo3DSExtendedGamepad.m \ + OHNintendo3DSGameController.m SRCS_NINTENDO_DS = OHNintendoDSGameController.m SRCS_XINPUT = OHXInputExtendedGamepad.m \ OHXInputGameController.m INCLUDES := ${SRCS:.m=.h} \ Index: src/hid/OHCombinedJoyCons.h ================================================================== --- src/hid/OHCombinedJoyCons.h +++ src/hid/OHCombinedJoyCons.h @@ -15,11 +15,11 @@ * You should have received a copy of the GNU Lesser General Public License * version 3.0 along with this program. If not, see * . */ -#import "OHGamepad.h" +#import "OHExtendedGamepad.h" OF_ASSUME_NONNULL_BEGIN @class OHGameController; @@ -26,11 +26,11 @@ /** * @class OHCombinedJoyCons OHCombinedJoyCons.h ObjFWHID/OHCombinedJoyCons.h * * @brief Combines a left and a right Joy-Con into a gamepad. */ -@interface OHCombinedJoyCons: OHGamepad +@interface OHCombinedJoyCons: OHExtendedGamepad { OHGameControllerProfile *_leftJoyCon, *_rightJoyCon; } /** Index: tests/gamecontroller/GameControllerTests.m ================================================================== --- tests/gamecontroller/GameControllerTests.m +++ tests/gamecontroller/GameControllerTests.m @@ -27,10 +27,11 @@ #import "OFNumber.h" #import "OFStdIOStream.h" #import "OFThread.h" #import "OHCombinedJoyCons.h" +#import "OHExtendedGamepad.h" #import "OHGameController.h" #import "OHGameControllerAxis.h" #import "OHGameControllerButton.h" #import "OHGameControllerDirectionalPad.h" #import "OHGameControllerProfile.h" @@ -135,23 +136,44 @@ gamepad.westButton.name, gamepad.eastButton.name]; [OFStdOut writeFormat: @"[Map] Left Shoulder: %@ Right Shoulder: %@\n", gamepad.leftShoulderButton.name, gamepad.rightShoulderButton.name]; + } + + if ([profile isKindOfClass: [OHExtendedGamepad class]]) { + OHExtendedGamepad *extendedGamepad = + (OHExtendedGamepad *)profile; + [OFStdOut writeFormat: @"[Map] Left Trigger: %@ Right Trigger: %@\n", - gamepad.leftTriggerButton.name, - gamepad.rightTriggerButton.name]; + extendedGamepad.leftTriggerButton.name, + extendedGamepad.rightTriggerButton.name]; [OFStdOut writeFormat: @"[Map] Left Thumbstick: %@ Right Thumbstick: %@\n", - gamepad.leftThumbstickButton.name, - gamepad.rightThumbstickButton.name]; + extendedGamepad.leftThumbstickButton.name, + extendedGamepad.rightThumbstickButton.name]; + } + + if ([profile isKindOfClass: [OHGamepad class]]) { + OHGamepad *gamepad = (OHGamepad *)profile; + [OFStdOut writeFormat: - @"[Map] Menu: %@ Options: %@ Home: %@\n", - gamepad.menuButton.name, gamepad.optionsButton.name, - gamepad.homeButton.name]; + @"[Map] Menu: %@ Options: %@", + gamepad.menuButton.name, gamepad.optionsButton.name]; + } + + if ([profile isKindOfClass: [OHExtendedGamepad class]]) { + OHExtendedGamepad *extendedGamepad = + (OHExtendedGamepad *)profile; + + [OFStdOut writeFormat: @" Home: %@", + extendedGamepad.homeButton.name]; } + + if ([profile isKindOfClass: [OHGamepad class]]) + [OFStdOut writeString: @"\n"]; } @implementation GameControllerTests - (void)applicationDidFinishLaunching: (OFNotification *)notification { Index: tests/gamecontroller/Makefile ================================================================== --- tests/gamecontroller/Makefile +++ tests/gamecontroller/Makefile @@ -3,11 +3,11 @@ CLEAN = boot.dol \ ${PROG_NOINST}.3dsx \ ${PROG_NOINST}.arm9 \ ${PROG_NOINST}.ndsd \ -PROG_NOINST = gamecontroller_tests${PROG_SUFFIX} +PROG_NOINST = tests${PROG_SUFFIX} SRCS = GameControllerTests.m include ../../buildsys.mk .PHONY: run