1
0
Fork 0
forked from len0rd/rockbox

duke3d: rewrite sound mixing to use fixed-point

Gives significant performance improvement on ipod6g.

Change-Id: I1e8462bec197acb10e770c796240b5001df52440
This commit is contained in:
Franklin Wei 2017-12-25 14:53:11 -05:00
parent 78db1d9502
commit 9f6ce046cb
10 changed files with 476 additions and 449 deletions

View file

@ -50,64 +50,64 @@ int32_t backflag,numenvsnds;
*/
void SoundStartup( void )
{
int32 status;
{
int32 status;
// if they chose None lets return
if (FXDevice == NumSoundCards) return;
// if they chose None lets return
if (FXDevice == NumSoundCards) return;
// Do special Sound Blaster, AWE32 stuff
if (
( FXDevice == SoundBlaster ) ||
( FXDevice == Awe32 )
)
{
int MaxVoices;
int MaxBits;
int MaxChannels;
// Do special Sound Blaster, AWE32 stuff
if (
( FXDevice == SoundBlaster ) ||
( FXDevice == Awe32 )
)
{
int MaxVoices;
int MaxBits;
int MaxChannels;
status = FX_SetupSoundBlaster
(
BlasterConfig, (int *)&MaxVoices, (int *)&MaxBits, (int *)&MaxChannels
);
}
else
{
status = FX_Ok;
}
status = FX_SetupSoundBlaster
(
BlasterConfig, (int *)&MaxVoices, (int *)&MaxBits, (int *)&MaxChannels
);
}
else
{
status = FX_Ok;
}
if ( status == FX_Ok )
{
if ( eightytwofifty && numplayers > 1)
{
status = FX_Init( FXDevice, min( NumVoices,4 ), 1, 8, 8000 );
}
else
{
status = FX_Init( FXDevice, NumVoices, NumChannels, NumBits, MixRate );
}
if ( status == FX_Ok )
{
if ( status == FX_Ok )
{
if ( eightytwofifty && numplayers > 1)
{
status = FX_Init( FXDevice, min( NumVoices,4 ), 1, 8, 8000 );
}
else
{
status = FX_Init( FXDevice, NumVoices, NumChannels, NumBits, MixRate );
}
if ( status == FX_Ok )
{
FX_SetVolume( FXVolume );
if (ReverseStereo == 1)
FX_SetVolume( FXVolume );
if (ReverseStereo == 1)
{
FX_SetReverseStereo(!FX_GetReverseStereo());
FX_SetReverseStereo(!FX_GetReverseStereo());
}
}
}
if ( status != FX_Ok )
{
Error(EXIT_FAILURE, FX_ErrorString( FX_Error ));
}
}
}
if ( status != FX_Ok )
{
Error(EXIT_FAILURE, FX_ErrorString( FX_Error ));
}
status = FX_SetCallBack( TestCallBack );
status = FX_SetCallBack( TestCallBack );
if ( status != FX_Ok )
{
Error(EXIT_FAILURE, FX_ErrorString( FX_Error ));
}
}
if ( status != FX_Ok )
{
Error(EXIT_FAILURE, FX_ErrorString( FX_Error ));
}
}
/*
===================