23 |
|
* ------------------ |
24 |
|
* |
25 |
|
* - Lots of empirically determined constants in the filter calculations |
26 |
– |
* - Voice 3 cannot be muted |
26 |
|
*/ |
27 |
|
|
28 |
|
#include "sysdeps.h" |
348 |
|
// The following bit is set for the modulating |
349 |
|
// voice, not for the modulated one (as the SID bits) |
350 |
|
bool sync; // Sync modulation bit |
351 |
+ |
bool mute; // Voice muted (voice 3 only) |
352 |
|
}; |
353 |
|
|
354 |
|
// Renderer class |
379 |
|
|
380 |
|
bool ready; // Flag: Renderer has initialized and is ready |
381 |
|
uint8 volume; // Master volume |
382 |
– |
bool v3_mute; // Voice 3 muted |
382 |
|
|
383 |
|
static uint16 TriTable[0x1000*2]; // Tables for certain waveforms |
384 |
|
static const uint16 TriSawTable[0x100]; |
450 |
|
int fd; |
451 |
|
audio_info status; |
452 |
|
uint_t sent_samples,delta_samples; |
453 |
< |
WORD *sound_calc_buf; |
453 |
> |
int16 *sound_calc_buf; |
454 |
|
#endif |
455 |
|
|
456 |
|
#ifdef __hpux |
457 |
|
int fd; |
458 |
|
audio_status status; |
459 |
< |
int16 * sound_calc_buf; |
459 |
> |
int16 *sound_calc_buf; |
460 |
|
int linecnt; |
461 |
|
#endif |
462 |
|
|
876 |
|
void DigitalRenderer::Reset(void) |
877 |
|
{ |
878 |
|
volume = 0; |
880 |
– |
v3_mute = false; |
879 |
|
|
880 |
|
for (int v=0; v<3; v++) { |
881 |
|
voice[v].wave = WAVE_NONE; |
885 |
|
voice[v].eg_level = voice[v].s_level = 0; |
886 |
|
voice[v].a_add = voice[v].d_sub = voice[v].r_sub = EGTable[0]; |
887 |
|
voice[v].gate = voice[v].ring = voice[v].test = false; |
888 |
< |
voice[v].filter = voice[v].sync = false; |
888 |
> |
voice[v].filter = voice[v].sync = voice[v].mute = false; |
889 |
|
} |
890 |
|
|
891 |
|
f_type = FILT_NONE; |
964 |
|
voice[v].gate = byte & 1; |
965 |
|
voice[v].mod_by->sync = byte & 2; |
966 |
|
voice[v].ring = byte & 4; |
967 |
< |
if ((voice[v].test = byte & 8)) |
967 |
> |
if ((voice[v].test = byte & 8) != 0) |
968 |
|
voice[v].count = 0; |
969 |
|
break; |
970 |
|
|
1003 |
|
|
1004 |
|
case 24: |
1005 |
|
volume = byte & 0xf; |
1006 |
< |
v3_mute = byte & 0x80; |
1006 |
> |
voice[2].mute = byte & 0x80; |
1007 |
|
if (((byte >> 4) & 7) != f_type) { |
1008 |
|
f_type = (byte >> 4) & 7; |
1009 |
|
#ifdef USE_FIXPOINT_MATHS |
1253 |
|
envelope = (v->eg_level * master_volume) >> 20; |
1254 |
|
|
1255 |
|
// Waveform generator |
1256 |
+ |
if (v->mute) |
1257 |
+ |
continue; |
1258 |
|
uint16 output; |
1259 |
|
|
1260 |
|
if (!v->test) |