ScummVM API documentation
OPL::NUKED::OPL Class Reference
Inheritance diagram for OPL::NUKED::OPL:
OPL::EmulatedOPL OPL::OPL Audio::AudioStream

Public Member Functions

 OPL (Config::OplType type)
 
bool init ()
 
void reset ()
 
void write (int a, int v)
 
byte read (int a)
 
void writeReg (int r, int v)
 
bool isStereo () const
 
- Public Member Functions inherited from OPL::EmulatedOPL
void setCallbackFrequency (int timerFrequency)
 
int readBuffer (int16 *buffer, const int numSamples)
 
int getRate () const
 
bool endOfData () const
 
- Public Member Functions inherited from OPL::OPL
void start (TimerCallback *callback, int timerFrequency=kDefaultCallbackFrequency)
 
void stop ()
 

Protected Member Functions

void generateSamples (int16 *buffer, int length)
 
- Protected Member Functions inherited from OPL::EmulatedOPL
void startCallbacks (int timerFrequency)
 
void stopCallbacks ()
 
- Protected Member Functions inherited from OPL::OPL
void initDualOpl2OnOpl3 (Config::OplType oplType)
 
bool emulateDualOpl2OnOpl3 (int r, int v, Config::OplType oplType)
 
- Protected Member Functions inherited from Audio::AudioStream
virtual bool endOfStream () const
 

Additional Inherited Members

- Public Types inherited from OPL::OPL
enum  { kDefaultCallbackFrequency = 250 }
 
- Protected Attributes inherited from OPL::OPL
Common::ScopedPtr< TimerCallback_callback
 
bool _rhythmMode
 
int _connectionFeedbackValues [3]
 

Member Function Documentation

◆ init()

bool OPL::NUKED::OPL::init ( )
virtual

Initializes the OPL emulator.

Returns
true on success, false on failure

Implements OPL::OPL.

◆ reset()

void OPL::NUKED::OPL::reset ( )
virtual

Reinitializes the OPL emulator

Implements OPL::OPL.

◆ write()

void OPL::NUKED::OPL::write ( int  a,
int  v 
)
virtual

Writes a byte to the given I/O port.

Parameters
aport address
vvalue, which will be written

Implements OPL::OPL.

◆ read()

byte OPL::NUKED::OPL::read ( int  a)
virtual

Reads a byte from the given I/O port.

Parameters
aport address
Returns
value read

Implements OPL::OPL.

◆ writeReg()

void OPL::NUKED::OPL::writeReg ( int  r,
int  v 
)
virtual

Function to directly write to a specific OPL register. This writes to both chips for a Dual OPL2. We allow writing to secondary OPL registers by using register values >= 0x100.

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

Implements OPL::OPL.

◆ isStereo()

bool OPL::NUKED::OPL::isStereo ( ) const
inlinevirtual

Check whether this is a stereo stream.

Implements Audio::AudioStream.

◆ generateSamples()

void OPL::NUKED::OPL::generateSamples ( int16 *  buffer,
int  numSamples 
)
protectedvirtual

Read up to 'length' samples.

Data will be in native endianess, 16 bit per sample, signed. For stereo OPL, 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 OPL, you will get a total of two left channel and two right channel samples.

Implements OPL::EmulatedOPL.


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