Debian Codegraph @

android/app/jni/extern/SAASound/src/SAADevice.h

raw
1 // Part of SAASound copyright 2020 Dave Hooper <[email protected]>
2 //
3 // SAADevice.h: connecting the subcomponents of the SAA1099 together.
4 // This class handles device inputs and outputs (clocking, data and
5 // address bus, and simulated output)
6 //
7 //////////////////////////////////////////////////////////////////////
8
9 #ifndef SAADEVICE_H_INCLUDED
10 #define SAADEVICE_H_INCLUDED
11
12 #include "SAASound.h"
13 #include "SAANoise.h"
14 #include "SAAEnv.h"
15 #include "SAAFreq.h"
16 #include "SAAAmp.h"
17
18 class CSAADevice
19 {
20 private:
21 int m_nCurrentSaaReg;
22 bool m_bOutputEnabled;
23 bool m_bSync;
24 int m_nOversample;
25
26 CSAANoise m_Noise0, m_Noise1;
27 CSAAEnv m_Env0, m_Env1;
28 CSAAFreq m_Osc0, m_Osc1, m_Osc2, m_Osc3, m_Osc4, m_Osc5;
29 CSAAAmp m_Amp0, m_Amp1, m_Amp2, m_Amp3, m_Amp4, m_Amp5;
30
31 CSAANoise* Noise[2];
32 CSAAEnv* Env[2];
33 CSAAFreq* Osc[6];
34 CSAAAmp* Amp[6];
35
36 #if defined(DEBUG) || defined(DEBUGSAA)
37 BYTE m_Reg[32];
38 #endif
39
40 public:
41 CSAADevice();
42 ~CSAADevice();
43
44 void _WriteAddress(BYTE nReg);
45 void _WriteData(BYTE nData);
46 #if defined(DEBUG) || defined(DEBUGSAA) || defined(USE_CONFIG_FILE)
47 BYTE _ReadAddress(void);
48 #endif
49 #if defined(DEBUG)
50 BYTE _ReadData(void);
51 #endif
52
53 void _SetClockRate(unsigned int nClockRate);
54 void _SetSampleRate(unsigned int nSampleRate);
55 void _SetOversample(unsigned int nOversample);
56 void _TickAndOutputStereo(unsigned int& left_mixed, unsigned int& right_mixed, DivDispatchOscBuffer** oscBuf, unsigned int where);
57 void _TickAndOutputSeparate(unsigned int& left_mixed, unsigned int& right_mixed,
58 unsigned int& left0, unsigned int& right0,
59 unsigned int& left1, unsigned int& right1,
60 unsigned int& left2, unsigned int& right2,
61 unsigned int& left3, unsigned int& right3,
62 unsigned int& left4, unsigned int& right4,
63 unsigned int& left5, unsigned int& right5
64 );
65
66 };
67
68 #endif // SAADEVICE_H_INCLUDED