mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-19 01:12:33 +00:00
(Xbox 1) Add flicker filter and soft display filter options in
Settings menu
This commit is contained in:
parent
f41c252f6f
commit
a9de8e41e5
@ -190,6 +190,16 @@ static void set_setting_label(menu * current_menu, item *items, unsigned current
|
||||
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "%fx (X) / %fx (Y)", g_settings.video.fbo_scale_x, g_settings.video.fbo_scale_y);
|
||||
snprintf(items[currentsetting].comment, sizeof(items[currentsetting].comment), "INFO - [Custom Scaling Factor] is set to: '%fx (X) / %fx (Y)'.", g_settings.video.fbo_scale_x, g_settings.video.fbo_scale_y);
|
||||
break;
|
||||
#endif
|
||||
#ifdef _XBOX1
|
||||
case SETTING_FLICKER_FILTER:
|
||||
set_setting_label_color(items,g_console.flicker_filter == 0, currentsetting);
|
||||
snprintf(items[currentsetting].setting_text, sizeof(items[currentsetting].setting_text), "%d", g_console.flicker_filter);
|
||||
break;
|
||||
case SETTING_SOFT_DISPLAY_FILTER:
|
||||
set_setting_label_write_on_or_off(items, g_console.soft_display_filter_enable, currentsetting);
|
||||
set_setting_label_color(items,g_console.soft_display_filter_enable, currentsetting);
|
||||
break;
|
||||
#endif
|
||||
case SETTING_HW_OVERSCAN_AMOUNT:
|
||||
set_setting_label_color(items,g_console.overscan_amount == 0.0f, currentsetting);
|
||||
@ -1267,6 +1277,34 @@ static void producesettingentry(menu *current_menu, item *items, unsigned switch
|
||||
apply_scaling(FBO_INIT);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef _XBOX1
|
||||
case SETTING_FLICKER_FILTER:
|
||||
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
{
|
||||
if(g_console.flicker_filter > 0)
|
||||
g_console.flicker_filter--;
|
||||
}
|
||||
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
{
|
||||
if(g_console.flicker_filter < 5)
|
||||
g_console.flicker_filter++;
|
||||
}
|
||||
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_START))
|
||||
{
|
||||
g_console.flicker_filter = 0;
|
||||
}
|
||||
break;
|
||||
case SETTING_SOFT_DISPLAY_FILTER:
|
||||
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT) || (input & (1 << RETRO_DEVICE_ID_JOYPAD_RIGHT)) || (input & (1 << RETRO_DEVICE_ID_JOYPAD_B)))
|
||||
{
|
||||
g_console.soft_display_filter_enable = !g_console.soft_display_filter_enable;
|
||||
}
|
||||
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_START))
|
||||
{
|
||||
g_console.soft_display_filter_enable = true;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case SETTING_HW_OVERSCAN_AMOUNT:
|
||||
if(input & (1 << RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
|
@ -145,6 +145,10 @@ enum
|
||||
SETTING_HW_TEXTURE_FILTER_2,
|
||||
SETTING_SCALE_ENABLED,
|
||||
SETTING_SCALE_FACTOR,
|
||||
#endif
|
||||
#ifdef _XBOX1
|
||||
SETTING_FLICKER_FILTER,
|
||||
SETTING_SOFT_DISPLAY_FILTER,
|
||||
#endif
|
||||
SETTING_HW_OVERSCAN_AMOUNT,
|
||||
SETTING_THROTTLE_MODE,
|
||||
|
@ -121,6 +121,28 @@ item rmenu_items[MAX_NO_OF_CONTROLS_SETTINGS] =
|
||||
"INFO - [Custom Scaling Factor] is set to '2x'.",
|
||||
WHITE,
|
||||
},
|
||||
#endif
|
||||
#ifdef _XBOX1
|
||||
{
|
||||
SETTING_FLICKER_FILTER,
|
||||
"Flicker Filter",
|
||||
"",
|
||||
0.0f,
|
||||
0.0f,
|
||||
YELLOW,
|
||||
"INFO - Toggle the [Flicker Filter].",
|
||||
WHITE,
|
||||
},
|
||||
{
|
||||
SETTING_SOFT_DISPLAY_FILTER,
|
||||
"Soft Display Filter",
|
||||
"",
|
||||
0.0f,
|
||||
0.0f,
|
||||
YELLOW,
|
||||
"INFO - Toggle the [Soft Display Filter].",
|
||||
WHITE,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
SETTING_HW_OVERSCAN_AMOUNT,
|
||||
|
@ -211,6 +211,10 @@ struct console_settings
|
||||
bool frame_advance_enable;
|
||||
#ifdef _XBOX
|
||||
bool menus_hd_enable;
|
||||
#endif
|
||||
#ifdef _XBOX1
|
||||
unsigned flicker_filter;
|
||||
bool soft_display_filter_enable;
|
||||
#endif
|
||||
bool initialize_rarch_enable;
|
||||
bool info_msg_enable;
|
||||
|
@ -83,12 +83,15 @@ void gfx_ctx_swap_buffers(void)
|
||||
void gfx_ctx_clear(void)
|
||||
{
|
||||
xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data;
|
||||
unsigned flicker_filter = g_console.flicker_filter;
|
||||
bool soft_filter_enable = g_console.soft_display_filter_enable;
|
||||
|
||||
device_ptr->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET,
|
||||
D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0);
|
||||
#ifdef _XBOX1
|
||||
device_ptr->d3d_render_device->BeginScene();
|
||||
device_ptr->d3d_render_device->SetFlickerFilter(1);
|
||||
device_ptr->d3d_render_device->SetSoftDisplayFilter(false);
|
||||
device_ptr->d3d_render_device->SetFlickerFilter(flicker_filter);
|
||||
device_ptr->d3d_render_device->SetSoftDisplayFilter(soft_filter_enable);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -365,6 +365,8 @@ static bool xdk_d3d_frame(void *data, const void *frame,
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
|
||||
bool menu_enabled = g_console.menu_enable;
|
||||
bool fps_enable = g_console.fps_info_msg_enable;
|
||||
unsigned flicker_filter = g_console.flicker_filter;
|
||||
bool soft_filter_enable = g_console.soft_display_filter_enable;
|
||||
|
||||
if (d3d->last_width != width || d3d->last_height != height) //240*160
|
||||
{
|
||||
@ -439,6 +441,8 @@ static bool xdk_d3d_frame(void *data, const void *frame,
|
||||
d3d->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0);
|
||||
|
||||
d3d->d3d_render_device->BeginScene();
|
||||
d3d->d3d_render_device->SetFlickerFilter(flicker_filter);
|
||||
d3d->d3d_render_device->SetSoftDisplayFilter(soft_filter_enable);
|
||||
d3d->d3d_render_device->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
|
||||
d3d->d3d_render_device->EndScene();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user