EOPT_SCALE_WIDE, // DAR 14:9
EOPT_SCALE_FULL, // DAR 16:9
// PSP vert:
- EOPT_VSCALE_PAL = 1, // always 240 lines
+ EOPT_VSCALE_43 = 1, // DAR 4:3
EOPT_VSCALE_FULL, // zoomed to full height
};
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--;
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;
}
/* 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;
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)
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 \
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);
}
void plat_video_menu_end(void)
{
plat_video_wait_vsync();
- plat_video_flip();
+ psp_video_flip(0, 0);
}
/* terminate menu display */
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;
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);
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);