ObjFW  Check-in [4f69c96c54]

Overview
Comment:OFGameController: Remove Mega Drive quirk

It doesn't seem to work correctly.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | gamecontroller
Files: files | file ages | folders
SHA3-256: 4f69c96c54e2a4b023e6816fc640fd9997dd1c47921c5e59f4815fe953d2e360
User & Date: js on 2024-05-11 09:56:12
Other Links: branch diff | manifest | tags
Context
2024-05-11
10:06
OFGameController: Report vendor ID and product ID check-in: c0735ac803 user: js tags: gamecontroller
09:56
OFGameController: Remove Mega Drive quirk check-in: 4f69c96c54 user: js tags: gamecontroller
2024-05-10
12:58
OFGameController: Quirks for Mega Drive controller check-in: 899801a8b8 user: js tags: gamecontroller
Changes

Modified src/platform/Linux/OFGameController.m from [3f585adcc6] to [fb841c3ea2].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#import "OFInvalidArgumentException.h"
#import "OFOpenItemFailedException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"

static const uint16_t vendorIDNintendo = 0x057E;
static const uint16_t productIDN64Controller = 0x2019;
static const uint16_t productIDMegaDriveController = 0x201E;

@interface OFGameController ()
- (instancetype)of_initWithPath: (OFString *)path OF_METHOD_FAMILY(init);
@end

static const uint16_t buttons[] = {
	BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL, BTN_TR, BTN_TL2,







<







36
37
38
39
40
41
42

43
44
45
46
47
48
49
#import "OFInvalidArgumentException.h"
#import "OFOpenItemFailedException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"

static const uint16_t vendorIDNintendo = 0x057E;
static const uint16_t productIDN64Controller = 0x2019;


@interface OFGameController ()
- (instancetype)of_initWithPath: (OFString *)path OF_METHOD_FAMILY(init);
@end

static const uint16_t buttons[] = {
	BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL, BTN_TR, BTN_TL2,
67
68
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
		case BTN_SELECT:
			return OFGameControllerButtonCPadUp;
		case BTN_X:
			return OFGameControllerButtonCPadDown;
		case BTN_MODE:
			return OFGameControllerButtonHome;
		case BTN_Z:
			return OFGameControllerButtonCapture;
		}
	} else if (vendorID == vendorIDNintendo &&
	    productID == productIDMegaDriveController) {
		switch (button) {
		case BTN_B:
			return OFGameControllerButtonA;
		case BTN_A:
			return OFGameControllerButtonB;
		case BTN_Z:
			return OFGameControllerButtonC;
		case BTN_TR2:
			return OFGameControllerButtonStart;
		case BTN_TR:
			return OFGameControllerButtonMode;
		case BTN_THUMBL:
			return OFGameControllerButtonCapture;
		}
	}

	switch (button) {
	case BTN_A:
		return OFGameControllerButtonA;







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







66
67
68
69
70
71
72
















73
74
75
76
77
78
79
		case BTN_SELECT:
			return OFGameControllerButtonCPadUp;
		case BTN_X:
			return OFGameControllerButtonCPadDown;
		case BTN_MODE:
			return OFGameControllerButtonHome;
		case BTN_Z:
















			return OFGameControllerButtonCapture;
		}
	}

	switch (button) {
	case BTN_A:
		return OFGameControllerButtonA;