Skip to content

Commit

Permalink
Rename dendy to 'isDendy'
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Jan 24, 2024
1 parent cbf1e7c commit 163a6b5
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
28 changes: 14 additions & 14 deletions libretro/libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ unsigned totalscanlines = 0;
unsigned normal_scanlines = 240;
unsigned extrascanlines = 0;
unsigned vblankscanlines = 0;
unsigned dendy = 0;
unsigned isDendy = 0;

static unsigned systemRegion = 0;
static unsigned opt_region = 0;
Expand Down Expand Up @@ -346,7 +346,7 @@ void FCEUD_DispMessage(enum retro_log_level level, unsigned duration, const char
}
else
{
float fps = (FSettings.PAL || dendy) ? NES_PAL_FPS : NES_NTSC_FPS;
float fps = (FSettings.PAL || isDendy) ? NES_PAL_FPS : NES_NTSC_FPS;
unsigned frames = (unsigned)(((float)duration * fps / 1000.0f) + 0.5f);
struct retro_message msg;

Expand Down Expand Up @@ -1671,7 +1671,7 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
info->geometry.max_height = NES_HEIGHT;
info->geometry.aspect_ratio = get_aspect_ratio(width, height);
info->timing.sample_rate = (float)sndsamplerate;
if (FSettings.PAL || dendy)
if (FSettings.PAL || isDendy)
info->timing.fps = NES_PAL_FPS;
else
info->timing.fps = NES_NTSC_FPS;
Expand Down Expand Up @@ -1765,7 +1765,7 @@ static void FCEUD_RegionOverride(unsigned region)
switch (region)
{
case 0: /* auto */
d = (systemRegion >> 1) & 1;
d = (systemRegion >> 1) & 1;
pal = systemRegion & 1;
break;
case 1: /* ntsc */
Expand All @@ -1781,7 +1781,7 @@ static void FCEUD_RegionOverride(unsigned region)
break;
}

dendy = d;
isDendy = d;
FCEUI_SetVidSystem(pal);
ResetPalette();
}
Expand Down Expand Up @@ -1979,7 +1979,7 @@ static void check_variables(bool startup)
do_reinit = true;
}

normal_scanlines = dendy ? 290 : 240;
normal_scanlines = isDendy ? 290 : 240;
totalscanlines = normal_scanlines + (overclock_enabled ? extrascanlines : 0);

if (do_reinit && startup)
Expand Down Expand Up @@ -3447,15 +3447,15 @@ bool retro_load_game(const struct retro_game_info *info)

/* initialize some of the default variables */
#ifdef GEKKO
sndsamplerate = 32000;
sndsamplerate = 32000;
#else
sndsamplerate = 48000;
sndsamplerate = 48000;
#endif
sndquality = 0;
sndvolume = 150;
swapDuty = 0;
dendy = 0;
opt_region = 0;
sndquality = 0;
sndvolume = 150;
swapDuty = 0;
isDendy = 0;
opt_region = 0;

/* Wii: initialize this or else last variable is passed through
* when loading another rom causing save state size change. */
Expand Down Expand Up @@ -3508,7 +3508,7 @@ bool retro_load_game(const struct retro_game_info *info)
system_dir, PATH_DEFAULT_SLASH_C());

/* Save region and dendy mode for region-auto detect */
systemRegion = (dendy << 1) | (retro_get_region() & 1);
systemRegion = (isDendy << 1) | (retro_get_region() & 1);

current_palette = 0;

Expand Down
8 changes: 4 additions & 4 deletions src/fceu.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ static void FCEU_ResetVidSys(void)
else if (GameInfo->vidsys == GIV_PAL)
{
w = 1;
dendy = 0;
isDendy = 0;
}
else
w = FSettings.PAL;

PAL = w ? 1 : 0;

if (PAL)
dendy = 0;
isDendy = 0;

normal_scanlines = dendy ? 290 : 240;
normal_scanlines = isDendy ? 290 : 240;
totalscanlines = normal_scanlines + (overclock_enabled ? extrascanlines : 0);

FCEUPPU_SetVideoSystem(w || dendy);
FCEUPPU_SetVideoSystem(w || isDendy);
SetSoundVariables();
}

Expand Down
2 changes: 1 addition & 1 deletion src/fceu.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extern unsigned extrascanlines;
extern unsigned vblankscanlines;

/* Region selection */
extern unsigned dendy;
extern unsigned isDendy;

/* Audio mods*/
extern unsigned swapDuty; /* Swap bits 6 & 7 of $4000/$4004 to mimic bug
Expand Down
2 changes: 1 addition & 1 deletion src/ines.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ int iNESLoad(const char *name, FCEUFILE *fp)
* 2: Multiple-region
* 3: UMC 6527P ("Dendy") */
if (iNESCart.region == 3)
dendy = 1;
isDendy = 1;
FCEUI_SetVidSystem((iNESCart.region == 1) ? 1 : 0);

return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/ppu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ static void FetchSpriteData(void) {

void FCEUPPU_SetVideoSystem(int w) {
if (w) {
scanlines_per_frame = dendy ? 262 : 312;
scanlines_per_frame = isDendy ? 262 : 312;
FSettings.FirstSLine = FSettings.UsrFirstSLine[1];
FSettings.LastSLine = FSettings.UsrLastSLine[1];
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/x6502.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern X6502 cpu;

extern void (*MapIRQHook)(int a);

#define NTSC_CPU (dendy ? 1773447.467 : 1789772.7272727272727272)
#define NTSC_CPU (isDendy ? 1773447.467 : 1789772.7272727272727272)
#define PAL_CPU 1662607.125

#define FCEU_IQEXT 0x001
Expand Down

0 comments on commit 163a6b5

Please sign in to comment.