X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=plugins%2Fdfsound%2Fregisters.c;h=badd0af063ad4f55eda1c659c6ef3869d6a83306;hb=a4621d435f84acf094a6601c3a444cc550f82929;hp=6b62247f8b3e5b370a16d6e3545351e56225914f;hpb=5fdcf5cd320abef2c685630e3edf3598645d141e;p=pcsx_rearmed.git diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c index 6b62247f..badd0af0 100644 --- a/plugins/dfsound/registers.c +++ b/plugins/dfsound/registers.c @@ -22,6 +22,7 @@ #include "externals.h" #include "registers.h" #include "spu_config.h" +#include "spu.h" static void SoundOn(int start,int end,unsigned short val); static void SoundOff(int start,int end,unsigned short val); @@ -127,7 +128,7 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val, break; //-------------------------------------------------// case H_SPUdata: - *(unsigned short *)(spu.spuMemC + spu.spuAddr) = val; + *(unsigned short *)(spu.spuMemC + spu.spuAddr) = HTOLE16(val); spu.spuAddr += 2; spu.spuAddr &= 0x7fffe; break; @@ -161,6 +162,17 @@ void CALLBACK SPUwriteRegister(unsigned long reg, unsigned short val, break; //-------------------------------------------------// + case H_SPUmvolL: + case H_SPUmvolR: + if (val & 0x8000) + log_unhandled("w master sweep: %08lx %04x\n", reg, val); + break; + + case 0x0dac: + if (val != 4) + log_unhandled("1f801dac %04x\n", val); + break; + /* case H_ExtLeft: //auxprintf("EL %d\n",val); @@ -323,7 +335,7 @@ unsigned short CALLBACK SPUreadRegister(unsigned long reg) case H_SPUdata: { - unsigned short s = *(unsigned short *)(spu.spuMemC + spu.spuAddr); + unsigned short s = LE16TOH(*(unsigned short *)(spu.spuMemC + spu.spuAddr)); spu.spuAddr += 2; spu.spuAddr &= 0x7fffe; return s; @@ -335,6 +347,10 @@ unsigned short CALLBACK SPUreadRegister(unsigned long reg) //case H_SPUIsOn2: // return IsSoundOn(16,24); + case H_SPUMute1: + case H_SPUMute2: + log_unhandled("r isOn: %08lx\n", reg); + break; } return spu.regArea[(r-0xc00)>>1]; @@ -431,6 +447,7 @@ static void SetVolumeL(unsigned char ch,short vol) // LEFT VOLUME if(vol&0x8000) // sweep? { short sInc=1; // -> sweep up? + log_unhandled("ch%d sweepl %04x\n", ch, vol); if(vol&0x2000) sInc=-1; // -> or down? if(vol&0x1000) vol^=0xffff; // -> mmm... phase inverted? have to investigate this vol=((vol&0x7f)+1)/2; // -> sweep: 0..127 -> 0..64 @@ -457,6 +474,7 @@ static void SetVolumeR(unsigned char ch,short vol) // RIGHT VOLUME if(vol&0x8000) // comments... see above :) { short sInc=1; + log_unhandled("ch%d sweepr %04x\n", ch, vol); if(vol&0x2000) sInc=-1; if(vol&0x1000) vol^=0xffff; vol=((vol&0x7f)+1)/2; @@ -488,10 +506,8 @@ static void SetPitch(int ch,unsigned short val) // SET PITCH spu.s_chan[ch].sinc = NP << 4; spu.s_chan[ch].sinc_inv = 0; spu.SB[ch * SB_SIZE + 32] = 1; // -> freq change in simple interpolation mode: set flag - if (val) - spu.dwChannelsAudible |= 1u << ch; - else - spu.dwChannelsAudible &= ~(1u << ch); + + // don't mess spu.dwChannelsAudible as adsr runs independently } ////////////////////////////////////////////////////////////////////////