unsigned char xpos;
unsigned char ypos;
};
-#define SV_LCD ((struct __sv_lcd*)0x2000)
+#define SV_LCD (*(struct __sv_lcd*)0x2000)
struct __sv_tone {
unsigned delay;
unsigned char control;
unsigned char timer;
};
-#define SV_RIGHT ((struct __sv_tone*)0x2010)
-#define SV_LEFT ((struct __sv_tone*)0x2014)
+#define SV_RIGHT (*(struct __sv_tone*)0x2010)
+#define SV_LEFT (*(struct __sv_tone*)0x2014)
struct __sv_noise {
unsigned char volume; /* and frequency */
unsigned char timer;
unsigned char control;
};
-#define SV_NOISE ((struct __sv_noise*)0x2028)
+#define SV_NOISE (*(struct __sv_noise*)0x2028)
struct __io_port {
unsigned char in;
unsigned char out;
};
-#define IO_PORT ((struct __io_port*)(0x2021)
+#define IO_PORT (*(struct __io_port*)0x2021)
struct __sv_dma {
unsigned start;
unsigned char control;
unsigned char on;
};
-#define SV_DMA ((struct __sv_dma*)0x2018)
+#define SV_DMA (*(struct __sv_dma*)0x2018)
#define SV_CONTROL (*(unsigned char*)0x2020)
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
-/* End of supervision.h */
-#endif
+#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)
+
+/* No support for dynamically loadable drivers */
+#define DYN_DRV 0
+
+/* The addresses of the static drivers */
+extern void supervision_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
+
+/* End of supervision.h */
+#endif