From: kub Date: Thu, 30 Nov 2023 19:35:49 +0000 (+0100) Subject: psp, revisit scaling X-Git-Tag: v2.00~155 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc07fe2b4eb1eadf565ff0e64777a8be3c97c300;p=picodrive.git psp, revisit scaling --- diff --git a/platform/common/emu.h b/platform/common/emu.h index 1b2fa0cd..db084022 100644 --- a/platform/common/emu.h +++ b/platform/common/emu.h @@ -41,12 +41,12 @@ enum { EOPT_SCALE_SW = 1, EOPT_SCALE_HW, // PSP horiz: - EOPT_SCALE_43 = 1, // DAR 4:3 (12:9) - EOPT_SCALE_WIDE, // DAR 14:9 - EOPT_SCALE_FULL, // DAR 16:9 + EOPT_SCALE_43 = 1, // 4:3 screen + EOPT_SCALE_STRETCH, // stretched to between _43 and _WIDE + EOPT_SCALE_WIDE, // stretched to match display width // PSP vert: - EOPT_VSCALE_43 = 1, // DAR 4:3 - EOPT_VSCALE_FULL, // zoomed to full height + EOPT_VSCALE_FULL = 1, // TV height scaled to screen height + EOPT_VSCALE_NOBORDER, // VDP area scaled to screen height }; enum { diff --git a/platform/psp/emu.c b/platform/psp/emu.c index b8800642..dbfa0eca 100644 --- a/platform/psp/emu.c +++ b/platform/psp/emu.c @@ -608,7 +608,7 @@ void pemu_prep_defconfig(void) defaultConfig.CPUclock = 333; defaultConfig.filter = EOPT_FILTER_BILINEAR; // bilinear filtering defaultConfig.scaling = EOPT_SCALE_43; - defaultConfig.vscaling = EOPT_VSCALE_43; + defaultConfig.vscaling = EOPT_VSCALE_FULL; defaultConfig.renderer = RT_8BIT_ACC; defaultConfig.renderer32x = RT_8BIT_ACC; defaultConfig.EmuOpt |= EOPT_SHOW_RTC; @@ -696,6 +696,9 @@ void plat_update_volume(int has_changed, int is_up) /* prepare for MD screen mode change */ void emu_video_mode_change(int start_line, int line_count, int start_col, int col_count) { + int h43 = (col_count >= 192 ? 320 : col_count); // ugh, mind GG... + int v43 = (line_count >= 192 ? Pico.m.pal ? 240 : 224 : line_count); + out_y = start_line; out_x = start_col; out_h = line_count; out_w = col_count; @@ -703,31 +706,30 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co col_count = 256; switch (currentConfig.vscaling) { - case EOPT_VSCALE_43: - // ugh, mind GG... - if (line_count >= 160) - line_count = (Pico.m.pal ? 240 : 224); + case EOPT_VSCALE_FULL: + line_count = v43; vscale = (float)270/line_count; break; - case EOPT_VSCALE_FULL: + case EOPT_VSCALE_NOBORDER: vscale = (float)270/line_count; break; default: vscale = 1; break; } + switch (currentConfig.scaling) { case EOPT_SCALE_43: - hscale = (float)360/col_count; + hscale = (vscale*h43)/col_count; break; - case EOPT_SCALE_WIDE: - hscale = (float)420/col_count; + case EOPT_SCALE_STRETCH: + hscale = (vscale*h43/2 + 480/2)/col_count; break; - case EOPT_SCALE_FULL: + case EOPT_SCALE_WIDE: hscale = (float)480/col_count; break; default: - hscale = 1; + hscale = vscale; break; } diff --git a/platform/psp/menu.c b/platform/psp/menu.c index 034ef3ee..95698a84 100644 --- a/platform/psp/menu.c +++ b/platform/psp/menu.c @@ -1,11 +1,11 @@ -static const char *men_hscaling_opts[] = { "OFF", "4:3", "wide", "fullscreen", NULL }; -static const char *men_vscaling_opts[] = { "OFF", "4:3", "fullscreen", NULL }; +static const char *men_vscaling_opts[] = { "OFF", "fullscreen", "borderless", NULL }; +static const char *men_hscaling_opts[] = { "1:1", "4:3", "extended", "fullwidth", NULL }; static const char *men_filter_opts[] = { "nearest", "bilinear", NULL }; #define MENU_OPTIONS_GFX \ - mee_enum ("Horizontal scaling", MA_OPT_SCALING, currentConfig.scaling, men_hscaling_opts), \ mee_enum ("Vertical scaling", MA_OPT_VSCALING, currentConfig.vscaling, men_vscaling_opts), \ + mee_enum ("Aspect ratio", MA_OPT_SCALING, currentConfig.scaling, men_hscaling_opts), \ mee_enum ("Scaler type", MA_OPT3_FILTERING, currentConfig.filter, men_filter_opts), \ mee_range ("Gamma adjustment", MA_OPT3_GAMMAA, currentConfig.gamma, -4, 16), \ mee_range ("Black level", MA_OPT3_BLACKLVL, currentConfig.gamma2, 0, 2), \