mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
core z80, fix cycle counting in reset state
This commit is contained in:
parent
c7661b80ef
commit
db2b6d9966
5 changed files with 6 additions and 7 deletions
|
@ -389,7 +389,7 @@ void PDebugZ80Frame(void)
|
|||
else
|
||||
lines = 262;
|
||||
|
||||
z80_resetCycles();
|
||||
z80_resetCycles(Pico.t.z80c_aim);
|
||||
PsndStartFrame();
|
||||
|
||||
if (/*Pico.m.z80Run &&*/ !Pico.m.z80_reset && (PicoIn.opt&POPT_EN_Z80)) {
|
||||
|
|
|
@ -72,8 +72,6 @@ void PicoPower(void)
|
|||
memset(&Pico.m,0,sizeof(Pico.m));
|
||||
memset(&Pico.t,0,sizeof(Pico.t));
|
||||
|
||||
z80_reset();
|
||||
|
||||
// my MD1 VA6 console has this in IO
|
||||
PicoMem.ioports[1] = PicoMem.ioports[2] = PicoMem.ioports[3] = 0xff;
|
||||
|
||||
|
@ -169,6 +167,7 @@ int PicoReset(void)
|
|||
|
||||
memset(&PicoIn.padInt, 0, sizeof(PicoIn.padInt));
|
||||
|
||||
z80_reset();
|
||||
if (PicoIn.AHW & PAHW_SMS) {
|
||||
PicoResetMS();
|
||||
return 0;
|
||||
|
|
|
@ -141,8 +141,8 @@ static int PicoFrameHints(void)
|
|||
|
||||
skip = PicoIn.skipFrame;
|
||||
|
||||
z80_resetCycles(cycles_68k_to_z80(Pico.t.m68c_aim - Pico.t.m68c_frame_start));
|
||||
Pico.t.m68c_frame_start = Pico.t.m68c_aim;
|
||||
z80_resetCycles();
|
||||
PsndStartFrame();
|
||||
|
||||
hint = pv->hint_cnt;
|
||||
|
|
|
@ -201,8 +201,8 @@ extern struct DrZ80 drZ80;
|
|||
|
||||
#define Z80_STATE_SIZE 0x60
|
||||
|
||||
#define z80_resetCycles() \
|
||||
Pico.t.z80c_cnt -= Pico.t.z80c_aim, Pico.t.z80c_aim = Pico.t.z80_scanline = 0
|
||||
#define z80_resetCycles(aim) \
|
||||
Pico.t.z80c_cnt -= (aim < Pico.t.z80c_cnt ? aim : Pico.t.z80c_cnt), Pico.t.z80c_aim = Pico.t.z80_scanline = 0
|
||||
|
||||
#define z80_cyclesDone() \
|
||||
(Pico.t.z80c_aim - z80_cyclesLeft)
|
||||
|
|
|
@ -846,7 +846,7 @@ void PicoFrameMS(void)
|
|||
int nmi;
|
||||
int y;
|
||||
|
||||
z80_resetCycles();
|
||||
z80_resetCycles(Pico.t.z80c_aim);
|
||||
PsndStartFrame();
|
||||
|
||||
// for SMS the pause button generates an NMI, for GG ths is not the case
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue