ScummVM API documentation
Audio::YM2149Emu Class Referencefinal
Inheritance diagram for Audio::YM2149Emu:
YM2149::YM2149 Audio::EmulatedChip Audio::Chip Audio::Chip Audio::AudioStream

Public Member Functions

bool init () override
 
void reset () override
 
void writeReg (int reg, uint8 value) override
 
bool isStereo () const override
 
- Public Member Functions inherited from Audio::Chip
void start (TimerCallback *callback, int timerFrequency)
 
void stop ()
 
- Public Member Functions inherited from Audio::EmulatedChip
void setCallbackFrequency (int timerFrequency) override
 
int readBuffer (int16 *buffer, const int numSamples) override
 
int getRate () const override
 
bool endOfData () const override
 

Protected Member Functions

void generateSamples (int16 *buffer, int numSamples) override
 
- Protected Member Functions inherited from Audio::EmulatedChip
void startCallbacks (int timerFrequency) override final
 
void stopCallbacks () override final
 
- Protected Member Functions inherited from Audio::AudioStream
virtual bool endOfStream () const
 

Additional Inherited Members

- Public Types inherited from Audio::Chip
typedef Common::Functor0< void > TimerCallback
 
- Protected Attributes inherited from Audio::Chip
Common::ScopedPtr< TimerCallback_callback
 
- Static Protected Attributes inherited from Audio::EmulatedChip
static const int FIXP_SHIFT = 16
 

Member Function Documentation

◆ init()

bool Audio::YM2149Emu::init ( )
overridevirtual

Initializes the YM2149 emulator.

Returns
true on success, false on failure

Implements YM2149::YM2149.

◆ reset()

void Audio::YM2149Emu::reset ( )
overridevirtual

Reinitializes the YM2149 emulator

Implements YM2149::YM2149.

◆ writeReg()

void Audio::YM2149Emu::writeReg ( int  r,
uint8  v 
)
overridevirtual

Function to directly write to a specific YM2149 register.

Parameters
rhardware register number to write to
vvalue, which will be written

Implements YM2149::YM2149.

◆ isStereo()

bool Audio::YM2149Emu::isStereo ( ) const
inlineoverridevirtual

Check whether this is a stereo stream.

Implements Audio::AudioStream.

◆ generateSamples()

void Audio::YM2149Emu::generateSamples ( int16 *  buffer,
int  numSamples 
)
overrideprotectedvirtual

Read up to 'length' samples.

Data will be in native endianess, 16 bit per sample, signed. For stereo chips, buffer will be filled with interleaved left and right channel samples, starting with a left sample. Furthermore, the samples in the left and right are summed up. So if you request 4 samples from a stereo chip, you will get a total of two left channel and two right channel samples.

Implements Audio::EmulatedChip.


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