22 #ifndef SCUMM_PLAYERS_PLAYER_AD_H 23 #define SCUMM_PLAYERS_PLAYER_AD_H 25 #include "scumm/music.h" 27 #include "common/mutex.h" 28 #include "common/serializer.h" 47 void setMusicVolume(
int vol)
override;
48 void startSound(
int sound)
override;
49 void stopSound(
int sound)
override;
50 void stopAllSounds()
override;
51 int getMusicTimer()
override;
52 int getSoundStatus(
int sound)
const override;
70 int32 _engineMusicTimer;
74 struct HardwareChannel {
80 static const int _operatorOffsetToChannel[22];
82 int allocateHWChannel(
int priority, SfxSlot *owner =
nullptr);
83 void freeHWChannel(
int channel);
84 void limitHWChannels(
int newCount);
87 uint8 _registerBackUpTable[256];
88 void writeReg(
int r,
int v);
89 uint8 readReg(
int r)
const;
92 void setupChannel(
const uint channel,
const byte *instrOffset);
93 void setupOperator(
const uint opr,
const byte *&instrOffset);
94 static const int _operatorOffsetTable[18];
102 void noteOff(uint channel);
103 void setupFrequency(uint channel, int8 frequency);
104 void setupRhythm(uint rhythmInstr, uint instrOffset);
106 const byte *_musicData;
110 uint32 _internalMusicTimer;
112 uint _musicLoopStart;
113 uint _instrumentOffset[16];
115 struct VoiceChannel {
120 void freeVoiceChannel(uint channel);
122 void musicSeekTo(
const uint position);
128 uint32 _nextEventTimer;
130 static const uint _noteFrequencies[12];
131 static const uint _mdvdrTable[6];
132 static const uint _rhythmOperatorTable[6];
133 static const uint _rhythmChannelTable[6];
137 kNoteStatePreInit = -1,
138 kNoteStateAttack = 0,
140 kNoteStateSustain = 2,
141 kNoteStateRelease = 3,
163 kChannelStateOff = 0,
164 kChannelStateParse = 1,
165 kChannelStatePlay = 2
170 const byte *currentOffset;
171 const byte *startOffset;
172 uint8 instrumentData[7];
186 SfxSlot *allocateSfxSlot(
int priority);
187 bool startSfx(SfxSlot *sfx,
const byte *resource);
188 void stopSfx(SfxSlot *sfx);
191 void clearChannel(
const Channel &channel);
192 void updateChannel(Channel *channel);
193 void parseSlot(Channel *channel);
194 void updateSlot(Channel *channel);
195 void parseNote(Note *note,
const Channel &channel,
const byte *offset);
196 bool processNote(Note *note,
const Channel &channel,
const byte *offset);
197 void noteOffOn(
int channel);
198 void writeRegisterSpecial(
int channel, uint8 value,
int offset);
199 uint8 readRegisterSpecial(
int channel, uint8 defaultValue,
int offset);
200 void setupNoteEnvelopeState(Note *note,
int steps,
int adjust);
201 bool processNoteEnvelope(Note *note);
208 static const uint _noteBiasTable[7];
209 static const uint _numStepsTable[16];
210 static const uint _noteAdjustScaleTable[7];
211 static const uint _noteAdjustTable[16];
212 static const bool _useOperatorTable[7];
213 static const uint _channelOffsetTable[11];
214 static const uint _channelOperatorOffsetTable[7];
215 static const uint _baseRegisterTable[7];
216 static const uint _registerMaskTable[7];
217 static const uint _registerShiftTable[7];
Definition: player_ad.h:41
Definition: serializer.h:79
Definition: player_ad.h:154