add 68k overclocking support

This commit is contained in:
notaz 2017-10-20 00:41:12 +03:00
parent 93f9619ed8
commit 35f2b65ef7
8 changed files with 33 additions and 2 deletions

View file

@ -652,6 +652,7 @@ int emu_read_config(const char *rom_fname, int no_defaults)
}
pemu_validate_config();
PicoIn.overclockM68k = currentConfig.overclock_68k;
// some sanity checks
#ifdef PSP

View file

@ -74,6 +74,7 @@ typedef struct _currentConfig_t {
int analog_deadzone;
int msh2_khz;
int ssh2_khz;
int overclock_68k;
} currentConfig_t;
extern currentConfig_t currentConfig, defaultConfig;

View file

@ -488,10 +488,13 @@ static int menu_loop_32x_options(int id, int keys)
// ------------ adv options menu ------------
static const char h_ovrclk[] = "Will break some games, keep at 0";
static menu_entry e_menu_adv_options[] =
{
mee_onoff ("SRAM/BRAM saves", MA_OPT_SRAM_STATES, currentConfig.EmuOpt, EOPT_EN_SRAM),
mee_onoff ("Disable sprite limit", MA_OPT2_NO_SPRITE_LIM, PicoIn.opt, POPT_DIS_SPRITE_LIM),
mee_range_h ("Overclock M68k (%)", MA_OPT2_OVERCLOCK_M68K,currentConfig.overclock_68k, 0, 1000, h_ovrclk),
mee_onoff ("Emulate Z80", MA_OPT2_ENABLE_Z80, PicoIn.opt, POPT_EN_Z80),
mee_onoff ("Emulate YM2612 (FM)", MA_OPT2_ENABLE_YM2612, PicoIn.opt, POPT_EN_FM),
mee_onoff ("Emulate SN76496 (PSG)", MA_OPT2_ENABLE_SN76496,PicoIn.opt, POPT_EN_PSG),
@ -508,7 +511,10 @@ static menu_entry e_menu_adv_options[] =
static int menu_loop_adv_options(int id, int keys)
{
static int sel = 0;
me_loop(e_menu_adv_options, &sel);
PicoIn.overclockM68k = currentConfig.overclock_68k; // int vs short
return 0;
}

View file

@ -57,6 +57,7 @@ typedef enum
MA_OPT2_DYNARECS,
MA_OPT2_NO_SPRITE_LIM,
MA_OPT2_NO_IDLE_LOOPS,
MA_OPT2_OVERCLOCK_M68K,
MA_OPT2_DONE,
MA_OPT3_SCALE, /* psp (all OPT3) */
MA_OPT3_HSCALE32,

View file

@ -10,6 +10,7 @@
#define _GNU_SOURCE 1 // mremap
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#ifndef _WIN32
@ -527,6 +528,7 @@ void retro_set_environment(retro_environment_t cb)
{ "picodrive_region", "Region; Auto|Japan NTSC|Japan PAL|US|Europe" },
{ "picodrive_aspect", "Core-provided aspect ratio; PAR|4/3|CRT" },
{ "picodrive_overscan", "Show Overscan; disabled|enabled" },
{ "picodrive_overclk68k", "68k overclock; disabled|+25%|+50%|+75%|+100%|+200%|+400%" },
#ifdef DRC_SH2
{ "picodrive_drc", "Dynamic recompilers; enabled|disabled" },
#endif
@ -1295,6 +1297,14 @@ static void update_variables(void)
environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &av_info);
}
var.value = NULL;
var.key = "picodrive_overclk68k";
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
PicoIn.overclockM68k = 0;
if (var.value[0] == '+')
PicoIn.overclockM68k = atoi(var.value + 1);
}
#ifdef DRC_SH2
var.value = NULL;
var.key = "picodrive_drc";