From: kub Date: Fri, 2 Apr 2021 19:57:08 +0000 (+0200) Subject: 32x, fix speed regression (wt memory write optimization) X-Git-Tag: v2.00~563 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6138c4df25f371572591d499d5cf75e1c6e38d5d;p=picodrive.git 32x, fix speed regression (wt memory write optimization) --- diff --git a/pico/32x/memory.c b/pico/32x/memory.c index fe9ae57d..5ef6bca3 100644 --- a/pico/32x/memory.c +++ b/pico/32x/memory.c @@ -1690,16 +1690,21 @@ static void REGPARM(3) sh2_write8_da(u32 a, u32 d, SH2 *sh2) } #endif +static NOINLINE void REGPARM(3) sh2_write8_sdram_sync(u32 a, u32 d, SH2 *sh2) +{ + DRC_SAVE_SR(sh2); + sh2_end_run(sh2, 32); + DRC_RESTORE_SR(sh2); + sh2_write8_sdram(a, d, sh2); +} + static void REGPARM(3) sh2_write8_sdram_wt(u32 a, u32 d, SH2 *sh2) { // xmen sync hack.. - if (a < 0x26000200) { - DRC_SAVE_SR(sh2); - sh2_end_run(sh2, 32); - DRC_RESTORE_SR(sh2); - } - - sh2_write8_sdram(a, d, sh2); + if ((a << 8) >> 17) // ((a & 0x00ffffff) < 0x200) + sh2_write8_sdram(a, d, sh2); + else + sh2_write8_sdram_sync(a, d, sh2); } // write16