Skip to content

Commit

Permalink
Rename hdmi_pal60_compatibility
Browse files Browse the repository at this point in the history
to crystal_mod_pal_mode
as better represents the issue.
  • Loading branch information
networkfusion committed Nov 24, 2024
1 parent 991739a commit 5ed9b43
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/menu/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ static void menu_init (boot_params_t *boot_params) {
.width = 640,
.height = 480,
.interlaced = INTERLACED ? INTERLACE_HALF : INTERLACE_OFF,
.pal60 = (!menu->settings.hdmi_pal60_compatibility && menu->settings.pal60_enabled),
.pal60 = (!menu->settings.crystal_mod_pal_mode && menu->settings.pal60_enabled),
};

if (menu->settings.hdmi_pal60_compatibility) {
if (menu->settings.crystal_mod_pal_mode) {
tv_type = get_tv_type();
if (tv_type == TV_PAL && menu->settings.pal60_enabled) {
// HACK: Set TV type to NTSC, so PAL console would output 60 Hz signal instead.
Expand Down
6 changes: 3 additions & 3 deletions src/menu/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ static char *settings_path = NULL;

static settings_t init = {
.pal60_enabled = false,
.hdmi_pal60_compatibility = false,
.crystal_mod_pal_mode = false,
.show_protected_entries = false,
.default_directory = "/",
.use_saves_folder = true,
Expand Down Expand Up @@ -40,7 +40,7 @@ void settings_load (settings_t *settings) {
mini_t *ini = mini_try_load(settings_path);

settings->pal60_enabled = mini_get_bool(ini, "menu", "pal60", init.pal60_enabled); // TODO: consider changing file setting name
settings->hdmi_pal60_compatibility = mini_get_bool(ini, "menu", "hdmi_pal60_compatibility_mode", init.hdmi_pal60_compatibility);
settings->crystal_mod_pal_mode = mini_get_bool(ini, "menu", "crystal_mod_pal_mode", init.crystal_mod_pal_mode);
settings->show_protected_entries = mini_get_bool(ini, "menu", "show_protected_entries", init.show_protected_entries);
settings->default_directory = strdup(mini_get_string(ini, "menu", "default_directory", init.default_directory));
settings->use_saves_folder = mini_get_bool(ini, "menu", "use_saves_folder", init.use_saves_folder);
Expand All @@ -61,7 +61,7 @@ void settings_save (settings_t *settings) {
mini_t *ini = mini_create(settings_path);

mini_set_bool(ini, "menu", "pal60", settings->pal60_enabled);
mini_set_bool(ini, "menu", "hdmi_pal60_compatibility_mode", settings->hdmi_pal60_compatibility);
mini_set_bool(ini, "menu", "crystal_modded_pal_mode", settings->crystal_mod_pal_mode);
mini_set_bool(ini, "menu", "show_protected_entries", settings->show_protected_entries);
mini_set_string(ini, "menu", "default_directory", settings->default_directory);
mini_set_bool(ini, "menu", "use_saves_folder", settings->use_saves_folder);
Expand Down
4 changes: 2 additions & 2 deletions src/menu/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ typedef struct {
/** @brief Use 60 Hz refresh rate on a PAL console */
bool pal60_enabled;

/** @brief Use 60 Hz refresh rate on a PAL console with certain HDMI mods that do not properly support it */
bool hdmi_pal60_compatibility;
/** @brief Use 60 Hz refresh rate on a PAL console with a crystal mod */
bool crystal_mod_pal_mode;

/** @brief Show files/directories that are filtered in the browser */
bool show_protected_entries;
Expand Down
12 changes: 6 additions & 6 deletions src/menu/views/settings_editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ static void set_pal60_type (menu_t *menu, void *arg) {
settings_save(&menu->settings);
}

static void set_hdmi_pal60_compatibility_type (menu_t *menu, void *arg) {
menu->settings.hdmi_pal60_compatibility = (bool)(uintptr_t)(arg);
static void set_crystal_mod_pal_mode_type (menu_t *menu, void *arg) {
menu->settings.crystal_mod_pal_mode = (bool)(uintptr_t)(arg);
settings_save(&menu->settings);
}

Expand Down Expand Up @@ -64,8 +64,8 @@ static component_context_menu_t set_pal60_type_context_menu = { .list = {
}};

static component_context_menu_t set_pal60_hdmi_compatibility_type_context_menu = { .list = {
{.text = "On", .action = set_hdmi_pal60_compatibility_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_hdmi_pal60_compatibility_type, .arg = (void *)(uintptr_t)(false) },
{.text = "On", .action = set_crystal_mod_pal_mode_type, .arg = (void *)(uintptr_t)(true) },
{.text = "Off", .action = set_crystal_mod_pal_mode_type, .arg = (void *)(uintptr_t)(false) },
COMPONENT_CONTEXT_MENU_LIST_END,
}};

Expand Down Expand Up @@ -151,7 +151,7 @@ static void draw (menu_t *menu, surface_t *d) {
" Autoload ROM : %s\n"
"To change the following menu settings, press 'A':\n"
"* PAL60 Mode : %s\n"
"* PAL60 HDMI Compat : %s\n"
"* PAL Crystal Mod : %s\n"
" Show Hidden Files : %s\n"
" Use Saves folder : %s\n"
" Sound Effects : %s\n"
Expand All @@ -165,7 +165,7 @@ static void draw (menu_t *menu, surface_t *d) {
menu->settings.default_directory,
format_switch(menu->settings.rom_autoload_enabled),
format_switch(menu->settings.pal60_enabled),
format_switch(menu->settings.hdmi_pal60_compatibility),
format_switch(menu->settings.crystal_mod_pal_mode),
format_switch(menu->settings.show_protected_entries),
format_switch(menu->settings.use_saves_folder),
format_switch(menu->settings.sound_enabled)
Expand Down

0 comments on commit 5ed9b43

Please sign in to comment.