1 |
|
/* |
2 |
|
* SID.cpp - 6581 emulation |
3 |
|
* |
4 |
< |
* Frodo (C) 1994-1997,2002-2003 Christian Bauer |
4 |
> |
* Frodo (C) 1994-1997,2002-2004 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 |
32 |
|
#include "Prefs.h" |
33 |
|
|
34 |
|
#ifdef __BEOS__ |
35 |
< |
#include <MediaKit.h> |
35 |
> |
#include <media/SoundPlayer.h> |
36 |
|
#endif |
37 |
|
|
38 |
|
#ifdef AMIGA |
417 |
|
int sample_in_ptr; // Index in sample_buf for writing |
418 |
|
|
419 |
|
#ifdef __BEOS__ |
420 |
< |
static bool stream_func(void *arg, char *buf, size_t count, void *header); |
420 |
> |
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 |
422 |
< |
BDACStream *the_stream; // Pointer to stream |
423 |
< |
BSubscriber *the_sub; // Pointer to subscriber |
424 |
< |
bool in_stream; // Flag: Subscriber has entered stream |
422 |
> |
BSoundPlayer *the_player; // Pointer to sound player |
423 |
> |
bool player_stopped; // Flag: player stopped |
424 |
|
#endif |
425 |
|
|
426 |
|
#ifdef AMIGA |
1198 |
|
#ifdef __riscos__ // on RISC OS we have 8 bit logarithmic sound |
1199 |
|
DigitalRenderer_GetTables(&LinToLog, &LogScale); // get translation tables |
1200 |
|
#else |
1202 |
– |
#ifdef __BEOS__ |
1203 |
– |
count >>= 2; // 16 bit stereo output, count is in bytes |
1204 |
– |
#else |
1201 |
|
count >>= 1; // 16 bit mono output, count is in bytes |
1202 |
|
#endif |
1207 |
– |
#endif |
1203 |
|
while (count--) { |
1204 |
|
int32 sum_output; |
1205 |
|
int32 sum_output_filter = 0; |
1330 |
|
} |
1331 |
|
|
1332 |
|
// Write to buffer |
1333 |
< |
#ifdef __BEOS__ |
1339 |
< |
int16 audio_data = (sum_output + sum_output_filter) >> 10; |
1340 |
< |
int val = *buf + audio_data; |
1341 |
< |
if (val > 32767) |
1342 |
< |
val = 32767; |
1343 |
< |
if (val < -32768) |
1344 |
< |
val = -32768; |
1345 |
< |
*buf++ = val; |
1346 |
< |
val = *buf + audio_data; |
1347 |
< |
if (val > 32767) |
1348 |
< |
val = 32767; |
1349 |
< |
if (val < -32768) |
1350 |
< |
val = -32768; |
1351 |
< |
*buf++ = val; |
1352 |
< |
#elif defined(__riscos__) // lookup in 8k (13bit) translation table |
1333 |
> |
#if defined(__riscos__) // lookup in 8k (13bit) translation table |
1334 |
|
*buf++ = LinToLog[((sum_output + sum_output_filter) >> 13) & 0x1fff]; |
1335 |
|
#else |
1336 |
|
*buf++ = (sum_output + sum_output_filter) >> 10; |
1396 |
|
else if (new_type == SIDTYPE_SIDCARD) |
1397 |
|
the_renderer = new SIDCardRenderer(); |
1398 |
|
#endif |
1399 |
+ |
#ifdef __linux__ |
1400 |
+ |
else if (new_type == SIDTYPE_SIDCARD) |
1401 |
+ |
the_renderer = new CatweaselRenderer(); |
1402 |
+ |
#endif |
1403 |
|
else |
1404 |
|
the_renderer = NULL; |
1405 |
|
|