mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
Add mus_al_additive to control the behavior mentioned in r8232 and rename mus_adlibstereo to mus_al_stereo
git-svn-id: https://svn.eduke32.com/eduke32@8238 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e82ddb23d3
commit
dafd71c72f
3 changed files with 10 additions and 3 deletions
|
@ -200,6 +200,7 @@ static int AL_LeftPort = ADLIB_PORT;
|
||||||
static int AL_RightPort = ADLIB_PORT;
|
static int AL_RightPort = ADLIB_PORT;
|
||||||
int AL_Stereo = TRUE;
|
int AL_Stereo = TRUE;
|
||||||
static int AL_MaxMidiChannel = 16;
|
static int AL_MaxMidiChannel = 16;
|
||||||
|
int AL_AdditiveMode;
|
||||||
|
|
||||||
// TODO: clean up this shit...
|
// TODO: clean up this shit...
|
||||||
#define OFFSET(structure, offset) (*((char **)&(structure)[offset]))
|
#define OFFSET(structure, offset) (*((char **)&(structure)[offset]))
|
||||||
|
@ -331,9 +332,13 @@ static void AL_SetVoiceVolume(int const voice)
|
||||||
if (timbre->Feedback & 0x01)
|
if (timbre->Feedback & 0x01)
|
||||||
{
|
{
|
||||||
int const slot = slotVoice[voc][0];
|
int const slot = slotVoice[voc][0];
|
||||||
|
uint32_t t2;
|
||||||
|
|
||||||
// amplitude
|
// amplitude
|
||||||
auto t2 = (Channel[channel].Volume * t1) >> 15;
|
if (AL_AdditiveMode)
|
||||||
|
t1 = (uint32_t)VoiceLevel[slot][port] * (velocity + 0x80);
|
||||||
|
|
||||||
|
t2 = (Channel[channel].Volume * t1) >> 15;
|
||||||
|
|
||||||
volume = t2 ^ 63;
|
volume = t2 ^ 63;
|
||||||
volume |= (uint32_t)VoiceKsl[slot][port];
|
volume |= (uint32_t)VoiceKsl[slot][port];
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "opl3.h"
|
#include "opl3.h"
|
||||||
|
|
||||||
extern int AL_Stereo;
|
extern int AL_Stereo;
|
||||||
|
extern int AL_AdditiveMode;
|
||||||
|
|
||||||
int AdLibDrv_GetError(void);
|
int AdLibDrv_GetError(void);
|
||||||
const char *AdLibDrv_ErrorString(int ErrorNumber);
|
const char *AdLibDrv_ErrorString(int ErrorNumber);
|
||||||
|
|
|
@ -56,7 +56,7 @@ static int osdcmd_cvar_set_audiolib(osdcmdptr_t parm)
|
||||||
|
|
||||||
if (!Bstrcasecmp(parm->name, "mus_emidicard"))
|
if (!Bstrcasecmp(parm->name, "mus_emidicard"))
|
||||||
MIDI_Restart();
|
MIDI_Restart();
|
||||||
else if (!Bstrcasecmp(parm->name, "mus_adlibstereo"))
|
else if (!Bstrcasecmp(parm->name, "mus_al_stereo"))
|
||||||
AL_SetStereo(AL_Stereo);
|
AL_SetStereo(AL_Stereo);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
@ -72,7 +72,8 @@ int FX_Init(int numvoices, int numchannels, int mixrate, void *initdata)
|
||||||
|
|
||||||
static osdcvardata_t cvars_audiolib[] = {
|
static osdcvardata_t cvars_audiolib[] = {
|
||||||
{ "mus_emidicard", "force a specific EMIDI instrument set", (void *)&ASS_EMIDICard, CVAR_INT | CVAR_FUNCPTR, -1, 10 },
|
{ "mus_emidicard", "force a specific EMIDI instrument set", (void *)&ASS_EMIDICard, CVAR_INT | CVAR_FUNCPTR, -1, 10 },
|
||||||
{ "mus_adlibstereo", "enable/disable OPL3 stereo mode", (void *)&AL_Stereo, CVAR_BOOL | CVAR_FUNCPTR, 0, 1 },
|
{ "mus_al_stereo", "enable/disable OPL3 stereo mode", (void *)&AL_Stereo, CVAR_BOOL | CVAR_FUNCPTR, 0, 1 },
|
||||||
|
{ "mus_al_additivemode", "enable/disable alternate additive AdLib timbre mode", (void *)&AL_AdditiveMode, CVAR_BOOL, 0, 1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!init++)
|
if (!init++)
|
||||||
|
|
Loading…
Reference in a new issue