From e65dad608ba5d7c4307d9144be75210311893748 Mon Sep 17 00:00:00 2001 From: Tatsuya79 Date: Fri, 28 Oct 2016 23:03:25 +0200 Subject: [PATCH 1/2] Update libretro.cpp --- libretro.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libretro.cpp b/libretro.cpp index b68da6c..c436aa7 100755 --- a/libretro.cpp +++ b/libretro.cpp @@ -4,6 +4,7 @@ #include "mednafen/general.h" #include "libretro.h" + #include #include From d65485eee8b6a1af7d7dd4ca1e071a1afe25014b Mon Sep 17 00:00:00 2001 From: Tatsuya79 Date: Fri, 28 Oct 2016 23:26:57 +0200 Subject: [PATCH 2/2] CPU Overclock parameter. --- libretro.cpp | 13 ++++++++++--- mednafen/settings.cpp | 5 +++-- mednafen/settings.h | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/libretro.cpp b/libretro.cpp index c436aa7..65616aa 100755 --- a/libretro.cpp +++ b/libretro.cpp @@ -4,7 +4,6 @@ #include "mednafen/general.h" #include "libretro.h" - #include #include @@ -1313,7 +1312,14 @@ static void check_variables(void) else if (strcmp(var.value, "enabled") == 0) setting_pce_fast_nospritelimit = 1; } - + + var.key = "pce_ocmultiplier"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + { + setting_pce_overclocked = atoi(var.value); + } + var.key = "pce_hoverscan"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) @@ -1751,8 +1757,9 @@ void retro_set_environment(retro_environment_t cb) static const struct retro_variable vars[] = { { "pce_fast_cdimagecache", "CD Image Cache (Restart); disabled|enabled" }, { "pce_nospritelimit", "No Sprite Limit (Restart); disabled|enabled" }, + { "pce_ocmultiplier", "CPU Overclock Multiplier (Restart); 1|2|3|4|5|6|7|8|9|10|20|30|40|50" }, { "pce_hoverscan", "Horizontal Overscan; disabled|enabled" }, - { "pce_initial_scanline", "Initial scanline; 3|4|5|6|7|8|9|10|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|0|1|2" }, + { "pce_initial_scanline", "Initial scanline; 3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|0|1|2" }, { "pce_last_scanline", "Last scanline; 242|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241" }, { "pce_cddavolume", "(CD) CDDA Volume %; 100|110|120|130|140|150|160|170|180|190|200|0|10|20|30|40|50|60|70|80|90" }, { "pce_adpcmvolume", "(CD) ADPCM Volume %; 100|110|120|130|140|150|160|170|180|190|200|0|10|20|30|40|50|60|70|80|90" }, diff --git a/mednafen/settings.cpp b/mednafen/settings.cpp index 17bf2bf..7917013 100755 --- a/mednafen/settings.cpp +++ b/mednafen/settings.cpp @@ -25,6 +25,7 @@ int setting_initial_scanline = 0; int setting_last_scanline = 242; int setting_pce_hoverscan = 0; int setting_pce_fast_nospritelimit = 0; +int setting_pce_overclocked = 1; int setting_pce_fast_cddavolume = 100; int setting_pce_fast_adpcmvolume = 100; int setting_pce_fast_cdpsgvolume = 100; @@ -40,8 +41,8 @@ uint64 MDFN_GetSettingUI(const char *name) return setting_pce_fast_cdpsgvolume; if (!strcmp("pce_fast.cdspeed", name)) return setting_pce_fast_cdspeed; - if (!strcmp("pce_fast.ocmultiplier", name)) /* make configurable */ - return 1; + if (!strcmp("pce_fast.ocmultiplier", name)) + return setting_pce_overclocked; if (!strcmp("pce_fast.slstart", name)) return setting_initial_scanline; if (!strcmp("pce_fast.slend", name)) diff --git a/mednafen/settings.h b/mednafen/settings.h index a1f3c45..5a1fe43 100755 --- a/mednafen/settings.h +++ b/mednafen/settings.h @@ -6,6 +6,7 @@ extern int setting_initial_scanline; extern int setting_last_scanline; extern int setting_pce_fast_nospritelimit; +extern int setting_pce_overclocked; extern int setting_pce_hoverscan; extern int setting_pce_fast_cddavolume; extern int setting_pce_fast_adpcmvolume;