add panning to flt_rc.[c/h] for Gyruss

This commit is contained in:
dinkc64 2015-02-09 21:20:26 +00:00
parent eaebf94886
commit 64e64504a5
2 changed files with 12 additions and 0 deletions

View File

@ -62,6 +62,11 @@ void filter_rc_update(INT32 num, INT16 *src, INT16 *pSoundBuf, INT32 length)
if ((ptr->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) {
nRightSample += (INT32)(memory * ptr->gain);
}
if (ptr->output_dir & (FLT_RC_PANNEDLEFT + FLT_RC_PANNEDRIGHT)) { // panned slightly right or left (used in gyruss)
nLeftSample += (INT32)(memory * ((ptr->output_dir & FLT_RC_PANNEDRIGHT) ? (ptr->gain / 3) : (ptr->gain)));
nRightSample += (INT32)(memory * ((ptr->output_dir & FLT_RC_PANNEDLEFT ) ? (ptr->gain / 3) : (ptr->gain)));
}
nLeftSample = BURN_SND_CLIP(nLeftSample);
nRightSample = BURN_SND_CLIP(nRightSample);
@ -97,6 +102,11 @@ void filter_rc_update(INT32 num, INT16 *src, INT16 *pSoundBuf, INT32 length)
if ((ptr->output_dir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) {
nRightSample += (INT32)(value * ptr->gain);
}
if (ptr->output_dir & (FLT_RC_PANNEDLEFT + FLT_RC_PANNEDRIGHT)) { // panned slightly right or left (used in gyruss)
nLeftSample += (INT32)(value * ((ptr->output_dir & FLT_RC_PANNEDRIGHT) ? (ptr->gain / 3) : (ptr->gain)));
nRightSample += (INT32)(value * ((ptr->output_dir & FLT_RC_PANNEDLEFT ) ? (ptr->gain / 3) : (ptr->gain)));
}
nLeftSample = BURN_SND_CLIP(nLeftSample);
nRightSample = BURN_SND_CLIP(nRightSample);

View File

@ -3,6 +3,8 @@
#define FLT_RC_LOWPASS 0
#define FLT_RC_HIGHPASS 1
#define FLT_RC_AC 2
#define FLT_RC_PANNEDLEFT 4
#define FLT_RC_PANNEDRIGHT 8
void filter_rc_update(INT32 num, INT16 *src, INT16 *pSoundBuf, INT32 length);
void filter_rc_set_RC(INT32 num, INT32 type, double R1, double R2, double R3, double C);