From: Stefan Date: Tue, 21 Nov 2017 09:22:53 +0000 (+0100) Subject: New API X-Git-Tag: V2.17~70^2~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e49744ecd065a958efd9d8ed90993f60b6fdf656;p=cc65 New API --- diff --git a/include/supervision.h b/include/supervision.h index 464c59e05..492346492 100644 --- a/include/supervision.h +++ b/include/supervision.h @@ -105,6 +105,26 @@ extern unsigned char sv_nmi_counter; extern unsigned char sv_timer_irq_counter; extern unsigned char sv_timer_dma_counter; +/* Masks for joy_read */ +#define JOY_UP_MASK 0x08 +#define JOY_DOWN_MASK 0x04 +#define JOY_LEFT_MASK 0x02 +#define JOY_RIGHT_MASK 0x01 +#define JOY_BTN_1_MASK 0x20 +#define JOY_BTN_2_MASK 0x10 +#define JOY_BTN_3_MASK 0x80 +#define JOY_BTN_4_MASK 0x40 + +#define JOY_BTN_A_MASK JOY_BTN_1_MASK +#define JOY_BTN_B_MASk JOY_BTN_2_MASK +#define JOY_START_MASK JOY_BTN_3_MASK +#define JOY_SELECT_MASK JOY_BTN_4_MASK + +#define JOY_BTN_A(v) ((v) & JOY_BTN_A_MASK) +#define JOY_BTN_B(v) ((v) & JOY_BTN_B_MASK) +#define JOY_START(v) ((v) & JOY_START_MASK) +#define JOY_SELECT(v) ((v) & JOY_SELECT_MASK) + /* The addresses of the static drivers */ extern void supervision_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */