X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=pico%2F32x%2Fmemory.c;h=a958737c063408a72aa01ff4d37d824a659d9784;hb=2368651527f2b14e24b7df5f7db3d95dc5bfbd3a;hp=999a060fcc59450edf2afa830f83ae818d09d42d;hpb=b081408f66662068a3d274f696bdabba5186b68e;p=picodrive.git diff --git a/pico/32x/memory.c b/pico/32x/memory.c index 999a060..a958737 100644 --- a/pico/32x/memory.c +++ b/pico/32x/memory.c @@ -341,6 +341,9 @@ static void p32x_vdp_write8(u32 a, u32 d) Pico32x.dirty_pal = 1; r[0] = (r[0] & P32XV_nPAL) | (d & 0xff); break; + case 0x03: // shift (for pp mode) + r[2 / 2] = d & 1; + break; case 0x05: // fill len r[4 / 2] = d & 0xff; break; @@ -1050,8 +1053,9 @@ static int REGPARM(3) sh2_write8_cs0(u32 a, u32 d, int id) return sh2_write8_unmapped(a, d, id); } +/* quirk: in both normal and overwrite areas only nonzero values go through */ #define sh2_write8_dramN(n) \ - if (!(a & 0x20000) || d) { \ + if ((d & 0xff) != 0) { \ u8 *dram = (u8 *)Pico32xMem->dram[n]; \ dram[(a & 0x1ffff) ^ 1] = d; \ } \ @@ -1517,8 +1521,8 @@ void PicoMemSetup32x(void) msh2.read8_map = ssh2.read8_map = sh2_read8_map; msh2.read16_map = ssh2.read16_map = sh2_read16_map; - msh2.write8_tab = ssh2.write8_tab = (const void **)sh2_write8_map; - msh2.write16_tab = ssh2.write16_tab = (const void **)sh2_write16_map; + msh2.write8_tab = ssh2.write8_tab = (const void **)(void *)sh2_write8_map; + msh2.write16_tab = ssh2.write16_tab = (const void **)(void *)sh2_write16_map; // setup poll detector m68k_poll.flag = P32XF_68KPOLL; @@ -1527,6 +1531,11 @@ void PicoMemSetup32x(void) sh2_poll[0].cyc_max = 21; sh2_poll[1].flag = P32XF_SSH2POLL; sh2_poll[1].cyc_max = 16; + +#ifdef DRC_SH2 + sh2_drc_mem_setup(&msh2); + sh2_drc_mem_setup(&ssh2); +#endif } // vim:shiftwidth=2:expandtab