X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=sound.c;fp=sound.c;h=f0eeaf87c0b7c496afd454536dcad5a67c86bd1e;hp=70ce2d4cc1a63e85fb061284727a87a72a15fb8c;hb=3ac1cc0b221c10cd9a82ba3c12d111597dc554e7;hpb=0d6a66c2a80f50ae51327cd406f9df14d99ad02e diff --git a/sound.c b/sound.c index 70ce2d4..f0eeaf8 100644 --- a/sound.c +++ b/sound.c @@ -555,6 +555,31 @@ static void FASTAPASS(1) CalcRectAmp(int P) *b=V; } +void FCEU_SoundCPUHook(int cycles48) +{ + fhcnt-=cycles48; + if(fhcnt<=0) + { + FrameSoundUpdate(); + fhcnt+=fhinc; + } + + if(PCMIRQCount>0) + { + PCMIRQCount-=cycles48; + if(PCMIRQCount<=0) + { + vdis=1; + if((PSG[0x10]&0x80) && !(PSG[0x10]&0x40)) + { + extern uint8 SIRQStat; + SIRQStat|=0x80; + X6502_IRQBegin(FCEU_IQDPCM); + } + } + } +} + static void RDoPCM(int32 end) { int32 V;