Skip to content

Commit

Permalink
Suspend emulation when timefence timeout (limit sound buffer looping)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbousquet committed Nov 2, 2024
1 parent 4d6128d commit fb71d0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/cpuexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ static void cpu_timeslice(void)
// We are ahead by a large amount: realign external clock
time_fence_global_offset = now - options.time_fence;
}
else if (time_fence_wait(1.0))
else if (time_fence_wait(0.250))
{
// We waited and received a new time fence, but if we are still ahead of it, just return
if (now - options.time_fence - time_fence_global_offset >= 0.)
Expand All @@ -994,9 +994,11 @@ static void cpu_timeslice(void)
else
{
// We waited and did not receive a new time fence, but timed out or just received an OS message, then just return
mame_pause(1); // we timed-out to get there, so we are stuck waiting for master clock: suspend sound (buffer would loop) and give user feedback (dimmed rendering)
return;
}
}
mame_pause(0);
}

double target = timer_time_until_next_timer();
Expand Down
1 change: 0 additions & 1 deletion src/wpc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ void vp_setDIP(int bank, int value) { }

#if defined(VPINMAME) || defined(LIBPINMAME)
#include "vpintf.h"
extern int g_fPause;
extern int g_fHandleKeyboard, g_fHandleMechanics;
extern char g_fShowWinDMD;
extern char g_fShowPinDMD; /* pinDMD */
Expand Down

0 comments on commit fb71d0e

Please sign in to comment.