ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/SID.cpp
(Generate patch)

Comparing Frodo4/Src/SID.cpp (file contents):
Revision 1.2 by cebix, 2003-07-01T17:51:17Z vs.
Revision 1.3 by cebix, 2003-07-09T13:46:37Z

# Line 23 | Line 23
23   * ------------------
24   *
25   *  - Lots of empirically determined constants in the filter calculations
26 *  - Voice 3 cannot be muted
26   */
27  
28   #include "sysdeps.h"
# Line 349 | Line 348 | struct DRVoice {
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
# Line 379 | Line 379 | private:
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];
# Line 451 | Line 450 | private:
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  
# Line 877 | Line 876 | DigitalRenderer::DigitalRenderer()
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;
# Line 887 | Line 885 | void DigitalRenderer::Reset(void)
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;
# Line 966 | Line 964 | void DigitalRenderer::WriteRegister(uint
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  
# Line 1005 | Line 1003 | void DigitalRenderer::WriteRegister(uint
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
# Line 1255 | Line 1253 | void DigitalRenderer::calc_buffer(int16
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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines