From 1b74b12cee5a889d71d379cd19b28d421ede487e Mon Sep 17 00:00:00 2001 From: Ompronce <88358700+Ompronce@users.noreply.github.com> Date: Wed, 19 Jan 2022 20:07:52 -0400 Subject: [PATCH 1/3] Added gameport at port 201h to AdLib Gold sound card --- src/sound/snd_adlibgold.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index 5fe65445a..4c2938aa2 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -9,6 +9,7 @@ #include <86box/dma.h> #include <86box/pic.h> #include <86box/device.h> +#include <86box/gameport.h> #include <86box/nvr.h> #include <86box/sound.h> #include <86box/filters.h> @@ -66,7 +67,9 @@ typedef struct adgold_t int16_t mma_buffer[2][SOUNDBUFLEN]; int pos; - + + int gameport_enabled; + int surround_enabled; } adgold_t; @@ -858,6 +861,8 @@ void *adgold_init(const device_t *info) memset(adgold, 0, sizeof(adgold_t)); adgold->surround_enabled = device_get_config_int("surround"); + + adgold->gameport_enabled = device_get_config_int("gameport"); opl3_init(&adgold->opl); if (adgold->surround_enabled) @@ -901,6 +906,9 @@ void *adgold_init(const device_t *info) /*388/389 are handled by adlib_init*/ io_sethandler(0x0388, 0x0008, adgold_read, NULL, NULL, adgold_write, NULL, NULL, adgold); + if (adgold->gameport_enabled) + gameport_remap(gameport_add(&gameport_201_device), 0x201); + timer_add(&adgold->adgold_mma_timer_count, adgold_timer_poll, adgold, 1); sound_add_handler(adgold_get_buffer, adgold); @@ -929,8 +937,11 @@ void adgold_close(void *p) static const device_config_t adgold_config[] = { { - "surround", "Surround module", CONFIG_BINARY, "", 1 + "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, + { + "surround", "Surround module", CONFIG_BINARY, "", 1 + }, { "receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 }, From 80dda2e18cd5499334307165332f7507cebda6b0 Mon Sep 17 00:00:00 2001 From: Ompronce <88358700+Ompronce@users.noreply.github.com> Date: Wed, 19 Jan 2022 20:10:39 -0400 Subject: [PATCH 2/3] Corrected spacing --- src/sound/snd_adlibgold.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index 4c2938aa2..ddbdca8f7 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -939,12 +939,12 @@ static const device_config_t adgold_config[] = { "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, - { + { "surround", "Surround module", CONFIG_BINARY, "", 1 - }, - { + }, + { "receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 - }, + }, { "", "", -1 } From e462f03a8913dd16613a108b6112c91cc8522151 Mon Sep 17 00:00:00 2001 From: Ompronce <88358700+Ompronce@users.noreply.github.com> Date: Wed, 19 Jan 2022 20:12:11 -0400 Subject: [PATCH 3/3] Corrected spacing again --- src/sound/snd_adlibgold.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index ddbdca8f7..5d435f61e 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -940,10 +940,10 @@ static const device_config_t adgold_config[] = "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, { - "surround", "Surround module", CONFIG_BINARY, "", 1 + "surround", "Surround module", CONFIG_BINARY, "", 1 }, { - "receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 + "receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 }, { "", "", -1