src/sound

This commit is contained in:
Jasmine Iwanek
2022-04-08 21:41:33 -04:00
parent 0cf7bd5eb0
commit 3431e01d4a
15 changed files with 1597 additions and 464 deletions

View File

@@ -541,9 +541,7 @@ static const device_config_t fluidsynth_config[] = {
}, },
.default_int = 2 .default_int = 2
}, },
{ { .name = "", .description = "", .type = CONFIG_END }
.type = -1
}
// clang-format on // clang-format on
}; };

View File

@@ -368,9 +368,7 @@ static const device_config_t mt32_config[] = {
.type = CONFIG_BINARY, .type = CONFIG_BINARY,
.default_int = 1 .default_int = 1
}, },
{ { .name = "", .description = "", .type = CONFIG_END }
.type = -1
}
// clang-format on // clang-format on
}; };

View File

@@ -234,57 +234,73 @@ rtmidi_in_get_dev_name(int num, char *s)
static const device_config_t system_midi_config[] = { static const device_config_t system_midi_config[] = {
{ {
"midi", "MIDI out device", CONFIG_MIDI_OUT, "", 0 .name = "midi",
.description = "MIDI out device",
.type = CONFIG_MIDI_OUT,
.default_string = "",
.default_int = 0
}, },
{ { .name = "", .description = "", .type = CONFIG_END }
"", "", -1
}
}; };
static const device_config_t midi_input_config[] = { static const device_config_t midi_input_config[] = {
{ {
"midi_input", "MIDI in device", CONFIG_MIDI_IN, "", 0 .name = "midi_input",
.description = "MIDI in device",
.type = CONFIG_MIDI_IN,
.default_string = "",
.default_int = 0
}, },
{ {
"realtime", "MIDI Real time", CONFIG_BINARY, "", 0 .name = "realtime",
.description = "MIDI Real time",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
}, },
{ {
"thruchan", "MIDI Thru", CONFIG_BINARY, "", 1 .name = "thruchan",
.description = "MIDI Thru",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
}, },
{ {
"clockout", "MIDI Clockout", CONFIG_BINARY, "", 1 .name = "clockout",
.description = "MIDI Clockout",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
}, },
{ { .name = "", .description = "", .type = CONFIG_END }
"", "", -1
}
}; };
const device_t rtmidi_output_device = { const device_t rtmidi_output_device = {
SYSTEM_MIDI_NAME, .name = SYSTEM_MIDI_NAME,
SYSTEM_MIDI_INTERNAL_NAME, .internal_name = SYSTEM_MIDI_INTERNAL_NAME,
0, 0, .flags = 0,
rtmidi_output_init, .local = 0,
rtmidi_output_close, .init = rtmidi_output_init,
NULL, .close = rtmidi_output_close,
{ rtmidi_out_get_num_devs }, .reset = NULL,
NULL, { .available = rtmidi_out_get_num_devs },
NULL, .speed_changed = NULL,
system_midi_config .force_redraw = NULL,
.config = system_midi_config
}; };
const device_t rtmidi_input_device = {
const device_t rtmidi_input_device = .name = MIDI_INPUT_NAME,
{ .internal_name = MIDI_INPUT_INTERNAL_NAME,
MIDI_INPUT_NAME, .flags = 0,
MIDI_INPUT_INTERNAL_NAME, .local = 0,
0, 0, .init = rtmidi_input_init,
rtmidi_input_init, .close = rtmidi_input_close,
rtmidi_input_close, .reset = NULL,
NULL, { .available = rtmidi_in_get_num_devs },
{ rtmidi_in_get_num_devs }, .speed_changed = NULL,
NULL, .force_redraw = NULL,
NULL, .config = midi_input_config
midi_input_config
}; };
} }

View File

