aboutsummaryrefslogtreecommitdiff
path: root/frontend/plugin_lib.c
diff options
context:
space:
mode:
authortwinaphex2013-01-10 03:06:17 +0100
committertwinaphex2013-01-10 03:06:17 +0100
commite5f4d90401d099d5191f95e9f771ab5a81c87ed8 (patch)
tree8de3efcfd7bf5111ea62a43ecd7db558f2ec8350 /frontend/plugin_lib.c
parentac7b2a33ddb2392582c50d29c772e9e99cd762c9 (diff)
parentd77e74383a9134e51c31607cfddf4dcd3535a0ae (diff)
downloadpcsx_rearmed-e5f4d90401d099d5191f95e9f771ab5a81c87ed8.tar.gz
pcsx_rearmed-e5f4d90401d099d5191f95e9f771ab5a81c87ed8.tar.bz2
pcsx_rearmed-e5f4d90401d099d5191f95e9f771ab5a81c87ed8.zip
Merge git://github.com/notaz/pcsx_rearmed
Diffstat (limited to 'frontend/plugin_lib.c')
-rw-r--r--frontend/plugin_lib.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c
index aa771ed..dfff868 100644
--- a/frontend/plugin_lib.c
+++ b/frontend/plugin_lib.c
@@ -44,7 +44,7 @@ void *tsdev;
void *pl_vout_buf;
int g_layer_x, g_layer_y, g_layer_w, g_layer_h;
static int pl_vout_w, pl_vout_h, pl_vout_bpp; /* output display/layer */
-static int pl_vout_scale;
+static int pl_vout_scale, pl_vout_yoffset;
static int psx_w, psx_h, psx_bpp;
static int vsync_cnt;
static int is_pal, frame_interval, frame_interval1024;
@@ -230,6 +230,7 @@ static int resolution_ok(int w, int h)
static void pl_vout_set_mode(int w, int h, int raw_w, int raw_h, int bpp)
{
int vout_w, vout_h, vout_bpp;
+ int buf_yoffset = 0;
// special h handling, Wipeout likes to change it by 1-6
static int vsync_cnt_ms_prev;
@@ -243,6 +244,12 @@ static void pl_vout_set_mode(int w, int h, int raw_w, int raw_h, int bpp)
vout_h = h;
vout_bpp = psx_bpp = bpp;
+ // don't use very low heights
+ if (vout_h < 192) {
+ buf_yoffset = (192 - vout_h) / 2;
+ vout_h = 192;
+ }
+
pl_vout_scale = 1;
#ifdef __ARM_NEON__
if (soft_filter) {
@@ -268,7 +275,11 @@ static void pl_vout_set_mode(int w, int h, int raw_w, int raw_h, int bpp)
pl_vout_w = vout_w;
pl_vout_h = vout_h;
pl_vout_bpp = vout_bpp;
+ pl_vout_yoffset = buf_yoffset;
}
+ if (pl_vout_buf != NULL)
+ pl_vout_buf = (char *)pl_vout_buf
+ + pl_vout_yoffset * pl_vout_w * pl_vout_bpp / 8;
menu_notify_mode_change(pl_vout_w, pl_vout_h, pl_vout_bpp);
}
@@ -366,6 +377,10 @@ out:
// let's flip now
pl_vout_buf = plat_gvideo_flip();
+ if (pl_vout_buf != NULL)
+ pl_vout_buf = (char *)pl_vout_buf
+ + pl_vout_yoffset * pl_vout_w * pl_vout_bpp / 8;
+
pl_rearmed_cbs.flip_cnt++;
}
@@ -591,6 +606,9 @@ void pl_frame_limit(void)
struct timeval now;
int diff, usadj;
+ if (g_resetting)
+ return;
+
vsync_cnt++;
/* doing input here because the pad is polled