X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FPico.c;h=71add131e6e7e99611bbceb8a85664169cc342bb;hb=03a265e5ebabff7adbb4f97387f81e9b0428dbee;hp=bb0f6e5b819a4c9a687a27d856d81685cfb8e3ef;hpb=f8ef8ff7100baa0ac0ecfcacb47aea3a9e24bc38;p=picodrive.git diff --git a/Pico/Pico.c b/Pico/Pico.c index bb0f6e5..71add13 100644 --- a/Pico/Pico.c +++ b/Pico/Pico.c @@ -19,6 +19,7 @@ int PicoAutoRgnOrder = 0; int emustatus = 0; // rapid_ym2612, multi_ym_updates 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; struct PicoSRAM SRam = {0,}; int z80startCycle, z80stopCycle; // in 68k cycles @@ -254,6 +255,11 @@ static int CheckIdle(void) // to be called on 224 or line_sample scanlines only static __inline void getSamples(int y) { +#if SIMPLE_WRITE_SOUND + PsndRender(0, PsndLen); + if (PicoWriteSound) PicoWriteSound(PsndLen); + PsndClear(); +#else static int curr_pos = 0; if(y == 224) { @@ -270,6 +276,7 @@ static __inline void getSamples(int y) emustatus&=~1; curr_pos = PsndRender(0, PsndLen/2); } +#endif } @@ -363,6 +370,7 @@ static int PicoFrameSimple(void) SekRunM68k(cycles_68k_block); PicoRunZ80Simple(line, lines); + if (PicoLineHook) PicoLineHook(lines_step); line=lines; } @@ -376,6 +384,7 @@ static int PicoFrameSimple(void) lines += sects*lines_step; PicoRunZ80Simple(line, lines); + if (PicoLineHook) PicoLineHook(sects*lines_step); } // render screen @@ -439,6 +448,7 @@ static int PicoFrameSimple(void) SekRunM68k(cycles_68k_vblock); PicoRunZ80Simple(line, lines); + if (PicoLineHook) PicoLineHook(lines_step); line=lines; sects--; @@ -449,6 +459,7 @@ static int PicoFrameSimple(void) if (sects) { lines += sects*lines_step; PicoRunZ80Simple(line, lines); + if (PicoLineHook) PicoLineHook(sects*lines_step); } return 0; @@ -576,14 +587,6 @@ char *debugString(void) } #endif -#if 0 - { - FILE *f = fopen("zram", "wb"); - fwrite(Pico.zram, 1, 0x2000, f); - fclose(f); - } -#endif - return dstr; } #endif