Make sure to 0 IX/IY for consoles other than the Master System.

This commit is contained in:
gameblabla 2021-11-05 22:48:09 +01:00
parent 5e95bb0be5
commit ff3b3dcf67
No known key found for this signature in database
GPG Key ID: 55F5ECF22285E516

View File

@ -3446,8 +3446,20 @@ void z80_init(int32_t (*irqcallback)(int32_t))
WZ = 0;
memset(&Z80, 0, sizeof(Z80));
Z80.irq_callback = irqcallback;
IX = IY = 0xffff; /* IX and IY are FFFF after a reset! */
/* TODO
* For Colecovision, we need to check for the Z80 registers.
* Unfortunately, there are not a lot of test ROMs for the Colecovision.
*/
if (sms.console < CONSOLE_SMS)
{
/* For SG-1000, Colecovision, it should be 0. */
IX = IY = 0;
}
else
{
IX = IY = 0xffff; /* IX and IY are FFFF after a reset! */
}
F = ZF; /* Zero flag is set */
/* Because this is only affecting systems with an actual BIOS, we need to make sure it only sets it in such cases.
* This code should not affect the SG-1000, Mark3 either.