comparison io.c @ 2422:1978bd770023

Expose gamepad state in debugger
author Michael Pavone <pavone@retrodev.com>
date Sat, 20 Jan 2024 21:15:56 -0800
parents 0a107b2d5837
children
comparison
equal deleted inserted replaced
2421:bcfa5e272f5e 2422:1978bd770023
87 [BUTTON_Y] = {.states = {GAMEPAD_EXTRA, GAMEPAD_NONE}, .value = 0x2}, 87 [BUTTON_Y] = {.states = {GAMEPAD_EXTRA, GAMEPAD_NONE}, .value = 0x2},
88 [BUTTON_Z] = {.states = {GAMEPAD_EXTRA, GAMEPAD_NONE}, .value = 0x1}, 88 [BUTTON_Z] = {.states = {GAMEPAD_EXTRA, GAMEPAD_NONE}, .value = 0x1},
89 [BUTTON_MODE] = {.states = {GAMEPAD_EXTRA, GAMEPAD_NONE}, .value = 0x8}, 89 [BUTTON_MODE] = {.states = {GAMEPAD_EXTRA, GAMEPAD_NONE}, .value = 0x8},
90 }; 90 };
91 91
92 static io_port *find_gamepad(sega_io *io, uint8_t gamepad_num) 92 io_port *find_gamepad(sega_io *io, uint8_t gamepad_num)
93 { 93 {
94 for (int i = 0; i < 3; i++) 94 for (int i = 0; i < 3; i++)
95 { 95 {
96 io_port *port = io->ports + i; 96 io_port *port = io->ports + i;
97 if (port->device_type < IO_MOUSE && port->device.pad.gamepad_num == gamepad_num) { 97 if (port->device_type < IO_MOUSE && port->device.pad.gamepad_num == gamepad_num) {