[Core/CPU] fixed Z80 interrupt duration (fixes music running too fast in Bomb on Basic City homebrew)

This commit is contained in:
EkeEke 2016-08-16 00:02:33 +02:00
parent fa8929eb3d
commit 446d9aa61f
5 changed files with 8 additions and 34 deletions

View File

@ -74,6 +74,8 @@ Genesis Plus GX 1.7.5 (xx/xx/xxxx) (Eke-Eke)
[Core/CPU] [Core/CPU]
--------------- ---------------
* improved 68k auto-vectored interrupts acknowledge cycle timing accuracy (Bubsy background color corruption during cutscenes)
* fixed Z80 interrupt duration (Bomb on Basic City music running too fast)
* fixed Z80 SP register initialization on power-on for Master System & Game Gear * fixed Z80 SP register initialization on power-on for Master System & Game Gear
(Ace of Aces, Shadow Dancer, Ecco the Dolphin, Evander Holyfield Real Deal Boxing) (Ace of Aces, Shadow Dancer, Ecco the Dolphin, Evander Holyfield Real Deal Boxing)

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 MiB

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

@ -517,6 +517,9 @@ void system_frame_gen(int do_skip)
Z80.cycles = MCYCLES_PER_LINE; Z80.cycles = MCYCLES_PER_LINE;
} }
/* Z80 interrupt is cleared at the end of the line */
Z80.irq_state = CLEAR_LINE;
/* run SVP chip */ /* run SVP chip */
if (svp) if (svp)
{ {
@ -548,23 +551,6 @@ void system_frame_gen(int do_skip)
/* update 6-Buttons & Lightguns */ /* update 6-Buttons & Lightguns */
input_refresh(); input_refresh();
if (Z80.irq_state)
{
/* Z80 interrupt is asserted for exactly one line */
m68k_run(mcycles_vdp + 788);
if (zstate == 1)
{
z80_run(mcycles_vdp + 788);
}
else
{
Z80.cycles = mcycles_vdp + 788;
}
/* clear Z80 interrupt */
Z80.irq_state = CLEAR_LINE;
}
/* run 68k & Z80 until end of line */ /* run 68k & Z80 until end of line */
m68k_run(mcycles_vdp + MCYCLES_PER_LINE); m68k_run(mcycles_vdp + MCYCLES_PER_LINE);
if (zstate == 1) if (zstate == 1)
@ -888,6 +874,9 @@ void system_frame_scd(int do_skip)
Z80.cycles = MCYCLES_PER_LINE; Z80.cycles = MCYCLES_PER_LINE;
} }
/* Z80 interrupt is cleared at the end of the line */
Z80.irq_state = CLEAR_LINE;
/* update VDP cycle count */ /* update VDP cycle count */
mcycles_vdp = MCYCLES_PER_LINE; mcycles_vdp = MCYCLES_PER_LINE;
@ -913,23 +902,6 @@ void system_frame_scd(int do_skip)
/* update 6-Buttons & Lightguns */ /* update 6-Buttons & Lightguns */
input_refresh(); input_refresh();
if (Z80.irq_state)
{
/* Z80 interrupt is asserted for exactly one line */
m68k_run(mcycles_vdp + 788);
if (zstate == 1)
{
z80_run(mcycles_vdp + 788);
}
else
{
Z80.cycles = mcycles_vdp + 788;
}
/* clear Z80 interrupt */
Z80.irq_state = CLEAR_LINE;
}
/* run both 68k & CD hardware until end of line */ /* run both 68k & CD hardware until end of line */
scd_update(mcycles_vdp + MCYCLES_PER_LINE); scd_update(mcycles_vdp + MCYCLES_PER_LINE);