ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
Classes | Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | List of all members
Sound Class Referencefinal

The sound chip of the CPC. More...

#include <sound.h>

Classes

union  LoopCount
 
union  TCounter
 

Public Member Functions

 Sound (Psg *psg=0)
 
void init (Psg *psg=0)
 
void setSynthesizer (Synthesizer syn)
 
Synthesizer synthesizer ()
 
void setMixerRegister (tUBYTE value)
 
void setAmplA (tUBYTE value)
 
void setAmplB (tUBYTE value)
 
void setAmplC (tUBYTE value)
 
void caseEnvType0_3__9 ()
 
void caseEnvType4_7__15 ()
 
void caseEnvType8 ()
 
void caseEnvType10 ()
 
void caseEnvType11 ()
 
void caseEnvType12 ()
 
void caseEnvType13 ()
 
void caseEnvType14 ()
 
void setEnvelopeRegister (tUBYTE value)
 
void setAYRegister (int num, tUBYTE value)
 
void synthesizerLogicQ ()
 
void synthesizerMixerQ ()
 
void synthesizerStereo16 ()
 
void synthesizerStereo8 ()
 
void synthesizerMixerQMono ()
 
void synthesizerMono16 ()
 
void synthesizerMono8 ()
 
void calculateLevelTables ()
 
void resetAYChipEmulation ()
 
void initAYCounterVars ()
 
void initAY ()
 
tUBYTEbuffer () const
 
tUBYTEbufferEnd () const
 
tUBYTEstream () const
 
void setBuffer (tUBYTE *ptr)
 
void setBufferEnd (tUBYTE *ptr)
 
void setStream (tUBYTE *ptr)
 
tDWORD freqTable (int num) const
 
void setEnabled (bool value)
 
void setPlaybackRate (uint value)
 
void setBits (uint value)
 
void setStereo (uint value)
 
void setVolume (uint value)
 
void setDevice (uint value)
 
void setBufferSize (uint value)
 
void setBufferPtr (tUBYTE *ptr)
 
void setBufferPtrDW (tDWORD ptr)
 
void setBufferPtrW (tWORD ptr)
 
void setBufferPtrU (tUBYTE ptr)
 
void setBufferFull (bool bf)
 
bool bufferFull () const
 
bool enabled () const
 
uint playbackRate () const
 
uint bits () const
 
uint stereo () const
 
uint volume () const
 
uint device () const
 
uint bufferSize () const
 
tUBYTEbufferPtr () const
 
const tINT64cycleCountInitBoth () const
 
uint cycleCountInitLow () const
 
uint cycleCountInitHigh () const
 
const tINT64cycleCountBoth () const
 
uint cycleCountLow () const
 
uint cycleCountHigh () const
 
void setCycleCountInitBoth (const tINT64 &value)
 
void setCycleCountBoth (const tINT64 &value)
 
void setCycleCountLow (uint value)
 
void setCycleCountHigh (uint value)
 

Public Attributes

~Sound() ROLAND_DEFAULT typedef void(Sound typedef void(Sound::* CaseEnvType )(void)
 
uint low
 
uint high
 
struct S {
   uint   low
 
   uint   high
 
s
 
tINT64 both
 
struct S {
   uint   low
 
   uint   high
 
s
 
tWORD low
 
tWORD val
 
struct S {
   tWORD   low
 
   tWORD   val
 
s
 
tDWORD seed
 
tDWORD low
 
tDWORD high
 
struct S {
   tDWORD   low
 
   tDWORD   high
 
s
 

Private Attributes

PsgmPsg
 
Synthesizer mSynthesizer
 
bool mSndEnabled
 
uint mSndPlaybackRate
 
uint mSndBits
 
uint mSndStereo
 
uint mSndVolume
 
uint mSndDevice
 
uint mSndBufferSize
 
tUBYTEmSndBufferPtr
 
tUBYTEmSndBuffer
 
tUBYTEmSndBufferEnd
 
tUBYTEmSndStream
 
tUBYTE mTapeLevel
 
bool mBufferFull
 
union {
   struct S {
      uint   low
 
      uint   high
 
   }   s
 
   tINT64   both
 
mCycleCount
 
union {
   struct S {
      uint   low
 
      uint   high
 
   }   s
 
   tINT64   both
 
mCycleCountInit
 
tINT64mLoopCount64
 
tINT64 mLoopCountInit
 
union cpcx::Sound::LoopCount mLoopCount
 
TCounter mTonCounterA
 
TCounter mTonCounterB
 
TCounter mTonCounterC
 
TCounter mNoiseCounter
 
union {
   struct S {
      tWORD   low
 
      tWORD   val
 
   }   s
 
   tDWORD   seed
 
mNoise
 
union {
   struct S {
      tDWORD   low
 
      tDWORD   high
 
   }   s
 
   tINT64   both
 
mEnvelopeCounter
 
CaseEnvType mCaseEnvType
 
int mLevelPP [256]
 
bool mTonEnA
 
bool mTonEnB
 
bool mTonEnC
 
bool mNoiseEnA
 
bool mNoiseEnB
 
bool mNoiseEnC
 
bool mEnvelopeEnA
 
bool mEnvelopeEnB
 
bool mEnvelopeEnC
 
tUBYTE mTonA
 
tUBYTE mTonB
 
tUBYTE mTonC
 
int mLevelAR [32]
 
int mLevelAL [32]
 
int mLevelBR [32]
 
int mLevelBL [32]
 
int mLevelCR [32]
 
int mLevelCL [32]
 
int mLevelTape
 
tUBYTE mIndexAL
 
tUBYTE mIndexAR
 
tUBYTE mIndexBL
 
tUBYTE mIndexBR
 
tUBYTE mIndexCL
 
tUBYTE mIndexCR
 
int mPreAmp
 
int mPreAmpMax
 
int mLeftChan
 
int mRightChan
 

Static Private Attributes

static const tUWORD mAmplitudesAY [16]
 
static const tDWORD mFreqTable [5]
 

Detailed Description

The sound chip of the CPC.

Constructor & Destructor Documentation

Sound ( Psg psg = 0)

References Sound::init().

Member Function Documentation

uint bits ( ) const
inline
tUBYTE* buffer ( ) const
inline
tUBYTE* bufferEnd ( ) const
inline

References Sound::mSndBufferEnd.

Referenced by Audio::dist(), and Audio::update().

bool bufferFull ( ) const
inline

References Sound::mBufferFull.

Referenced by Z80::execute().

tUBYTE* bufferPtr ( ) const
inline

References Sound::mSndBufferPtr.

Referenced by Audio::dist().

uint bufferSize ( ) const
inline

References Sound::mSndBufferSize.

Referenced by Audio::init().

void calculateLevelTables ( )
void caseEnvType0_3__9 ( )
void caseEnvType10 ( )
void caseEnvType11 ( )
void caseEnvType12 ( )
void caseEnvType13 ( )
void caseEnvType14 ( )
void caseEnvType4_7__15 ( )
void caseEnvType8 ( )
const tINT64& cycleCountBoth ( ) const
inline

References Sound::mCycleCount.

Referenced by Cpc::waitstates().

uint cycleCountHigh ( ) const
inline

References Sound::mCycleCount.

Referenced by Cpc::waitstates().

const tINT64& cycleCountInitBoth ( ) const
inline

References Sound::mCycleCountInit.

Referenced by Cpc::waitstates().

uint cycleCountInitHigh ( ) const
inline

References Sound::mCycleCountInit.

Referenced by Cpc::waitstates().

uint cycleCountInitLow ( ) const
inline
uint cycleCountLow ( ) const
inline

References Sound::mCycleCount.

uint device ( ) const
inline
bool enabled ( ) const
inline
tDWORD freqTable ( int  num) const
inline

References Sound::mFreqTable.

Referenced by Audio::init().

void init ( Psg psg = 0)
void initAY ( )
void initAYCounterVars ( )
uint playbackRate ( ) const
inline
void resetAYChipEmulation ( )
void setAmplA ( tUBYTE  value)
inline
void setAmplB ( tUBYTE  value)
inline
void setAmplC ( tUBYTE  value)
inline
void setAYRegister ( int  num,
tUBYTE  value 
)
inline
void setBits ( uint  value)
inline

References Sound::mSndBits.

void setBuffer ( tUBYTE ptr)
inline

References Sound::mSndBuffer.

Referenced by Audio::init().

void setBufferEnd ( tUBYTE ptr)
inline

References Sound::mSndBufferEnd.

Referenced by Audio::init().

void setBufferFull ( bool  bf)
inline

References Sound::mBufferFull.

void setBufferPtr ( tUBYTE ptr)
inline

References Sound::mSndBufferPtr.

Referenced by Audio::init().

void setBufferPtrDW ( tDWORD  ptr)
inline

References Sound::mSndBufferPtr.

void setBufferPtrU ( tUBYTE  ptr)
inline

References Sound::mSndBufferPtr.

Referenced by Sound::synthesizerMono8().

void setBufferPtrW ( tWORD  ptr)
inline
void setBufferSize ( uint  value)
inline

References Sound::mSndBufferSize.

Referenced by Audio::init().

void setCycleCountBoth ( const tINT64 value)
inline

References Sound::mCycleCount.

Referenced by Cpc::waitstates().

void setCycleCountHigh ( uint  value)
inline

References Sound::mCycleCount.

Referenced by Cpc::waitstates().

void setCycleCountInitBoth ( const tINT64 value)
inline
void setCycleCountLow ( uint  value)
inline

References Sound::mCycleCount.

void setDevice ( uint  value)
inline

References Sound::mSndDevice.

void setEnabled ( bool  value)
inline

References Sound::mSndEnabled.

void setEnvelopeRegister ( tUBYTE  value)
inline
void setMixerRegister ( tUBYTE  value)
inline
void setPlaybackRate ( uint  value)
inline
void setStereo ( uint  value)
inline

References Sound::mSndStereo.

void setStream ( tUBYTE ptr)
inline

References Sound::mSndStream.

Referenced by Audio::init(), and Audio::update().

void setSynthesizer ( Synthesizer  syn)
inline

References Sound::mSynthesizer.

Referenced by Sound::initAY().

void setVolume ( uint  value)
inline

References Sound::mSndVolume.

uint stereo ( ) const
inline
tUBYTE* stream ( ) const
inline

References Sound::mSndStream.

Referenced by Audio::dist(), and Audio::update().

Synthesizer synthesizer ( )
inline
void synthesizerLogicQ ( )
inline
void synthesizerMixerQ ( )
inline
void synthesizerMixerQMono ( )
inline
void synthesizerMono16 ( )
void synthesizerMono8 ( )
void synthesizerStereo16 ( )
void synthesizerStereo8 ( )
uint volume ( ) const
inline

Member Data Documentation

tINT64 both
~Sound () ROLAND_DEFAULT typedef void (Sound typedef void(Sound::* CaseEnvType) (void)
uint high
tDWORD high
uint low
tWORD low
tDWORD low
const tUWORD mAmplitudesAY
staticprivate
Initial value:
=
{ 0, 836, 1212, 1773, 2619, 3875, 5397, 8823, 10392, 16706, 23339,
29292, 36969, 46421, 55195, 65535 }

Referenced by Sound::calculateLevelTables().

bool mBufferFull
private
CaseEnvType mCaseEnvType
private
union { ... } mCycleCount
union { ... } mCycleCountInit
union { ... } mEnvelopeCounter
bool mEnvelopeEnA
private
bool mEnvelopeEnB
private
bool mEnvelopeEnC
private
const tDWORD mFreqTable
staticprivate
Initial value:
=
{ 11025, 22050, 44100, 48000, 96000 }

Referenced by Sound::freqTable(), and Sound::initAYCounterVars().

tUBYTE mIndexAL
private
tUBYTE mIndexAR
private
tUBYTE mIndexBL
private
tUBYTE mIndexBR
private
tUBYTE mIndexCL
private
tUBYTE mIndexCR
private
int mLeftChan
private
int mLevelAL[32]
private
int mLevelAR[32]
private
int mLevelBL[32]
private
int mLevelBR[32]
private
int mLevelCL[32]
private
int mLevelCR[32]
private
int mLevelPP[256]
private
int mLevelTape
private
union cpcx::Sound::LoopCount mLoopCount
private
tINT64* mLoopCount64
private
tINT64 mLoopCountInit
private
union { ... } mNoise
TCounter mNoiseCounter
private
bool mNoiseEnA
private
bool mNoiseEnB
private
bool mNoiseEnC
private
int mPreAmp
private
int mPreAmpMax
private
Psg* mPsg
private
int mRightChan
private
uint mSndBits
private
tUBYTE* mSndBuffer
private
tUBYTE* mSndBufferEnd
private
tUBYTE* mSndBufferPtr
private
uint mSndBufferSize
private
uint mSndDevice
private
bool mSndEnabled
private
uint mSndPlaybackRate
private
uint mSndStereo
private
tUBYTE* mSndStream
private

Referenced by Sound::setStream(), and Sound::stream().

uint mSndVolume
private
Synthesizer mSynthesizer
private
tUBYTE mTapeLevel
private
tUBYTE mTonA
private
tUBYTE mTonB
private
tUBYTE mTonC
private
TCounter mTonCounterA
private
TCounter mTonCounterB
private
TCounter mTonCounterC
private
bool mTonEnA
private
bool mTonEnB
private
bool mTonEnC
private
struct { ... } ::S s
struct { ... } ::S s
struct { ... } ::S s
struct { ... } ::S s
tDWORD seed
tWORD val

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