diff --git a/src/game/gameport.c b/src/game/gameport.c index 3d02167bc..45f34f1e1 100644 --- a/src/game/gameport.c +++ b/src/game/gameport.c @@ -416,8 +416,8 @@ gameport_init(const device_t *info) dev->len = (info->local >> 16) & 0xff; gameport_remap(dev, info->local & 0xffff); - /* Register ISAPnP if this is a standard game port card. */ - if ((info->local & 0xffff) == 0x200) + /* Register ISAPnP if this is a PNP game port card. */ + if (info->local & GAMEPORT_PNPROM) isapnp_set_device_defaults(isapnp_add_card(gameport_pnp_rom, sizeof(gameport_pnp_rom), gameport_pnp_config_changed, NULL, NULL, NULL, dev), 0, gameport_pnp_defaults); return dev; @@ -489,6 +489,20 @@ gameport_close(void *priv) free(dev); } +const device_t gameport_device = { + .name = "86Box PNP Game port", + .internal_name = "gameport", + .flags = 0, + .local = GAMEPORT_PNPROM | GAMEPORT_8ADDR | 0x0200, + .init = gameport_init, + .close = gameport_close, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + const device_t gameport_200_device = { .name = "Game port (Port 200h-207h)", .internal_name = "gameport_200", @@ -759,6 +773,7 @@ static const GAMEPORT gameports[] = { { &device_none }, { &device_internal }, { &gameport_200_device }, + { &gameport_device }, { &gameport_208_device }, { &gameport_pnp_device }, { &gameport_tm_acm_device }, diff --git a/src/include/86box/gameport.h b/src/include/86box/gameport.h index ac0ea2d58..a990d018e 100644 --- a/src/include/86box/gameport.h +++ b/src/include/86box/gameport.h @@ -51,6 +51,7 @@ #define GAMEPORT_6ADDR 0x060000 #define GAMEPORT_8ADDR 0x080000 #define GAMEPORT_SIO 0x1000000 +#define GAMEPORT_PNPROM 0x2000000 typedef struct joystick_t { const char *name; @@ -125,6 +126,7 @@ extern const char *gameport_get_internal_name(int port); extern int gameport_get_from_internal_name(const char *str); #ifdef EMU_DEVICE_H +extern const device_t gameport_device; extern const device_t gameport_200_device; extern const device_t gameport_201_device; extern const device_t gameport_203_device; diff --git a/src/machine/m_at.c b/src/machine/m_at.c index b30951140..d2c4b99a2 100644 --- a/src/machine/m_at.c +++ b/src/machine/m_at.c @@ -81,7 +81,7 @@ machine_at_common_init_ex(const machine_t *model, int type) else if (type == 0) device_add(&at_nvr_device); - standalone_gameport_type = &gameport_200_device; + standalone_gameport_type = &gameport_device; } void