Only set SP register to 0xDFF0 if emulated system has BIOS.

Game Gear, Mark 3 and Japanese SMS have no BIOS and thus,
we do not need to set the SP register.
We also don't need to set it if BIOS mode is enabled.
This commit is contained in:
gameblabla 2021-10-30 19:16:09 +02:00
parent 5bef1e2427
commit 7423b37d26
No known key found for this signature in database
GPG Key ID: 55F5ECF22285E516

View File

@ -3399,7 +3399,19 @@ void z80_init(int32_t (*irqcallback)(int32_t))
IX = IY = 0xffff; /* IX and IY are FFFF after a reset! */
F = ZF; /* Zero flag is set */
SP = 0xdff0; /* fix Shadow Dancer & Ace of Aces (normally set by BIOS) */
/* 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.
* TODO : Watch Colecovision BIOS */
if (sms.territory == TERRITORY_EXPORT && IS_SMS && bios.enabled == 0)
{
/* Fix Shadow Dancer & Ace of Aces (normally set by BIOS)
* Shadow Dancer will black screen on boot without this. */
SP = 0xdff0;
}
else
{
SP = 0;
}
/* setup cycle tables */
cc[Z80_TABLE_op] = cc_op;