]> git.sur5r.net Git - cc65/blobdiff - include/gamate.h
atari5200: name conio constructor 'initconio'
[cc65] / include / gamate.h
index b7c2fef7a3949e1f4078e1b9ef1396de60c89ffc..0af21623d102664028703034e82831cf62ca96a9 100644 (file)
  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
 
 /* 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
 /* 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