From 05006805224615eba45c7e1491915f64e23bf18a Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 25 Mar 2024 01:50:25 +0200 Subject: [PATCH] spu: more status bits notaz/pcsx_rearmed#338 --- plugins/dfsound/registers.c | 2 +- plugins/dfsound/registers.h | 5 ++++- plugins/dfsound/spu.c | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c index 1e79c0e6..6d72d3ca 100644 --- a/plugins/dfsound/registers.c +++ b/plugins/dfsound/registers.c @@ -144,7 +144,7 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val, break; //-------------------------------------------------// case H_SPUctrl: - spu.spuStat = (spu.spuStat & ~0x3f) | (val & 0x3f); + spu.spuStat = (spu.spuStat & ~0xbf) | (val & 0x3f) | ((val << 2) & 0x80); spu.spuStat &= ~STAT_IRQ | val; if (!(spu.spuCtrl & CTRL_IRQ)) { if (val & CTRL_IRQ) diff --git a/plugins/dfsound/registers.h b/plugins/dfsound/registers.h index a296431f..4acfe6f2 100644 --- a/plugins/dfsound/registers.h +++ b/plugins/dfsound/registers.h @@ -153,7 +153,10 @@ #define CTRL_MUTE 0x4000 #define CTRL_ON 0x8000 -#define STAT_IRQ 0x40 +#define STAT_IRQ 0x0040 +#define STAT_DMA_W 0x0100 +#define STAT_DMA_R 0x0200 +#define STAT_DMA_BUSY 0x0400 /////////////////////////////////////////////////////////// diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 9d43e438..022a1e3d 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -1245,6 +1245,7 @@ void do_samples(unsigned int cycles_to, int force_no_thread) spu.cycles_played += ns_to * 768; spu.decode_pos = (spu.decode_pos + ns_to) & 0x1ff; + spu.spuStat = (spu.spuStat & ~0x800) | ((spu.decode_pos << 3) & 0x800); #if 0 static int ccount; static time_t ctime; ccount++; if (time(NULL) != ctime) -- 2.39.5