Added alternate Tandy PSSJ I/O port at 1E0h (used in Tandy 1000 RSX)

This commit is contained in:
Ompronce
2021-10-17 23:37:10 -04:00
committed by GitHub
parent bd9b6766b7
commit a041469ff8

View File

@@ -201,6 +201,20 @@ void *pssj_init(const device_t *info)
return pssj;
}
void *pssj_1e0_init(const device_t *info)
{
pssj_t *pssj = malloc(sizeof(pssj_t));
memset(pssj, 0, sizeof(pssj_t));
sn76489_init(&pssj->sn76489, 0x01e0, 0x0004, PSSJ, 3579545);
io_sethandler(0x01E4, 0x0004, pssj_read, NULL, NULL, pssj_write, NULL, NULL, pssj);
timer_add(&pssj->timer_count, pssj_callback, pssj, pssj->enable);
sound_add_handler(pssj_get_buffer, pssj);
return pssj;
}
void pssj_close(void *p)
{
pssj_t *pssj = (pssj_t *)p;
@@ -219,3 +233,15 @@ const device_t pssj_device =
NULL,
NULL
};
const device_t pssj_1e0_device =
{
"Tandy PSSJ (port 1e0h)",
0, 0,
pssj_1e0_init,
pssj_close,
NULL,
{ NULL },
NULL,
NULL
};