psp, more fps, improve sms/gg scaling

This commit is contained in:
kub 2022-09-28 18:43:33 +00:00
parent 96948bdfc8
commit 6370b1d401
7 changed files with 31 additions and 25 deletions

View file

@ -189,8 +189,7 @@ static void set_scaling_params(void)
g_vertices[1].y = fbimg_yoffs + fbimg_height;
if (!is_16bit_mode()) {
// 8-bit modes have an 8 px overlap area on the left
int offs = out_w == 248 ? 16 : 8;
g_vertices[0].u += offs; g_vertices[1].u += offs;
g_vertices[0].u += 8; g_vertices[1].u += 8;
}
if (border_hack) {
g_vertices[0].u++; g_vertices[1].u--;
@ -594,7 +593,9 @@ void pemu_prep_defconfig(void)
defaultConfig.CPUclock = 333;
defaultConfig.filter = EOPT_FILTER_BILINEAR; // bilinear filtering
defaultConfig.scaling = EOPT_SCALE_43;
defaultConfig.vscaling = EOPT_VSCALE_FULL;
defaultConfig.vscaling = EOPT_VSCALE_43;
defaultConfig.renderer = RT_8BIT_ACC;
defaultConfig.renderer32x = RT_8BIT_ACC;
defaultConfig.EmuOpt |= EOPT_SHOW_RTC;
}
@ -686,18 +687,18 @@ 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)
{
/* NTSC always has 224 visible lines, anything smaller has bars */
if (line_count < 224 && line_count > 144) {
start_line -= (224-line_count) /2;
line_count = 224;
}
out_y = start_line; out_x = start_col;
out_h = line_count; out_w = col_count;
if (col_count == 248) // mind aspect ration when blanking 1st column
col_count = 256;
switch (currentConfig.vscaling) {
case EOPT_VSCALE_PAL:
vscale = (float)270/240;
case EOPT_VSCALE_43:
// ugh, mind GG...
if (line_count >= 160)
line_count = (Pico.m.pal ? 240 : 224);
vscale = (float)270/line_count;
break;
case EOPT_VSCALE_FULL:
vscale = (float)270/line_count;

View file

@ -52,7 +52,12 @@ static int lg2(unsigned v)
static unsigned in_psp_get_bits(void)
{
return psp_pad_read(0) & 0xf000ffff;
unsigned mask = PSP_NUB_UP|PSP_NUB_DOWN|PSP_NUB_LEFT|PSP_NUB_RIGHT |
PSP_CTRL_UP|PSP_CTRL_DOWN|PSP_CTRL_LEFT|PSP_CTRL_RIGHT |
PSP_CTRL_CIRCLE|PSP_CTRL_CROSS|PSP_CTRL_TRIANGLE|PSP_CTRL_SQUARE |
PSP_CTRL_LTRIGGER|PSP_CTRL_RTRIGGER|PSP_CTRL_SELECT|PSP_CTRL_START;
return psp_pad_read(0) & mask;
}
static void in_psp_probe(const in_drv_t *drv)

View file

@ -1,6 +1,6 @@
static const char *men_hscaling_opts[] = { "OFF", "4:3", "wide", "fullscreen", NULL };
static const char *men_vscaling_opts[] = { "OFF", "PAL", "fullscreen", NULL };
static const char *men_vscaling_opts[] = { "OFF", "4:3", "fullscreen", NULL };
static const char *men_filter_opts[] = { "nearest", "bilinear" };
#define MENU_OPTIONS_GFX \

View file

@ -68,7 +68,7 @@ void plat_target_finish(void)
void plat_video_flip(void)
{
g_menubg_src_ptr = psp_screen;
psp_video_flip(currentConfig.EmuOpt & EOPT_VSYNC);
psp_video_flip(currentConfig.EmuOpt & EOPT_VSYNC, 1);
g_screen_ptr = VRAM_CACHED_STUFF + (psp_screen - VRAM_FB0);
plat_video_set_buffer(g_screen_ptr);
}
@ -94,7 +94,7 @@ void plat_video_menu_begin(void)
void plat_video_menu_end(void)
{
plat_video_wait_vsync();
plat_video_flip();
psp_video_flip(0, 0);
}
/* terminate menu display */

View file

@ -192,12 +192,12 @@ void psp_finish(void)
sceKernelExitGame();
}
void psp_video_flip(int wait_vsync)
void psp_video_flip(int wait_vsync, int other)
{
void *fb = (void *)((unsigned long)psp_screen & ~0x40000000);
sceGuSync(0, 0);
unsigned long fb = (unsigned long)psp_screen & ~0x40000000;
if (other) fb ^= 0x44000;
if (wait_vsync) sceDisplayWaitVblankStart();
sceDisplaySetFrameBuf(fb, 512, PSP_DISPLAY_PIXEL_FORMAT_565,
sceDisplaySetFrameBuf((void *)fb, 512, PSP_DISPLAY_PIXEL_FORMAT_565,
wait_vsync ? PSP_DISPLAY_SETBUF_IMMEDIATE : PSP_DISPLAY_SETBUF_NEXTFRAME);
current_screen ^= 1;
psp_screen = current_screen ? VRAM_FB0 : VRAM_FB1;

View file

@ -38,7 +38,7 @@ extern int psp_unhandled_suspend;
void *psp_video_get_active_fb(void);
void psp_video_switch_to_single(void);
void psp_video_flip(int wait_vsync);
void psp_video_flip(int wait_vsync, int other);
extern void *psp_screen;
unsigned int psp_pad_read(int blocking);
@ -52,10 +52,10 @@ void psp_wait_suspend(void);
void psp_resume_suspend(void);
/* fake 'nub' btns, mapped to the 4 unused upper bits of ctrl buttons */
#define PSP_NUB_UP (1 << 28)
#define PSP_NUB_RIGHT (1 << 29)
#define PSP_NUB_DOWN (1 << 30)
#define PSP_NUB_LEFT (1 << 31)
#define PSP_NUB_UP (1 << 26)
#define PSP_NUB_RIGHT (1 << 27)
#define PSP_NUB_DOWN (1 << 28)
#define PSP_NUB_LEFT (1 << 29)
/* from menu.c */
void psp_menu_init(void);