spu: more status bits
authornotaz <notasas@gmail.com>
Sun, 24 Mar 2024 23:50:25 +0000 (01:50 +0200)
committernotaz <notasas@gmail.com>
Mon, 25 Mar 2024 20:48:08 +0000 (22:48 +0200)
notaz/pcsx_rearmed#338

plugins/dfsound/registers.c
plugins/dfsound/registers.h
plugins/dfsound/spu.c

index 1e79c0e..6d72d3c 100644 (file)
@@ -144,7 +144,7 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val,
       break;\r
     //-------------------------------------------------//\r
     case H_SPUctrl:\r
-      spu.spuStat = (spu.spuStat & ~0x3f) | (val & 0x3f);\r
+      spu.spuStat = (spu.spuStat & ~0xbf) | (val & 0x3f) | ((val << 2) & 0x80);\r
       spu.spuStat &= ~STAT_IRQ | val;\r
       if (!(spu.spuCtrl & CTRL_IRQ)) {\r
         if (val & CTRL_IRQ)\r
index a296431..4acfe6f 100644 (file)
 #define CTRL_MUTE               0x4000\r
 #define CTRL_ON                 0x8000\r
 \r
-#define STAT_IRQ                0x40\r
+#define STAT_IRQ                0x0040\r
+#define STAT_DMA_W              0x0100\r
+#define STAT_DMA_R              0x0200\r
+#define STAT_DMA_BUSY           0x0400\r
 \r
 ///////////////////////////////////////////////////////////\r
 \r
index 9d43e43..022a1e3 100644 (file)
@@ -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)