diff --git a/core/hw/pvr/spg.cpp b/core/hw/pvr/spg.cpp index 0cf4c4d0b..b0970c3f1 100755 --- a/core/hw/pvr/spg.cpp +++ b/core/hw/pvr/spg.cpp @@ -88,6 +88,8 @@ double full_rps; static u32 lightgun_line = 0xffff; static u32 lightgun_hpos; +double mspdf; + u32 fskip=0; //called from sh4 context , should update pvr/ta state and everything else int spg_line_sched(int tag, int cycl, int jit) @@ -174,7 +176,7 @@ int spg_line_sched(int tag, int cycl, int jit) } double frames_done=spd_cpu/2; - double mspdf=1/frames_done*1000; + mspdf=1/frames_done*1000; full_rps=(spd_fps+fskip/ts); diff --git a/core/oslib/audiostream.cpp b/core/oslib/audiostream.cpp index ea6845bed..1d6f4f079 100644 --- a/core/oslib/audiostream.cpp +++ b/core/oslib/audiostream.cpp @@ -140,6 +140,7 @@ u32 asRingFreeCount() return RingBufferSampleCount-asRingUsedCount(); } +extern double mspdf; void WriteSample(s16 r, s16 l) { const u32 ptr=(WritePtr+1)%RingBufferSampleCount; @@ -149,7 +150,9 @@ void WriteSample(s16 r, s16 l) if (WritePtr==(SAMPLE_COUNT-1)) { - PushAudio(RingBuffer,SAMPLE_COUNT,settings.aica.LimitFPS); + bool do_wait = settings.aica.LimitFPS && (mspdf <= 11); + + PushAudio(RingBuffer,SAMPLE_COUNT, do_wait); } }