ScummVM API documentation
c64.sfx.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef FREESCAPE_ECLIPSE_C64_SFX_H
23 #define FREESCAPE_ECLIPSE_C64_SFX_H
24 
25 #include "audio/sid.h"
26 #include "freescape/sid.h"
27 
28 namespace Freescape {
29 
31 public:
34 
35  void playSfx(int sfxIndex);
36  void sfxTick();
37  void stopAllSfx();
38 
39  bool isSfxActive() const;
40  void initSID();
41  void destroySID();
42 
43 private:
44  SID::SID *_sid;
45 
46  void sidWrite(int reg, uint8 data);
47  void onTimer();
48 
49  uint8 _state;
50 
51  uint8 _numNotes;
52  uint8 _repeatCount;
53  uint8 _waveform;
54  uint8 _speed;
55 
56  uint8 _repeatLeft;
57  uint8 _notesLeft;
58  uint8 _freqIndex;
59  uint8 _durIndex;
60  uint8 _durCounter;
61  uint8 _speedCounter;
62 
63  uint8 _curFreqLo;
64  uint8 _curFreqHi;
65 
66  int16 _startFreqs[16];
67  int16 _deltas[16];
68  uint8 _durCopies[9];
69 
70  void silenceV1();
71  void silenceAll();
72  void setupSfx(int index);
73  void tickStart();
74  void tickSlide();
75 };
76 
77 } // namespace Freescape
78 
79 #endif // FREESCAPE_ECLIPSE_C64_SFX_H
Definition: area.h:36
Definition: c64.sfx.h:30
Definition: sid.h:44