# gpu
OBJS += plugins/gpu_neon/gpu.o
+ifeq "$(HAVE_NEON)" "1"
+OBJS += plugins/gpu_neon/psx_gpu_if.o plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o
+plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
+plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c
+else
# note: code is not safe for strict-aliasing? (Castlevania problems)
plugins/gpu_neon/peops_if.o: CFLAGS += -fno-strict-aliasing
plugins/gpu_neon/peops_if.o: plugins/dfxvideo/prim.c plugins/dfxvideo/soft.c
OBJS += plugins/gpu_neon/peops_if.o
+endif
ifdef X11
LDFLAGS += -lX11 `sdl-config --libs`
OBJS += plugins/gpu_neon/vout_sdl.o
@rm $@_
.PHONY: FORCE
+%.o: %.S
+ $(CC) $(CFLAGS) -c $^ -o $@
$(TARGET): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS) -Wl,-Map=$@.map
{ #val, sizeof(pl_rearmed_cbs.val), &pl_rearmed_cbs.val }
// 'versioned' var, used when defaults change
+#define CE_CONFIG_STR_V(val, ver) \
+ { #val #ver, 0, Config.val }
+
#define CE_INTVAL_V(val, ver) \
{ #val #ver, sizeof(val), &val }
void *val;
} config_data[] = {
CE_CONFIG_STR(Bios),
- CE_CONFIG_STR(Gpu),
+ CE_CONFIG_STR_V(Gpu, 2),
CE_CONFIG_STR(Spu),
// CE_CONFIG_STR(Cdr),
CE_CONFIG_VAL(Xa),
TARGETS += gpu_neon.$(EXT)
endif
-gpu_neon.$(EXT): SRC += psx_gpu_if.c
-gpu_neon.$(EXT): CFLAGS += -fno-strict-aliasing
+gpu_neon.$(EXT): SRC += psx_gpu_if.c psx_gpu/psx_gpu_arm_neon.S
+gpu_neon.$(EXT): CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
gpu_peops.$(EXT): SRC += peops_if.c
gpu_peops.$(EXT): CFLAGS += -fno-strict-aliasing
gpu_unai.$(EXT): SRC += unai_if.cpp ../gpu_unai/gpu_arm.s
CC_ = $(CROSS_COMPILE)gcc
ARCH = $(shell $(CC) -v 2>&1 | grep -i 'target:' | awk '{print $$2}' | awk -F '-' '{print $$1}')
+HAVE_NEON = $(shell $(CC_) -E -dD $(CFLAGS) gpu.h | grep -q '__ARM_NEON__ 1' && echo 1)
CFLAGS += -ggdb -Wall -DTEST
+ifndef DEBUG
CFLAGS += -O2
+endif
ifeq "$(ARCH)" "arm"
CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
endif
CFLAGS += -m32
endif
-# test_neon
TARGETS = test_peops test_unai
+ifeq "$(HAVE_NEON)" "1"
+TARGETS += test_neon
+endif
+
SRC += test.c
all: $(TARGETS)
-test_neon: SRC += psx_gpu_if.c
-test_neon: CFLAGS += -fno-strict-aliasing
+test_neon: SRC += psx_gpu_if.c psx_gpu/psx_gpu_arm_neon.S
+test_neon: psx_gpu_if.c psx_gpu/*.c
+test_neon: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
test_peops: SRC += peops_if.c
test_peops: CFLAGS += -fno-strict-aliasing
-test_unai: SRC += unai_if.cpp
+test_unai: SRC += unai_if.cpp ../gpu_unai/gpu_arm.s
test_unai: CC_ = $(CXX)
$(TARGETS): $(SRC)
--- /dev/null
+/*
+ * (C) GraÅžvydas "notaz" Ignotas, 2011
+ *
+ * This work is licensed under the terms of any of these licenses
+ * (at your option):
+ * - GNU GPL, version 2 or later.
+ * - GNU LGPL, version 2.1 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include <stdio.h>
+
+#if 1
+#include "psx_gpu/psx_gpu.c"
+#else
+#define printf xprintf
+#define xprintf(...)
+#include "psx_gpu/psx_gpu_standard.c"
+#endif
+#include "psx_gpu/psx_gpu_parse.c"
+#include "gpu.h"
+
+static psx_gpu_struct egpu __attribute__((aligned(256)));
+
+void do_cmd_list(uint32_t *list, int count)
+{
+ gpu_parse(&egpu, list, count * 4);
+}
+
+int renderer_init(void)
+{
+ initialize_psx_gpu(&egpu, gpu.vram);
+ return 0;
+}
+
+void renderer_sync_ecmds(uint32_t *ecmds)
+{
+ gpu_parse(&egpu, ecmds + 1, 6 * 4);
+}
+
+void renderer_invalidate_caches(int x, int y, int w, int h)
+{
+ invalidate_texture_cache_region(&egpu, x, y, x + w - 1, y + h - 1);
+}
+
+void renderer_flush_queues(void)
+{
+ flush_render_block_buffer(&egpu);
+}
+
+void renderer_set_config(const struct rearmed_cbs *cbs)
+{
+}