1 |
|
/* |
2 |
|
* SID.cpp - 6581 emulation |
3 |
|
* |
4 |
< |
* Frodo (C) 1994-1997,2002-2005 Christian Bauer |
4 |
> |
* Frodo Copyright (C) Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
354 |
|
// Renderer class |
355 |
|
class DigitalRenderer : public SIDRenderer { |
356 |
|
public: |
357 |
– |
#if defined(__BEOS__) || defined(__riscos__) |
357 |
|
DigitalRenderer(C64 *c64); |
359 |
– |
#else |
360 |
– |
DigitalRenderer(); |
361 |
– |
#endif |
358 |
|
virtual ~DigitalRenderer(); |
359 |
|
|
360 |
|
virtual void Reset(void); |
373 |
|
void calc_buffer(int16 *buf, long count); |
374 |
|
#endif |
375 |
|
|
376 |
+ |
C64 *the_c64; // Pointer to C64 object |
377 |
+ |
|
378 |
|
bool ready; // Flag: Renderer has initialized and is ready |
379 |
|
uint8 volume; // Master volume |
380 |
|
|
416 |
|
|
417 |
|
#ifdef __BEOS__ |
418 |
|
static void buffer_proc(void *cookie, void *buffer, size_t size, const media_raw_audio_format &format); |
421 |
– |
C64 *the_c64; // Pointer to C64 object |
419 |
|
BSoundPlayer *the_player; // Pointer to sound player |
420 |
|
bool player_stopped; // Flag: player stopped |
421 |
|
#endif |
488 |
|
#ifdef __riscos__ |
489 |
|
int linecnt, sndbufsize; |
490 |
|
uint8 *sound_buffer; |
494 |
– |
C64 *the_c64; |
491 |
|
#endif |
492 |
|
}; |
493 |
|
|
818 |
|
* Constructor |
819 |
|
*/ |
820 |
|
|
825 |
– |
#if defined(__BEOS__) || defined(__riscos__) |
821 |
|
DigitalRenderer::DigitalRenderer(C64 *c64) : the_c64(c64) |
827 |
– |
#else |
828 |
– |
DigitalRenderer::DigitalRenderer() |
829 |
– |
#endif |
822 |
|
{ |
823 |
|
// Link voices together |
824 |
|
voice[0].mod_by = &voice[2]; |
1376 |
|
delete the_renderer; |
1377 |
|
|
1378 |
|
// Create new renderer |
1379 |
< |
if (new_type == SIDTYPE_DIGITAL) |
1388 |
< |
#if defined(__BEOS__) || defined(__riscos__) |
1379 |
> |
if (new_type == SIDTYPE_DIGITAL) { |
1380 |
|
the_renderer = new DigitalRenderer(the_c64); |
1390 |
– |
#else |
1391 |
– |
the_renderer = new DigitalRenderer; |
1392 |
– |
#endif |
1381 |
|
#ifdef AMIGA |
1382 |
< |
else if (new_type == SIDTYPE_SIDCARD) |
1382 |
> |
} else if (new_type == SIDTYPE_SIDCARD) { |
1383 |
|
the_renderer = new SIDCardRenderer; |
1384 |
|
#endif |
1385 |
|
#ifdef __linux__ |
1386 |
< |
else if (new_type == SIDTYPE_SIDCARD) |
1386 |
> |
} else if (new_type == SIDTYPE_SIDCARD) { |
1387 |
|
the_renderer = new CatweaselRenderer; |
1388 |
|
#endif |
1389 |
< |
else |
1389 |
> |
} else { |
1390 |
|
the_renderer = NULL; |
1391 |
+ |
} |
1392 |
|
|
1393 |
|
// Stuff the current register values into the new renderer |
1394 |
|
if (the_renderer != NULL) |