ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Got::MusicDriver_Got_AdLib Class Reference
Inheritance diagram for Got::MusicDriver_Got_AdLib:
Got::MusicDriver_Got

Public Member Functions

 MusicDriver_Got_AdLib (uint8 timerFrequency)
 
int open () override
 
void close () override
 
void syncSoundSettings () override
 
void send (uint16 b) override
 
void stopAllNotes () override
 
void setTimerFrequency (uint8 timerFrequency) override
 
- Public Member Functions inherited from Got::MusicDriver_Got
 MusicDriver_Got (uint8 timerFrequency)
 
bool isOpen () const
 
void onTimer ()
 
void setTimerCallback (void *timer_param, Common::TimerManager::TimerProc timer_proc)
 

Static Public Attributes

static const uint8 OPL2_NUM_CHANNELS = 9
 
static const uint8 OPL_REGISTER_BASE_FREQMULT_MISC = 0x20
 
static const uint8 OPL_REGISTER_BASE_LEVEL = 0x40
 
static const uint8 OPL_REGISTER_BASE_DECAY_ATTACK = 0x60
 
static const uint8 OPL_REGISTER_BASE_RELEASE_SUSTAIN = 0x80
 
static const uint8 OPL_REGISTER_BASE_WAVEFORMSELECT = 0xE0
 
static const uint8 OPL_REGISTER_BASE_FNUMLOW = 0xA0
 
static const uint8 OPL_REGISTER_BASE_FNUMHIGH_BLOCK_KEYON = 0xB0
 
static const uint8 OPL_REGISTER_BASE_CONNECTION_FEEDBACK_PANNING = 0xC0
 

Protected Member Functions

void initOpl ()
 
void recalculateVolumes ()
 
uint8 calculateVolume (uint8 channel, uint8 operatorNum)
 
bool isVolumeApplicableToOperator (uint8 oplChannel, uint8 operatorNum)
 
uint16 determineOperatorRegisterOffset (uint8 oplChannel, uint8 operatorNum)
 
void writeRegister (uint8 oplRegister, uint8 value)
 

Protected Attributes

OPL::OPL_opl
 
uint8 _channelOp0LevelRegisterValues [OPL2_NUM_CHANNELS]
 
uint8 _channelOp1LevelRegisterValues [OPL2_NUM_CHANNELS]
 
uint8 _channelBxRegisterValues [OPL2_NUM_CHANNELS]
 
uint8 _channelConnectionValues [OPL2_NUM_CHANNELS]
 
uint16 _userMusicVolume
 
bool _userMute
 
- Protected Attributes inherited from Got::MusicDriver_Got
bool _isOpen
 
int _timerFrequency
 
void * _timer_param
 
Common::TimerManager::TimerProc _timer_proc
 

Member Function Documentation

◆ initOpl()

void Got::MusicDriver_Got_AdLib::initOpl ( )
protected

Initializes the OPL registers to their default values.

◆ isVolumeApplicableToOperator()

bool Got::MusicDriver_Got_AdLib::isVolumeApplicableToOperator ( uint8  oplChannel,
uint8  operatorNum 
)
protected

Determines if volume settings should be applied to the operator level. This depends on the type of the operator (carrier or modulator), which depends on the type of connection specified on the channel.

Parameters
oplChannelThe OPL channel
operatorNumThe number of the operator (0-1)
Returns
True if volume should be applied, false otherwise

◆ determineOperatorRegisterOffset()

uint16 Got::MusicDriver_Got_AdLib::determineOperatorRegisterOffset ( uint8  oplChannel,
uint8  operatorNum 
)
protected

Determines the offset from a base register for the specified operator of the specified OPL channel. Add the offset to the base register to get the correct register for this operator and channel.

Parameters
oplChannelThe OPL channel for which to determine the offset.
operatorNumThe operator for which to determine the offset (0-1).
Returns
The offset to the base register for this operator.

Member Data Documentation

◆ OPL2_NUM_CHANNELS

const uint8 Got::MusicDriver_Got_AdLib::OPL2_NUM_CHANNELS = 9
static

The number of available channels on the OPL2 chip.

◆ OPL_REGISTER_BASE_FREQMULT_MISC

const uint8 Got::MusicDriver_Got_AdLib::OPL_REGISTER_BASE_FREQMULT_MISC = 0x20
static

OPL operator base registers.

◆ OPL_REGISTER_BASE_FNUMLOW

const uint8 Got::MusicDriver_Got_AdLib::OPL_REGISTER_BASE_FNUMLOW = 0xA0
static

OPL channel base registers.


The documentation for this class was generated from the following file: