86Box Specific PNP Gameport

This commit is contained in:
Jasmine Iwanek
2025-07-11 12:59:55 -04:00
parent c419de5031
commit dbd8d1d8f5
3 changed files with 20 additions and 3 deletions

View File

@@ -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 },

View File

@@ -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;

View File

@@ -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