Skip to content

Commit

Permalink
Add similar functions for controlling OPL volumes, just like what's
Browse files Browse the repository at this point in the history
present for digitized sounds. This is still limited to SB Pro, SB 16.
Also add a compatibility macro related to Line-In for S3DNA.
  • Loading branch information
NY00123 committed Aug 21, 2021
1 parent e7b71df commit 241b6cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/backend/audio/be_audio_opl.c
Expand Up @@ -54,6 +54,16 @@ void BEL_ST_SetOPLMixerSource(BE_ST_AudioMixerSource *src)
g_oplMixerSource = src;
}

void BE_ST_SetFMSBProSoundVolumes(uint8_t volBits)
{
BEL_ST_SetSBProVolumesForSource(g_oplMixerSource, volBits);
}

uint8_t BE_ST_GetFMSBProSoundVolumes(void)
{
return BEL_ST_GetSBProVolumesFromSource(g_oplMixerSource);
}

#define OPL_NUM_OF_SAMPLES 2048 // About 40ms of OPL sound data

void BEL_ST_GenOPLSamples(BE_ST_SndSample_T *stream, int length)
Expand Down
7 changes: 7 additions & 0 deletions src/be_st.h
Expand Up @@ -313,6 +313,13 @@ void BE_ST_SetDigiSBProSoundVolumes(uint8_t volBits);
// Same but for getting the volumes
uint8_t BE_ST_GetDigiSBProSoundVolumes(void);

// Similar functions, but for the SB Pro's FM synthesis.
void BE_ST_SetFMSBProSoundVolumes(uint8_t volBits);
uint8_t BE_ST_GetFMSBProSoundVolumes(void);

// Compatibility macro that was originally added for Super 3-D Noah's Ark
#define BE_ST_SetLineInSBProSoundVolumes(volBits)

void BE_ST_PlaySoundEffect(void *data, int numOfSamples, int bits);
void BE_ST_StopSoundEffect(void);
// Safe alternatives for Borland's sound and nosound functions from Catacomb Abyss' gelib.c
Expand Down

0 comments on commit 241b6cd

Please sign in to comment.