1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 02:29:52 +00:00

Merge pull request #464 from pmjdebruijn/joy

expand nes/pce joystick defines
This commit is contained in:
Oliver Schmidt 2017-07-21 16:18:26 +02:00 committed by GitHub
commit d90f032114
2 changed files with 21 additions and 9 deletions

View File

@ -90,15 +90,16 @@
/* No support for dynamically loadable drivers */
#define DYN_DRV 0
/* The joystick keys - all keys are supported */
#define KEY_A 0x01
#define KEY_B 0x02
#define KEY_SELECT 0x04
#define KEY_START 0x08
#define KEY_UP 0x10
#define KEY_DOWN 0x20
#define KEY_LEFT 0x40
#define KEY_RIGHT 0x80
/* Expanding upon joystick.h */
#define JOY_A 4
#define JOY_B 5
#define JOY_SELECT 6
#define JOY_START 7
#define JOY_BTN_A(v) ((v) & joy_masks[JOY_A])
#define JOY_BTN_B(v) ((v) & joy_masks[JOY_B])
#define JOY_BTN_SELECT(v) ((v) & joy_masks[JOY_SELECT])
#define JOY_BTN_START(v) ((v) & joy_masks[JOY_START])
/* Define hardware */

View File

@ -76,6 +76,17 @@
/* No support for dynamically loadable drivers */
#define DYN_DRV 0
/* Expanding upon joystick.h */
#define JOY_I 4
#define JOY_II 5
#define JOY_SELECT 6
#define JOY_RUN 7
#define JOY_BTN_I(v) ((v) & joy_masks[JOY_I])
#define JOY_BTN_II(v) ((v) & joy_masks[JOY_II])
#define JOY_BTN_SELECT(v) ((v) & joy_masks[JOY_SELECT])
#define JOY_BTN_RUN(v) ((v) & joy_masks[JOY_RUN])
/* The addresses of the static drivers */
extern void pce_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */