Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

DigitalRenderer Class Reference

Inheritance diagram for DigitalRenderer:

Inheritance graph
[legend]
Collaboration diagram for DigitalRenderer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DigitalRenderer (C64 *c64)
virtual ~DigitalRenderer ()
virtual void Reset (void)
virtual void EmulateLine (void)
virtual void WriteRegister (uint16 adr, uint8 byte)
virtual void NewPrefs (Prefs *prefs)
virtual void Pause (void)
virtual void Resume (void)
void MaoscOpenComplete (TInt aError)
void MaoscBufferCopied (TInt aError, const TDesC8 &aBuffer)
void MaoscPlayComplete (TInt aError)
void reset_sync ()
void SetVolumeL (TInt aVolume)
void InitFixSinTab (void)
FixPoint fixsin (FixPoint x)
FixPoint fixcos (FixPoint x)
 DigitalRenderer (C64 *c64)
virtual ~DigitalRenderer ()
virtual void Reset (void)
virtual void EmulateLine (void)
virtual void WriteRegister (uint16 adr, uint8 byte)
virtual void NewPrefs (Prefs *prefs)
virtual void Pause (void)
virtual void Resume (void)

Public Attributes

CMdaAudioOutputStream * iStream
TMdaAudioDataSettings iSettings
TUint iStartPlayTickCount
TUint iCountSampleBlocksCopied
TInt iTickPeriod_ys
TBool iAudioStarvation
TPtrC8 sound_buffer_desc
int16sound_buffer
 pointer to PCM sound buffer

int divisor
int to_output
int buffer_pos
FixPoint SinTable [(1<< ldSINTAB)]

Private Member Functions

void init_sound (void)
void calc_filter (void)
void calc_buffer (int16 *buf, long count)
uint8 sid_random ()
void init_sound (void)
void calc_filter (void)
void calc_buffer (uint8 *buf, long count)
uint8 sid_random ()

Private Attributes

bool ready
uint8 volume
bool v3_mute
uint16 TriTable [0x1000 *2]
DRVoice voice [3]
uint8 f_type
uint8 f_freq
uint8 f_res
FixPoint f_ampl
FixPoint d1
FixPoint d2
FixPoint g1
FixPoint g2
int32 xn1
int32 xn2
int32 yn1
int32 yn2
FixPoint sidquot
FixPoint resonanceLP [256]
FixPoint resonanceHP [256]
uint8 sample_buf [SAMPLE_BUF_SIZE]
int sample_in_ptr
C64the_c64
 Pointer to C64 object.

PrefsThePrefs
uint32 seed
 random seed

C64the_c64
 Pointer to C64 object.

PrefsThePrefs

Static Private Attributes

const uint16 TriSawTable [0x100]
const uint16 TriRectTable [0x100]
const uint16 SawRectTable [0x100]
const uint16 TriSawRectTable [0x100]
const uint32 EGTable [16]
const uint8 EGDRShift [256]
const int16 SampleTab [16]

Detailed Description

Renderer class

Definition at line 358 of file SID.cpp.


Constructor & Destructor Documentation

DigitalRenderer::DigitalRenderer C64 c64  ) 
 

Definition at line 889 of file SID.cpp.

References __CHECK_NULL, CALC_RESONANCE_HP, CALC_RESONANCE_LP, CTOR, FixNo, init_sound(), InitFixSinTab(), int32, DRVoice::mod_by, DRVoice::mod_to, Reset(), resonanceHP, resonanceLP, SAMPLE_FREQ, SID_FREQ, sidquot, ThePrefs, TriTable, and voice.

DigitalRenderer::~DigitalRenderer  )  [virtual]
 

Destructor

Definition at line 39 of file SID_Acorn.i.

References DigitalRenderer_Deactivate(), ready, sound_buffer, TASKNAME, and Wimp_ReportError().

DigitalRenderer::DigitalRenderer C64 c64  ) 
 

virtual DigitalRenderer::~DigitalRenderer  )  [virtual]
 


Member Function Documentation

void DigitalRenderer::calc_buffer uint8 buf,
long  count
[private]
 

Fill one audio buffer with calculated SID sound

Definition at line 1187 of file SID_epoc.cpp.

References DRVoice::a_add, DRVoice::add, DRVoice::count, DRVoice::d_sub, DigitalRenderer_GetTables(), EG_ATTACK, EG_DECAY, EG_IDLE, DRVoice::eg_level, EG_RELEASE, DRVoice::eg_state, DRVoice::filter, int16, int32, DRVoice::mod_by, DRVoice::mod_to, DRVoice::noise, DRVoice::pw, DRVoice::r_sub, DRVoice::ring, DRVoice::s_level, SAMPLE_BUF_SIZE, SAMPLE_FREQ, DRVoice::sync, DRVoice::test, ThePrefs, uint16, uint32, uint8, DRVoice::wave, WAVE_NOISE, WAVE_RECT, WAVE_SAW, WAVE_SAWRECT, WAVE_TRI, WAVE_TRIRECT, WAVE_TRISAW, and WAVE_TRISAWRECT.

void DigitalRenderer::calc_buffer int16 buf,
long  count
[private]
 

Fill one audio buffer with calculated SID sound

Definition at line 1290 of file SID.cpp.

References DRVoice::a_add, DRVoice::add, DRVoice::count, DRVoice::d_sub, DigitalRenderer_GetTables(), EG_ATTACK, EG_DECAY, EG_IDLE, DRVoice::eg_level, EG_RELEASE, DRVoice::eg_state, DRVoice::filter, int16, int32, DRVoice::mod_by, DRVoice::mod_to, DRVoice::noise, DRVoice::pw, DRVoice::r_sub, DRVoice::ring, DRVoice::s_level, SAMPLE_BUF_SIZE, SAMPLE_FREQ, DRVoice::sync, DRVoice::test, ThePrefs, uint16, uint32, uint8, DRVoice::wave, WAVE_NOISE, WAVE_RECT, WAVE_SAW, WAVE_SAWRECT, WAVE_TRI, WAVE_TRIRECT, WAVE_TRISAW, and WAVE_TRISAWRECT.

Referenced by EmulateLine().

void DigitalRenderer::calc_filter void   )  [private]
 

void DigitalRenderer::calc_filter void   )  [private]
 

Definition at line 1140 of file SID.cpp.

References FixPoint::abs(), CALC_RESONANCE_HP, CALC_RESONANCE_LP, d1, d2, f_ampl, f_freq, f_res, f_type, FILT_ALL, FILT_BP, FILT_HP, FILT_HPBP, FILT_LP, FILT_LPBP, FILT_NONE, FILT_NOTCH, fixcos(), FixNo, fixsin(), g1, g2, resonanceHP, resonanceLP, SAMPLE_FREQ, and FixPoint::sqrt().

Referenced by NewPrefs(), and WriteRegister().

virtual void DigitalRenderer::EmulateLine void   )  [virtual]
 

Implements SIDRenderer.

void DigitalRenderer::EmulateLine void   )  [virtual]
 

Fill buffer, sample volume (for sampled voice)

Implements SIDRenderer.

Definition at line 56 of file SID_Acorn.i.

References calc_buffer(), DigitalRenderer_NewSample(), DigitalRenderer_ReadState(), DRState_NeedData, ready, sample_buf, SAMPLE_BUF_SIZE, sample_in_ptr, sound_buffer, the_c64, and volume.

FixPoint DigitalRenderer::fixcos FixPoint  x  )  [inline]
 

Definition at line 474 of file sid_epoc32.i.

References FIXPOINT_PREC, FIXPOINT_SIN_COS_GENERIC, and ldSINTAB.

Referenced by calc_filter().

FixPoint DigitalRenderer::fixsin FixPoint  x  )  [inline]
 

Definition at line 465 of file sid_epoc32.i.

References FIXPOINT_PREC, FIXPOINT_SIN_COS_GENERIC, and ldSINTAB.

Referenced by calc_filter().

void DigitalRenderer::init_sound void   )  [private]
 

void DigitalRenderer::init_sound void   )  [private]
 

Initialization

configure sound device

prepare the buffer

Definition at line 14 of file SID_Acorn.i.

References DigitalRenderer_Activate(), DigitalRenderer_ReadState(), DRState_Active, ready, SAMPLE_FREQ, sound_buffer, sprintf, TASKNAME, uint8, and Wimp_ReportError().

Referenced by DigitalRenderer().

void DigitalRenderer::InitFixSinTab void   )  [inline]
 

Definition at line 484 of file sid_epoc32.i.

References ELOG1, ELOG2, FixNo, ldSINTAB, and SinTable.

Referenced by DigitalRenderer().

void DigitalRenderer::MaoscBufferCopied TInt  aError,
const TDesC8 &  aBuffer
 

void DigitalRenderer::MaoscOpenComplete TInt  aError  ) 
 

void DigitalRenderer::MaoscPlayComplete TInt  aError  ) 
 

virtual void DigitalRenderer::NewPrefs Prefs prefs  )  [virtual]
 

Implements SIDRenderer.

void DigitalRenderer::NewPrefs Prefs prefs  )  [virtual]
 

Implements SIDRenderer.

Definition at line 1100 of file SID.cpp.

References calc_filter(), ELOG2, Prefs::iVolume, and SetVolumeL().

virtual void DigitalRenderer::Pause void   )  [virtual]
 

Implements SIDRenderer.

void DigitalRenderer::Pause void   )  [virtual]
 

Pause sound output (do nothing)

Implements SIDRenderer.

Definition at line 86 of file SID_Acorn.i.

References DigitalRenderer_Pause(), and ready.

virtual void DigitalRenderer::Reset void   )  [virtual]
 

Implements SIDRenderer.

void DigitalRenderer::Reset void   )  [virtual]
 

Implements SIDRenderer.

Definition at line 946 of file SID.cpp.

References DRVoice::a_add, DRVoice::add, DRVoice::count, d1, d2, DRVoice::d_sub, EG_IDLE, DRVoice::eg_level, DRVoice::eg_state, EGTable, ELOG1, f_ampl, f_freq, f_res, f_type, FILT_NONE, DRVoice::filter, FixNo, DRVoice::freq, g1, g2, DRVoice::gate, memset, DRVoice::pw, DRVoice::r_sub, DRVoice::ring, DRVoice::s_level, sample_buf, SAMPLE_BUF_SIZE, sample_in_ptr, DRVoice::sync, DRVoice::test, v3_mute, voice, volume, DRVoice::wave, WAVE_NONE, xn1, xn2, yn1, and yn2.

Referenced by DigitalRenderer().

void DigitalRenderer::reset_sync  ) 
 

Reset audio synchronizing

Definition at line 146 of file sid_epoc32.i.

References CE32FrodoDocument::iAppUiPtr, CE32FrodoAppUi::iAppView, iAudioStarvation, SidDebugData::iBufferLengthTooBigCounter, SidDebugData::iCountDuplicatedBlocks, SidDebugData::iCountExtraBlocks, SidDebugData::iCountNormalBlocks, iCountSampleBlocksCopied, SidDebugData::iCountSamplesCopied, SidDebugData::iCountSkippedBlocks, Frodo::iDocPtr, C64::iFrodoPtr, SidDebugData::iLeadInBlocks, SidDebugData::iPlayCompleteCounter, SidDebugData::iPrevCountSamplesCopied, SidDebugData::iPrevTickCount, iStartPlayTickCount, iTickPeriod_ys, SidDebugData::iTickPeriod_ys2, and the_c64.

virtual void DigitalRenderer::Resume void   )  [virtual]
 

Implements SIDRenderer.

void DigitalRenderer::Resume void   )  [virtual]
 

Resume sound output (do nothing)

Implements SIDRenderer.

Definition at line 94 of file SID_Acorn.i.

References DigitalRenderer_Resume(), and ready.

void DigitalRenderer::SetVolumeL TInt  aVolume  ) 
 

Referenced by NewPrefs().

uint8 DigitalRenderer::sid_random  )  [private]
 

uint8 DigitalRenderer::sid_random  )  [private]
 

Random number generator for noise waveform

Definition at line 559 of file SID.cpp.

References seed, and uint8.

virtual void DigitalRenderer::WriteRegister uint16  adr,
uint8  byte
[virtual]
 

Implements SIDRenderer.

void DigitalRenderer::WriteRegister uint16  adr,
uint8  byte
[virtual]
 

Implements SIDRenderer.

Definition at line 986 of file SID.cpp.

References DRVoice::a_add, DRVoice::add, calc_filter(), DRVoice::count, DRVoice::d_sub, EG_ATTACK, EG_IDLE, EG_RELEASE, DRVoice::eg_state, EGTable, f_freq, f_res, f_type, DRVoice::filter, DRVoice::freq, DRVoice::gate, FixPoint::imul(), DRVoice::mod_by, DRVoice::pw, DRVoice::r_sub, ready, DRVoice::ring, DRVoice::s_level, SAMPLE_FREQ, SID_FREQ, Prefs::SIDFilters, sidquot, DRVoice::sync, DRVoice::test, ThePrefs, uint32, v3_mute, voice, volume, DRVoice::wave, xn1, xn2, yn1, and yn2.


Member Data Documentation

int DigitalRenderer::buffer_pos
 

Definition at line 544 of file SID.cpp.

FixPoint DigitalRenderer::d1 [private]
 

Definition at line 389 of file SID_epoc.cpp.

Referenced by calc_filter(), and Reset().

FixPoint DigitalRenderer::d2 [private]
 

Definition at line 389 of file SID_epoc.cpp.

Referenced by calc_filter(), and Reset().

int DigitalRenderer::divisor
 

Definition at line 542 of file SID.cpp.

const uint8 DigitalRenderer::EGDRShift [static, private]
 

Initial value:

 {
        5,5,5,5,5,5,5,5,4,4,4,4,4,4,4,4,
        3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,
        2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
        2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
}

Definition at line 803 of file SID_epoc.cpp.

const uint32 DigitalRenderer::EGTable [static, private]
 

Initial value:

 {
        (SID_CYCLES << 16) / 9, (SID_CYCLES << 16) / 32,
        (SID_CYCLES << 16) / 63, (SID_CYCLES << 16) / 95,
        (SID_CYCLES << 16) / 149, (SID_CYCLES << 16) / 220,
        (SID_CYCLES << 16) / 267, (SID_CYCLES << 16) / 313,
        (SID_CYCLES << 16) / 392, (SID_CYCLES << 16) / 977,
        (SID_CYCLES << 16) / 1954, (SID_CYCLES << 16) / 3126,
        (SID_CYCLES << 16) / 3906, (SID_CYCLES << 16) / 11720,
        (SID_CYCLES << 16) / 19531, (SID_CYCLES << 16) / 31251
}

Definition at line 792 of file SID_epoc.cpp.

Referenced by Reset(), and WriteRegister().

FixPoint DigitalRenderer::f_ampl [private]
 

Definition at line 388 of file SID_epoc.cpp.

Referenced by calc_filter(), and Reset().

uint8 DigitalRenderer::f_freq [private]
 

Definition at line 385 of file SID_epoc.cpp.

Referenced by calc_filter(), Reset(), and WriteRegister().

uint8 DigitalRenderer::f_res [private]
 

Definition at line 386 of file SID_epoc.cpp.

Referenced by calc_filter(), Reset(), and WriteRegister().

uint8 DigitalRenderer::f_type [private]
 

Definition at line 384 of file SID_epoc.cpp.

Referenced by calc_filter(), Reset(), and WriteRegister().

FixPoint DigitalRenderer::g1 [private]
 

Definition at line 389 of file SID_epoc.cpp.

Referenced by calc_filter(), and Reset().

FixPoint DigitalRenderer::g2 [private]
 

Definition at line 389 of file SID_epoc.cpp.

Referenced by calc_filter(), and Reset().

TBool DigitalRenderer::iAudioStarvation
 

Definition at line 536 of file SID.cpp.

Referenced by reset_sync().

TUint DigitalRenderer::iCountSampleBlocksCopied
 

Definition at line 534 of file SID.cpp.

Referenced by reset_sync().

TMdaAudioDataSettings DigitalRenderer::iSettings
 

Definition at line 530 of file SID.cpp.

TUint DigitalRenderer::iStartPlayTickCount
 

Definition at line 533 of file SID.cpp.

Referenced by reset_sync().

CMdaAudioOutputStream* DigitalRenderer::iStream
 

Definition at line 529 of file SID.cpp.

TInt DigitalRenderer::iTickPeriod_ys
 

Definition at line 535 of file SID.cpp.

Referenced by reset_sync().

bool DigitalRenderer::ready [private]
 

Definition at line 369 of file SID_epoc.cpp.

Referenced by EmulateLine(), init_sound(), Pause(), Resume(), WriteRegister(), and ~DigitalRenderer().

FixPoint DigitalRenderer::resonanceHP[256] [private]
 

Definition at line 409 of file SID.cpp.

Referenced by calc_filter(), and DigitalRenderer().

FixPoint DigitalRenderer::resonanceLP[256] [private]
 

Definition at line 408 of file SID.cpp.

Referenced by calc_filter(), and DigitalRenderer().

uint8 DigitalRenderer::sample_buf [private]
 

Definition at line 406 of file SID_epoc.cpp.

Referenced by EmulateLine(), and Reset().

int DigitalRenderer::sample_in_ptr [private]
 

Definition at line 407 of file SID_epoc.cpp.

Referenced by EmulateLine(), and Reset().

const int16 DigitalRenderer::SampleTab [static, private]
 

Initial value:

 {
        0x8000, 0x9111, 0xa222, 0xb333, 0xc444, 0xd555, 0xe666, 0xf777,
        0x0888, 0x1999, 0x2aaa, 0x3bbb, 0x4ccc, 0x5ddd, 0x6eee, 0x7fff,
}

Definition at line 822 of file SID_epoc.cpp.

const uint16 DigitalRenderer::SawRectTable [static, private]
 

Definition at line 580 of file SID_epoc.cpp.

uint32 DigitalRenderer::seed [private]
 

random seed

Definition at line 495 of file SID_epoc.cpp.

Referenced by sid_random().

FixPoint DigitalRenderer::sidquot [private]
 

Definition at line 391 of file SID_epoc.cpp.

Referenced by DigitalRenderer(), and WriteRegister().

FixPoint DigitalRenderer::SinTable[(1<<ldSINTAB)]
 

Definition at line 550 of file SID.cpp.

Referenced by InitFixSinTab().

int16* DigitalRenderer::sound_buffer
 

pointer to PCM sound buffer

Definition at line 540 of file SID.cpp.

Referenced by EmulateLine(), init_sound(), and ~DigitalRenderer().

TPtrC8 DigitalRenderer::sound_buffer_desc
 

Definition at line 537 of file SID.cpp.

C64* DigitalRenderer::the_c64 [private]
 

Pointer to C64 object.

Definition at line 489 of file SID_epoc.cpp.

C64* DigitalRenderer::the_c64 [private]
 

Pointer to C64 object.

Definition at line 504 of file SID.cpp.

Referenced by EmulateLine(), and reset_sync().

Prefs& DigitalRenderer::ThePrefs [private]
 

Definition at line 492 of file SID_epoc.cpp.

Prefs& DigitalRenderer::ThePrefs [private]
 

Definition at line 507 of file SID.cpp.

Referenced by WriteRegister().

int DigitalRenderer::to_output
 

Definition at line 543 of file SID.cpp.

const uint16 DigitalRenderer::TriRectTable [static, private]
 

Definition at line 545 of file SID_epoc.cpp.

const uint16 DigitalRenderer::TriSawRectTable [static, private]
 

Definition at line 615 of file SID_epoc.cpp.

const uint16 DigitalRenderer::TriSawTable [static, private]
 

Definition at line 510 of file SID_epoc.cpp.

uint16 DigitalRenderer::TriTable [private]
 

Definition at line 373 of file SID_epoc.cpp.

Referenced by DigitalRenderer().

bool DigitalRenderer::v3_mute [private]
 

Definition at line 371 of file SID_epoc.cpp.

Referenced by Reset(), and WriteRegister().

DRVoice DigitalRenderer::voice [private]
 

Definition at line 382 of file SID_epoc.cpp.

Referenced by DigitalRenderer(), Reset(), and WriteRegister().

uint8 DigitalRenderer::volume [private]
 

Definition at line 370 of file SID_epoc.cpp.

Referenced by EmulateLine(), Reset(), and WriteRegister().

int32 DigitalRenderer::xn1 [private]
 

Definition at line 390 of file SID_epoc.cpp.

Referenced by Reset(), and WriteRegister().

int32 DigitalRenderer::xn2 [private]
 

Definition at line 390 of file SID_epoc.cpp.

Referenced by Reset(), and WriteRegister().

int32 DigitalRenderer::yn1 [private]
 

Definition at line 390 of file SID_epoc.cpp.

Referenced by Reset(), and WriteRegister().

int32 DigitalRenderer::yn2 [private]
 

Definition at line 390 of file SID_epoc.cpp.

Referenced by Reset(), and WriteRegister().


The documentation for this class was generated from the following files:
Generated on Tue Feb 8 04:11:55 2005 for E32frodo by doxygen 1.3.3