aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authortwinaphex2013-03-18 01:16:31 +0100
committertwinaphex2013-03-18 01:16:31 +0100
commit22dade5ca95efa7fb3530023dbab77f8516bfed7 (patch)
tree40a660c1e7a806abe03b2c9f2e6389073894877b /plugins
parent24f4865eff11beb6348d9e0e310d593477359afe (diff)
parent101e053c72e9299bfbd1cbf6a8de9ba6cff11e4c (diff)
downloadpcsx_rearmed-22dade5ca95efa7fb3530023dbab77f8516bfed7.tar.gz
pcsx_rearmed-22dade5ca95efa7fb3530023dbab77f8516bfed7.tar.bz2
pcsx_rearmed-22dade5ca95efa7fb3530023dbab77f8516bfed7.zip
Merge git://github.com/notaz/pcsx_rearmed
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dfsound/spu.c22
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu.c2
-rw-r--r--plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S2
-rw-r--r--plugins/gpu_neon/psx_gpu/tests/Makefile3
-rwxr-xr-xplugins/gpu_neon/psx_gpu/tests/psx_dump_check.sh5
5 files changed, 20 insertions, 14 deletions
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);
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() \
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 ]
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 <logfile>"
+ exit 1
+fi
+
truncate --size 0 $1
for dump in gpu_dumps_all/*
do