ScummVM API documentation
MADS::RexNebular::Sound::PSound Class Reference

#include <psound.h>

Inheritance diagram for MADS::RexNebular::Sound::PSound:
MADS::SoundDriver MADS::RexNebular::Sound::PSound1 MADS::RexNebular::Sound::PSound2 MADS::RexNebular::Sound::PSound3 MADS::RexNebular::Sound::PSound4 MADS::RexNebular::Sound::PSound5 MADS::RexNebular::Sound::PSound6 MADS::RexNebular::Sound::PSound7 MADS::RexNebular::Sound::PSound8 MADS::RexNebular::Sound::PSound9 MADS::RexNebular::Sound::PSoundDemo1 MADS::RexNebular::Sound::PSoundDemo9

Classes

struct  Channel
 
struct  ChannelData
 

Public Types

enum  { kChannelCount = 9, kMusicChannelCount = 6, kPatchSize = 64, kOpcodeBudgetPerTick = 256 }
 
enum  RegisterBank { kFirstBank = 1, kSecondBank = 2, kBothBanks = kFirstBank | kSecondBank }
 

Public Member Functions

bool isReady () const
 
int stop () override
 
int poll () override
 
void noise () override
 
void setVolume (int volume) override
 
- Public Member Functions inherited from MADS::SoundDriver
 SoundDriver (Audio::Mixer *mixer, const Common::Path &filename, int dataOffset, int dataSize)
 
virtual int command (int commandId, int param)=0
 
virtual void pause (bool paused)
 
virtual void stopAllNotes ()
 

Static Public Member Functions

static void validate (bool isDemo)
 

Protected Member Functions

 PSound (Audio::Mixer *mixer, const PSoundDriverData &driverData)
 
bool isDataRangeValid (uint32 offset, uint32 length) const
 
void requireDataRange (uint32 offset, uint32 length, const char *operation) const
 
const byte * getDataPointer (uint32 offset, uint32 length, const char *operation) const
 
byte * getDataPointer (uint32 offset, uint32 length, const char *operation)
 
void validateDataLayout (const PSoundDriverData &driverData) const
 
byte readDataByte (uint32 offset) const
 
uint16 readDataUint16 (uint32 offset) const
 
void writeDataByte (uint32 offset, byte value)
 
void writeDataUint16 (uint32 offset, uint16 value)
 
byte getBankMask (uint channel) const
 
byte getOplChannel (uint channel) const
 
byte getOperatorOffset (uint channel, uint operatorIndex) const
 
const byte * getPatch (uint patchIndex) const
 
byte getPanningAttenuation (byte panning) const
 
uint16 getFrequencyNumber (byte semitone) const
 
void writeRegister (byte banks, byte reg, byte value)
 
byte getCachedRegister (byte banks, byte reg) const
 
void resetDriver ()
 
virtual int command0 ()
 
int command1 ()
 
int command2 ()
 
int command3 ()
 
int command4 ()
 
int command5 ()
 
int command6 ()
 
int command7 ()
 
int command8 ()
 
int nullCommand ()
 
void loadChannel (uint channel, uint16 sequenceOffset)
 
void playSound (uint16 sequenceOffset)
 
void playSoundAny (uint16 sequenceOffset)
 
bool isSoundActive (uint16 sequenceOffset) const
 
void requestStop (uint firstChannel, uint endChannel)
 
void setCurrentSequence (uint firstChannel, uint endChannel, uint16 sequenceOffset)
 
void onTimer ()
 
int serviceUpdate ()
 
void serviceNoise ()
 
void update ()
 
virtual void tickCallback ()
 
virtual byte getStopFadeReload () const
 
void updateChannel (uint channelIndex)
 
bool executeOpcode (uint channelIndex, byte opcode, bool &levelsDirty)
 
void checkPendingStops ()
 
void finishChannel (uint channelIndex)
 
void loadPatch (uint channelIndex, byte patchIndex)
 
void programOperator (byte banks, uint channelIndex, uint operatorIndex, const byte *operatorData)
 
void updatePanning (uint channelIndex)
 
void updateChannelLevels (uint channelIndex)
 
void updateChannelFrequency (uint channelIndex, bool keyOn)
 
void updatePitchBend (uint channelIndex)
 
void keyOff (uint channelIndex)
 
void startNoise (uint channelIndex)
 
void updateNoise ()
 
void setNoiseFrequency (uint channelIndex, int frequency)
 
void resultCheck ()
 
uint16 nextRandom ()
 
byte scaledCommandParameter (int param) const
 
- Protected Member Functions inherited from MADS::SoundDriver
Common::MemoryReadStream getDataStream (int offset) const
 
 SoundDriver (Audio::Mixer *mixer)
 

Protected Attributes

OPL::OPL * _opl
 
byte _registerCache [2][256]
 
NativeSoundTimer _hostTimer
 
Channel _channels [kChannelCount]
 
ChannelData _channelData [kChannelCount]
 
int _masterVolume
 
uint16 _randomSeed
 
uint16 _frameCounter
 
int16 _pollResult
 
int8 _resultFlag
 
uint16 _nullSequenceOffset
 
uint16 _patchTableOffset
 
PSoundTableLayout _tableLayout
 
byte _patchCount
 
byte _musicChannelCount
 
int _commandParam
 
bool _updatesEnabled
 
bool _noiseServiceEnabled
 
byte _noiseTicks [2]
 
byte _savedNoiseTicks [2]
 
byte _noiseChannel [2]
 
uint16 _noiseMask [2]
 
int32 _noiseBase [2]
 
int16 _noiseStep [2]
 
bool _noiseState
 
- Protected Attributes inherited from MADS::SoundDriver
Audio::Mixer * _mixer
 
Common::Array< byte > _soundData
 
Common::Mutex _driverMutex
 
bool _paused
 

Detailed Description

Common PSOUND driver implementation.

Member Function Documentation

◆ stop()

int MADS::RexNebular::Sound::PSound::stop ( )
overridevirtual

Stop all currently playing sounds

Implements MADS::SoundDriver.

◆ poll()

int MADS::RexNebular::Sound::PSound::poll ( )
overridevirtual

Main poll method to allow sounds to progress

Implements MADS::SoundDriver.

◆ noise()

void MADS::RexNebular::Sound::PSound::noise ( )
overridevirtual

General noise/note output

Implements MADS::SoundDriver.


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