Cleanup the fix.

This commit is contained in:
TC1995
2025-07-10 01:57:23 +02:00
parent dbbc49dc17
commit ef17a9f3f2
2 changed files with 6 additions and 2 deletions

View File

@@ -306,6 +306,9 @@ gameport_remap(void *priv, uint16_t address)
gameport_t *dev = (gameport_t *) priv;
gameport_t *other_dev;
if (dev == NULL)
return;
if (dev->addr) {
/* Remove this port from the active ports list. */
if (active_gameports == dev) {

View File

@@ -1152,8 +1152,9 @@ sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *priv)
else if ((val & 0x06) == 0x02)
mpu401_change_addr(sb->mpu, 0);
}
sb->gameport_addr = 0;
if (sb->gameport != NULL) {
sb->gameport_addr = 0;
gameport_remap(sb->gameport, 0);
if (!(val & 0x01)) {
sb->gameport_addr = 0x200;
@@ -1373,7 +1374,7 @@ sb_ct1745_mixer_read(uint16_t addr, void *priv)
else
ret = 0x06; /* Should never happen. */
}
if (!sb->gameport_addr && (sb->gameport != NULL))
if (!sb->gameport_addr)
ret |= 0x01;
break;