ScummVM API documentation
asound_phantom.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 MADS_PHANTOM_SOUND_ASOUND_PHANTOM_H
23 #define MADS_PHANTOM_SOUND_ASOUND_PHANTOM_H
24 
25 #include "mads/phantom/sound/asound.h"
26 
27 namespace MADS {
28 namespace Phantom {
29 namespace Sound {
30 
47 class ASound1 : public ASound {
48 private:
49  typedef int (ASound1::*CommandPtr)();
50  static const CommandPtr _commandList[77];
51 
52  // Tracks which music piece was last selected.
53  int _musicIndex = 0;
54 
55  // Background-music loaders (targets of an indirect jump table).
56  int commandMusic0();
57  int commandMusic1();
58  int commandMusic2();
59  int commandMusic3();
60 
61  int command0();
62  int command1();
63  int command2();
64  int command3();
65  int command4();
66  int command5();
67  int command6();
68  int command7();
69  int command8();
70 
71  int command16();
72 
73  int command24();
74  int command25();
75  int command26();
76  int command27();
77 
78  int command32();
79  int command33();
80  int command34();
81  int command35();
82  int command36();
83  int command37();
84  int command38();
85  int command39();
86  int command64();
87  int command65();
88  int command66();
89  int command67();
90  int command68();
91  int command69();
92  int command70();
93  int command71();
94  int command72();
95  int command73();
96  int command74();
97  int command75();
98  int command76();
99 
100 public:
101  ASound1(Audio::Mixer *mixer);
102  ~ASound1() override {}
103  int command(int commandId, int param) override;
104 };
105 
116 class ASound2 : public ASound {
117 private:
118  typedef int (ASound2::*CommandPtr)();
119  static const CommandPtr _commandList[73];
120 
121  int command0();
122  int command1();
123  int command2();
124  int command3();
125  int command4();
126  int command5();
127  int command6();
128  int command7();
129  int command8();
130 
131  int command16();
132 
133  int command24();
134  int command25();
135  int command26();
136  int command27();
137 
138  int command32();
139  int command33();
140  int command34();
141  int command35();
142 
143  int command64();
144  int command65();
145  int command66();
146  int command67();
147  int command68();
148  int command69();
149  int command70();
150  int command71();
151  int command72();
152 
153 public:
154  ASound2(Audio::Mixer *mixer);
155  ~ASound2() override {}
156  int command(int commandId, int param) override;
157 };
158 
170 class ASound3 : public ASound {
171 private:
172  typedef int (ASound3::*CommandPtr)();
173  static const CommandPtr _commandList[77];
174 
175  // Internal helper: isSoundActive guard on 0xC36, load ch0–7.
176  // Called by command34 which then adds ch8.
177  void sub11CC6();
178 
179  int command0();
180  int command1();
181  int command2();
182  int command3();
183  int command4();
184  int command5();
185  int command6();
186  int command7();
187  int command8();
188 
189  int command16();
190 
191  int command24();
192  int command25();
193  int command26();
194  int command27();
195 
196  int command32();
197  int command33();
198  int command34();
199  int command35();
200  int command36();
201  int command37();
202 
203  int command64();
204  int command65();
205  int command66();
206  int command67();
207  int command68();
208  int command69();
209  int command70();
210  int command71();
211  int command72();
212  int command73();
213  int command74();
214  int command75();
215 
216 public:
217  ASound3(Audio::Mixer *mixer);
218  ~ASound3() override {}
219  int command(int commandId, int param) override;
220 };
221 
234 class ASound4 : public ASound {
235 private:
236  typedef int (ASound4::*CommandPtr)();
237  static const CommandPtr _commandList[71];
238 
239  int command0();
240  int command1();
241  int command2();
242  int command3();
243  int command4();
244  int command5();
245  int command6();
246  int command7();
247  int command8();
248 
249  int command16();
250 
251  int command24();
252  int command25();
253  int command26();
254  int command27();
255 
256  int command64();
257  int command65();
258  int command66();
259  int command67();
260  int command68();
261  int command69();
262  int command70();
263 
264  void callFunction(uint16 offset, AdlibChannel &channel) override;
265 
266 public:
267  ASound4(Audio::Mixer *mixer);
268  ~ASound4() override {}
269  int command(int commandId, int param) override;
270 };
271 
286 class ASound5 : public ASound {
287 private:
288  typedef int (ASound5::*CommandPtr)();
289  static const CommandPtr _commandList[79];
290 
291  int command0();
292  int command1();
293  int command2();
294  int command3();
295  int command4();
296  int command5();
297  int command6();
298  int command7();
299  int command8();
300 
301  int command16();
302 
303  int command24();
304  int command25();
305  int command26();
306  int command27();
307 
308  int command32();
309  int command33();
310  int command34();
311  int command35();
312  int command36();
313  int command37();
314  int command38();
315  int command39();
316 
317  int command64();
318  int command65();
319  int command66();
320  int command67();
321  int command68();
322  int command69();
323  int command70();
324  int command71();
325  int command72();
326  int command73();
327  int command74();
328  int command75();
329  int command76();
330  int command77();
331  int command78();
332 
333 public:
334  ASound5(Audio::Mixer *mixer);
335  ~ASound5() override {}
336  int command(int commandId, int param) override;
337 };
338 
339 class ASound9 : public ASound {
340 private:
341  typedef int (ASound9:: *CommandPtr)();
342  int command0();
343  int command1();
344  int command2();
345  int command3();
346  int command4();
347  int command5();
348  int command6();
349  int command7();
350  int command8();
351 
352  int command16() {
353  return command24();
354  }
355 
356  int command24();
357  int command25();
358  int command26();
359  int command27();
360 
361  int command32();
362  int command33();
363  int command34();
364  int command35();
365  int command36();
366  int command37();
367  int command38();
368  int command39();
369 
370  int command64();
371  int command65();
372  int command66();
373  int command67();
374  int command68();
375  int command69();
376  int command70();
377  int command71();
378 
379  static const CommandPtr _commandList[72];
380 
381 public:
382  ASound9(Audio::Mixer *mixer);
383  ~ASound9() override {
384  }
385  int command(int commandId, int param) override;
386 };
387 
388 class ASoundDemo : public ASound {
389 private:
390  typedef int (ASoundDemo:: *CommandPtr)();
391  int command0();
392  int command1();
393  int command2();
394  int command3();
395  int command4();
396  int command5();
397  int command6();
398  int command7();
399  int command8();
400  int command9();
401  int command10();
402  int command11();
403  int command12();
404  int command13();
405  int command14();
406  int command15();
407  int command16();
408  int command17();
409  int command18();
410  int command19();
411  int command20();
412  int command21();
413  int command22();
414  int command23();
415  int command24();
416  int command25();
417  int command26();
418  int command27();
419  int command28();
420  int command29();
421 
422  void callFunction(uint16 offset, AdlibChannel &channel) override;
423 
424  static const CommandPtr _commandList[30];
425 
426 public:
427  ASoundDemo(Audio::Mixer *mixer);
428  ~ASoundDemo() override {
429  }
430  int command(int commandId, int param) override;
431 };
432 
433 } // namespace Sound
434 } // namespace Phantom
435 } // namespace MADS
436 
437 #endif
Definition: asound_phantom.h:388
int command(int commandId, int param) override
Definition: asound_phantom.h:339
Definition: asound_phantom.h:234
Definition: asound_phantom.h:170
Definition: mixer.h:70
virtual void callFunction(uint16 offset, AdlibChannel &channel)
Definition: asound_phantom.h:116
Definition: asound.h:133
Definition: asound.h:38
Definition: anim_timer.h:27
Definition: asound_phantom.h:47
Definition: asound_phantom.h:286