MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / writeSoundReg

Method writeSoundReg

extlibs/soloud/src/audiosource/tedsid/ted.cpp:74–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void TED::writeSoundReg(unsigned int reg, unsigned char value)
75{
76
77 switch (reg) {
78 case 0:
79 Freq1 = (Freq1 & 0x300) | value;
80 setFreq(0, Freq1);
81 break;
82 case 1:
83 Freq2 = (Freq2 & 0x300) | value;
84 setFreq(1, Freq2);
85 break;
86 case 2:
87 Freq2 = (Freq2 & 0xFF) | (value << 8);
88 setFreq(1, Freq2);
89 break;
90 case 3:
91 DAStatus = value & 0x80;
92 if (DAStatus) {
93 FlipFlop[0] = 1;
94 FlipFlop[1] = 1;
95 oscCount[0] = OscReload[0];
96 oscCount[1] = OscReload[1];
97 NoiseCounter = 0xFF;
98 }
99 Volume = value & 0x0F;
100 if (Volume > 8) Volume = 8;
101 Volume = (Volume << 8) * masterVolume / 10;
102 Snd1Status = value & 0x10;
103 Snd2Status = value & 0x20;
104 SndNoiseStatus = value & 0x40;
105 break;
106 case 4:
107 Freq1 = (Freq1 & 0xFF) | (value << 8);
108 setFreq(0, Freq1);
109 break;
110 }
111}
112
113inline unsigned int TED::waveSquare(unsigned int channel)
114{

Callers 1

tickMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected