mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
32x, improved auto frame skip, plus new config option for max auto skip
This commit is contained in:
parent
20d2358ab1
commit
e7ee7bc00a
5 changed files with 17 additions and 3 deletions
|
@ -322,6 +322,10 @@ static int custom_read(menu_entry *me, const char *var, const char *val)
|
|||
currentConfig.gamma = atoi(val);
|
||||
return 1;
|
||||
|
||||
case MA_OPT2_MAX_FRAMESKIP:
|
||||
currentConfig.max_skip = atoi(val);
|
||||
return 1;
|
||||
|
||||
/* PSP */
|
||||
case MA_OPT3_SCALE:
|
||||
if (strcasecmp(var, "Scale factor") != 0) return 0;
|
||||
|
|
|
@ -596,6 +596,7 @@ void emu_prep_defconfig(void)
|
|||
defaultConfig.turbo_rate = 15;
|
||||
defaultConfig.msh2_khz = PICO_MSH2_HZ / 1000;
|
||||
defaultConfig.ssh2_khz = PICO_SSH2_HZ / 1000;
|
||||
defaultConfig.max_skip = 4;
|
||||
|
||||
// platform specific overrides
|
||||
pemu_prep_defconfig();
|
||||
|
@ -1463,10 +1464,16 @@ void emu_loop(void)
|
|||
else if (diff < -target_frametime_x3)
|
||||
{
|
||||
/* no time left for this frame - skip */
|
||||
/* limit auto frameskip to 8 */
|
||||
if (frames_done / 8 <= frames_shown)
|
||||
/* limit auto frameskip to max_skip */
|
||||
if (fskip_cnt < currentConfig.max_skip) {
|
||||
fskip_cnt++;
|
||||
skip = 1;
|
||||
}
|
||||
else {
|
||||
fskip_cnt = 0;
|
||||
}
|
||||
} else
|
||||
fskip_cnt = 0;
|
||||
|
||||
// don't go in debt too much
|
||||
while (diff < -target_frametime_x3 * 3) {
|
||||
|
|
|
@ -76,6 +76,7 @@ typedef struct _currentConfig_t {
|
|||
int msh2_khz;
|
||||
int ssh2_khz;
|
||||
int overclock_68k;
|
||||
int max_skip;
|
||||
} currentConfig_t;
|
||||
|
||||
extern currentConfig_t currentConfig, defaultConfig;
|
||||
|
|
|
@ -506,6 +506,7 @@ static menu_entry e_menu_adv_options[] =
|
|||
mee_onoff ("Disable frame limiter", MA_OPT2_NO_FRAME_LIMIT,currentConfig.EmuOpt, EOPT_NO_FRMLIMIT),
|
||||
mee_onoff ("Enable dynarecs", MA_OPT2_DYNARECS, PicoIn.opt, POPT_EN_DRC),
|
||||
mee_onoff ("Status line in main menu", MA_OPT2_STATUS_LINE, currentConfig.EmuOpt, EOPT_SHOW_RTC),
|
||||
mee_range ("Max auto frameskip", MA_OPT2_MAX_FRAMESKIP, currentConfig.max_skip, 1, 10),
|
||||
mee_onoff ("PWM IRQ optimization", MA_OPT2_PWM_IRQ_OPT, PicoIn.opt, POPT_PWM_IRQ_OPT),
|
||||
MENU_OPTIONS_ADV
|
||||
mee_end,
|
||||
|
|
|
@ -58,6 +58,7 @@ typedef enum
|
|||
MA_OPT2_NO_SPRITE_LIM,
|
||||
MA_OPT2_NO_IDLE_LOOPS,
|
||||
MA_OPT2_OVERCLOCK_M68K,
|
||||
MA_OPT2_MAX_FRAMESKIP,
|
||||
MA_OPT2_PWM_IRQ_OPT,
|
||||
MA_OPT2_DONE,
|
||||
MA_OPT3_SCALE, /* psp (all OPT3) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue