ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

A representation of a Yamaha OPL chip. More...

#include <fmopl.h>

Inheritance diagram for OPL::OPL:
Collaboration diagram for OPL::OPL:

List of all members.

Public Types

enum  { kDefaultCallbackFrequency = 250 }

Public Member Functions

 OPL ()
virtual ~OPL ()
virtual bool init ()=0
 Initializes the OPL emulator.
virtual void reset ()=0
 Reinitializes the OPL emulator.
virtual void write (int a, int v)=0
 Writes a byte to the given I/O port.
virtual byte read (int a)=0
 Reads a byte from the given I/O port.
virtual void writeReg (int r, int v)=0
 Function to directly write to a specific OPL register.
void start (TimerCallback *callback, int timerFrequency=kDefaultCallbackFrequency)
 Start the OPL with callbacks.
void stop ()
 Stop the OPL.
virtual void setCallbackFrequency (int timerFrequency)=0
 Change the callback frequency.

Protected Member Functions

virtual void startCallbacks (int timerFrequency)=0
 Start the callbacks.
virtual void stopCallbacks ()=0
 Stop the callbacks.

Protected Attributes

Common::ScopedPtr< TimerCallback_callback
 The functor for callbacks.

Static Private Attributes

static bool _hasInstance = false

Detailed Description

A representation of a Yamaha OPL chip.

Definition at line 117 of file fmopl.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
kDefaultCallbackFrequency 

The default callback frequency that start() uses.

Definition at line 179 of file fmopl.h.


Constructor & Destructor Documentation

OPL::OPL::OPL (  ) 

Definition at line 54 of file fmopl.cpp.

virtual OPL::OPL::~OPL (  )  [inline, virtual]

Reimplemented in OPL::ALSA::OPL.

Definition at line 122 of file fmopl.h.


Member Function Documentation

virtual bool OPL::OPL::init (  )  [pure virtual]

Initializes the OPL emulator.

Returns:
true on success, false on failure

Implemented in OPL::ALSA::OPL.

virtual byte OPL::OPL::read ( int  a  )  [pure virtual]

Reads a byte from the given I/O port.

Parameters:
a port address
Returns:
value read

Implemented in OPL::ALSA::OPL.

virtual void OPL::OPL::reset (  )  [pure virtual]

Reinitializes the OPL emulator.

Implemented in OPL::ALSA::OPL.

virtual void OPL::OPL::setCallbackFrequency ( int  timerFrequency  )  [pure virtual]

Change the callback frequency.

This must only be called from a timer proc.

Implemented in OPL::RealOPL.

void OPL::OPL::start ( TimerCallback callback,
int  timerFrequency = kDefaultCallbackFrequency 
)

Start the OPL with callbacks.

Definition at line 194 of file fmopl.cpp.

virtual void OPL::OPL::startCallbacks ( int  timerFrequency  )  [protected, pure virtual]

Start the callbacks.

Implemented in OPL::RealOPL.

void OPL::OPL::stop (  ) 

Stop the OPL.

Definition at line 199 of file fmopl.cpp.

virtual void OPL::OPL::stopCallbacks (  )  [protected, pure virtual]

Stop the callbacks.

Implemented in OPL::RealOPL.

virtual void OPL::OPL::write ( int  a,
int  v 
) [pure virtual]

Writes a byte to the given I/O port.

Parameters:
a port address
v value, which will be written

Implemented in OPL::ALSA::OPL.

virtual void OPL::OPL::writeReg ( int  r,
int  v 
) [pure 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:
r hardware register number to write to
v value, which will be written

Implemented in OPL::ALSA::OPL.


Member Data Documentation

The functor for callbacks.

Definition at line 200 of file fmopl.h.

bool OPL::OPL::_hasInstance = false [static, private]

Definition at line 119 of file fmopl.h.


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


Generated on Sat Mar 23 2019 05:08:51 for ResidualVM by doxygen 1.7.1
curved edge   curved edge