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 "../include/blip/Blip_Buffer.h"
10 
11 struct T6W28_Osc
12 {
13 	Blip_Buffer* outputs [4]; // NULL, right, left, center
14 	Blip_Buffer* output;
15 	int output_select;
16 
17 	int delay;
18 	int last_amp_left;
19 	int last_amp_right;
20 
21 	int volume_left;
22 	int volume_right;
23 
24 	T6W28_Osc();
25 	void reset();
26 };
27 
28 struct T6W28_Square : T6W28_Osc
29 {
30 	int period;
31 	int phase;
32 
33 	typedef Blip_Synth<blip_good_quality,1> Synth;
34 	const Synth* synth;
35 
36 	void reset();
37 	void run( long, long );
38 };
39 
40 struct T6W28_Noise : T6W28_Osc
41 {
42 	const int* period;
43 	int period_extra;
44 	unsigned shifter;
45 	unsigned tap;
46 
47 	typedef Blip_Synth<blip_med_quality,1> Synth;
48 	Synth synth;
49 
50 	void reset();
51 	void run( long, long );
52 };
53 
54 #endif
55 
56