diff options
author | neonloop | 2021-03-10 16:53:39 +0000 |
---|---|---|
committer | neonloop | 2021-03-10 16:53:39 +0000 |
commit | adaecd14d484d309e4d9ba2353ae843ab5213aec (patch) | |
tree | 92ba55bfc2e06aac66a6f5e1080cc2018815c7dc /shell/emu | |
parent | ba054eee2a5f9d7abfaf1fad62c0f77eef1c1da7 (diff) | |
download | snesemu-adaecd14d484d309e4d9ba2353ae843ab5213aec.tar.gz snesemu-adaecd14d484d309e4d9ba2353ae843ab5213aec.tar.bz2 snesemu-adaecd14d484d309e4d9ba2353ae843ab5213aec.zip |
Initial trimui model s support
Diffstat (limited to 'shell/emu')
-rw-r--r-- | shell/emu/core.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/shell/emu/core.c b/shell/emu/core.c index e20e43d..d4ff19d 100644 --- a/shell/emu/core.c +++ b/shell/emu/core.c @@ -274,6 +274,11 @@ static const uint32_t TblSkip[4][4] = { }; #endif +#ifdef AUDIO_FRAMESKIP +#define MAX_SKIP_COUNT 3 +static uint32_t SkipCnt = 0; +#endif + void Emulation_Run (void) { #ifndef USE_BLARGG_APU @@ -294,6 +299,21 @@ void Emulation_Run (void) #endif Settings.HardDisableAudio = false; +#ifdef AUDIO_FRAMESKIP + if (IPPU.RenderThisFrame) { + if (Audio_Underrun_Likely()) { + if (SkipCnt < MAX_SKIP_COUNT) { + SkipCnt++; + IPPU.RenderThisFrame = false; + } else { + SkipCnt = 0; + } + } + } else { + SkipCnt = 0; + } +#endif + S9xMainLoop(); #ifndef USE_BLARGG_APU @@ -310,12 +330,12 @@ void Emulation_Run (void) #endif -#ifdef FRAMESKIP +#if defined(FRAMESKIP) || defined(AUDIO_FRAMESKIP) if (IPPU.RenderThisFrame) { #endif Update_Video_Ingame(); -#ifdef FRAMESKIP +#if defined(FRAMESKIP) || defined(AUDIO_FRAMESKIP) IPPU.RenderThisFrame = false; } else |