--- trunk/src/devices/dev_dreamcast_maple.c 2007/10/08 16:21:17 34 +++ trunk/src/devices/dev_dreamcast_maple.c 2007/10/08 16:21:34 36 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: dev_dreamcast_maple.c,v 1.11 2007/02/03 20:14:23 debug Exp $ + * $Id: dev_dreamcast_maple.c,v 1.14 2007/03/08 19:04:09 debug Exp $ * * Dreamcast "Maple" bus controller. * @@ -41,6 +41,7 @@ * * TODO: * Unit numbers / IDs for real Maple devices. + * The Controller (up/down/left/right, buttons, etc). */ #include @@ -95,6 +96,7 @@ * * TODO: Figure out strings and numbers of _real_ Maple devices. */ +#if 0 static struct maple_device maple_device_controller = { { BE32_TO_HOST(MAPLE_FUNC(MAPLE_FN_CONTROLLER)), /* di_func */ @@ -107,6 +109,7 @@ LE16_TO_HOST(100) /* di_max_power */ } }; +#endif static struct maple_device maple_device_keyboard = { { BE32_TO_HOST(MAPLE_FUNC(MAPLE_FN_KEYBOARD)),/* di_func */ @@ -138,16 +141,22 @@ DEVICE_TICK(maple) { struct dreamcast_maple_data *d = (struct dreamcast_maple_data *) extra; - int control_bits, key = console_readchar(d->console_handle); + int key; - if (key < 0) - return; + while ((key = console_readchar(d->console_handle)) >= 0) { + /* Add to the keyboard queue: */ + d->char_queue[d->char_queue_head] = key; + d->char_queue_head = (d->char_queue_head + 1) % MAX_CHARS; + if (d->char_queue_head == d->char_queue_tail) + fatal("[ dreamcast_maple: KEYBOARD QUEUE OVERRUN! ]\n"); + } - /* Add to the keyboard queue: */ - d->char_queue[d->char_queue_head] = key; - d->char_queue_head = (d->char_queue_head + 1) % MAX_CHARS; - if (d->char_queue_head == d->char_queue_tail) - fatal("[ dreamcast_maple: KEYBOARD QUEUE OVERRUN! ]\n"); +#if 0 + /* + * NOTE/TODO: + * + * Implement the controller in a reasonable way! + */ control_bits = 0; switch (key) { @@ -205,6 +214,7 @@ fatal("[ dreamcast_maple: CONTROLLER QUEUE " "OVERRUN! ]\n"); } +#endif } @@ -310,7 +320,7 @@ key = get_key(d); /* - * buf[0] = shift keys (1 = ctrl, 2 = shift) + * buf[0] = shift keys (1 = left ctrl, 2 = shift, 0x10 = right ctrl) * buf[1] = led state * buf[2] = key */ @@ -627,7 +637,7 @@ 0x5f6c00, 0x100, dev_dreamcast_maple_access, d, DM_DEFAULT, NULL); /* Devices connected to port A..D: */ - d->device[0] = &maple_device_controller; + d->device[0] = NULL; /* &maple_device_controller; */ d->device[1] = NULL; d->device[2] = &maple_device_keyboard; d->device[3] = NULL; /* TODO: &maple_device_mouse; */