Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspend emulation when timefence timeout (limit sound buffer looping) #366

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading