X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FPico.c;h=66b27c2ad3edc74bf19d3b87a5fd543492f17410;hb=c060a9ab9c428e1ed9c4159b56529a2a36031e44;hp=268fb75ff3b897c5275b68c7f96c74bf995d4c20;hpb=947fb5f96ae1efc90fb72ceb82b1f41e324c08a8;p=picodrive.git diff --git a/Pico/Pico.c b/Pico/Pico.c index 268fb75..66b27c2 100644 --- a/Pico/Pico.c +++ b/Pico/Pico.c @@ -23,7 +23,7 @@ struct PicoSRAM SRam = {0,}; void (*PicoWriteSound)(int len) = NULL; // called at the best time to send sound buffer (PsndOut) to hardware void (*PicoResetHook)(void) = NULL; -void (*PicoLineHook)(int count) = NULL; +void (*PicoLineHook)(void) = NULL; // to be called once on emu init void PicoInit(void) @@ -250,7 +250,7 @@ static __inline void SekRunM68k(int cyc) #elif defined(EMU_M68K) SekCycleCnt+=m68k_execute(cyc_do); #elif defined(EMU_F68K) - SekCycleCnt+=fm68k_emulate(cyc_do+1, 0); + SekCycleCnt+=fm68k_emulate(cyc_do+1, 0, 0); #endif } @@ -308,12 +308,12 @@ PICO_INTERNAL void PicoSyncZ80(int m68k_cycles_done) } -// TODO: rm from asm too +// TODO: rm from Sek.c+asm too int idle_hit_counter = 0; void PicoFrame(void) { -#if 0 +#if 1 if ((Pico.m.frame_count&0x3f) == 0) { elprintf(EL_STATUS, "ihits: %i", idle_hit_counter); idle_hit_counter = 0; @@ -364,13 +364,22 @@ char *debugString(void) static char dstr[1024]; struct PicoVideo *pv=&Pico.video; unsigned char *reg=pv->reg, r; + extern int HighPreSpr[]; + int i, sprites_lo, sprites_hi; char *dstrp; + sprites_lo = sprites_hi = 0; + for (i = 0; HighPreSpr[i] != 0; i+=2) + if (HighPreSpr[i+1] & 0x8000) + sprites_hi++; + else sprites_lo++; + dstrp = dstr; - sprintf(dstrp, "mode set 1: %02x\n", (r=reg[0])); dstrp+=strlen(dstrp); + sprintf(dstrp, "mode set 1: %02x spr lo: %2i, spr hi: %2i\n", (r=reg[0]), sprites_lo, sprites_hi); + dstrp+=strlen(dstrp); sprintf(dstrp, "display_disable: %i, M3: %i, palette: %i, ?, hints: %i\n", bit(r,0), bit(r,1), bit(r,2), bit(r,4)); dstrp+=strlen(dstrp); - sprintf(dstrp, "mode set 2: %02x\n", (r=reg[1])); dstrp+=strlen(dstrp); + sprintf(dstrp, "mode set 2: %02x hcnt: %i\n", (r=reg[1]), pv->reg[10]); dstrp+=strlen(dstrp); sprintf(dstrp, "SMS/gen: %i, pal: %i, dma: %i, vints: %i, disp: %i, TMS: %i\n", bit(r,2), bit(r,3), bit(r,4), bit(r,5), bit(r,6), bit(r,7)); dstrp+=strlen(dstrp); sprintf(dstrp, "mode set 3: %02x\n", (r=reg[0xB])); dstrp+=strlen(dstrp);