1 
2 // Private oscillators used by T6W28_Apu
3 
4 // T6W28_Snd_Emu
5 
6 #ifndef SMS_OSCS_H
7 #define SMS_OSCS_H
8 
9 #include <mednafen/sound/Blip_Buffer.h>
10 
11 namespace MDFN_IEN_NGP
12 {
13 
14 struct T6W28_Osc
15 {
16 	Blip_Buffer* outputs [4]; // NULL, right, left, center
17 	Blip_Buffer* output;
18 	int output_select;
19 
20 	int delay;
21 	int last_amp_left;
22 	int last_amp_right;
23 
24 	int volume_left;
25 	int volume_right;
26 
27 	T6W28_Osc();
28 	void reset();
29 };
30 
31 struct T6W28_Square : T6W28_Osc
32 {
33 	int period;
34 	int phase;
35 
36 	typedef Blip_Synth<blip_good_quality,1> Synth;
37 	const Synth* synth;
38 
39 	void reset();
40 	void run( sms_time_t, sms_time_t );
41 };
42 
43 struct T6W28_Noise : T6W28_Osc
44 {
45 	const int* period;
46 	int period_extra;
47 	unsigned shifter;
48 	unsigned tap;
49 
50 	typedef Blip_Synth<blip_med_quality,1> Synth;
51 	Synth synth;
52 
53 	void reset();
54 	void run( sms_time_t, sms_time_t );
55 };
56 
57 }
58 
59 #endif
60 
61