fix SID emulation logic, add some UI elements for SID config

This commit is contained in:
Kotori
2025-06-29 09:57:19 +02:00
parent 8b77e14712
commit 6ba5dc107b
2 changed files with 38 additions and 6 deletions

View File

@@ -72,7 +72,7 @@ ssi2001_init(UNUSED(const device_t *info))
{
ssi2001_t *ssi2001 = calloc(1, sizeof(ssi2001_t));
ssi2001->psid = sid_init(0);
ssi2001->psid = sid_init(device_get_config_int("sid_config"),device_get_config_int("sid_adjustment"));
sid_reset(ssi2001->psid);
uint16_t addr = device_get_config_hex16("base");
ssi2001->gameport_enabled = device_get_config_int("gameport");
@@ -112,7 +112,7 @@ entertainer_init(UNUSED(const device_t *info))
ssi2001_t *ssi2001 = calloc(1, sizeof(ssi2001_t));
entertainer_t *entertainer = calloc(1, sizeof(entertainer_t));
ssi2001->psid = sid_init(0);
ssi2001->psid = sid_init(0, 0.5);
sid_reset(ssi2001->psid);
ssi2001->gameport_enabled = device_get_config_int("gameport");
io_sethandler(0x200, 0x0001, entertainer_read, NULL, NULL, entertainer_write, NULL, NULL, entertainer);
@@ -163,6 +163,33 @@ static const device_config_t ssi2001_config[] = {
.selection = { { 0 } },
.bios = { { 0 } }
},
{
.name = "sid_config",
.description = "SID Model",
.type = CONFIG_HEX16,
.default_string = NULL,
.default_int = 0x000,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "8580", .value = 0x001 },
{ .description = "6581", .value = 0x000 },
{ .description = "" }
},
.bios = { { 0 } }
},
{
.name = "sid_adjustment",
.description = "SID Filter Strength",
.type = CONFIG_STRING,
.default_string = "0.5",
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {{"0.5"}},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format off
};