[Core/MCD] fixed state loading bug when SUB-CPU interrupt is pending

This commit is contained in:
EkeEke 2014-10-23 23:37:50 +02:00
parent 07677550fe
commit aabd7f8c2b
4 changed files with 6 additions and 3 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

View File

@ -1448,7 +1448,7 @@ int scd_context_load(uint8 *state)
{
int i;
uint16 tmp16;
uint32 tmp32;
uint32 tmp32, int_level;
int bufferptr = 0;
/* internal harware */
@ -1608,9 +1608,9 @@ int scd_context_load(uint8 *state)
load_param(&tmp16, 2);
*(uint16 *)(m68k.memory_map[scd.cartridge.boot].base + 0x72) = tmp16;
/* SUB-CPU internal state */
/* SUB-CPU internal state (NB: IRQ level should remain reseted to prevent spurious interrupt processing when SP register is restored) */
load_param(&s68k.cycles, sizeof(s68k.cycles));
load_param(&s68k.int_level, sizeof(s68k.int_level));
load_param(&int_level, sizeof(s68k.int_level));
load_param(&s68k.stopped, sizeof(s68k.stopped));
/* SUB-CPU registers */
@ -1635,6 +1635,9 @@ int scd_context_load(uint8 *state)
load_param(&tmp32, 4); s68k_set_reg(M68K_REG_USP,tmp32);
load_param(&tmp32, 4); s68k_set_reg(M68K_REG_ISP,tmp32);
/* restore IRQ level */
s68k.int_level = int_level;
/* bootable MD cartridge hardware */
if (scd.cartridge.boot)
{