aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpu_unai
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/gpu_unai')
-rw-r--r--plugins/gpu_unai/Makefile4
-rw-r--r--plugins/gpu_unai/gpu.cpp8
2 files changed, 9 insertions, 3 deletions
diff --git a/plugins/gpu_unai/Makefile b/plugins/gpu_unai/Makefile
index 92f7ade..636c31b 100644
--- a/plugins/gpu_unai/Makefile
+++ b/plugins/gpu_unai/Makefile
@@ -1,7 +1,9 @@
CC = $(CROSS_COMPILE)gcc
-CFLAGS += -fPIC -Wall -DREARMED
+CFLAGS += -ggdb -fPIC -Wall -DREARMED
+ifndef DEBUG
CFLAGS += -O2 -ffast-math -fomit-frame-pointer
+endif
CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
# -fschedule-insns (from -O2+) causes bugs, probably bad asm() statements
CFLAGS += -fno-schedule-insns -fno-schedule-insns2
diff --git a/plugins/gpu_unai/gpu.cpp b/plugins/gpu_unai/gpu.cpp
index fa19b63..3e69aaa 100644
--- a/plugins/gpu_unai/gpu.cpp
+++ b/plugins/gpu_unai/gpu.cpp
@@ -864,8 +864,8 @@ static void blit(void)
static s16 old_res_horz, old_res_vert, old_rgb24;
s16 isRGB24 = (GPU_GP1 & 0x00200000) ? 1 : 0;
s16 h0, x0, y0, w0, h1;
- u8 *dest = (u8 *)screen_buf;
u16 *srcs;
+ u8 *dest;
x0 = DisplayArea[0] & ~3; // alignment needed by blitter
y0 = DisplayArea[1];
@@ -877,13 +877,17 @@ static void blit(void)
h1 = DisplayArea[5] - DisplayArea[4]; // display needed
if (h0 == 480) h1 = Min2(h1*2,480);
+ if (h1 <= 0)
+ return;
+
if (w0 != old_res_horz || h1 != old_res_vert || isRGB24 != old_rgb24)
{
old_res_horz = w0;
old_res_vert = h1;
old_rgb24 = (s16)isRGB24;
- cbs->pl_fbdev_set_mode(w0, h1, isRGB24 ? 24 : 16);
+ screen_buf = cbs->pl_fbdev_set_mode(w0, h1, isRGB24 ? 24 : 16);
}
+ dest = (u8 *)screen_buf;
if (isRGB24)
{