From 134f81ec45254560f7eee08bb0b59d403449c5e0 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 13 Mar 2013 01:51:32 +0200 Subject: psx_gpu: fix mask set in blend_blocks variant thanks to Exophase for help with coming up with this fix --- plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plugins') diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S index 344331d..d8fb153 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S @@ -4280,6 +4280,7 @@ function(blend_blocks_textured_unblended_on) beq 1f 0: + vorr.u16 pixels, pixels, msb_mask vorr.u16 draw_mask, draw_mask, write_mask vbif.u16 fb_pixels, pixels, draw_mask vst1.u16 { fb_pixels }, [ fb_ptr ] @@ -4294,6 +4295,7 @@ function(blend_blocks_textured_unblended_on) bne 0b 1: + vorr.u16 pixels, pixels, msb_mask vorr.u16 draw_mask, draw_mask, write_mask vbif.u16 fb_pixels, pixels, draw_mask vst1.u16 { fb_pixels }, [ fb_ptr ] -- cgit v1.2.3 From a2fc80704176e6f98c579f795f39bcc29f5877ed Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 13 Mar 2013 01:54:13 +0200 Subject: psx_gpu: minor test fixes --- plugins/gpu_neon/psx_gpu/tests/Makefile | 3 ++- plugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/gpu_neon/psx_gpu/tests/Makefile b/plugins/gpu_neon/psx_gpu/tests/Makefile index 58cca29..bb91a5a 100644 --- a/plugins/gpu_neon/psx_gpu/tests/Makefile +++ b/plugins/gpu_neon/psx_gpu/tests/Makefile @@ -1,6 +1,7 @@ CC = $(CROSS_COMPILE)gcc CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP CFLAGS += -Wall -ggdb +CFLAGS += -fno-strict-aliasing CFLAGS += `sdl-config --cflags` LDFLAGS += `sdl-config --libs` @@ -13,7 +14,7 @@ ASFLAGS = $(CFLAGS) OBJ += psx_gpu_arm_neon.o endif ifndef DEBUG -CFLAGS += -O2 -DNDEBUG -fno-strict-aliasing +CFLAGS += -O2 -DNDEBUG endif OBJ += psx_gpu.o psx_gpu_parse.o psx_gpu_main.o diff --git a/plugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh b/plugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh index 25d0725..58427b1 100755 --- a/plugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh +++ b/plugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh @@ -1,3 +1,8 @@ +if test -z "$1"; then + echo "$0 " + exit 1 +fi + truncate --size 0 $1 for dump in gpu_dumps_all/* do -- cgit v1.2.3 From 2177c1ea9af71647a43a38d2277a7a68429d4f3c Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 13 Mar 2013 02:09:36 +0200 Subject: psx_gpu: fix line mask test --- plugins/gpu_neon/psx_gpu/psx_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.c b/plugins/gpu_neon/psx_gpu/psx_gpu.c index 396d274..f52e842 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.c +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.c @@ -4344,7 +4344,7 @@ void render_sprite(psx_gpu_struct *psx_gpu, s32 x, s32 y, u32 u, u32 v, } #define draw_pixel_line_mask_evaluate_yes() \ - if(*vram_ptr & 0x8000) \ + if((*vram_ptr & 0x8000) == 0) \ #define draw_pixel_line_mask_evaluate_no() \ -- cgit v1.2.3 From 16187bfb1518db23ade931cd7358ba973a585180 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 16 Mar 2013 04:14:24 +0200 Subject: spu: change sync again will hurt audio if game is way too slow, but perhaps improve sync situation a bit.. --- plugins/dfsound/spu.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index b89ab1a..6cefd11 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -707,8 +707,6 @@ static int do_samples(int forced_updates) while(!bIRQReturn) { - cycles_since_update = 0; - ns_from=0; ns_to=NSSIZE; ch=0; @@ -837,6 +835,8 @@ static int do_samples(int forced_updates) ns++; } + cycles_since_update -= PSXCLK / 44100 * NSSIZE; + ////////////////////////////////////////////////////// // special irq handling in the decode buffers (0x0000-0x1000) // we know: @@ -888,8 +888,15 @@ static int do_samples(int forced_updates) if(forced_updates == 0 && out_current->busy()) break; } + + if(cycles_since_update <= -PSXCLK/60 / 4) + break; } + // this may cause desync, but help audio when the emu can't keep up.. + if(cycles_since_update < 0) + cycles_since_update = 0; + return 0; } @@ -900,7 +907,6 @@ static int do_samples(int forced_updates) void CALLBACK SPUasync(unsigned long cycle) { - static int old_ctrl; int forced_updates = 0; int do_update = 0; @@ -915,16 +921,8 @@ void CALLBACK SPUasync(unsigned long cycle) had_dma = 0; } - if((spuCtrl&CTRL_IRQ) && (((spuCtrl^old_ctrl)&CTRL_IRQ) // irq was enabled - || cycles_since_update > PSXCLK/60 / 4)) { + if(cycles_since_update > PSXCLK/60 * 5/4) do_update = 1; - forced_updates = cycles_since_update / (PSXCLK/44100) / NSSIZE; - } - // with no irqs, once per frame should be fine (using a bit more because of BIAS) - else if(cycles_since_update > PSXCLK/60 * 5/4) - do_update = 1; - - old_ctrl = spuCtrl; if(do_update) do_samples(forced_updates); -- cgit v1.2.3