From: notaz Date: Wed, 24 Dec 2014 22:35:21 +0000 (+0200) Subject: frontend: add 2x scaling option X-Git-Tag: r20~6 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efcf1f7301adbcc06b05eb92fc01a32faa993cfa;p=pcsx_rearmed.git frontend: add 2x scaling option --- diff --git a/frontend/menu.c b/frontend/menu.c index 2823a230..a37ab05b 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -391,7 +391,7 @@ static const struct { CE_CONFIG_VAL(VSyncWA), CE_CONFIG_VAL(Cpu), CE_INTVAL(region), - CE_INTVAL_V(g_scaler, 2), + CE_INTVAL_V(g_scaler, 3), CE_INTVAL(g_gamma), CE_INTVAL(g_layer_x), CE_INTVAL(g_layer_y), @@ -1194,13 +1194,17 @@ static int menu_loop_keyconfig(int id, int keys) // ------------ gfx options menu ------------ -static const char *men_scaler[] = { "1x1", "scaled 4:3", "integer scaled 4:3", "fullscreen", "custom", NULL }; +static const char *men_scaler[] = { + "1x1", "integer scaled 2x", "scaled 4:3", "integer scaled 4:3", "fullscreen", "custom", NULL +}; static const char *men_soft_filter[] = { "None", #ifdef __ARM_NEON__ "scale2x", "eagle2x", #endif NULL }; static const char *men_dummy[] = { NULL }; +static const char h_scaler[] = "int. 2x - scales w. or h. 2x if it fits on screen\n" + "int. 4:3 - uses integer if possible, else fractional"; static const char h_cscaler[] = "Displays the scaler layer, you can resize it\n" "using d-pad or move it using R+d-pad"; static const char h_overlay[] = "Overlay provides hardware accelerated scaling"; @@ -1261,7 +1265,7 @@ static int menu_loop_cscaler(int id, int keys) static menu_entry e_menu_gfx_options[] = { - mee_enum ("Scaler", MA_OPT_VARSCALER, g_scaler, men_scaler), + mee_enum_h ("Scaler", MA_OPT_VARSCALER, g_scaler, men_scaler, h_scaler), mee_enum ("Video output mode", MA_OPT_VOUT_MODE, plat_target.vout_method, men_dummy), mee_onoff ("Software Scaling", MA_OPT_SCALER2, soft_scaling, 1), mee_enum ("Hardware Filter", MA_OPT_HWFILTER, plat_target.hwfilter, men_dummy), diff --git a/frontend/menu.h b/frontend/menu.h index 0d68469e..6b1e55f3 100644 --- a/frontend/menu.h +++ b/frontend/menu.h @@ -15,6 +15,7 @@ enum g_opts_opts { enum g_scaler_opts { SCALE_1_1, + SCALE_2_2, SCALE_4_3, SCALE_4_3v2, SCALE_FULLSCREEN, diff --git a/frontend/plat_omap.c b/frontend/plat_omap.c index 6126140a..f397cc61 100644 --- a/frontend/plat_omap.c +++ b/frontend/plat_omap.c @@ -99,7 +99,7 @@ void *plat_gvideo_set_mode(int *w, int *h, int *bpp) int l = 0, r = 0, t = 0, b = 0; void *buf; - if (g_scaler == SCALE_1_1) { + if (g_scaler == SCALE_1_1 || g_scaler == SCALE_2_2) { if (*w > g_menuscreen_w) l = r = (*w - g_menuscreen_w) / 2; if (*h > g_menuscreen_h) diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index 72b33950..64f96a01 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -180,6 +180,14 @@ static void update_layer_size(int w, int h) g_layer_w = w; g_layer_h = h; break; + case SCALE_2_2: + g_layer_w = w; g_layer_h = h; + if (w * 2 <= g_menuscreen_w) + g_layer_w = w * 2; + if (h * 2 <= g_menuscreen_h) + g_layer_h = h * 2; + break; + case SCALE_4_3v2: if (h > g_menuscreen_h || (240 < h && h <= 360)) goto fractional_4_3;