X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fgamate.h;h=0af21623d102664028703034e82831cf62ca96a9;hb=8cb930b50e93647cd28debfc40f39fcf6507797b;hp=7b1c04a8198cea66a70eadefecb2b2d9b5118ec9;hpb=b39a8b7a618c049ec1c885d7af53fbee44494c18;p=cc65 diff --git a/include/gamate.h b/include/gamate.h index 7b1c04a81..0af21623d 100644 --- a/include/gamate.h +++ b/include/gamate.h @@ -80,17 +80,6 @@ bit 3: */ -#define JOY_DATA 0x4400 - -#define JOY_DATA_UP 0x01 -#define JOY_DATA_DOWN 0x02 -#define JOY_DATA_LEFT 0x04 -#define JOY_DATA_RIGHT 0x08 -#define JOY_DATA_FIRE_A 0x10 -#define JOY_DATA_FIRE_B 0x20 -#define JOY_DATA_START 0x40 -#define JOY_DATA_SELECT 0x80 - /* LCD resolution 160x152 in 4 greys/greens @@ -144,7 +133,7 @@ /* each of the following 4 increments by 1 per IRQ - it is _not_ a 32bit counter (see code at $ffa6 in BIOS) - these are not used elsewhere in the bios and can be (re)setted as needed by + these are not used elsewhere in the bios and can be (re)set as needed by the user. */ #define ZP_IRQ_CNT1 0x0e @@ -158,41 +147,57 @@ #define COLOR_BLACK 0x03 #define COLOR_WHITE 0x00 -#define CH_HLINE 1 -#define CH_VLINE 2 -#define CH_CROSS 3 -#define CH_ULCORNER 4 -#define CH_URCORNER 5 -#define CH_LLCORNER 6 -#define CH_LRCORNER 7 -#define CH_TTEE 8 -#define CH_BTEE 9 +#define CH_HLINE 1 +#define CH_VLINE 2 +#define CH_CROSS 3 +#define CH_ULCORNER 4 +#define CH_URCORNER 5 +#define CH_LLCORNER 6 +#define CH_LRCORNER 7 +#define CH_TTEE 8 +#define CH_BTEE 9 -#define CH_RTEE 11 -#define CH_LTEE 12 +#define CH_RTEE 11 +#define CH_LTEE 12 -#define CH_ENTER 13 -#define CH_PI 18 +#define CH_ENTER 13 +#define CH_PI 18 -#define TV_NTSC 0 -#define TV_PAL 1 -#define TV_OTHER 2 +#define TV_NTSC 0 +#define TV_PAL 1 +#define TV_OTHER 2 /* No support for dynamically loadable drivers */ #define DYN_DRV 0 +/* Masks for joy_read */ +#define JOY_UP_MASK 0x01 +#define JOY_DOWN_MASK 0x02 +#define JOY_LEFT_MASK 0x04 +#define JOY_RIGHT_MASK 0x08 +#define JOY_BTN_1_MASK 0x10 +#define JOY_BTN_2_MASK 0x20 +#define JOY_BTN_3_MASK 0x40 +#define JOY_BTN_4_MASK 0x80 + +#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 gamate_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */ -#define JOY_FIRE_B 5 -#define JOY_START 6 -#define JOY_SELECT 7 - -void waitvblank (void); -/* Wait for the vertical blanking */ +void waitvsync (void); +/* Wait for start of next frame */ /* NOTE: all Gamate are "NTSC" */ -#define get_tv() TV_NTSC +#define get_tv() TV_NTSC /* Return the video mode the machine is using. */ /* End of gamate.h */