summaryrefslogtreecommitdiff
path: root/app/mac/controller-adapter-gamepad.mm
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-01-30 16:43:06 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-01-31 00:02:26 +0100
commit307e07d6513f9524b7fcab5134494bd175465cd1 (patch)
treece025db2ea998bdcd8980a0ed443083f0daf8d35 /app/mac/controller-adapter-gamepad.mm
parent5959349f341a2380c0c3f41ec40a1e8e0d969d00 (diff)
handle input devices in the c++ application
Diffstat (limited to 'app/mac/controller-adapter-gamepad.mm')
-rw-r--r--app/mac/controller-adapter-gamepad.mm29
1 files changed, 0 insertions, 29 deletions
diff --git a/app/mac/controller-adapter-gamepad.mm b/app/mac/controller-adapter-gamepad.mm
deleted file mode 100644
index f1d8db8..0000000
--- a/app/mac/controller-adapter-gamepad.mm
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "controller-adapter-gamepad.hh"
-
-@implementation ControllerAdapterGamepad
-
-- (instancetype)initWithProfile:(GCExtendedGamepad*)profile
-{
- self = [super init];
- if (self)
- {
- _profile = profile;
- }
- return self;
-}
-
-- (nes::button_mask)readPressedButtons
-{
- auto res = nes::button_mask{};
- if ([[[_profile dpad] up] isPressed]) { res.add(nes::buttons::up); }
- if ([[[_profile dpad] down] isPressed]) { res.add(nes::buttons::down); }
- if ([[[_profile dpad] left] isPressed]) { res.add(nes::buttons::left); }
- if ([[[_profile dpad] right] isPressed]) { res.add(nes::buttons::right); }
- if ([[_profile buttonA] isPressed]) { res.add(nes::buttons::a); }
- if ([[_profile buttonB] isPressed]) { res.add(nes::buttons::b); }
- if ([[_profile leftTrigger] isPressed]) { res.add(nes::buttons::select); }
- if ([[_profile rightTrigger] isPressed]) { res.add(nes::buttons::start); }
- return res;
-}
-
-@end \ No newline at end of file