SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
Cocoa/GBButtons.h
1 typedef enum {
2 GBRight,
3 GBLeft,
4 GBUp,
5 GBDown,
6 GBA,
7 GBB,
8 GBSelect,
9 GBStart,
10 GBRapidA,
11 GBRapidB,
12 GBTurbo,
13 GBRewind,
14 GBUnderclock,
15 GBHotkey1,
16 GBHotkey2,
17 GBTotalButtonCount,
18 GBKeyboardButtonCount = GBUnderclock + 1,
19 GBPerPlayerButtonCount = GBRapidB + 1,
20 } GBButton;
21
22 #define GBJoyKitHotkey1 JOYButtonUsageGeneric0 + 0x100
23 #define GBJoyKitHotkey2 JOYButtonUsageGeneric0 + 0x101
24 #define GBJoyKitRapidA JOYButtonUsageGeneric0 + 0x102
25 #define GBJoyKitRapidB JOYButtonUsageGeneric0 + 0x103
26
27 extern NSString const *GBButtonNames[GBTotalButtonCount];
28
29 static inline NSString *n2s(uint64_t number)
30 {
31 return [NSString stringWithFormat:@"%llx", number];
32 }
33
34 static inline NSString *button_to_preference_name(GBButton button, unsigned player)
35 {
36 if (player) {
37 return [NSString stringWithFormat:@"GBPlayer%d%@", player + 1, GBButtonNames[button]];
38 }
39 return [NSString stringWithFormat:@"GB%@", GBButtonNames[button]];
40 }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.