@@ -982,10 +982,28 @@ adgold_close(void *p)
static const device_config_t adgold_config[] = { static const device_config_t adgold_config[] = {
// clang-format off // clang-format off
{ "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, {
{ "surround", "Surround module", CONFIG_BINARY, "", 1 }, .name = "gameport",
{ "receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 }, .description = "Enable Game port",
{ "", "", -1 } .type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{
.name = "surround",
.description = "Surround module",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{
.name = "receive_input",
.description = "Receive input (MIDI)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };

View File

@@ -2055,46 +2055,54 @@ es1371_speed_changed(void *p)
static const device_config_t es1371_config[] = { static const device_config_t es1371_config[] = {
// clang-format off // clang-format off
{ {
.name = "codec", .name = "codec",
.description = "CODEC", .description = "CODEC",
.type = CONFIG_SELECTION, .type = CONFIG_SELECTION,
.selection = { .selection = {
{ {
.description = "Asahi Kasei AK4540", .description = "Asahi Kasei AK4540",
.value = AC97_CODEC_AK4540 .value = AC97_CODEC_AK4540
}, { },
.description = "Crystal CS4297", {
.value = AC97_CODEC_CS4297 .description = "Crystal CS4297",
}, { .value = AC97_CODEC_CS4297
.description = "Crystal CS4297A", },
.value = AC97_CODEC_CS4297A {
}, { .description = "Crystal CS4297A",
.description = "SigmaTel STAC9708", .value = AC97_CODEC_CS4297A
.value = AC97_CODEC_STAC9708 },
}, { {
.description = "SigmaTel STAC9721", .description = "SigmaTel STAC9708",
.value = AC97_CODEC_STAC9721 .value = AC97_CODEC_STAC9708
} },
}, {
.default_int = AC97_CODEC_CS4297A .description = "SigmaTel STAC9721",
.value = AC97_CODEC_STAC9721
}
},
.default_int = AC97_CODEC_CS4297A
}, },
{ {
"receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 .name = "receive_input",
.description = "Receive input (MIDI)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
}, },
{ { .name = "", .description = "", .type = CONFIG_END }
"", "", -1
}
// clang-format on // clang-format on
}; };
static const device_config_t es1371_onboard_config[] = { static const device_config_t es1371_onboard_config[] = {
// clang-format off // clang-format off
{ {
"receive_input", "Receive input (MIDI)", CONFIG_BINARY, "", 1 .name = "receive_input",
.description = "Receive input (MIDI)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
}, },
{ { .name = "", .description = "", .type = CONFIG_END }
"", "", -1
}
// clang-format on // clang-format on
}; };

View File

@@ -1251,12 +1251,29 @@ static const device_config_t azt1605_config[] = {
.default_int = 0 .default_int = 0
}, },
{ {
"addr", "SB Address", CONFIG_HEX16, "", 0, "", { 0 }, .name = "addr",
{ .description = "SB Address",
{ "0x220", 0x220 }, .type = CONFIG_HEX16,
{ "0x240", 0x240 }, .default_string = "",
{ "Use EEPROM setting", 0 }, .default_int = 0,
{ "" } .file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "0x220",
.value = 0x220
},
{
.description = "0x240",
.value = 0x240
},
{
.description = "Use EEPROM setting",
.value = 0
},
{
.description = ""
}
} }
}, },
{ {
@@ -1328,10 +1345,28 @@ static const device_config_t azt1605_config[] = {
}, },
.default_int = 0 .default_int = 0
}, },
{ "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, {
{ "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, .name = "opl",
{ "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, .description = "Enable OPL",
{ "", "", -1 } .type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{
.name = "receive_input",
.description = "Receive input (SB MIDI)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{
.name = "receive_input401",
.description = "Receive input (MPU-401)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };
@@ -1341,8 +1376,7 @@ static const device_config_t azt2316a_config[] = {
.name = "codec", .name = "codec",
.description = "CODEC", .description = "CODEC",
.type = CONFIG_SELECTION, .type = CONFIG_SELECTION,
.selection = .selection = {
{
{ {
.description = "CS4248", .description = "CS4248",
.value = AD1848_TYPE_CS4248 .value = AD1848_TYPE_CS4248
@@ -1361,20 +1395,36 @@ static const device_config_t azt2316a_config[] = {
.default_int = 0 .default_int = 0
}, },
{ {
"addr", "SB Address", CONFIG_HEX16, "", 0, "", { 0 }, .name = "addr",
{ .description = "SB Address",
{ "0x220", 0x220 }, .type = CONFIG_HEX16,
{ "0x240", 0x240 }, .default_string = "",
{ "Use EEPROM setting", 0 }, .default_int = 0,
{ "" } .file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "0x220",
.value = 0x220
},
{
.description = "0x240",
.value = 0x240
},
{
.description = "Use EEPROM setting",
.value = 0
},
{
.description = ""
}
} }
}, },
{ {
.name = "wss_irq", .name = "wss_irq",
.description = "WSS IRQ", .description = "WSS IRQ",
.type = CONFIG_SELECTION, .type = CONFIG_SELECTION,
.selection = .selection = {
{
{ {
.description = "IRQ 11", .description = "IRQ 11",
.value = 11 .value = 11
@@ -1397,8 +1447,7 @@ static const device_config_t azt2316a_config[] = {
.name = "wss_dma", .name = "wss_dma",
.description = "WSS DMA", .description = "WSS DMA",
.type = CONFIG_SELECTION, .type = CONFIG_SELECTION,
.selection = .selection = {
{
{ {
.description = "DMA 0", .description = "DMA 0",
.value = 0 .value = 0
@@ -1417,10 +1466,28 @@ static const device_config_t azt2316a_config[] = {
}, },
.default_int = 0 .default_int = 0
}, },
{ "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, {
{ "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, .name = "opl",
{ "receive_input401", "Receive input (MPU-401)", CONFIG_BINARY, "", 0 }, .description = "Enable OPL",
{ "", "", -1 } .type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{
.name = "receive_input",
.description = "Receive input (SB MIDI)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{
.name = "receive_input401",
.description = "Receive input (MPU-401)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };

View File

@@ -1446,16 +1446,34 @@ cmi8x38_close(void *priv)
static const device_config_t cmi8x38_config[] = { static const device_config_t cmi8x38_config[] = {
// clang-format off // clang-format off
{ "receive_input", "Receive input (MPU-401)", CONFIG_BINARY, "", 1 }, {
{ "", "", -1 } .name = "receive_input",
.description = "Receive input (MPU-401)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };
static const device_config_t cmi8738_config[] = { static const device_config_t cmi8738_config[] = {
// clang-format off // clang-format off
{ "six_channel", "6CH variant (6-channel)", CONFIG_BINARY, "", 1 }, {
{ "receive_input", "Receive input (MPU-401)", CONFIG_BINARY, "", 1 }, .name = "six_channel",
{ "", "", -1 } .description = "6CH variant (6-channel)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{
.name = "receive_input",
.description = "Receive input (MPU-401)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };

View File

@@ -189,20 +189,44 @@ cms_close(void *p)
static const device_config_t cms_config[] = { static const device_config_t cms_config[] = {
// clang-format off // clang-format off
{ {
"base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, .name = "base",
{ .description = "Address",
{ "0x210", 0x210 }, .type = CONFIG_HEX16,
{ "0x220", 0x220 }, .default_string = "",
{ "0x230", 0x230 }, .default_int = 0x220,
{ "0x240", 0x240 }, .file_filter = "",
{ "0x250", 0x250 }, .spinner = { 0 },
{ "0x260", 0x260 }, .selection = {
{ "" } {
.description = "0x210",
.value = 0x210
},
{
.description = "0x220",
.value = 0x220
},
{
.description = "0x230",
.value = 0x230
},
{
.description = "0x240",
.value = 0x240
},
{
.description = "0x250",
.value = 0x250
},
{
.description = "0x260",
.value = 0x260
},
{
.description = ""
}
} }
}, },
{ { .name = "", .description = "", .type = CONFIG_END }
"", "", -1
}
// clang-format on // clang-format on
}; };

View File

@@ -1204,37 +1204,94 @@ gus_speed_changed(void *p)
static const device_config_t gus_config[] = { static const device_config_t gus_config[] = {
// clang-format off // clang-format off
{ {
"type", "GUS type", CONFIG_SELECTION, "", 0, "", { 0 }, .name = "type",
{ .description = "GUS type",
{ "Classic", GUS_CLASSIC }, .type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "Classic",
.value = GUS_CLASSIC
},
#if defined(DEV_BRANCH) && defined(USE_GUSMAX) #if defined(DEV_BRANCH) && defined(USE_GUSMAX)
{ "MAX", GUS_MAX }, {
.description = "MAX",
.value = GUS_MAX
},
#endif #endif
{ NULL } { NULL }
}, },
}, },
{ {
"base", "Address", CONFIG_HEX16, "", 0x220, "", { 0 }, .name = "base",
{ .description = "Address",
{ "210H", 0x210 }, .type = CONFIG_HEX16,
{ "220H", 0x220 }, .default_string = "",
{ "230H", 0x230 }, .default_int = 0x220,
{ "240H", 0x240 }, .file_filter = "",
{ "250H", 0x250 }, .spinner = { 0 },
{ "260H", 0x260 }, .selection = {
{
.description = "210H",
.value = 0x210
},
{
.description = "220H",
.value = 0x220
},
{
.description = "230H",
.value = 0x230
},
{
.description = "240H",
.value = 0x240
},
{
.description = "250H",
.value = 0x250
},
{
.description = "260H",
.value = 0x260
},
}, },
}, },
{ {
"gus_ram", "Onboard RAM", CONFIG_SELECTION, "", 0, "", { 0 }, .name = "gus_ram",
{ "Onboard RAM",
{ "256 KB", 0 }, .type = CONFIG_SELECTION,
{ "512 KB", 1 }, .default_string = "",
{ "1 MB", 2 }, .default_int = 0,
{ NULL } .file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "256 KB",
.value = 0
},
{
.description = "512 KB",
.value = 1
},
{
.description = "1 MB",
.value = 2
},
{ NULL }
} }
}, },
{ "receive_input", "Receive input (SB MIDI)", CONFIG_BINARY, "", 1 }, {
{ "", "", -1 } .name = "receive_input",
.description = "Receive input (SB MIDI)",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format off // clang-format off
}; };

View File

@@ -1806,30 +1806,87 @@ mpu401_standalone_close(void *priv)
static const device_config_t mpu401_standalone_config[] = { static const device_config_t mpu401_standalone_config[] = {
// clang-format off // clang-format off
{ {
"base", "MPU-401 Address", CONFIG_HEX16, "", 0x330, "", { 0 }, .name = "base",
{ .description = "MPU-401 Address",
{ "0x220", 0x220 }, .type = CONFIG_HEX16,
{ "0x230", 0x230 }, .default_string = "",
{ "0x240", 0x240 }, .default_int = 0x330,
{ "0x250", 0x250 }, .file_filter = "",
{ "0x300", 0x300 }, .spinner = { 0 },
{ "0x320", 0x320 }, .selection = {
{ "0x330", 0x330 }, {
{ "0x340", 0x340 }, .description = "0x220",
{ "0x350", 0x350 }, .value = 0x220
{ "" } },
{
.description = "0x230",
.value = 0x230
},
{
.description = "0x240",
.value = 0x240
},
{
.description = "0x250",
.value = 0x250
},
{
.description = "0x300",
.value = 0x300
},
{
.description = "0x320",
.value = 0x320
},
{
.description = "0x330",
.value = 0x330
},
{
.description = "0x340",
.value = 0x340
},
{
.description = "0x350",
.value = 0x350
},
{ .description = "" }
} }
}, },
{ {
"irq", "MPU-401 IRQ", CONFIG_SELECTION, "", 2, "", { 0 }, .name = "irq",
{ .description = "MPU-401 IRQ",
{ "IRQ 2", 2 }, .type = CONFIG_SELECTION,
{ "IRQ 3", 3 }, .default_string = "",
{ "IRQ 4", 4 }, .default_int = 2,
{ "IRQ 5", 5 }, .file_filter = "",
{ "IRQ 6", 6 }, .spinner = { 0 },
{ "IRQ 7", 7 }, .selection = {
{ "" } {
.description = "IRQ 2",
.value = 2
},
{
.description = "IRQ 3",
.value = 3
},
{
.description = "IRQ 4",
.value = 4
},
{
.description = "IRQ 5",
.value = 5
},
{
.description = "IRQ 6",
.value = 6
},
{
.description = "IRQ 7",
.value = 7
},
{ .description = "" }
} }
}, },
{ {
@@ -1838,7 +1895,7 @@ static const device_config_t mpu401_standalone_config[] = {
.type = CONFIG_BINARY, .type = CONFIG_BINARY,
.default_int = 1 .default_int = 1
}, },
{ "", "", -1 } { .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };
@@ -1850,9 +1907,7 @@ static const device_config_t mpu401_standalone_mca_config[] = {
.type = CONFIG_BINARY, .type = CONFIG_BINARY,
.default_int = 1 .default_int = 1
}, },
{ { .name = "", .description = "", .type = CONFIG_END }
"", "", -1
}
// clang-format on // clang-format on
}; };

View File

@@ -239,15 +239,30 @@ pssj_close(void *p)
static const device_config_t pssj_isa_config[] = { static const device_config_t pssj_isa_config[] = {
// clang-format off // clang-format off
{ {
"base", "Address", CONFIG_HEX16, "", 0x2C0, "", { 0 }, .name = "base",
{ .description = "Address",
{ "0x0C0", 0x0C0 }, .type = CONFIG_HEX16,
{ "0x1E0", 0x1E0 }, .default_string = "",
{ "0x2C0", 0x2C0 }, .default_int = 0x2C0,
{ "" } .file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "0x0C0",
.value = 0x0C0
},
{
.description = "0x1E0",
.value = 0x1E0
},
{
.description = "0x2C0",
.value = 0x2C0
},
{ .description = "" }
} }
}, },
{ "", "", -1 } { .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };
#endif #endif
@@ -277,7 +292,7 @@ const device_t pssj_1e0_device = {
{ .available = NULL }, { .available = NULL },
.speed_changed = NULL, .speed_changed = NULL,
.force_redraw = NULL, .force_redraw = NULL,
.config = NULL .config = NULL
}; };
#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) #if defined(DEV_BRANCH) && defined(USE_TANDY_ISA)

File diff suppressed because it is too large Load Diff

View File

@@ -247,15 +247,30 @@ sn76489_device_close(void *p)
static const device_config_t tndy_config[] = { static const device_config_t tndy_config[] = {
// clang-format off // clang-format off
{ {
"base", "Address", CONFIG_HEX16, "", 0x0C0, "", { 0 }, .name = "base",
{ .description = "Address",
{ "0x0C0", 0x0C0 }, .type = CONFIG_HEX16,
{ "0x1E0", 0x1E0 }, .default_string = "",
{ "0x2C0", 0x2C0 }, .default_int = 0x0C0,
{ "" } .file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "0x0C0",
.value = 0x0C0
},
{
.description = "0x1E0",
.value = 0x1E0
},
{
.description = "0x2C0",
.value = 0x2C0
},
{ .description = "" }
} }
}, },
{ "", "", -1 } { .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };
#endif #endif

View File

@@ -92,13 +92,32 @@ ssi2001_close(void *p)
static const device_config_t ssi2001_config[] = { static const device_config_t ssi2001_config[] = {
// clang-format off // clang-format off
{ "base", "Address", CONFIG_HEX16, "", 0x280, "", { 0 }, {
{ .name = "base",
{ "0x280", 0x280 }, .description = "Address",
{ "0x2A0", 0x2A0 }, .type = CONFIG_HEX16,
{ "0x2C0", 0x2C0 }, .default_string = "",
{ "0x2E0", 0x2E0 }, .default_int = 0x280,
{ "" } .file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "0x280",
.value = 0x280
},
{
.description = "0x2A0",
.value = 0x2A0
},
{
.description = "0x2C0",
.value = 0x2C0
},
{
.description = "0x2E0",
.value = 0x2E0
},
{ .description = "" }
} }
}, },
{ "gameport", "Enable Game port", CONFIG_BINARY, "", 1 }, { "gameport", "Enable Game port", CONFIG_BINARY, "", 1 },

View File

@@ -228,17 +228,42 @@ wss_speed_changed(void *priv)
static const device_config_t wss_config[] = { static const device_config_t wss_config[] = {
// clang-format off // clang-format off
{ "base", "Address", CONFIG_HEX16, "", 0x530, "", { 0 }, {
{ .name = "base",
{ "0x530", 0x530 }, .description = "Address",
{ "0x604", 0x604 }, .type = CONFIG_HEX16,
{ "0xe80", 0xe80 }, .default_string = "",
{ "0xf40", 0xf40 }, .default_int = 0x530,
{ "" } .file_filter = "",
.spinner = { 0 },
.selection = {
{
.description = "0x530",
.value = 0x530
},
{
.description = "0x604",
.value = 0x604
},
{
.description = "0xe80",
.value = 0xe80
},
{
.description = "0xf40",
.value = 0xf40
},
{ .description = "" }
} }
}, },
{ "opl", "Enable OPL", CONFIG_BINARY, "", 1 }, {
{ "", "", -1 } .name = "opl",
.description = "Enable OPL",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on // clang-format on
}; };