CD Volume is 16-bits signed, not unsigned.
Otherwise in Star Wars Dark Forces :
If you set the volume slider to the minimum value allowed
for the CD Volume, it will overflow and wrap around (to the maximum volume).
short * pS;\r
\r
void (CALLBACK *irqCallback)(void); // func of main emu, called on spu irq\r
- void (CALLBACK *cddavCallback)(unsigned short,unsigned short);\r
+ void (CALLBACK *cddavCallback)(short, short);\r
void (CALLBACK *scheduleCallback)(unsigned int);\r
\r
xa_decode_t * xapGlobal;\r
break;\r
//-------------------------------------------------//\r
case H_CDLeft:\r
- spu.iLeftXAVol=val & 0x7fff;\r
- if(spu.cddavCallback) spu.cddavCallback(0,val);\r
+ spu.iLeftXAVol=(int16_t)val;\r
+ if(spu.cddavCallback) spu.cddavCallback(0,(int16_t)val);\r
break;\r
case H_CDRight:\r
- spu.iRightXAVol=val & 0x7fff;\r
- if(spu.cddavCallback) spu.cddavCallback(1,val);\r
+ spu.iRightXAVol=(int16_t)val;\r
+ if(spu.cddavCallback) spu.cddavCallback(1,(int16_t)val);\r
break;\r
//-------------------------------------------------//\r
case H_FMod1:\r
spu.irqCallback = callback;
}
-void CALLBACK SPUregisterCDDAVolume(void (CALLBACK *CDDAVcallback)(unsigned short,unsigned short))
+void CALLBACK SPUregisterCDDAVolume(void (CALLBACK *CDDAVcallback)(short, short))
{
spu.cddavCallback = CDDAVcallback;
}
////////////////////////////////////////////////////////////////////////
void (CALLBACK *irqCallback)(void)=0; // func of main emu, called on spu irq
-void (CALLBACK *cddavCallback)(unsigned short,unsigned short)=0;
+void (CALLBACK *cddavCallback)(short, short)=0;
////////////////////////////////////////////////////////////////////////
// CODE AREA
irqCallback = callback;
}
-void CALLBACK SPUregisterCDDAVolume(void (CALLBACK *CDDAVcallback)(unsigned short,unsigned short))
+void CALLBACK SPUregisterCDDAVolume(void (CALLBACK *CDDAVcallback)(short, short))
{
cddavCallback = CDDAVcallback;
}