ScummVM API documentation
rsound_dragonsphere.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_DRAGONSPHERE_SOUND_RSOUND_DRAGONSPHERE_H
23 #define MADS_DRAGONSPHERE_SOUND_RSOUND_DRAGONSPHERE_H
24 
25 #include "mads/dragonsphere/sound/rsound.h"
26 
27 namespace MADS {
28 namespace Dragonsphere {
29 namespace Sound {
30 
54 class RSound1 : public RSound {
55 private:
56  typedef int (RSound1:: *CommandPtr)();
57  static const CommandPtr _commandList[102];
58 
59  int command16();
60  int loadCommand16();
61  int loadCallback2478();
62 
63  int command17();
64 
65  int command18();
66 
67  int command24();
68  int command25();
69  int command26();
70  int command27();
71  int command28();
72  int command30();
73  int command31();
74 
75  int command32();
76  int loadCommand32();
77  int command33();
78  int loadCommand33();
79  int command34();
80  int command35();
81  int loadCommand35();
82  int command36();
83  int loadCommand36();
84  int command37();
85  int loadCommand37();
86  int command38();
87  int loadCommand38();
88  int command39();
89  int loadCommand39();
90  int command40();
91  int loadCommand40();
92  int command41();
93  int loadCommand41();
94  int command42();
95  int loadCommand42();
96 
104  void command43_48Tail(byte variant);
105  int command43();
106  int command48();
107  void loadCommand43_48();
108 
109  int command44();
110  int loadCommand44();
111  int command45();
112  int loadCommand45();
113  int command46();
114  int loadCommand46();
115  int command47();
116  int loadCommand47();
117 
118  int command64();
119  int command65();
120  int command66();
121  int command67();
122  int command68();
123  int command69();
124  int command70();
125  int command71();
126  int command73();
127  int command74();
128  int command75();
129  int command76();
130  int command77();
131  int command78();
132  int command79();
133  int command80();
134  int command81();
135  int command82();
136  int command83();
137  int command84();
138  int command85();
139  int command86();
140  int command87();
141  int command88();
142  int command89();
143  int command90();
144  int command91();
145  int command93();
146  int command94();
147  int command95();
148  int command96();
149  int command97();
150  int command99();
151  int command100();
152  int command101();
153  bool callFunction(uint16 targetOffset, Channel &channel) override;
154 
155 public:
156  RSound1(Audio::Mixer *mixer);
157 
158  int command(int commandId, int param) override;
159 };
160 
183 class RSound2 : public RSound {
184 private:
185  typedef int (RSound2:: *CommandPtr)();
186  static const CommandPtr _commandList[73];
187 
188  int command1();
189  int command2();
190  int command3();
191  int command5();
192 
194  void resetChannels1to6();
195 
196  int command16();
197  int loadCommand16();
198  int command17();
199  int command18();
200 
201  int command24();
202  int command25();
203  int command26();
204  int command27();
205  int command28();
206  int command30();
207  int command31();
208 
209  int command32();
210  int loadCommand32();
211  int command33();
212  int loadCommand33();
213  int command34();
214  int loadCommand34();
215 
216  int command35();
217  int loadCommand35();
218 
219  int command64();
220  int command65();
221  int command66();
222  int command67();
223  int command68();
224  int command69();
225  int command70();
226  int command71();
227  int command72();
228 
229 public:
230  RSound2(Audio::Mixer *mixer);
231 
232  int command(int commandId, int param) override;
233 };
234 
272 class RSound3 : public RSound {
273 private:
274  typedef int (RSound3:: *CommandPtr)();
275  static const CommandPtr _commandList[74];
276 
277  int command1();
278  int command3();
279  int command5();
280 
281  int command16();
282  int loadCommand16();
283  int command17();
284  int command18();
285 
286  int command24();
287  int command25();
288  int command26();
289  int command27();
290  int command28();
291  int command30();
292  int command31();
293 
299  void command31_64Tail(byte variant);
300  int command64();
301 
302  int command32();
303  int loadCommand32();
304  int command33();
305  int loadCommand33();
306 
307  int command65();
308  int command67();
309  int command68();
310  int command69();
311  int command70();
312  int command71();
313  int command72();
314  int command73();
315  bool callFunction(uint16 targetOffset, Channel &channel) override;
316 
317 public:
318  RSound3(Audio::Mixer *mixer);
319 
320  int command(int commandId, int param) override;
321 };
322 
351 class RSound4 : public RSound {
352 private:
353  int command1();
354  int command2();
355  int command3();
356  int command4();
357 
359  void resetChannels1to5();
360 
362  void resetChannels6to8();
363 
364  typedef int (RSound4:: *CommandPtr)();
365  static const CommandPtr _commandList[79];
366 
375  int command16();
376  int loadCommand16();
377 
378  int command17();
379  int command18();
380 
381  int command24();
382  int command25();
383  int command26();
384  int command27();
385  int command28();
386 
388  int command29();
389  int command30();
390  int command31();
391 
392  int command32();
393  int loadCommand32();
394  int command33();
395  int loadCommand33();
396 
398  int command35();
399  int loadCommand35();
400 
401  int command36();
402  int loadCommand36();
403  int command37();
404  int loadCommand37();
405  int command38();
406  int loadCommand38();
407  int command39();
408  int loadCommand39();
409  int command40();
410  int loadCommand40();
411 
412  int command64();
413  int command65();
414  int command66();
415  int command67();
416  int command68();
417  int command69();
418  int command70();
419  int command71();
420  int command72();
421  int command73();
422  int command74();
423  int command75();
424  int command76();
425  int command77();
426  int command78();
427  bool callFunction(uint16 targetOffset, Channel &channel) override;
428 
429 public:
430  RSound4(Audio::Mixer *mixer);
431 
432  int command(int commandId, int param) override;
433 };
434 
454 class RSound5 : public RSound {
455 private:
456  typedef int (RSound5:: *CommandPtr)();
457  static const CommandPtr _commandList[79];
458 
459  int command1();
460  int command5();
461 
468  bool _command16Played = false;
469 
470  int command16();
471  int loadCommand16A();
472  int loadCommand16B();
473  void dispatchCommand16B();
474 
475  int command17();
476  int command18();
477 
478  int command24();
479  int command25();
480  int command26();
481  int command27();
482  int command28();
483  int command29();
484  int command30();
485 
492  void command31_78Tail(byte variant);
493  int command31();
494 
495  int command32();
496  int loadCommand32();
497  int command33();
498  int loadCommand33();
499  int command34();
500  int loadCommand34();
501  int command35();
502  int loadCommand35();
503  int command36();
504 
506  int command37();
507 
508  int command38();
509  int loadCommand38();
510 
511  int command64();
512  int command65();
513  int command66();
514  int command67();
515  int command68();
516  int command69();
517  int command70();
518  int command71();
519  int command72();
520  int command73();
521  int command74();
522  int command75();
523  int command76();
524 
526  int command77();
527  int command78();
528  bool callFunction(uint16 targetOffset, Channel &channel) override;
529 
530 public:
531  RSound5(Audio::Mixer *mixer);
532 
533  int command(int commandId, int param) override;
534 };
535 
568 class RSound6 : public RSound {
569 private:
570  bool callFunction(uint16 targetOffset, Channel &channel) override;
571 
572  int command1();
573  int command2();
574  int command3();
575  int command4();
576  int command5();
577 
583  void resetChannels6to8();
584 
590  int isMusicChannelsActive();
591 
598  Channel *playSoundChannels1To6(int offset);
599 
607  Channel *playSoundAny(int offset);
608 
609  typedef int (RSound6:: *CommandPtr)();
610  static const CommandPtr _commandList[99];
611 
612  int command16();
613  int loadCommand16();
614  int command17();
615  int command18();
616 
617  int command24();
618  int command25();
619  int command26();
620  int command27();
621  int command28();
622  int command30();
623  int command31();
624 
631  int command32();
632  int command33();
633  int command32_33Load();
634  void command32_33LoadCh4();
635  byte _command33Flag = 0;
636 
637  int command34();
638  int command34LoadCh1AndRest();
639  void command34LoadRestOnly();
640 
641  int command35();
642  int retryCommand35();
643 
644  int command36();
645  int retryCommand36();
646  int command37();
647  int retryCommand37();
648  int command38();
649  int retryCommand38();
650  int command39();
651  int retryCommand39();
652  int command40();
653  int retryCommand40();
654 
655  int command44();
656  int loadCommand44();
657  int command45();
658  int retryCommand45();
659 
660  int command64();
661  int command65();
662  int command66();
663  int command67();
664  int command68();
665  int command69();
666  int command70();
667  int command71();
668  int command72();
669  int command73();
670  int command74();
671  int command75();
672  int command76();
673  int command77();
674  int command78();
675  int command79();
676  int command80();
677  int command81();
678  int command82();
679  int command83();
680  int command84();
681  int command85();
682  int command86();
683  int command87();
684  int command88();
685  int command89();
686  int command90();
687  int command91();
688  int command92();
689  int command93();
690  int command94();
691  int command95();
692  int command96();
693  int retryCommand96();
694  int command97();
695  int command98();
696 
697 public:
698  RSound6(Audio::Mixer *mixer);
699 
700  int command(int commandId, int param) override;
701 };
702 
739 class RSound9 : public RSound {
740 private:
741  int command1();
742  int command3();
743  int command5();
744 
745  int command32();
746 
748  void variantSetupA();
749 
751  void variantSetupB();
752 
759  int command33_47_60Load();
760  int command60();
761 
763  int command33Or47();
764 
766  int command34Or54();
767  int loadCommand34Or54();
768 
769  int command35();
770  int loadCommand35();
771  int command36();
772  int loadCommand36();
773  int command37();
774  int loadCommand37();
775  int command38();
776  int loadCommand38();
777  int command39();
778  int loadCommand39();
779  int command40();
780  int loadCommand40();
781  int command41();
782  int loadCommand41();
783 
784  int command53();
785  int command53Callback();
786 
787  int command42();
788  int loadCommand42();
789 
790  int command43();
791 
792  int command45();
793  int command46();
794 
795  int command48();
796  int command49();
797  int command50();
798 
799  int command51();
800  int loadCommand51();
801 
810  int command52();
811  int loadCommand52();
812 
813  int command55();
814  int loadCommand55();
815  int command57();
816  int loadCommand57();
817 
819  int command58();
820  int loadCommand58();
821 
822  int command59();
823 
824  int command61();
825  int command62();
826  int command63();
827 
828  typedef int (RSound9:: *CommandPtr)();
829  static const CommandPtr _commandList[64];
830  bool callFunction(uint16 targetOffset, Channel &channel) override;
831 
832 public:
833  RSound9(Audio::Mixer *mixer);
834 
835  int command(int commandId, int param) override;
836 };
837 
844 class RSoundDemo : public RSound {
845 protected:
846  RSoundDemo(Audio::Mixer *mixer, const Common::Path &filename,
847  int dataOffset, int dataSize, int sysExOffset);
848 
849  int executeDemoCommonCommand(int commandId);
850  int queueDemoMusic(CallbackFunction callback, uint16 counter,
851  uint16 period);
852  Channel *playDemoSoundAny(int offset);
853 
854 public:
855  static void validate();
856 };
857 
859 class RSoundDemo1 : public RSoundDemo {
860 private:
861  int command16();
862  int loadCommand16();
863  int command32();
864  int loadCommand32();
865  int command33();
866  int loadCommand33();
867  int command34();
868  int loadCommand34();
869  int command35();
870  int loadCommand35();
871  int command36();
872  int loadCommand36();
873  int command37();
874  int loadCommand37();
875  int command38();
876  int loadCommand38();
877  int command39();
878  int loadCommand39();
879  int command40();
880  int loadCommand40();
881  int command41();
882  int loadCommand41();
883  int command42();
884  int loadCommand42();
885  int command43();
886  int loadCommand43();
887  int command44();
888  int loadCommand44();
889  int command45();
890  int loadCommand45();
891  int command92();
892  int loadCommand92();
893  bool callFunction(uint16 targetOffset, Channel &channel) override;
894 
895 public:
896  explicit RSoundDemo1(Audio::Mixer *mixer);
897  int command(int commandId, int param) override;
898 };
899 
901 class RSoundDemo9 : public RSoundDemo {
902 private:
903  int command32();
904  int command33Or47();
905  int loadCommand33Or47();
906  int command34();
907  int loadCommand34();
908  int command35();
909  int loadCommand35();
910  int command36();
911  int loadCommand36();
912  int command37();
913  int loadCommand37();
914  int command38();
915  int loadCommand38();
916  int command39();
917  int loadCommand39();
918  int command40();
919  int loadCommand40();
920  int command41();
921  int loadCommand41();
922  int command42();
923  int loadCommand42();
924  int command43();
925  int command44();
926 
927 public:
928  explicit RSoundDemo9(Audio::Mixer *mixer);
929  int command(int commandId, int param) override;
930 };
931 
932 } // namespace Sound
933 } // namespace Dragonsphere
934 } // namespace MADS
935 
936 #endif
Definition: rsound_dragonsphere.h:568
Definition: rsound.h:56
Definition: rsound_dragonsphere.h:739
Definition: rsound_dragonsphere.h:901
Definition: path.h:52
Definition: rsound_dragonsphere.h:454
Definition: rsound.h:170
Definition: mixer.h:70
Definition: rsound_dragonsphere.h:351
Definition: rsound_dragonsphere.h:859
Definition: rsound_dragonsphere.h:183
Definition: rsound_dragonsphere.h:272
Definition: anim_timer.h:27
Definition: rsound_dragonsphere.h:844
int(RSound::* CallbackFunction)()
Definition: rsound.h:185
Definition: rsound_dragonsphere.h:54
int command(int commandId, int param) override