From: notaz Date: Sun, 24 Mar 2024 23:50:25 +0000 (+0200) Subject: spu: more status bits X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=3047daea4d4f6f00fdaa0467c15efd128b822367 spu: more status bits notaz/pcsx_rearmed#338 --- 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)