X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsound%2Fsound.c;h=1f23e1aaebee33b1bd5fc69f053bed78f7bdd5fe;hb=9b5713af95da3f72cb659d4d8017559aca593a31;hp=5a9b8b3399557e76f2bfa651987ae673a5defd00;hpb=98da48e4181441545c6a66e622f845ab33b34e5b;p=picodrive.git diff --git a/pico/sound/sound.c b/pico/sound/sound.c index 5a9b8b3..1f23e1a 100644 --- a/pico/sound/sound.c +++ b/pico/sound/sound.c @@ -1,11 +1,11 @@ -// This is part of Pico Library - -// (c) Copyright 2004 Dave, All rights reserved. -// (c) Copyright 2006,2007 notaz, All rights reserved. -// Free for non-commercial use. - -// For commercial use, separate licencing terms must be obtained. - +/* + * PicoDrive + * (c) Copyright Dave, 2004 + * (C) notaz, 2006-2009 + * + * This work is licensed under the terms of MAME license. + * See COPYING file in the top-level directory. + */ #include #include "ym2612.h" @@ -181,6 +181,9 @@ PICO_INTERNAL void PsndDoDAC(int line_to) int dout = ym2612.dacout; int line_from = PsndDacLine; + if (line_to >= 312) + line_to = 311; + PsndDacLine = line_to + 1; pos =dac_info[line_from]>>4; @@ -291,7 +294,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 +311,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 @@ -335,6 +340,7 @@ static int PsndRender(int offset, int length) memset32(buf32, 0, length<