ObjFW  Check-in [f5e3072b7e]

Overview
Comment:OHEvdevGameController: Buttons for N64 controller
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f5e3072b7eaef8fcf829066fe1425b49c7b85fc71992e4ab02545f098c6fdc3d
User & Date: js on 2024-06-09 09:53:19
Other Links: manifest | tags
Context
2024-06-09
11:17
ObjFWHID: Add OHCombinedJoyCons check-in: 1ba9cce376 user: js tags: trunk
09:53
OHEvdevGameController: Buttons for N64 controller check-in: f5e3072b7e user: js tags: trunk
02:13
OHEvdevGameController: Add button map for Joy-Cons check-in: 081c229439 user: js tags: trunk
Changes

Modified src/hid/OHEvdevGameController.m from [e96c61a23a] to [47295b2089].

160
161
162
163
164
165
166
























167
168
169
170
171
172
173
			return @"+";
		case BTN_MODE:
			return @"Home";
		case BTN_TL:
			return @"SL";
		case BTN_TL2:
			return @"SR";
























		}
	} else if (vendorID == OHVendorIDGoogle &&
	    productID == OHProductIDStadiaController) {
		switch (button) {
		case BTN_TL:
			return @"L1";
		case BTN_TR:







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
			return @"+";
		case BTN_MODE:
			return @"Home";
		case BTN_TL:
			return @"SL";
		case BTN_TL2:
			return @"SR";
		}
	} else if (vendorID == OHVendorIDNintendo &&
	    productID == OHProductIDN64Controller) {
		switch (button) {
		case BTN_SELECT:
			return @"C-Pad Up";
		case BTN_X:
			return @"C-Pad Down";
		case BTN_Y:
			return @"C-Pad Left";
		case BTN_C:
			return @"C-Pad Right";
		case BTN_TL:
			return @"L";
		case BTN_TR:
			return @"R";
		case BTN_TL2:
			return @"Z";
		case BTN_TR2:
			return @"ZR";
		case BTN_MODE:
			return @"Home";
		case BTN_Z:
			return @"Capture";
		}
	} else if (vendorID == OHVendorIDGoogle &&
	    productID == OHProductIDStadiaController) {
		switch (button) {
		case BTN_TL:
			return @"L1";
		case BTN_TR:

Modified src/hid/OHGameController.h from [711330479c] to [993476fab8].

102
103
104
105
106
107
108

109
110
111
112
113
114
extern const uint16_t OHVendorIDSony;
extern const uint16_t OHVendorIDNintendo;
extern const uint16_t OHVendorIDGoogle;
extern const uint16_t OHProductIDDualShock4;
extern const uint16_t OHProductIDDualSense;
extern const uint16_t OHProductIDLeftJoyCon;
extern const uint16_t OHProductIDRightJoyCon;

extern const uint16_t OHProductIDStadiaController;
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END







>






102
103
104
105
106
107
108
109
110
111
112
113
114
115
extern const uint16_t OHVendorIDSony;
extern const uint16_t OHVendorIDNintendo;
extern const uint16_t OHVendorIDGoogle;
extern const uint16_t OHProductIDDualShock4;
extern const uint16_t OHProductIDDualSense;
extern const uint16_t OHProductIDLeftJoyCon;
extern const uint16_t OHProductIDRightJoyCon;
extern const uint16_t OHProductIDN64Controller;
extern const uint16_t OHProductIDStadiaController;
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END

Modified src/hid/OHGameController.m from [1bbd2ab193] to [65e834b561].

41
42
43
44
45
46
47

48
49
50
51
52
53
54
const uint16_t OHVendorIDSony = 0x054C;
const uint16_t OHVendorIDNintendo = 0x057E;
const uint16_t OHVendorIDGoogle = 0x18D1;
const uint16_t OHProductIDDualShock4 = 0x09CC;
const uint16_t OHProductIDDualSense = 0x0CE6;
const uint16_t OHProductIDLeftJoyCon = 0x2006;
const uint16_t OHProductIDRightJoyCon = 0x2007;

const uint16_t OHProductIDStadiaController = 0x9400;

@implementation OHGameController
@dynamic name, rawProfile;

+ (OFArray OF_GENERIC(OHGameController *) *)controllers
{







>







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const uint16_t OHVendorIDSony = 0x054C;
const uint16_t OHVendorIDNintendo = 0x057E;
const uint16_t OHVendorIDGoogle = 0x18D1;
const uint16_t OHProductIDDualShock4 = 0x09CC;
const uint16_t OHProductIDDualSense = 0x0CE6;
const uint16_t OHProductIDLeftJoyCon = 0x2006;
const uint16_t OHProductIDRightJoyCon = 0x2007;
const uint16_t OHProductIDN64Controller = 0x2019;
const uint16_t OHProductIDStadiaController = 0x9400;

@implementation OHGameController
@dynamic name, rawProfile;

+ (OFArray OF_GENERIC(OHGameController *) *)controllers
{