ObjFW  Diff

Differences From Artifact [3f585adcc6]:

To Artifact [fb841c3ea2]:


36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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;
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,
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
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;
		}
	} 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;