From: Pascal de Bruijn Date: Wed, 19 Jul 2017 16:14:44 +0000 (+0200) Subject: nes: add system specific joy_masks array indices and macros X-Git-Tag: V2.17~115^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d277055b5a06ee314fd3c93a562fd494cefbd767;p=cc65 nes: add system specific joy_masks array indices and macros --- diff --git a/include/nes.h b/include/nes.h index 2687e2626..3e139e00c 100644 --- a/include/nes.h +++ b/include/nes.h @@ -90,6 +90,17 @@ /* No support for dynamically loadable drivers */ #define DYN_DRV 0 +/* 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 */ /* Picture Processing Unit */