aboutsummaryrefslogtreecommitdiff
path: root/plugins/gpu_neon
diff options
context:
space:
mode:
authornotaz2012-10-06 23:36:06 +0300
committernotaz2012-10-06 23:59:31 +0300
commitf82c62507c67309b9c020a54f6c848853d39febe (patch)
tree9a7481f95550b2386371aa4380117cdbbb49557f /plugins/gpu_neon
parentc979c3ee0d0bc6bece799a6f4013993d7cb2d5f3 (diff)
downloadpcsx_rearmed-f82c62507c67309b9c020a54f6c848853d39febe.tar.gz
pcsx_rearmed-f82c62507c67309b9c020a54f6c848853d39febe.tar.bz2
pcsx_rearmed-f82c62507c67309b9c020a54f6c848853d39febe.zip
psx_gpu: standalone test build + tweaks
Diffstat (limited to 'plugins/gpu_neon')
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu_main.c25
-rw-r--r--plugins/gpu_neon/psx_gpu/tests/Makefile26
-rwxr-xr-xplugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh8
3 files changed, 57 insertions, 2 deletions
diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_main.c b/plugins/gpu_neon/psx_gpu/psx_gpu_main.c
index 8ca3ad0..c7ce0ee 100644
--- a/plugins/gpu_neon/psx_gpu/psx_gpu_main.c
+++ b/plugins/gpu_neon/psx_gpu/psx_gpu_main.c
@@ -127,7 +127,7 @@ void update_screen(psx_gpu_struct *psx_gpu, SDL_Surface *screen)
int main(int argc, char *argv[])
{
psx_gpu_struct *psx_gpu = &_psx_gpu;
- SDL_Surface *screen;
+ SDL_Surface *screen = NULL;
SDL_Event event;
u32 *list;
@@ -164,14 +164,35 @@ int main(int argc, char *argv[])
{
SDL_Init(SDL_INIT_EVERYTHING);
screen = SDL_SetVideoMode(1024, 512, 32, 0);
+ if (screen == 0)
+ {
+ printf("can't set video mode: %s\n", SDL_GetError());
+ return 1;
+ }
}
#ifdef NEON_BUILD
+ u16 *vram_ptr;
+#if 0
system("ofbset -fb /dev/fb1 -mem 6291456 -en 0");
u32 fbdev_handle = open("/dev/fb1", O_RDWR);
- u16 *vram_ptr =
vram_ptr = (mmap((void *)0x50000000, 1024 * 1024 * 2, PROT_READ | PROT_WRITE,
MAP_SHARED | 0xA0000000, fbdev_handle, 0));
+#elif 1
+ #ifndef MAP_HUGETLB
+ #define MAP_HUGETLB 0x40000 /* arch specific */
+ #endif
+ vram_ptr = (mmap((void *)0x50000000, 1024 * 1024 * 2, PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_PRIVATE | MAP_HUGETLB, -1, 0));
+#else
+ vram_ptr = (mmap((void *)0x50000000, 1024 * 1024 * 2, PROT_READ | PROT_WRITE,
+ MAP_ANONYMOUS | MAP_PRIVATE, -1, 0));
+#endif
+ if (vram_ptr == MAP_FAILED)
+ {
+ perror("mmap");
+ return 1;
+ }
vram_ptr += 64;
initialize_psx_gpu(psx_gpu, vram_ptr);
diff --git a/plugins/gpu_neon/psx_gpu/tests/Makefile b/plugins/gpu_neon/psx_gpu/tests/Makefile
new file mode 100644
index 0000000..210f44d
--- /dev/null
+++ b/plugins/gpu_neon/psx_gpu/tests/Makefile
@@ -0,0 +1,26 @@
+CC = $(CROSS_COMPILE)gcc
+CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
+CFLAGS += -Wall -ggdb
+
+CFLAGS += `sdl-config --cflags`
+LDFLAGS += `sdl-config --libs`
+
+VPATH += ..
+
+ifdef NEON
+CFLAGS += -mcpu=cortex-a8 -mfpu=neon -DNEON_BUILD
+ASFLAGS = $(CFLAGS)
+OBJ += psx_gpu_arm_neon.o
+endif
+ifndef DEBUG
+CFLAGS += -O2 -fno-strict-aliasing
+endif
+
+OBJ += psx_gpu.o psx_gpu_parse.o psx_gpu_main.o
+
+all: psx_gpu
+
+psx_gpu: $(OBJ)
+
+clean:
+ $(RM) psx_gpu $(OBJ)
diff --git a/plugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh b/plugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh
new file mode 100755
index 0000000..25d0725
--- /dev/null
+++ b/plugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh
@@ -0,0 +1,8 @@
+truncate --size 0 $1
+for dump in gpu_dumps_all/*
+do
+ if [ -e $dump/dump3.dump -a -e $dump/list.dump ]; then
+ ./psx_gpu $dump/dump3.dump $dump/list.dump -n >> $1
+ echo "Mismatches in $dump: $?"
+ fi
+done