From: kub Date: Wed, 7 Apr 2021 20:31:00 +0000 (+0200) Subject: 32x, scheduling optimization X-Git-Tag: v2.00~560 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bb230c7ec944855974b44278f44a663aa804dad;p=picodrive.git 32x, scheduling optimization --- diff --git a/pico/32x/32x.c b/pico/32x/32x.c index bf3c9ec0..e75a2775 100644 --- a/pico/32x/32x.c +++ b/pico/32x/32x.c @@ -56,14 +56,14 @@ void p32x_update_irls(SH2 *active_sh2, unsigned int m68k_cycles) if (mrun) { p32x_sh2_poll_event(&msh2, SH2_IDLE_STATES, m68k_cycles); if (msh2.state & SH2_STATE_RUN) - sh2_end_run(&msh2, 1); + sh2_end_run(&msh2, 0); } srun = sh2_irl_irq(&ssh2, slvl, ssh2.state & SH2_STATE_RUN); if (srun) { p32x_sh2_poll_event(&ssh2, SH2_IDLE_STATES, m68k_cycles); if (ssh2.state & SH2_STATE_RUN) - sh2_end_run(&ssh2, 1); + sh2_end_run(&ssh2, 0); } elprintf(EL_32X, "update_irls: m %d/%d, s %d/%d", mlvl, mrun, slvl, srun); @@ -328,7 +328,7 @@ void p32x_event_schedule_sh2(SH2 *sh2, enum p32x_event event, int after) left_to_next = C_M68K_TO_SH2(sh2, (int)(event_time_next - now)); if (sh2_cycles_left(sh2) > left_to_next) { if (left_to_next < 1) - left_to_next = 1; + left_to_next = 0; sh2_end_run(sh2, left_to_next); } } @@ -421,7 +421,7 @@ void p32x_sync_other_sh2(SH2 *sh2, unsigned int m68k_target) left_to_event = C_M68K_TO_SH2(sh2, (int)(event_time_next - m68k_target)); if (sh2_cycles_left(sh2) > left_to_event) { if (left_to_event < 1) - left_to_event = 1; + left_to_event = 0; sh2_end_run(sh2, left_to_event); } } diff --git a/pico/32x/memory.c b/pico/32x/memory.c index 5ef6bca3..0bdf2eb8 100644 --- a/pico/32x/memory.c +++ b/pico/32x/memory.c @@ -126,7 +126,7 @@ void NOINLINE p32x_sh2_poll_detect(u32 a, SH2 *sh2, u32 flags, int maxcnt) sh2->state, sh2->state | flags); sh2->state |= flags; - sh2_end_run(sh2, 1); + sh2_end_run(sh2, 0); pevt_log_sh2(sh2, EVT_POLL_START); #ifdef DRC_SH2 // mark this as an address used for polling if SDRAM @@ -855,7 +855,7 @@ static void p32x_sh2reg_write8(u32 a, u32 d, SH2 *sh2) p32x_m68k_poll_event(P32XF_68KCPOLL); p32x_sh2_poll_event(sh2->other_sh2, SH2_STATE_CPOLL, cycles); if (p32x_sh2_ready(sh2->other_sh2, cycles+8)) - sh2_end_run(sh2, 1); + sh2_end_run(sh2, 0); sh2_poll_write(a & ~1, r[a / 2], cycles, sh2); } return; @@ -948,7 +948,7 @@ static void p32x_sh2reg_write16(u32 a, u32 d, SH2 *sh2) p32x_m68k_poll_event(P32XF_68KCPOLL); p32x_sh2_poll_event(sh2->other_sh2, SH2_STATE_CPOLL, cycles); if (p32x_sh2_ready(sh2->other_sh2, cycles+8)) - sh2_end_run(sh2, 1); + sh2_end_run(sh2, 0); sh2_poll_write(a, d, cycles, sh2); } return; @@ -1583,7 +1583,7 @@ static void sh2_sdram_poll(u32 a, u32 d, SH2 *sh2) sh2_poll_write(a, d, cycles, sh2); p32x_sh2_poll_event(sh2->other_sh2, SH2_STATE_RPOLL, cycles); if (p32x_sh2_ready(sh2->other_sh2, cycles+8)) - sh2_end_run(sh2, 1); + sh2_end_run(sh2, 0); DRC_RESTORE_SR(sh2); }