Skip to content

Commit

Permalink
32x, fix speed regression (wt memory write optimization)
Browse files Browse the repository at this point in the history
  • Loading branch information
irixxxx committed Apr 2, 2021
1 parent bac4eb5 commit 6138c4d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions pico/32x/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6138c4d

Please sign in to comment.