1 // Private oscillators used by Sms_Apu 2 3 // Sms_Snd_Emu 0.1.4 4 #ifndef SMS_OSCS_H 5 #define SMS_OSCS_H 6 7 #include <mednafen/sound/Blip_Buffer.h> 8 9 struct Sms_Osc 10 { 11 Blip_Buffer* outputs [4]; // NULL, right, left, center 12 Blip_Buffer* output; 13 int output_select; 14 15 int delay; 16 int last_amp; 17 int volume; 18 19 Sms_Osc(); 20 void reset(); 21 }; 22 23 struct Sms_Square : Sms_Osc 24 { 25 int period; 26 int phase; 27 28 typedef Blip_Synth<blip_good_quality,1> Synth; 29 const Synth* synth; 30 31 void reset(); 32 void run( blip_time_t, blip_time_t ); 33 }; 34 35 struct Sms_Noise : Sms_Osc 36 { 37 const int* period; 38 unsigned shifter; 39 unsigned feedback; 40 41 typedef Blip_Synth<blip_med_quality,1> Synth; 42 Synth synth; 43 44 void reset(); 45 void run( blip_time_t, blip_time_t ); 46 }; 47 48 #endif 49