Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 line
436B

  1. #include <stdint.h>
  2. #include <stdbool.h>
  3. #include "emul.h"
  4. typedef enum {
  5. PAD_BTN_UP = 0,
  6. PAD_BTN_DOWN = 1,
  7. PAD_BTN_LEFT = 2,
  8. PAD_BTN_RIGHT = 3,
  9. PAD_BTN_B = 4,
  10. PAD_BTN_C = 5,
  11. PAD_BTN_A = 6,
  12. PAD_BTN_START = 7
  13. } PAD_BTN;
  14. typedef struct {
  15. uint8_t pressed;
  16. Tristate *TH;
  17. } Pad;
  18. void pad_init(Pad *pad, Tristate *TH);
  19. void pad_setbtn(Pad *pad, PAD_BTN btn, bool pressed);
  20. uint8_t pad_rd(Pad *pad);