Make the Game Blaster's I/O address configurable

This commit is contained in:
Alexander Babikov
2021-08-04 13:46:26 +05:00
parent bfcc36ac8e
commit 9632f99552
4 changed files with 54 additions and 6 deletions

View File

@@ -163,6 +163,7 @@
#define IDC_CHECK_FLOAT 1048
#define IDC_CONFIGURE_GUS 1049
#define IDC_COMBO_MIDI_IN 1050
#define IDC_CONFIGURE_CMS 1051
#define IDC_COMBO_NET_TYPE 1060 /* network config */
#define IDC_COMBO_PCAP 1061

View File

@@ -181,7 +181,8 @@ void *cms_init(const device_t *info)
cms_t *cms = malloc(sizeof(cms_t));
memset(cms, 0, sizeof(cms_t));
io_sethandler(0x0220, 0x0010, cms_read, NULL, NULL, cms_write, NULL, NULL, cms);
uint16_t addr = device_get_config_hex16("base");
io_sethandler(addr, 0x0010, cms_read, NULL, NULL, cms_write, NULL, NULL, cms);
sound_add_handler(cms_get_buffer, cms);
return cms;
}
@@ -193,11 +194,44 @@ void cms_close(void *p)
free(cms);
}
static const device_config_t cms_config[] =
{
{
"base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 },
{
{
"0x210", 0x210
},
{
"0x220", 0x220
},
{
"0x230", 0x230
},
{
"0x240", 0x240
},
{
"0x250", 0x250
},
{
"0x260", 0x260
},
{
""
}
}
},
{
"", "", -1
}
};
const device_t cms_device =
{
"Creative Music System / Game Blaster",
0, 0,
cms_init, cms_close, NULL,
{ NULL }, NULL, NULL,
NULL
cms_config
};

View File

@@ -517,15 +517,17 @@ BEGIN
CONTROL "Innovation SSI-2001",IDC_CHECK_SSI,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,84,95,10
CONTROL "CMS / Game Blaster",IDC_CHECK_CMS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,147,84,95,10
BS_AUTOCHECKBOX | WS_TABSTOP,7,102,95,10
PUSHBUTTON "Configure",IDC_CONFIGURE_CMS,214,100,46,12
CONTROL "Gravis Ultrasound",IDC_CHECK_GUS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,101,94,10
PUSHBUTTON "Configure",IDC_CONFIGURE_GUS,214,101,46,12
BS_AUTOCHECKBOX | WS_TABSTOP,7,120,94,10
PUSHBUTTON "Configure",IDC_CONFIGURE_GUS,214,118,46,12
CONTROL "Use FLOAT32 sound",IDC_CHECK_FLOAT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,117,94,10
BS_AUTOCHECKBOX | WS_TABSTOP,7,138,94,10
END
DLG_CFG_NETWORK DIALOG DISCARDABLE 107, 0, 267, 65

View File

@@ -1376,6 +1376,7 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow());
settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401);
settings_set_check(hdlg, IDC_CHECK_CMS, temp_GAMEBLASTER);
settings_enable_window(hdlg, IDC_CONFIGURE_CMS, temp_GAMEBLASTER);
settings_set_check(hdlg, IDC_CHECK_GUS, temp_GUS);
settings_enable_window(hdlg, IDC_CONFIGURE_GUS, temp_GUS);
settings_set_check(hdlg, IDC_CHECK_SSI, temp_SSI2001);
@@ -1437,6 +1438,16 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
(void *)&mpu401_mca_device : (void *)&mpu401_device);
break;
case IDC_CHECK_CMS:
temp_GAMEBLASTER = settings_get_check(hdlg, IDC_CHECK_CMS);
settings_enable_window(hdlg, IDC_CONFIGURE_CMS, temp_GAMEBLASTER);
break;
case IDC_CONFIGURE_CMS:
temp_deviceconfig |= deviceconfig_open(hdlg, &cms_device);
break;
case IDC_CHECK_GUS:
temp_GUS = settings_get_check(hdlg, IDC_CHECK_GUS);
settings_enable_window(hdlg, IDC_CONFIGURE_GUS, temp_GUS);