X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fcarthw%2Fsvp%2Fssp16.c;h=ea0529f1f60c6f508854b3d4e6e4d1d8707e5515;hb=d274c33b6b4607f0bf2361610a1e53fd1dd04195;hp=3288ee3c344aa70d867ac0d352798e0946d57012;hpb=726bbb3e08e3d4e7ed086a3c98dec0e21a386d75;p=picodrive.git diff --git a/Pico/carthw/svp/ssp16.c b/Pico/carthw/svp/ssp16.c index 3288ee3..ea0529f 100644 --- a/Pico/carthw/svp/ssp16.c +++ b/Pico/carthw/svp/ssp16.c @@ -332,7 +332,10 @@ } -static ssp1601_t *ssp = NULL; +#ifndef EMBED_INTERPRETER +static +#endif +ssp1601_t *ssp = NULL; static unsigned short *PC; static int g_cycles; @@ -340,6 +343,9 @@ static int g_cycles; static int running = 0; static int last_iram = 0; #endif +#ifdef EMBED_INTERPRETER +static int iram_dirty = 0; +#endif // ----------------------------------------------------- // register i/o handlers @@ -440,7 +446,7 @@ static u32 pm_io(int reg, int write, u32 d) elprintf(EL_SVP, "PM%i (%c) set to %08x @ %04x", reg, write ? 'w' : 'r', rPMC.v, GET_PPC_OFFS()); ssp->pmac_read[write ? reg + 6 : reg] = rPMC.v; ssp->emu_status &= ~SSP_PMC_SET; - if ((rPMC.h & 0x7f) == 0x1c && (rPMC.l & 0x7fff) == 0) { + if ((rPMC.v & 0x7fffff) == 0x1c8000 || (rPMC.v & 0x7fffff) == 0x1c8240) { elprintf(EL_SVP, "ssp IRAM copy from %06x", (ssp->RAM1[0]-1)<<1); #ifdef USE_DEBUGGER last_iram = (ssp->RAM1[0]-1)<<1; @@ -493,6 +499,9 @@ static u32 pm_io(int reg, int write, u32 d) elprintf(EL_SVP, "ssp IRAM w [%06x] %04x (inc %i)", (addr<<1)&0x7ff, d, inc); ((unsigned short *)svp->iram_rom)[addr&0x3ff] = d; ssp->pmac_write[reg] += inc; +#ifdef EMBED_INTERPRETER + iram_dirty = 1; +#endif } else { @@ -878,7 +887,7 @@ static u32 ptr2_read(int op) // ----------------------------------------------------- -#if defined(USE_DEBUGGER) // || defined(EMBED_INTERPRETER) +#if defined(USE_DEBUGGER) //|| defined(EMBED_INTERPRETER) static void debug_dump2file(const char *fname, void *mem, int len) { FILE *f = fopen(fname, "wb"); @@ -981,9 +990,6 @@ static void debug(unsigned int pc, unsigned int op) #endif // USE_DEBUGGER -#ifdef EMBED_INTERPRETER -static -#endif void ssp1601_reset(ssp1601_t *l_ssp) { ssp = l_ssp; @@ -995,9 +1001,6 @@ void ssp1601_reset(ssp1601_t *l_ssp) } -#ifdef EMBED_INTERPRETER -static -#endif void ssp1601_run(int cycles) { #ifndef EMBED_INTERPRETER