SRC += gpu.c
ifeq "$(ARCH)" "arm"
+ARM_CORTEXA8 ?= 1
+ifeq "$(ARM_CORTEXA8)" "1"
CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
-SRC += vout_fb.c ../../frontend/cspace_neon.s
+SRC += ../../frontend/cspace_neon.s
+else
+CFLAGS += -mcpu=arm926ej-s -mtune=arm926ej-s
+SRC += ../../frontend/cspace.c
+endif
+SRC += vout_fb.c
EXT = so
endif
ifeq "$(ARCH)" "x86_64"
EXT = so.x86
endif
-TARGETS = gpu_neon.$(EXT) gpu_peops.$(EXT) gpu_unai.$(EXT)
+HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
+
+TARGETS = gpu_peops.$(EXT) gpu_unai.$(EXT)
+ifeq "$(HAVE_NEON)" "1"
+TARGETS += gpu_neon.$(EXT)
+endif
gpu_neon.$(EXT): SRC += psx_gpu_if.c
gpu_neon.$(EXT): CFLAGS += -fno-strict-aliasing
//#define log_anomaly gpu_log
#define log_anomaly(...)
-struct psx_gpu gpu __attribute__((aligned(64)));
+struct psx_gpu gpu __attribute__((aligned(2048)));
static noinline void do_reset(void)
{
return 0;
}
-static void blit(void)
+static void check_mode_change(void)
{
static uint32_t old_status;
static int old_h;
+
+ // width|rgb24 change?
+ if ((gpu.status.reg ^ old_status) & ((7<<16)|(1<<21)) || gpu.screen.h != old_h)
+ {
+ old_status = gpu.status.reg;
+ old_h = gpu.screen.h;
+ screen_buf = cbs->pl_vout_set_mode(gpu.screen.hres,
+ gpu.screen.h, gpu.status.rgb24 ? 24 : 16);
+ }
+}
+
+static void blit(void)
+{
int x = gpu.screen.x & ~1; // alignment needed by blitter
int y = gpu.screen.y;
int w = gpu.screen.w;
uint8_t *dest;
fb_offs = y * 1024 + x;
-
- if ((gpu.status.reg ^ old_status) & ((7<<16)|(1<<21)) || h != old_h) // width|rgb24 change?
- {
- old_status = gpu.status.reg;
- old_h = h;
- screen_buf = cbs->pl_vout_set_mode(stride, h, gpu.status.rgb24 ? 24 : 16);
- }
-
dest = (uint8_t *)screen_buf;
// only do centering, at least for now
}
renderer_flush_queues();
- blit();
+ check_mode_change();
+ if (cbs->pl_vout_raw_flip)
+ cbs->pl_vout_raw_flip(gpu.screen.x, gpu.screen.y);
+ else
+ blit();
gpu.state.fb_dirty = 0;
}