YM2151: fix swapped arguments to set_connect when loading a save state (#2041)

ym2151_postload_refresh called set_connect(op, connect[j], j), but
set_connect takes the channel first and the algorithm second, as the
register write path does (set_connect(op, r&7, v&7)). After loading a
state every FM channel was rebuilt with the wrong algorithm until the
game wrote that register again (X-Men's music played wrong for a few
seconds after a load).
This commit is contained in:
Federico Pereira
2026-10-07 01:39:18 -04:00
committed by GitHub
parent a0ab0427b9
commit b52156ee5d
+1 -1
View File
@@ -1396,7 +1396,7 @@ static void ym2151_postload_refresh(void)
{
for (j=0; j<8; j++)
{
set_connect(&YMPSG[i].oper[j*4], YMPSG[i].connect[j], j);
set_connect(&YMPSG[i].oper[j*4], j, YMPSG[i].connect[j]);
}
}
}