/* ______ ___ ___ * /\ _ \ /\_ \ /\_ \ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ * /\____/ * \_/__/ * * Joystick driver for the IF-SEGA/ISA (I-O DATA) controller. * * By E. Watanabe (99/09/08), * based on sample code by Earle F. Philhower, III / Kerry High (SNES). * */ #include "allegro.h" #ifndef ALLEGRO_DOS #error something is wrong with the makefile #endif #define IFSEGAISA_BASE 0x1001 /* driver functions */ static int sg_init(void); static void sg_exit(void); static int sg_poll(int); static int sg1_poll(void); static int sg_poll_sub(int num, int base); static int sg_poll_sub2(int base); static int sg_poll_sub3(int num, int count, int base); static int pad_kind(int base); static void sg_button_init(int num); JOYSTICK_DRIVER joystick_sg1 = { JOY_TYPE_IFSEGA_ISA, NULL, NULL, "IF-SEGA/ISA", sg_init, sg_exit, sg1_poll, NULL, NULL, NULL, NULL }; /* sg_init: * Initialises the driver. */ static int sg_init(void) { static char *name_b[] = { "A", "B", "C", "X", "Y", "Z", "L", "R", "Start" }; int i, j; num_joysticks = 4; for (i=0; i