ScummVM API documentation
adlibchannel.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 SKY_MUSIC_ADLIBCHANNEL_H
23#define SKY_MUSIC_ADLIBCHANNEL_H
24
25#include "sky/music/musicbase.h"
26
27namespace OPL {
28class OPL;
29}
30
31namespace Sky {
32
33typedef struct {
34 uint8 ad_Op1, ad_Op2;
35 uint8 sr_Op1, sr_Op2;
36 uint8 ampMod_Op1, ampMod_Op2;
37 uint8 waveSelect_Op1, waveSelect_Op2;
38 uint8 bindedEffect;
39 uint8 feedBack;
40 uint8 totOutLev_Op1, totOutLev_Op2;
41 uint8 scalingLevel;
42 uint8 pad1, pad2, pad3;
44
45typedef struct {
46 uint16 eventDataPtr;
47 int32 nextEventTime;
48 uint16 loopPoint;
49 uint8 adlibChannelNumber;
50 uint8 lastCommand;
51 bool channelActive;
52 uint8 note;
53 uint8 adlibReg1, adlibReg2;
54 InstrumentStruct *instrumentData;
55 uint8 assignedInstrument;
56 uint8 channelVolume;
57 uint8 padding; // field_12 / not used by original driver
58 uint8 tremoVibro;
59 uint8 freqOffset;
60 uint16 frequency;
62
63class AdLibChannel : public ChannelBase {
64public:
65 AdLibChannel (OPL::OPL *opl, uint8 *pMusicData, uint16 startOfData);
66 ~AdLibChannel() override;
67 uint8 process(uint16 aktTime) override;
68 void updateVolume(uint16 pVolume) override;
69 bool isActive() override;
70private:
71 OPL::OPL *_opl;
72 uint8 *_musicData;
73 uint16 _musicVolume;
74 AdLibChannelType _channelData;
75
76 InstrumentStruct *_instruments;
77 uint16 *_frequenceTable;
78 uint8 *_instrumentMap;
79 uint8 *_registerTable, *_opOutputTable;
80 uint8 *_adlibRegMirror;
81
82 // normal subs
83 void setRegister(uint8 regNum, uint8 value);
84 int32 getNextEventTime();
85 uint16 getNextNote(uint8 param);
86 void adlibSetupInstrument();
87 void setupInstrument(uint8 opcode);
88 void setupChannelVolume(uint8 volume);
89 void stopNote();
90
91 // Streamfunctions from Command90hTable
92 void com90_caseNoteOff(); // 0
93 void com90_stopChannel(); // 1
94 void com90_setupInstrument(); // 2
95 uint8 com90_updateTempo(); // 3
96 //void com90_dummy(); // 4
97 void com90_getFreqOffset(); // 5
98 void com90_getChannelVolume(); // 6
99 void com90_getTremoVibro(); // 7
100 void com90_loopMusic(); // 8
101 void com90_keyOff(); // 9
102 //void com90_error(); // 10
103 //void com90_doLodsb(); // 11
104 void com90_setLoopPoint(); // 12
105 //void com90_do_two_Lodsb(); // 13
106};
107
108} // End of namespace Sky
109
110#endif //ADLIBCHANNEL_H
Definition: fmopl.h:116
Definition: adlibchannel.h:63
Definition: musicbase.h:46
Definition: autoroute.h:28
Definition: adlibchannel.h:45
Definition: adlibchannel.h:33