X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fsound%2Fsound.c;h=ede33f11fd8cc92915f37e5c12e40044d0b6d710;hb=ba6e8bfd4b707aab042e47bc3e2a14f70be01075;hp=dfa1d651b17e44f7b3d2403ddb44e4f7a94f70bd;hpb=b8a1c09ad1ef0b807c2eb1632d34e6bfae14b633;p=picodrive.git diff --git a/pico/sound/sound.c b/pico/sound/sound.c index dfa1d65..ede33f1 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" @@ -14,6 +14,8 @@ #include "../cd/pcm.h" #include "mix.h" +#define SIMPLE_WRITE_SOUND 0 + void (*PsndMix_32_to_16l)(short *dest, int *src, int count) = mix_32_to_16l_stereo; // master int buffer to mix to @@ -181,6 +183,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; @@ -308,6 +313,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 +342,7 @@ static int PsndRender(int offset, int length) memset32(buf32, 0, length<