aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/plugin_lib.c3
-rw-r--r--plugins/gpulib/gpu.c12
-rw-r--r--plugins/gpulib/gpu.h2
-rw-r--r--plugins/gpulib/vout_pl.c16
-rw-r--r--plugins/gpulib/vout_sdl.c4
5 files changed, 35 insertions, 2 deletions
diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c
index 2e954aa..17fa1ec 100644
--- a/frontend/plugin_lib.c
+++ b/frontend/plugin_lib.c
@@ -116,6 +116,9 @@ void pl_print_hud(int xborder)
{
int w = pl_vout_w, h = pl_vout_h;
+ if (h < 16)
+ return;
+
if (g_opts & OPT_SHOWSPU)
draw_active_chans(w, h);
diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c
index 79a5fa4..70847ab 100644
--- a/plugins/gpulib/gpu.c
+++ b/plugins/gpulib/gpu.c
@@ -601,7 +601,16 @@ void GPUupdateLace(void)
flush_cmd_buffer();
renderer_flush_queues();
- if (gpu.status.blanking || !gpu.state.fb_dirty)
+ if (gpu.status.blanking) {
+ if (!gpu.state.blanked) {
+ vout_blank();
+ gpu.state.blanked = 1;
+ gpu.state.fb_dirty = 1;
+ }
+ return;
+ }
+
+ if (!gpu.state.fb_dirty)
return;
if (gpu.frameskip.set) {
@@ -615,6 +624,7 @@ void GPUupdateLace(void)
vout_update();
gpu.state.fb_dirty = 0;
+ gpu.state.blanked = 0;
}
void GPUvBlank(int is_vblank, int lcf)
diff --git a/plugins/gpulib/gpu.h b/plugins/gpulib/gpu.h
index 11bfe46..a508cdc 100644
--- a/plugins/gpulib/gpu.h
+++ b/plugins/gpulib/gpu.h
@@ -66,6 +66,7 @@ struct psx_gpu {
uint32_t fb_dirty:1;
uint32_t old_interlace:1;
uint32_t allow_interlace:2;
+ uint32_t blanked:1;
uint32_t *frame_count;
uint32_t *hcnt; /* hsync count */
struct {
@@ -105,6 +106,7 @@ void renderer_set_config(const struct rearmed_cbs *config);
int vout_init(void);
int vout_finish(void);
void vout_update(void);
+void vout_blank(void);
void vout_set_config(const struct rearmed_cbs *config);
/* listing these here for correct linkage if rasterizer uses c++ */
diff --git a/plugins/gpulib/vout_pl.c b/plugins/gpulib/vout_pl.c
index 79b6c3e..0bd1ecf 100644
--- a/plugins/gpulib/vout_pl.c
+++ b/plugins/gpulib/vout_pl.c
@@ -9,6 +9,7 @@
* See the COPYING file in the top-level directory.
*/
+#include <string.h>
#include "gpu.h"
#include "cspace.h"
#include "../../frontend/plugin_lib.h"
@@ -52,8 +53,11 @@ static void blit(void)
int fb_offs, doffs;
uint8_t *dest;
- fb_offs = y * 1024 + x;
dest = (uint8_t *)screen_buf;
+ if (dest == NULL)
+ return;
+
+ fb_offs = y * 1024 + x;
// only do centering, at least for now
doffs = (stride - w) / 2 & ~1;
@@ -99,6 +103,16 @@ void vout_update(void)
blit();
}
+void vout_blank(void)
+{
+ check_mode_change();
+ if (cbs->pl_vout_raw_flip == NULL) {
+ int bytespp = gpu.status.rgb24 ? 3 : 2;
+ memset(screen_buf, 0, gpu.screen.hres * gpu.screen.h * bytespp);
+ screen_buf = cbs->pl_vout_flip();
+ }
+}
+
long GPUopen(void **unused)
{
gpu.frameskip.active = 0;
diff --git a/plugins/gpulib/vout_sdl.c b/plugins/gpulib/vout_sdl.c
index db1ae96..b8c4eae 100644
--- a/plugins/gpulib/vout_sdl.c
+++ b/plugins/gpulib/vout_sdl.c
@@ -77,6 +77,10 @@ void vout_update(void)
SDL_UpdateRect(screen, 0, 0, 1024, 512);
}
+void vout_blank(void)
+{
+}
+
long GPUopen(void **dpy)
{
*dpy = x11_display;