aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libretro.c19
-rw-r--r--source/snes9x.h7
2 files changed, 20 insertions, 6 deletions
diff --git a/libretro.c b/libretro.c
index 7172cee..e0cb2da 100644
--- a/libretro.c
+++ b/libretro.c
@@ -38,6 +38,7 @@ char retro_save_directory[PATH_MAX];
char retro_base_name[PATH_MAX];
bool overclock_cycles = false;
bool reduce_sprite_flicker = false;
+int one_c, slow_one_c, two_c;
#ifdef _WIN32
char slash = '\\';
@@ -296,7 +297,7 @@ void retro_init(void)
static const struct retro_variable vars[] =
{
{ "catsfc_VideoMode", "Video Mode; auto|NTSC|PAL" },
- { "catsfc_overclock_cycles", "Reduce Slowdown (Hack, Unsafe, Restart); disabled|enabled" },
+ { "catsfc_overclock_cycles", "Reduce Slowdown (Hack, Unsafe, Restart); disabled|compatible|max" },
{ "catsfc_reduce_sprite_flicker", "Reduce Flickering (Hack, Unsafe); disabled|enabled" },
{ NULL, NULL },
};
@@ -388,8 +389,20 @@ static void check_variables(void)
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
- if (strcmp(var.value, "enabled") == 0)
- overclock_cycles = true;
+ if (strcmp(var.value, "compatible") == 0)
+ {
+ overclock_cycles = true;
+ one_c = 4;
+ slow_one_c = 5;
+ two_c = 6;
+ }
+ else if (strcmp(var.value, "max") == 0)
+ {
+ overclock_cycles = true;
+ one_c = 3;
+ slow_one_c = 3;
+ two_c = 3;
+ }
else
overclock_cycles = false;
}
diff --git a/source/snes9x.h b/source/snes9x.h
index 4a4364c..11dc1ff 100644
--- a/source/snes9x.h
+++ b/source/snes9x.h
@@ -46,9 +46,9 @@
#define SNES_CYCLES_PER_SCANLINE ((uint32_t) ((SNES_SCANLINE_TIME / SNES_CLOCK_LEN) * 6 + 0.5))
-#define ONE_CYCLE (overclock_cycles ? 4u : 6u)
-#define SLOW_ONE_CYCLE (overclock_cycles ? 4u : 8u)
-#define TWO_CYCLES (overclock_cycles ? 6u : 12u)
+#define ONE_CYCLE (overclock_cycles ? one_c : 6u)
+#define SLOW_ONE_CYCLE (overclock_cycles ? slow_one_c : 8u)
+#define TWO_CYCLES (overclock_cycles ? two_c : 12u)
#define SNES_TR_MASK (1u << 4)
#define SNES_TL_MASK (1u << 5)
@@ -64,6 +64,7 @@
#define SNES_B_MASK (1u << 15)
extern bool overclock_cycles;
+extern int one_c, slow_one_c, two_c;
enum
{