X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fcd%2FPico.c;h=dfdbf5e8a72a2b19c4438ef00a7dc7dfd568c555;hb=7a93adeb29f01f5867ff36606cd73a382b6ee0e3;hp=d643cb7f834af02410b5413090f3bc593ba15cee;hpb=1cd356a33daf2eec34e52c075b06d62866f5fb2f;p=picodrive.git diff --git a/Pico/cd/Pico.c b/Pico/cd/Pico.c index d643cb7..dfdbf5e 100644 --- a/Pico/cd/Pico.c +++ b/Pico/cd/Pico.c @@ -131,27 +131,6 @@ static __inline void update_chips(void) gfx_cd_update(); } -// to be called on 224 or line_sample scanlines only -static __inline void getSamples(int y) -{ - if(y == 224) { - //dprintf("sta%i: %i [%i]", (emustatus & 2), emustatus, y); - if(emustatus & 2) - sound_render(PsndLen/2, PsndLen-PsndLen/2); - else sound_render(0, PsndLen); - if (emustatus&1) emustatus|=2; else emustatus&=~2; - if (PicoWriteSound) PicoWriteSound(); - // clear sound buffer - sound_clear(); - //memset(PsndOut, 0, (PicoOpt & 8) ? (PsndLen<<2) : (PsndLen<<1)); - } - else if(emustatus & 3) { - emustatus|= 2; - emustatus&=~1; - sound_render(0, PsndLen/2); - } -} - static int PicoFrameHintsMCD(void) { @@ -240,10 +219,12 @@ static int PicoFrameHintsMCD(void) sound_timers_and_dac(y); // get samples from sound chips - if(y == 32 && PsndOut) - emustatus &= ~1; - else if((y == 224 || y == line_sample) && PsndOut) - getSamples(y); + if (y == 224 && PsndOut) { + int len = sound_render(0, PsndLen); + if (PicoWriteSound) PicoWriteSound(len); + // clear sound buffer + sound_clear(); + } // Run scanline: //dprintf("m68k starting exec @ %06x", SekPc);