X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=Pico%2Fsound%2Fsound.c;h=fbb81c8902ed98a0cbbda0f4daff8c98f9e3fac3;hb=dca310c413517d278898b967cfe610574310acd8;hp=aa2acb2e4c75e761d3a32a1bbc26a408ed0edb6d;hpb=88b3d7c16ae976d332b8462de839b86f856a7180;p=picodrive.git diff --git a/Pico/sound/sound.c b/Pico/sound/sound.c index aa2acb2..fbb81c8 100644 --- a/Pico/sound/sound.c +++ b/Pico/sound/sound.c @@ -1,7 +1,7 @@ // This is part of Pico Library // (c) Copyright 2004 Dave, All rights reserved. -// (c) Copyright 2006 notaz, 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. @@ -11,18 +11,12 @@ #include "ym2612.h" #include "sn76496.h" -#if defined(_USE_MZ80) -#include "../../cpu/mz80/mz80.h" -#elif defined(_USE_DRZ80) -#include "../../cpu/DrZ80/drz80.h" -#elif defined(_USE_CZ80) -#include "../../cpu/cz80/cz80.h" -#endif - #include "../PicoInt.h" #include "../cd/pcm.h" #include "mix.h" +void (*PsndMix_32_to_16l)(short *dest, int *src, int count) = mix_32_to_16l_stereo; + // master int buffer to mix to static int PsndBuffer[2*44100/50]; @@ -36,11 +30,6 @@ int PsndLen_exc_add=0; // this is for non-integer sample counts per line, eg. 22 int PsndLen_exc_cnt=0; short *PsndOut=NULL; // PCM data buffer -// from ym2612.c -extern int *ym2612_dacen; -extern INT32 *ym2612_dacout; -void YM2612TimerHandler(int c,int cnt); - // sn76496 extern int *sn76496_regs; @@ -164,6 +153,9 @@ void PsndRerate(int preserve_state) memset32(PsndBuffer, 0, sizeof(PsndBuffer)/4); if (PsndOut) PsndClear(); + + // set mixer + PsndMix_32_to_16l = (PicoOpt & 8) ? mix_32_to_16l_stereo : mix_32_to_16_mono; } @@ -254,9 +246,9 @@ PICO_INTERNAL int PsndRender(int offset, int length) SN76496Update(PsndOut+offset, length, stereo); // Add in the stereo FM buffer - if (PicoOpt & 1) + if (PicoOpt & 1) { buf32_updated = YM2612UpdateOne(buf32, length, stereo, 1); - else + } else memset32(buf32, 0, length<