aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTwinaphex2018-02-10 15:30:18 +0100
committerGitHub2018-02-10 15:30:18 +0100
commit9cc3ad1599ad7e9edcf9e594a3a6e365fed950f8 (patch)
tree6b35011452686daf822f4acc2755330e5ef032e7
parent8e71246886c0957e047571743ec524ff4c83a53e (diff)
parentb23fdeb8198fb625331740a0c12d5663a03a816c (diff)
downloadsnes9x2005-9cc3ad1599ad7e9edcf9e594a3a6e365fed950f8.tar.gz
snes9x2005-9cc3ad1599ad7e9edcf9e594a3a6e365fed950f8.tar.bz2
snes9x2005-9cc3ad1599ad7e9edcf9e594a3a6e365fed950f8.zip
Merge pull request #50 from Tatsuya79/master
Add sprite limit hack.
-rw-r--r--libretro.c15
-rw-r--r--source/gfx.c6
2 files changed, 18 insertions, 3 deletions
diff --git a/libretro.c b/libretro.c
index 42e316d..7172cee 100644
--- a/libretro.c
+++ b/libretro.c
@@ -37,6 +37,7 @@ struct retro_perf_callback perf_cb;
char retro_save_directory[PATH_MAX];
char retro_base_name[PATH_MAX];
bool overclock_cycles = false;
+bool reduce_sprite_flicker = false;
#ifdef _WIN32
char slash = '\\';
@@ -295,7 +296,8 @@ void retro_init(void)
static const struct retro_variable vars[] =
{
{ "catsfc_VideoMode", "Video Mode; auto|NTSC|PAL" },
- { "catsfc_overclock_cycles", "CPU Overclock (Hack, Unsafe, Restart); disabled|enabled" },
+ { "catsfc_overclock_cycles", "Reduce Slowdown (Hack, Unsafe, Restart); disabled|enabled" },
+ { "catsfc_reduce_sprite_flicker", "Reduce Flickering (Hack, Unsafe); disabled|enabled" },
{ NULL, NULL },
};
@@ -391,6 +393,17 @@ static void check_variables(void)
else
overclock_cycles = false;
}
+
+ var.key = "catsfc_reduce_sprite_flicker";
+ var.value = NULL;
+
+ if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
+ {
+ if (strcmp(var.value, "enabled") == 0)
+ reduce_sprite_flicker = true;
+ else
+ reduce_sprite_flicker = false;
+ }
}
#ifdef PSP
diff --git a/source/gfx.c b/source/gfx.c
index 6dd9ff5..1b9928d 100644
--- a/source/gfx.c
+++ b/source/gfx.c
@@ -36,6 +36,8 @@ extern SLineMatrixData LineMatrixData [240];
extern uint8_t Mode7Depths [2];
+extern bool reduce_sprite_flicker;
+
#define CLIP_10_BIT_SIGNED(a) \
((a) & ((1 << 10) - 1)) + (((((a) & (1 << 13)) ^ (1 << 13)) - (1 << 13)) >> 3)
@@ -611,7 +613,7 @@ void S9xSetupOBJ(void)
for (i = 0; i < SNES_HEIGHT_EXTENDED; i++)
{
GFX.OBJLines[i].RTOFlags = 0;
- GFX.OBJLines[i].Tiles = 34;
+ GFX.OBJLines[i].Tiles = (reduce_sprite_flicker ? 60 : 34);
}
FirstSprite = PPU.FirstSprite;
S = FirstSprite;
@@ -733,7 +735,7 @@ void S9xSetupOBJ(void)
for (Y = 0; Y < SNES_HEIGHT_EXTENDED; Y++)
{
GFX.OBJLines[Y].RTOFlags = Y ? GFX.OBJLines[Y - 1].RTOFlags : 0;
- GFX.OBJLines[Y].Tiles = 34;
+ GFX.OBJLines[Y].Tiles = (reduce_sprite_flicker ? 60 : 34);
j = 0;
if (AnyOBJOnLine[Y])
{