rework sr

note to self:

h32 0x10A .. 0x127 0x1D2 .. 0x1FF 0x000 .. 0x109
pclk      30      |      46      |      266      = 342
hbset       0x126        ...       0x009
pclk   29  |      1   +  46    +  10    |  256
mclk   290 |           570              |  2560  = 3420
68kclk 41.4            81.4               365.7 ~= 488.5

h40 0x14A .. 0x16C 0x1C9 .. 0x1FF 0x000 .. 0x149
pclk      35      |      55      |      330      = 420
hbset       0x166        ...       0x00A
pclk   28  |      7   +  55    +  11    |  319
mclk  28*8 | 7*8   4*8+314+10+(18+11)*8 | 319*8  = 3420
68kclk  32             92                 364.5 ~= 488.5
This commit is contained in:
notaz 2017-10-10 01:13:48 +03:00
parent 22814963cc
commit 0e4bde9b2d
5 changed files with 33 additions and 32 deletions

View file

@ -108,7 +108,7 @@ static int PicoFrameHints(void)
}
else skip=PicoSkipFrame;
Pico.t.m68c_frame_start = SekCyclesDone();
Pico.t.m68c_frame_start = Pico.t.m68c_aim;
pv->v_counter = Pico.m.scanline = 0;
z80_resetCycles();
PsndStartFrame();
@ -170,7 +170,7 @@ static int PicoFrameHints(void)
}
// Run scanline:
Pico.t.m68c_line_start = SekCyclesDone();
Pico.t.m68c_line_start = Pico.t.m68c_aim;
do_timing_hacks_as(pv, vdp_slots);
CPUS_RUN(CYCLES_M68K_LINE);
@ -205,16 +205,17 @@ static int PicoFrameHints(void)
do_hint(pv);
}
pv->status |= SR_VB; // go into vblank
pv->status |= SR_VB | PVS_VB2; // go into vblank
// the following SekRun is there for several reasons:
// there must be a delay after vblank bit is set and irq is asserted (Mazin Saga)
// also delay between F bit (bit 7) is set in SR and IRQ happens (Ex-Mutants)
// also delay between last H-int and V-int (Golden Axe 3)
Pico.t.m68c_line_start = SekCyclesDone();
Pico.t.m68c_line_start = Pico.t.m68c_aim;
do_timing_hacks_vb();
CPUS_RUN(CYCLES_M68K_VINT_LAG);
pv->status |= SR_F;
pv->pending_ints |= 0x20;
if (pv->reg[1] & 0x20) {
Pico.t.m68c_aim = Pico.t.m68c_cnt + 11; // HACK
@ -278,7 +279,7 @@ static int PicoFrameHints(void)
}
// Run scanline:
Pico.t.m68c_line_start = SekCyclesDone();
Pico.t.m68c_line_start = Pico.t.m68c_aim;
do_timing_hacks_vb();
CPUS_RUN(CYCLES_M68K_LINE);
@ -286,7 +287,8 @@ static int PicoFrameHints(void)
pevt_log_m68k_o(EVT_NEXT_LINE);
}
pv->status &= ~SR_VB;
pv->status &= ~(SR_VB | PVS_VB2);
pv->status |= ((pv->reg[1] >> 3) ^ SR_VB) & SR_VB; // forced blanking
// last scanline
Pico.m.scanline = y;
@ -302,7 +304,7 @@ static int PicoFrameHints(void)
}
// Run scanline:
Pico.t.m68c_line_start = SekCyclesDone();
Pico.t.m68c_line_start = Pico.t.m68c_aim;
do_timing_hacks_as(pv, vdp_slots);
CPUS_RUN(CYCLES_M68K_LINE);