diff options
author | Johannes Schickel | 2014-06-04 01:49:30 +0200 |
---|---|---|
committer | Johannes Schickel | 2014-06-04 01:49:30 +0200 |
commit | fa6779c7a789f2bf8120553bb7f020a37bc5279f (patch) | |
tree | 00eb13280461e7d178597fbd5bf5fd5d5c9360f9 /engines | |
parent | f95d28b74eeabd1fc21b7df576d19d6eddaca9fa (diff) | |
download | scummvm-rg350-fa6779c7a789f2bf8120553bb7f020a37bc5279f.tar.gz scummvm-rg350-fa6779c7a789f2bf8120553bb7f020a37bc5279f.tar.bz2 scummvm-rg350-fa6779c7a789f2bf8120553bb7f020a37bc5279f.zip |
SCUMM: Store hardware channel number explicitly in Channel structure in AD code.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/players/player_ad.cpp | 9 | ||||
-rw-r--r-- | engines/scumm/players/player_ad.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/engines/scumm/players/player_ad.cpp b/engines/scumm/players/player_ad.cpp index a353f38ac1..631a86eae5 100644 --- a/engines/scumm/players/player_ad.cpp +++ b/engines/scumm/players/player_ad.cpp @@ -63,6 +63,9 @@ Player_AD::Player_AD(ScummEngine *scumm, Audio::Mixer *mixer) _rndSeed = 1; memset(_channels, 0, sizeof(_channels)); + for (int i = 0; i < ARRAYSIZE(_channels); ++i) { + _channels[i].hardwareChannel = i; + } memset(_sfxResource, 0, sizeof(_sfxResource)); memset(_sfxPriority, 0, sizeof(_sfxPriority)); } @@ -710,9 +713,9 @@ void Player_AD::updateSlot(int channel) { updateNote = processNoteEnvelope(note); if (note->bias) { - writeRegisterSpecial(channel, note->bias - note->instrumentValue, *curOffset & 0x07); + writeRegisterSpecial(_channels[channel].hardwareChannel, note->bias - note->instrumentValue, *curOffset & 0x07); } else { - writeRegisterSpecial(channel, note->instrumentValue, *curOffset & 0x07); + writeRegisterSpecial(_channels[channel].hardwareChannel, note->instrumentValue, *curOffset & 0x07); } } @@ -764,7 +767,7 @@ bool Player_AD::processNote(Note *note, int channel, const byte *offset) { instrumentDataValue = _channels[channel].instrumentData[instrumentDataOffset]; } - uint8 noteInstrumentValue = readRegisterSpecial(channel, instrumentDataValue, instrumentDataOffset); + uint8 noteInstrumentValue = readRegisterSpecial(_channels[channel].hardwareChannel, instrumentDataValue, instrumentDataOffset); if (note->bias) { noteInstrumentValue = note->bias - noteInstrumentValue; } diff --git a/engines/scumm/players/player_ad.h b/engines/scumm/players/player_ad.h index 6d7d28f155..29b6e5156f 100644 --- a/engines/scumm/players/player_ad.h +++ b/engines/scumm/players/player_ad.h @@ -180,6 +180,8 @@ private: uint8 instrumentData[7]; Note notes[2]; + + int hardwareChannel; } _channels[11]; uint8 _rndSeed; |