mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 08:37:41 +00:00
(RMenu) Add refresh rate option - setting not saved to config
for safety reasons
This commit is contained in:
parent
f001938b2e
commit
61518f51b7
@ -42,6 +42,7 @@
|
||||
#include "../../gfx/gfx_context.h"
|
||||
|
||||
#include "../../file.h"
|
||||
#include "../../driver.h"
|
||||
#include "../../general.h"
|
||||
|
||||
|
||||
@ -214,6 +215,11 @@ static void populate_setting_item(void *data, unsigned input)
|
||||
snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%f", g_extern.console.screen.overscan_amount);
|
||||
snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Adjust or decrease [Overscan]. Set this to higher than 0.000\nif the screen doesn't fit on your TV/monitor.");
|
||||
break;
|
||||
case SETTING_REFRESH_RATE:
|
||||
snprintf(current_item->text, sizeof(current_item->text), "Refresh rate");
|
||||
snprintf(current_item->setting_text, sizeof(current_item->setting_text), "%fHz", g_settings.video.refresh_rate);
|
||||
snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Adjust or decrease [Refresh Rate].");
|
||||
break;
|
||||
case SETTING_THROTTLE_MODE:
|
||||
snprintf(current_item->text, sizeof(current_item->text), "Throttle Mode");
|
||||
snprintf(current_item->setting_text, sizeof(current_item->setting_text), (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE)) ? "ON" : "OFF");
|
||||
@ -1264,6 +1270,23 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
|
||||
gfx_ctx_set_overscan();
|
||||
}
|
||||
break;
|
||||
case SETTING_REFRESH_RATE:
|
||||
if(input & (1ULL << RMENU_DEVICE_NAV_LEFT))
|
||||
{
|
||||
rmenu_settings_set(S_REFRESH_RATE_DECREMENT);
|
||||
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
|
||||
}
|
||||
if((input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
|
||||
{
|
||||
rmenu_settings_set(S_REFRESH_RATE_INCREMENT);
|
||||
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
|
||||
}
|
||||
if(input & (1ULL << RMENU_DEVICE_NAV_START))
|
||||
{
|
||||
rmenu_settings_set_default(S_DEF_REFRESH_RATE);
|
||||
driver_set_monitor_refresh_rate(g_settings.video.refresh_rate);
|
||||
}
|
||||
break;
|
||||
case SETTING_THROTTLE_MODE:
|
||||
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
|
||||
{
|
||||
|
@ -120,6 +120,7 @@ enum
|
||||
SETTING_SOFT_DISPLAY_FILTER,
|
||||
#endif
|
||||
SETTING_HW_OVERSCAN_AMOUNT,
|
||||
SETTING_REFRESH_RATE,
|
||||
SETTING_THROTTLE_MODE,
|
||||
SETTING_TRIPLE_BUFFERING,
|
||||
SETTING_ENABLE_SCREENSHOTS,
|
||||
|
@ -129,6 +129,12 @@ void rmenu_settings_set(unsigned setting)
|
||||
else
|
||||
g_extern.lifecycle_mode_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
|
||||
break;
|
||||
case S_REFRESH_RATE_DECREMENT:
|
||||
g_settings.video.refresh_rate -= 0.01f;
|
||||
break;
|
||||
case S_REFRESH_RATE_INCREMENT:
|
||||
g_settings.video.refresh_rate += 0.01f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,6 +189,13 @@ void rmenu_settings_set_default(unsigned setting)
|
||||
g_settings.video.fbo.scale_x = 2.0f;
|
||||
g_settings.video.fbo.scale_y = 2.0f;
|
||||
break;
|
||||
case S_DEF_REFRESH_RATE:
|
||||
#if defined(RARCH_CONSOLE)
|
||||
g_settings.video.refresh_rate = 59.92;
|
||||
#else
|
||||
g_settings.video.refresh_rate = 59.95;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,9 @@ enum
|
||||
S_SCALE_FACTOR_DECREMENT,
|
||||
S_SCALE_FACTOR_INCREMENT,
|
||||
S_THROTTLE,
|
||||
S_TRIPLE_BUFFERING
|
||||
S_TRIPLE_BUFFERING,
|
||||
S_REFRESH_RATE_DECREMENT,
|
||||
S_REFRESH_RATE_INCREMENT,
|
||||
};
|
||||
|
||||
enum
|
||||
@ -66,7 +68,8 @@ enum
|
||||
S_DEF_TRIPLE_BUFFERING,
|
||||
S_DEF_SAVE_STATE,
|
||||
S_DEF_SCALE_ENABLED,
|
||||
S_DEF_SCALE_FACTOR
|
||||
S_DEF_SCALE_FACTOR,
|
||||
S_DEF_REFRESH_RATE,
|
||||
};
|
||||
|
||||
enum
|
||||
|
Loading…
x
Reference in New Issue
Block a user