linux+psp, improve sw upscaling

This commit is contained in:
kub 2021-11-26 21:32:29 +01:00
parent 6890dcfafc
commit 44e4bf2b0f
2 changed files with 12 additions and 8 deletions

View file

@ -175,10 +175,14 @@ void pemu_finalize_frame(const char *fps, const char *notice)
u16 *ps = ghost_buf; u16 *ps = ghost_buf;
int y, h = currentConfig.vscaling == EOPT_SCALE_SW ? 240:out_h; int y, h = currentConfig.vscaling == EOPT_SCALE_SW ? 240:out_h;
int w = currentConfig.scaling == EOPT_SCALE_SW ? 320:out_w; int w = currentConfig.scaling == EOPT_SCALE_SW ? 320:out_w;
for (y = 0; y < h; y++) {
if (currentConfig.ghosting == 1) if (currentConfig.ghosting == 1)
for (y = 0; y < h; y++) {
v_blend((u32 *)pd, (u32 *)ps, w/2, p_075_round); v_blend((u32 *)pd, (u32 *)ps, w/2, p_075_round);
pd += g_screen_ppitch;
ps += w;
}
else else
for (y = 0; y < h; y++) {
v_blend((u32 *)pd, (u32 *)ps, w/2, p_05_round); v_blend((u32 *)pd, (u32 *)ps, w/2, p_05_round);
pd += g_screen_ppitch; pd += g_screen_ppitch;
ps += w; ps += w;
@ -388,7 +392,7 @@ void emu_video_mode_change(int start_line, int line_count, int start_col, int co
PicoDrawSetCallbacks(cb_vscaling_begin,cb_vscaling_nop); PicoDrawSetCallbacks(cb_vscaling_begin,cb_vscaling_nop);
break; break;
case EOPT_SCALE_SW: case EOPT_SCALE_SW:
screen_y = (screen_h - 240)/2 + (out_h > 144); screen_y = (screen_h - 240)/2 + (out_h < 240 && out_h > 144);
// NTSC always has 224 visible lines, anything smaller has bars // NTSC always has 224 visible lines, anything smaller has bars
if (out_h < 224 && out_h > 144) if (out_h < 224 && out_h > 144)
screen_y += (224 - out_h)/2; screen_y += (224 - out_h)/2;

View file

@ -104,7 +104,7 @@ static void change_renderer(int diff)
static void apply_renderer(void) static void apply_renderer(void)
{ {
PicoIn.opt &= ~POPT_ALT_RENDERER; PicoIn.opt &= ~(POPT_ALT_RENDERER|POPT_EN_SOFTSCALE);
switch (get_renderer()) { switch (get_renderer()) {
case RT_16BIT: case RT_16BIT: