Continuing the game port overhaul: added support for Super I/O game ports not being broken out
This commit is contained in:
@@ -119,7 +119,7 @@ static const isapnp_device_config_t gameport_pnp_defaults[] = {
|
||||
|
||||
|
||||
const device_t *standalone_gameport_type;
|
||||
static int gameport_instance_id = 0;
|
||||
int gameport_instance_id = 0;
|
||||
/* Linked list of active game ports. Only the top port responds to reads
|
||||
or writes, and ports at the standard 200h location are prioritized. */
|
||||
static gameport_t *active_gameports = NULL;
|
||||
@@ -356,8 +356,10 @@ gameport_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *pr
|
||||
void *
|
||||
gameport_add(const device_t *gameport_type)
|
||||
{
|
||||
/* Prevent a standalone game port from being added later on. */
|
||||
standalone_gameport_type = NULL;
|
||||
/* Prevent a standalone game port from being added later on, unless this
|
||||
is an unused Super I/O game port (no MACHINE_GAMEPORT machine flag). */
|
||||
if (!(gameport_type->local & 0x10000) || (machines[machine].flags & MACHINE_GAMEPORT))
|
||||
standalone_gameport_type = NULL;
|
||||
|
||||
/* Add game port device. */
|
||||
return device_add_inst(gameport_type, gameport_instance_id++);
|
||||
@@ -399,7 +401,7 @@ gameport_init(const device_t *info)
|
||||
dev->joystick = joystick_instance;
|
||||
|
||||
/* Map game port to the default address. Not applicable on PnP-only ports. */
|
||||
gameport_remap(dev, info->local);
|
||||
gameport_remap(dev, info->local & 0xffff);
|
||||
|
||||
/* Register ISAPnP if this is a standard game port card. */
|
||||
if (info->local == 0x200)
|
||||
@@ -455,3 +457,12 @@ const device_t gameport_pnp_device = {
|
||||
NULL, { NULL }, NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
const device_t gameport_sio_device = {
|
||||
"Game port (Super I/O)",
|
||||
0, 0x10000,
|
||||
gameport_init,
|
||||
gameport_close,
|
||||
NULL, { NULL }, NULL,
|
||||
NULL
|
||||
};
|
||||
|
@@ -108,9 +108,11 @@ extern "C" {
|
||||
extern const device_t gameport_device;
|
||||
extern const device_t gameport_201_device;
|
||||
extern const device_t gameport_pnp_device;
|
||||
extern const device_t gameport_sio_device;
|
||||
|
||||
extern const device_t *standalone_gameport_type;
|
||||
#endif
|
||||
extern int gameport_instance_id;
|
||||
extern plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS];
|
||||
extern joystick_t joystick_state[MAX_JOYSTICKS];
|
||||
extern int joysticks_present;
|
||||
|
@@ -61,6 +61,7 @@
|
||||
#define MACHINE_SOUND 0x00008000 /* sys has int sound */
|
||||
#define MACHINE_FDC 0x00010000 /* sys has int FDC */
|
||||
#define MACHINE_NIC 0x00020000 /* sys has int NIC */
|
||||
#define MACHINE_GAMEPORT 0x00040000 /* sys has int game port */
|
||||
/* Combined flags. */
|
||||
#define MACHINE_VIDEO_FIXED 0x00003000 /* sys has fixed int video */
|
||||
/* Feature flags for internal storage controllers. */
|
||||
|
@@ -76,6 +76,7 @@ machine_init_ex(int m)
|
||||
|
||||
is_vpc = 0;
|
||||
standalone_gameport_type = NULL;
|
||||
gameport_instance_id = 0;
|
||||
|
||||
/* Set up the architecture flags. */
|
||||
AT = IS_AT(machine);
|
||||
|
@@ -340,7 +340,7 @@ const machine_t machines[] = {
|
||||
{ "[i430VX] HP Brio 80xx", "brio80xx", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 66666667, 66666667, 2200, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_brio80xx_init, NULL },
|
||||
{ "[i430VX] Packard Bell PB680", "pb680", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_pb680_init, NULL },
|
||||
{ "[i430VX] PC Partner MB520N", "mb520n", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_mb520n_init, NULL },
|
||||
{ "[i430VX] Shuttle HOT-557", "430vx", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, machine_at_i430vx_init, NULL },
|
||||
{ "[i430VX] Shuttle HOT-557", "430vx", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_GAMEPORT, 8192, 131072, 8192, 127, machine_at_i430vx_init, NULL },
|
||||
|
||||
/* 430TX */
|
||||
{ "[i430TX] ADLink NuPRO-592", "nupro592", MACHINE_TYPE_SOCKET7, CPU_PKG_SOCKET5_7, 0, 66666667, 66666667, 1900, 2800, 1.5, 5.5, MACHINE_PCI | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL, 8192, 262144, 8192, 255, machine_at_nupro592_init, NULL },
|
||||
|
@@ -89,7 +89,7 @@ static const isapnp_device_config_t um8669f_pnp_defaults[] = {
|
||||
}, {
|
||||
.activate = 0
|
||||
}, {
|
||||
.activate = 1,
|
||||
.activate = 0,
|
||||
.io = { { .base = 0x200 }, }
|
||||
}
|
||||
};
|
||||
@@ -287,7 +287,7 @@ um8669f_init(const device_t *info)
|
||||
dev->uart[0] = device_add_inst(&ns16550_device, 1);
|
||||
dev->uart[1] = device_add_inst(&ns16550_device, 2);
|
||||
|
||||
dev->gameport = gameport_add(&gameport_pnp_device);
|
||||
dev->gameport = gameport_add(&gameport_sio_device);
|
||||
|
||||
io_sethandler(0x0108, 0x0002,
|
||||
um8669f_read, NULL, NULL, um8669f_write, NULL, NULL, dev);
|
||||
|
Reference in New Issue
Block a user