X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsound%2Fsound.c;h=5bb8e9d89fc216358958c98572e5ce1dae3db880;hb=f6c49d38cbb965c502ca2af66d76e92f95acda7c;hp=5a9b8b3399557e76f2bfa651987ae673a5defd00;hpb=98da48e4181441545c6a66e622f845ab33b34e5b;p=picodrive.git diff --git a/pico/sound/sound.c b/pico/sound/sound.c index 5a9b8b3..5bb8e9d 100644 --- a/pico/sound/sound.c +++ b/pico/sound/sound.c @@ -291,7 +291,7 @@ PICO_INTERNAL void PsndClear(void) memset32((int *) PsndOut, 0, len); // assume PsndOut to be aligned else { short *out = PsndOut; - if ((int)out & 2) { *out++ = 0; len--; } + if ((long)out & 2) { *out++ = 0; len--; } memset32((int *) out, 0, len/2); if (len & 1) out[len-1] = 0; } @@ -308,6 +308,8 @@ static int PsndRender(int offset, int length) (Pico_mcd->pcm.control & 0x80) && Pico_mcd->pcm.enabled; offset <<= stereo; + pprof_start(sound); + #if !SIMPLE_WRITE_SOUND if (offset == 0) { // should happen once per frame // compensate for float part of PsndLen @@ -362,6 +364,8 @@ static int PsndRender(int offset, int length) // convert + limit to normal 16bit output PsndMix_32_to_16l(PsndOut+offset, buf32, length); + pprof_end(sound); + return length; }