]> git.sur5r.net Git - cc65/commitdiff
pce: add system specific joy_masks array indices and macros 464/head
authorPascal de Bruijn <pmjdebruijn@pcode.nl>
Wed, 19 Jul 2017 16:29:35 +0000 (18:29 +0200)
committerPascal de Bruijn <pmjdebruijn@pcode.nl>
Wed, 19 Jul 2017 16:29:35 +0000 (18:29 +0200)
include/pce.h

index 856a2fa1d74ca2089ba3e7d3d695b4127153b219..ac6b2503fe7fa48591a026d57a2d5b1fcd0af4f7 100644 (file)
 /* 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[] */