Overview
Context
Changes
Modified src/hid/Makefile
from [e11835f6dd]
to [9ac3135daf].
︙ | | |
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
+
+
|
ObjFWHID.h
SRCS += OHDualSenseGamepad.m \
OHDualShock4Gamepad.m \
OHEmulatedGameControllerAxis.m \
OHEmulatedGameControllerButton.m \
OHEmulatedGameControllerTriggerButton.m \
OHExtendedN64Controller.m \
OHN64Controller.m \
OHStadiaGamepad.m \
OHXboxGamepad.m \
${USE_SRCS_EVDEV} \
${USE_SRCS_NINTENDO_3DS} \
${USE_SRCS_NINTENDO_DS} \
${USE_SRCS_NINTENDO_SWITCH} \
${USE_SRCS_WII} \
|
︙ | | |
Modified src/hid/OHEvdevGameController.m
from [758671613d]
to [7e3c50d414].
︙ | | |
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
+
|
#import "OFFileManager.h"
#import "OFLocale.h"
#import "OFNumber.h"
#import "OHDualSenseGamepad.h"
#import "OHDualShock4Gamepad.h"
#import "OHEvdevExtendedGamepad.h"
#import "OHExtendedN64Controller.h"
#import "OHGameControllerAxis+Private.h"
#import "OHGameControllerAxis.h"
#import "OHGameControllerButton.h"
#import "OHGameControllerProfile.h"
#import "OHStadiaGamepad.h"
#include <sys/ioctl.h>
|
︙ | | |
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
+
+
+
|
if (_vendorID == OHVendorIDSony &&
_productID == OHProductIDDualSense)
_profile = [[OHDualSenseGamepad alloc] init];
else if (_vendorID == OHVendorIDSony &&
_productID == OHProductIDDualShock4)
_profile = [[OHDualShock4Gamepad alloc] init];
else if (_vendorID == OHVendorIDNintendo &&
_productID == OHProductIDN64Controller)
_profile = [[OHExtendedN64Controller alloc] init];
else if (_vendorID == OHVendorIDGoogle &&
_productID == OHProductIDStadiaController)
_profile = [[OHStadiaGamepad alloc] init];
else
_profile = [[OHEvdevExtendedGamepad alloc]
initWithKeyBits: _keyBits
evBits: _evBits
|
︙ | | |
Modified src/hid/OHEvdevGameControllerProfile.m
from [9b605a4be7]
to [566139f646].
︙ | | |
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
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";
}
}
switch (button) {
case BTN_A:
return @"A";
case BTN_B:
return @"B";
|
︙ | | |
Added src/hid/OHExtendedN64Controller.h version [1d023dc5ed].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3.0 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* version 3.0 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3.0 along with this program. If not, see
* <https://www.gnu.org/licenses/>.
*/
#import "OHN64Controller.h"
OF_ASSUME_NONNULL_BEGIN
@interface OHExtendedN64Controller: OHN64Controller
@end
OF_ASSUME_NONNULL_END
|
| | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/hid/OHExtendedN64Controller.m version [3611333b7c].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3.0 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* version 3.0 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3.0 along with this program. If not, see
* <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#import "OHExtendedN64Controller.h"
#import "OFDictionary.h"
#import "OHGameControllerButton.h"
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
# include <linux/input.h>
#endif
static OFString *const buttonNames[] = {
@"ZR", @"Home", @"Capture"
};
static const size_t numButtons = sizeof(buttonNames) / sizeof(*buttonNames);
@implementation OHExtendedN64Controller
- (instancetype)init
{
self = [super init];
@try {
void *pool = objc_autoreleasePoolPush();
OFMutableDictionary *buttons =
[[_buttons mutableCopy] autorelease];
for (size_t i = 0; i < numButtons; i++) {
OHGameControllerButton *button =
[[[OHGameControllerButton alloc]
initWithName: buttonNames[i]] autorelease];
[buttons setObject: button forKey: buttonNames[i]];
}
[buttons makeImmutable];
[_buttons release];
_buttons = [buttons retain];
objc_autoreleasePoolPop(pool);
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
- (OHGameControllerButton *)oh_buttonForEvdevButton: (uint16_t)button
{
switch (button) {
case BTN_TR2:
return [_buttons objectForKey: @"ZR"];
case BTN_MODE:
return [_buttons objectForKey: @"Home"];
case BTN_Z:
return [_buttons objectForKey: @"Capture"];
}
return [super oh_buttonForEvdevButton: button];
}
#endif
@end
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/hid/OHN64Controller.h version [635752411f].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3.0 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* version 3.0 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3.0 along with this program. If not, see
* <https://www.gnu.org/licenses/>.
*/
#import "OHGameControllerProfile.h"
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
# import "OHEvdevGameController.h"
#endif
OF_ASSUME_NONNULL_BEGIN
@interface OHN64Controller: OFObject <OHGameControllerProfile
#if defined(OF_LINUX) && defined(OF_HAVE_FILES)
, OHEvdevMapping
#endif
>
{
OFDictionary OF_GENERIC(OFString *, OHGameControllerButton *) *_buttons;
OFDictionary OF_GENERIC(OFString *, OHGameControllerDirectionalPad *)
*_directionalPads;
}
@end
OF_ASSUME_NONNULL_END
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/hid/OHN64Controller.m version [fae6195d95].