Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added button masks for Neo Geo ASP extended buttons #845

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion headers/drivers/neogeo/NeoGeoDescriptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
// Button report (16 bits)
#define NEOGEO_MASK_A (1U << 0)
#define NEOGEO_MASK_B (1U << 1)
#define NEOGEO_MASK_R1 (1U << 2)
#define NEOGEO_MASK_C (1U << 3)
#define NEOGEO_MASK_D (1U << 4)
#define NEOGEO_MASK_R2 (1U << 5)
#define NEOGEO_MASK_L1 (1U << 6)
#define NEOGEO_MASK_L2 (1U << 7)
#define NEOGEO_MASK_OPTIONS (1U << 9)
#define NEOGEO_MASK_SELECT (1U << 10)
#define NEOGEO_MASK_START (1U << 11)

#define NEOGEO_JOYSTICK_MID 0x7f

typedef struct __attribute((packed, aligned(1)))
Expand Down
5 changes: 5 additions & 0 deletions src/drivers/neogeo/NeoGeoDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ void NeoGeoDriver::process(Gamepad * gamepad, uint8_t * outBuffer) {
| (gamepad->pressedB2() ? NEOGEO_MASK_D : 0)
| (gamepad->pressedS1() ? NEOGEO_MASK_SELECT : 0)
| (gamepad->pressedS2() ? NEOGEO_MASK_START : 0)
| (gamepad->pressedA1() ? NEOGEO_MASK_OPTIONS : 0)
| (gamepad->pressedL1() ? NEOGEO_MASK_L1 : 0)
| (gamepad->pressedL2() ? NEOGEO_MASK_L2 : 0)
| (gamepad->pressedR1() ? NEOGEO_MASK_R1 : 0)
| (gamepad->pressedR2() ? NEOGEO_MASK_R2 : 0)
;

// Wake up TinyUSB device
Expand Down