libjoybus
Joybus implementation for 32-bit MCUs
Loading...
Searching...
No Matches
n64.h
1#pragma once
2
3#include <stdint.h>
4
8#define JOYBUS_N64_BUTTON_RIGHT (1 << 0)
9#define JOYBUS_N64_BUTTON_LEFT (1 << 1)
10#define JOYBUS_N64_BUTTON_DOWN (1 << 2)
11#define JOYBUS_N64_BUTTON_UP (1 << 3)
12#define JOYBUS_N64_BUTTON_START (1 << 4)
13#define JOYBUS_N64_BUTTON_Z (1 << 5)
14#define JOYBUS_N64_BUTTON_B (1 << 6)
15#define JOYBUS_N64_BUTTON_A (1 << 7)
16#define JOYBUS_N64_BUTTON_C_RIGHT (1 << 8)
17#define JOYBUS_N64_BUTTON_C_LEFT (1 << 9)
18#define JOYBUS_N64_BUTTON_C_DOWN (1 << 10)
19#define JOYBUS_N64_BUTTON_C_UP (1 << 11)
20#define JOYBUS_N64_BUTTON_R (1 << 12)
21#define JOYBUS_N64_BUTTON_L (1 << 13)
22#define JOYBUS_N64_RST (1 << 15)
23#define JOYBUS_N64_BUTTON_MASK 0x3FFF
24
30 uint16_t buttons;
31
33 uint8_t stick_x;
34
36 uint8_t stick_y;
37} __attribute__((packed));
N64 controller input state.
Definition n64.h:28
uint16_t buttons
Button state.
Definition n64.h:30
uint8_t stick_x
Stick x-axis position.
Definition n64.h:33
uint8_t stick_y
Stick y-axis position.
Definition n64.h:36