X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfsound%2Fregisters.c;h=ae7ed24e776c8028ac7af7c745b292ef2c3d4766;hb=4b22d9501e7de7b7991e5cf3163e4b48806a0913;hp=580589975d334784b681f7f05af343adb5c87542;hpb=31cd6032b51dd31def3cee4d778e480c8fb0df67;p=pcsx_rearmed.git diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c index 58058997..ae7ed24e 100644 --- a/plugins/dfsound/registers.c +++ b/plugins/dfsound/registers.c @@ -37,17 +37,19 @@ static void ReverbOn(int start,int end,unsigned short val); // WRITE REGISTERS: called by main emu //////////////////////////////////////////////////////////////////////// -static const uint32_t ignore_dupe[8] = { +static const uint32_t ignore_dupe[16] = { // ch 0-15 c40 c80 cc0 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f, 0x7f7f7f7f, // ch 16-24 d40 control reverb - 0x7f7f7f7f, 0x7f7f7f7f, 0xff05ff0f, 0xffffffff + 0x7f7f7f7f, 0x7f7f7f7f, 0xff05ff0f, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val, unsigned int cycles) { - int r = reg & 0xfff; + int r = reg & 0xffe; int rofs = (r - 0xc00) >> 1; int changed = spu.regArea[rofs] != val; spu.regArea[rofs] = val; @@ -119,6 +121,12 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val, } return; } + else if (0x0e00 <= r && r < 0x0e60) + { + int ch = (r >> 2) & 0x1f; + log_unhandled("c%02d w %cvol %04x\n", ch, (r & 2) ? 'r' : 'l', val); + spu.s_chan[ch].iVolume[(r >> 1) & 1] = (signed short)val >> 1; + } switch(r) { @@ -300,7 +308,7 @@ rvbd: unsigned short CALLBACK SPUreadRegister(unsigned long reg) { - const unsigned long r=reg&0xfff; + const unsigned long r = reg & 0xffe; if(r>=0x0c00 && r<0x0d80) { @@ -323,6 +331,13 @@ unsigned short CALLBACK SPUreadRegister(unsigned long reg) } } } + else if (0x0e00 <= r && r < 0x0e60) + { + int ch = (r >> 2) & 0x1f; + int v = spu.s_chan[ch].iVolume[(r >> 1) & 1] << 1; + log_unhandled("c%02d r %cvol %04x\n", ch, (r & 2) ? 'r' : 'l', v); + return v; + } switch(r) { @@ -478,6 +493,7 @@ static void SetVolumeL(unsigned char ch,short vol) // LEFT VOLUME vol&=0x3fff; spu.s_chan[ch].iLeftVolume=vol; // store volume + //spu.regArea[(0xe00-0xc00)/2 + ch*2 + 0] = vol << 1; } //////////////////////////////////////////////////////////////////////// @@ -505,6 +521,7 @@ static void SetVolumeR(unsigned char ch,short vol) // RIGHT VOLUME vol&=0x3fff; spu.s_chan[ch].iRightVolume=vol; + //spu.regArea[(0xe00-0xc00)/2 + ch*2 + 1] = vol << 1; } ////////////////////////////////////////////////////////////////////////