Rename all "Adlib" uses to "AdLib" to match the real name of the sound card / company.

Check this for reference:
http://en.wikipedia.org/wiki/Ad_Lib,_Inc.
http://www.crossfire-designs.de/images/articles/soundcards/adlib.jpg (note the upper left of the card)

This commit does not touch "adlib" and "ADLIB" uses!

Also it does not update all the SCUMM detection entries, which still use "Adlib".

svn-id: r47279
This commit is contained in:
Johannes Schickel 2010-01-12 21:07:56 +00:00
parent 1ebe047972
commit 0d995c5920
54 changed files with 738 additions and 738 deletions

View file

@ -130,7 +130,7 @@ void MidiPlayer::send(uint32 b) {
// If I understand it correctly, the current standard indicates
// that the volume should be reset, but the next revision will
// exclude it. On my system, both ALSA and FluidSynth seem to
// reset it, while Adlib does not. Let's follow the majority.
// reset it, while AdLib does not. Let's follow the majority.
_current->volume[channel] = 127;
}

View file

@ -58,9 +58,9 @@ CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Eng
// Setup mixer
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
// Use music volume for plain sound types (At least the Adlib player uses a plain sound type
// Use music volume for plain sound types (At least the AdLib player uses a plain sound type
// so previously the music and sfx volume controls didn't affect it at all).
// FIXME: Make Adlib player differentiate between playing sound effects and music and remove this.
// FIXME: Make AdLib player differentiate between playing sound effects and music and remove this.
_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, ConfMan.getInt("music_volume"));
g_cine = this;

View file

@ -78,7 +78,7 @@ const int PCSoundDriver::_noteTable[] = {
const int PCSoundDriver::_noteTableCount = ARRAYSIZE(_noteTable);
struct AdlibRegisterSoundInstrument {
struct AdLibRegisterSoundInstrument {
uint8 vibrato;
uint8 attackDecay;
uint8 sustainRelease;
@ -88,20 +88,20 @@ struct AdlibRegisterSoundInstrument {
uint8 freqMod;
};
struct AdlibSoundInstrument {
struct AdLibSoundInstrument {
byte mode;
byte channel;
AdlibRegisterSoundInstrument regMod;
AdlibRegisterSoundInstrument regCar;
AdLibRegisterSoundInstrument regMod;
AdLibRegisterSoundInstrument regCar;
byte waveSelectMod;
byte waveSelectCar;
byte amDepth;
};
class AdlibSoundDriver : public PCSoundDriver, Audio::AudioStream {
class AdLibSoundDriver : public PCSoundDriver, Audio::AudioStream {
public:
AdlibSoundDriver(Audio::Mixer *mixer);
virtual ~AdlibSoundDriver();
AdLibSoundDriver(Audio::Mixer *mixer);
virtual ~AdLibSoundDriver();
// PCSoundDriver interface
virtual void setupChannel(int channel, const byte *data, int instrument, int volume);
@ -117,8 +117,8 @@ public:
void initCard();
void update(int16 *buf, int len);
void setupInstrument(const byte *data, int channel);
void loadRegisterInstrument(const byte *data, AdlibRegisterSoundInstrument *reg);
virtual void loadInstrument(const byte *data, AdlibSoundInstrument *asi) = 0;
void loadRegisterInstrument(const byte *data, AdLibRegisterSoundInstrument *reg);
virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi) = 0;
protected:
FM_OPL *_opl;
@ -128,7 +128,7 @@ protected:
byte _vibrato;
int _channelsVolumeTable[4];
AdlibSoundInstrument _instrumentsTable[4];
AdLibSoundInstrument _instrumentsTable[4];
static const int _freqTable[];
static const int _freqTableCount;
@ -138,41 +138,41 @@ protected:
static const int _voiceOperatorsTableCount;
};
const int AdlibSoundDriver::_freqTable[] = {
const int AdLibSoundDriver::_freqTable[] = {
0x157, 0x16C, 0x181, 0x198, 0x1B1, 0x1CB,
0x1E6, 0x203, 0x222, 0x243, 0x266, 0x28A
};
const int AdlibSoundDriver::_freqTableCount = ARRAYSIZE(_freqTable);
const int AdLibSoundDriver::_freqTableCount = ARRAYSIZE(_freqTable);
const int AdlibSoundDriver::_operatorsTable[] = {
const int AdLibSoundDriver::_operatorsTable[] = {
0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
};
const int AdlibSoundDriver::_operatorsTableCount = ARRAYSIZE(_operatorsTable);
const int AdLibSoundDriver::_operatorsTableCount = ARRAYSIZE(_operatorsTable);
const int AdlibSoundDriver::_voiceOperatorsTable[] = {
const int AdLibSoundDriver::_voiceOperatorsTable[] = {
0, 3, 1, 4, 2, 5, 6, 9, 7, 10, 8, 11, 12, 15, 16, 16, 14, 14, 17, 17, 13, 13
};
const int AdlibSoundDriver::_voiceOperatorsTableCount = ARRAYSIZE(_voiceOperatorsTable);
const int AdLibSoundDriver::_voiceOperatorsTableCount = ARRAYSIZE(_voiceOperatorsTable);
// Future Wars Adlib driver
class AdlibSoundDriverINS : public AdlibSoundDriver {
// Future Wars AdLib driver
class AdLibSoundDriverINS : public AdLibSoundDriver {
public:
AdlibSoundDriverINS(Audio::Mixer *mixer) : AdlibSoundDriver(mixer) {}
AdLibSoundDriverINS(Audio::Mixer *mixer) : AdLibSoundDriver(mixer) {}
virtual const char *getInstrumentExtension() const { return ".INS"; }
virtual void loadInstrument(const byte *data, AdlibSoundInstrument *asi);
virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi);
virtual void setChannelFrequency(int channel, int frequency);
virtual void playSample(const byte *data, int size, int channel, int volume);
};
// Operation Stealth Adlib driver
class AdlibSoundDriverADL : public AdlibSoundDriver {
// Operation Stealth AdLib driver
class AdLibSoundDriverADL : public AdLibSoundDriver {
public:
AdlibSoundDriverADL(Audio::Mixer *mixer) : AdlibSoundDriver(mixer) {}
AdLibSoundDriverADL(Audio::Mixer *mixer) : AdLibSoundDriver(mixer) {}
virtual const char *getInstrumentExtension() const { return ".ADL"; }
virtual void loadInstrument(const byte *data, AdlibSoundInstrument *asi);
virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi);
virtual void setChannelFrequency(int channel, int frequency);
virtual void playSample(const byte *data, int size, int channel, int volume);
};
@ -237,22 +237,22 @@ void PCSoundDriver::resetChannel(int channel) {
stopAll();
}
AdlibSoundDriver::AdlibSoundDriver(Audio::Mixer *mixer)
AdLibSoundDriver::AdLibSoundDriver(Audio::Mixer *mixer)
: _mixer(mixer) {
_sampleRate = _mixer->getOutputRate();
_opl = makeAdlibOPL(_sampleRate);
_opl = makeAdLibOPL(_sampleRate);
memset(_channelsVolumeTable, 0, sizeof(_channelsVolumeTable));
memset(_instrumentsTable, 0, sizeof(_instrumentsTable));
initCard();
_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
}
AdlibSoundDriver::~AdlibSoundDriver() {
AdLibSoundDriver::~AdLibSoundDriver() {
_mixer->stopHandle(_soundHandle);
OPLDestroy(_opl);
}
void AdlibSoundDriver::setupChannel(int channel, const byte *data, int instrument, int volume) {
void AdLibSoundDriver::setupChannel(int channel, const byte *data, int instrument, int volume) {
assert(channel < 4);
if (data) {
if (volume > 80) {
@ -269,9 +269,9 @@ void AdlibSoundDriver::setupChannel(int channel, const byte *data, int instrumen
}
}
void AdlibSoundDriver::stopChannel(int channel) {
void AdLibSoundDriver::stopChannel(int channel) {
assert(channel < 4);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
if (ins->mode != 0 && ins->channel == 6) {
channel = 6;
}
@ -284,7 +284,7 @@ void AdlibSoundDriver::stopChannel(int channel) {
}
}
void AdlibSoundDriver::stopAll() {
void AdLibSoundDriver::stopAll() {
int i;
for (i = 0; i < 18; ++i) {
OPLWriteReg(_opl, 0x40 | _operatorsTable[i], 63);
@ -295,12 +295,12 @@ void AdlibSoundDriver::stopAll() {
OPLWriteReg(_opl, 0xBD, 0);
}
int AdlibSoundDriver::readBuffer(int16 *buffer, const int numSamples) {
int AdLibSoundDriver::readBuffer(int16 *buffer, const int numSamples) {
update(buffer, numSamples);
return numSamples;
}
void AdlibSoundDriver::initCard() {
void AdLibSoundDriver::initCard() {
_vibrato = 0x20;
OPLWriteReg(_opl, 0xBD, _vibrato);
OPLWriteReg(_opl, 0x08, 0x40);
@ -324,7 +324,7 @@ void AdlibSoundDriver::initCard() {
OPLWriteReg(_opl, 1, 0);
}
void AdlibSoundDriver::update(int16 *buf, int len) {
void AdLibSoundDriver::update(int16 *buf, int len) {
static int samplesLeft = 0;
while (len != 0) {
int count = samplesLeft;
@ -344,13 +344,13 @@ void AdlibSoundDriver::update(int16 *buf, int len) {
}
}
void AdlibSoundDriver::setupInstrument(const byte *data, int channel) {
void AdLibSoundDriver::setupInstrument(const byte *data, int channel) {
assert(channel < 4);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
loadInstrument(data, ins);
int mod, car, tmp;
const AdlibRegisterSoundInstrument *reg;
const AdLibRegisterSoundInstrument *reg;
if (ins->mode != 0) {
mod = _operatorsTable[_voiceOperatorsTable[2 * ins->channel + 0]];
@ -390,7 +390,7 @@ void AdlibSoundDriver::setupInstrument(const byte *data, int channel) {
OPLWriteReg(_opl, 0xE0 | car, ins->waveSelectCar);
}
void AdlibSoundDriver::loadRegisterInstrument(const byte *data, AdlibRegisterSoundInstrument *reg) {
void AdLibSoundDriver::loadRegisterInstrument(const byte *data, AdLibRegisterSoundInstrument *reg) {
reg->vibrato = 0;
if (READ_LE_UINT16(data + 18)) { // amplitude vibrato
reg->vibrato |= 0x80;
@ -422,7 +422,7 @@ void AdlibSoundDriver::loadRegisterInstrument(const byte *data, AdlibRegisterSou
reg->freqMod = READ_LE_UINT16(data + 24);
}
void AdlibSoundDriverINS::loadInstrument(const byte *data, AdlibSoundInstrument *asi) {
void AdLibSoundDriverINS::loadInstrument(const byte *data, AdLibSoundInstrument *asi) {
asi->mode = *data++;
asi->channel = *data++;
loadRegisterInstrument(data, &asi->regMod); data += 26;
@ -432,9 +432,9 @@ void AdlibSoundDriverINS::loadInstrument(const byte *data, AdlibSoundInstrument
asi->amDepth = data[0]; data += 2;
}
void AdlibSoundDriverINS::setChannelFrequency(int channel, int frequency) {
void AdLibSoundDriverINS::setChannelFrequency(int channel, int frequency) {
assert(channel < 4);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
if (ins->mode != 0 && ins->channel == 6) {
channel = 6;
}
@ -458,12 +458,12 @@ void AdlibSoundDriverINS::setChannelFrequency(int channel, int frequency) {
}
}
void AdlibSoundDriverINS::playSample(const byte *data, int size, int channel, int volume) {
void AdLibSoundDriverINS::playSample(const byte *data, int size, int channel, int volume) {
assert(channel < 4);
_channelsVolumeTable[channel] = 127;
resetChannel(channel);
setupInstrument(data + 257, channel);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
if (ins->mode != 0 && ins->channel == 6) {
channel = 6;
}
@ -483,7 +483,7 @@ void AdlibSoundDriverINS::playSample(const byte *data, int size, int channel, in
}
}
void AdlibSoundDriverADL::loadInstrument(const byte *data, AdlibSoundInstrument *asi) {
void AdLibSoundDriverADL::loadInstrument(const byte *data, AdLibSoundInstrument *asi) {
asi->mode = *data++;
asi->channel = *data++;
asi->waveSelectMod = *data++ & 3;
@ -494,9 +494,9 @@ void AdlibSoundDriverADL::loadInstrument(const byte *data, AdlibSoundInstrument
loadRegisterInstrument(data, &asi->regCar); data += 26;
}
void AdlibSoundDriverADL::setChannelFrequency(int channel, int frequency) {
void AdLibSoundDriverADL::setChannelFrequency(int channel, int frequency) {
assert(channel < 4);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
if (ins->mode != 0) {
channel = ins->channel;
if (channel == 9) {
@ -527,11 +527,11 @@ void AdlibSoundDriverADL::setChannelFrequency(int channel, int frequency) {
}
}
void AdlibSoundDriverADL::playSample(const byte *data, int size, int channel, int volume) {
void AdLibSoundDriverADL::playSample(const byte *data, int size, int channel, int volume) {
assert(channel < 4);
_channelsVolumeTable[channel] = 127;
setupInstrument(data, channel);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
if (ins->mode != 0 && ins->channel == 6) {
OPLWriteReg(_opl, 0xB0 | channel, 0);
}
@ -723,9 +723,9 @@ void PCSoundFxPlayer::unload() {
PCSound::PCSound(Audio::Mixer *mixer, CineEngine *vm)
: Sound(mixer, vm) {
if (_vm->getGameType() == GType_FW) {
_soundDriver = new AdlibSoundDriverINS(_mixer);
_soundDriver = new AdLibSoundDriverINS(_mixer);
} else {
_soundDriver = new AdlibSoundDriverADL(_mixer);
_soundDriver = new AdLibSoundDriverADL(_mixer);
}
_player = new PCSoundFxPlayer(_soundDriver);
}

View file

@ -364,7 +364,7 @@ int loadFileSub1(uint8 **ptr, const char *name, uint8 *ptr2) {
* strcat(buffer, ".H32");
*}
* else
* if (useAdlib)
* if (useAdLib)
* { */
strcat(buffer,".ADL");
/* }

View file

@ -82,7 +82,7 @@ const int PCSoundDriver::_noteTable[] = {
const int PCSoundDriver::_noteTableCount = ARRAYSIZE(_noteTable);
struct AdlibRegisterSoundInstrument {
struct AdLibRegisterSoundInstrument {
uint8 vibrato;
uint8 attackDecay;
uint8 sustainRelease;
@ -92,11 +92,11 @@ struct AdlibRegisterSoundInstrument {
uint8 freqMod;
};
struct AdlibSoundInstrument {
struct AdLibSoundInstrument {
byte mode;
byte channel;
AdlibRegisterSoundInstrument regMod;
AdlibRegisterSoundInstrument regCar;
AdLibRegisterSoundInstrument regMod;
AdLibRegisterSoundInstrument regCar;
byte waveSelectMod;
byte waveSelectCar;
byte amDepth;
@ -107,10 +107,10 @@ struct VolumeEntry {
int adjusted;
};
class AdlibSoundDriver : public PCSoundDriver, Audio::AudioStream {
class AdLibSoundDriver : public PCSoundDriver, Audio::AudioStream {
public:
AdlibSoundDriver(Audio::Mixer *mixer);
virtual ~AdlibSoundDriver();
AdLibSoundDriver(Audio::Mixer *mixer);
virtual ~AdLibSoundDriver();
// PCSoundDriver interface
virtual void setupChannel(int channel, const byte *data, int instrument, int volume);
@ -126,9 +126,9 @@ public:
void initCard();
void update(int16 *buf, int len);
void setupInstrument(const byte *data, int channel);
void setupInstrument(const AdlibSoundInstrument *ins, int channel);
void loadRegisterInstrument(const byte *data, AdlibRegisterSoundInstrument *reg);
virtual void loadInstrument(const byte *data, AdlibSoundInstrument *asi) = 0;
void setupInstrument(const AdLibSoundInstrument *ins, int channel);
void loadRegisterInstrument(const byte *data, AdLibRegisterSoundInstrument *reg);
virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi) = 0;
virtual void syncSounds();
void adjustVolume(int channel, int volume);
@ -141,7 +141,7 @@ protected:
byte _vibrato;
VolumeEntry _channelsVolumeTable[5];
AdlibSoundInstrument _instrumentsTable[5];
AdLibSoundInstrument _instrumentsTable[5];
static const int _freqTable[];
static const int _freqTableCount;
@ -151,30 +151,30 @@ protected:
static const int _voiceOperatorsTableCount;
};
const int AdlibSoundDriver::_freqTable[] = {
const int AdLibSoundDriver::_freqTable[] = {
0x157, 0x16C, 0x181, 0x198, 0x1B1, 0x1CB,
0x1E6, 0x203, 0x222, 0x243, 0x266, 0x28A
};
const int AdlibSoundDriver::_freqTableCount = ARRAYSIZE(_freqTable);
const int AdLibSoundDriver::_freqTableCount = ARRAYSIZE(_freqTable);
const int AdlibSoundDriver::_operatorsTable[] = {
const int AdLibSoundDriver::_operatorsTable[] = {
0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
};
const int AdlibSoundDriver::_operatorsTableCount = ARRAYSIZE(_operatorsTable);
const int AdLibSoundDriver::_operatorsTableCount = ARRAYSIZE(_operatorsTable);
const int AdlibSoundDriver::_voiceOperatorsTable[] = {
const int AdLibSoundDriver::_voiceOperatorsTable[] = {
0, 3, 1, 4, 2, 5, 6, 9, 7, 10, 8, 11, 12, 15, 16, 16, 14, 14, 17, 17, 13, 13
};
const int AdlibSoundDriver::_voiceOperatorsTableCount = ARRAYSIZE(_voiceOperatorsTable);
const int AdLibSoundDriver::_voiceOperatorsTableCount = ARRAYSIZE(_voiceOperatorsTable);
class AdlibSoundDriverADL : public AdlibSoundDriver {
class AdLibSoundDriverADL : public AdLibSoundDriver {
public:
AdlibSoundDriverADL(Audio::Mixer *mixer) : AdlibSoundDriver(mixer) {}
AdLibSoundDriverADL(Audio::Mixer *mixer) : AdLibSoundDriver(mixer) {}
virtual const char *getInstrumentExtension() const { return ".ADL"; }
virtual void loadInstrument(const byte *data, AdlibSoundInstrument *asi);
virtual void loadInstrument(const byte *data, AdLibSoundInstrument *asi);
virtual void setChannelFrequency(int channel, int frequency);
virtual void playSample(const byte *data, int size, int channel, int volume);
};
@ -287,10 +287,10 @@ void PCSoundDriver::syncSounds() {
_sfxVolume = ConfMan.getBool("sfx_mute") ? 0 : MIN(255, ConfMan.getInt("sfx_volume"));
}
AdlibSoundDriver::AdlibSoundDriver(Audio::Mixer *mixer)
AdLibSoundDriver::AdLibSoundDriver(Audio::Mixer *mixer)
: _mixer(mixer) {
_sampleRate = _mixer->getOutputRate();
_opl = makeAdlibOPL(_sampleRate);
_opl = makeAdLibOPL(_sampleRate);
for (int i = 0; i < 5; ++i) {
_channelsVolumeTable[i].original = 0;
@ -304,23 +304,23 @@ AdlibSoundDriver::AdlibSoundDriver(Audio::Mixer *mixer)
_sfxVolume = ConfMan.getBool("sfx_mute") ? 0 : MIN(255, ConfMan.getInt("sfx_volume"));
}
AdlibSoundDriver::~AdlibSoundDriver() {
AdLibSoundDriver::~AdLibSoundDriver() {
_mixer->stopHandle(_soundHandle);
OPLDestroy(_opl);
}
void AdlibSoundDriver::syncSounds() {
void AdLibSoundDriver::syncSounds() {
PCSoundDriver::syncSounds();
// Force all instruments to reload on the next playing point
for (int i = 0; i < 5; ++i) {
adjustVolume(i, _channelsVolumeTable[i].original);
AdlibSoundInstrument *ins = &_instrumentsTable[i];
AdLibSoundInstrument *ins = &_instrumentsTable[i];
setupInstrument(ins, i);
}
}
void AdlibSoundDriver::adjustVolume(int channel, int volume) {
void AdLibSoundDriver::adjustVolume(int channel, int volume) {
_channelsVolumeTable[channel].original = volume;
if (volume > 80) {
@ -342,7 +342,7 @@ void AdlibSoundDriver::adjustVolume(int channel, int volume) {
_channelsVolumeTable[channel].adjusted = volume;
}
void AdlibSoundDriver::setupChannel(int channel, const byte *data, int instrument, int volume) {
void AdLibSoundDriver::setupChannel(int channel, const byte *data, int instrument, int volume) {
assert(channel < 5);
if (data) {
adjustVolume(channel, volume);
@ -350,9 +350,9 @@ void AdlibSoundDriver::setupChannel(int channel, const byte *data, int instrumen
}
}
void AdlibSoundDriver::stopChannel(int channel) {
void AdLibSoundDriver::stopChannel(int channel) {
assert(channel < 5);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
if (ins->mode != 0 && ins->channel == 6) {
channel = 6;
}
@ -365,7 +365,7 @@ void AdlibSoundDriver::stopChannel(int channel) {
}
}
void AdlibSoundDriver::stopAll() {
void AdLibSoundDriver::stopAll() {
int i;
for (i = 0; i < 18; ++i) {
OPLWriteReg(_opl, 0x40 | _operatorsTable[i], 63);
@ -376,12 +376,12 @@ void AdlibSoundDriver::stopAll() {
OPLWriteReg(_opl, 0xBD, 0);
}
int AdlibSoundDriver::readBuffer(int16 *buffer, const int numSamples) {
int AdLibSoundDriver::readBuffer(int16 *buffer, const int numSamples) {
update(buffer, numSamples);
return numSamples;
}
void AdlibSoundDriver::initCard() {
void AdLibSoundDriver::initCard() {
_vibrato = 0x20;
OPLWriteReg(_opl, 0xBD, _vibrato);
OPLWriteReg(_opl, 0x08, 0x40);
@ -405,7 +405,7 @@ void AdlibSoundDriver::initCard() {
OPLWriteReg(_opl, 1, 0);
}
void AdlibSoundDriver::update(int16 *buf, int len) {
void AdLibSoundDriver::update(int16 *buf, int len) {
static int samplesLeft = 0;
while (len != 0) {
int count = samplesLeft;
@ -425,17 +425,17 @@ void AdlibSoundDriver::update(int16 *buf, int len) {
}
}
void AdlibSoundDriver::setupInstrument(const byte *data, int channel) {
void AdLibSoundDriver::setupInstrument(const byte *data, int channel) {
assert(channel < 5);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
loadInstrument(data, ins);
setupInstrument(ins, channel);
}
void AdlibSoundDriver::setupInstrument(const AdlibSoundInstrument *ins, int channel) {
void AdLibSoundDriver::setupInstrument(const AdLibSoundInstrument *ins, int channel) {
int mod, car, tmp;
const AdlibRegisterSoundInstrument *reg;
const AdLibRegisterSoundInstrument *reg;
if (ins->mode != 0) {
mod = _operatorsTable[_voiceOperatorsTable[2 * ins->channel + 0]];
@ -475,7 +475,7 @@ void AdlibSoundDriver::setupInstrument(const AdlibSoundInstrument *ins, int chan
OPLWriteReg(_opl, 0xE0 | car, ins->waveSelectCar);
}
void AdlibSoundDriver::loadRegisterInstrument(const byte *data, AdlibRegisterSoundInstrument *reg) {
void AdLibSoundDriver::loadRegisterInstrument(const byte *data, AdLibRegisterSoundInstrument *reg) {
reg->vibrato = 0;
if (READ_LE_UINT16(data + 18)) { // amplitude vibrato
reg->vibrato |= 0x80;
@ -507,7 +507,7 @@ void AdlibSoundDriver::loadRegisterInstrument(const byte *data, AdlibRegisterSou
reg->freqMod = READ_LE_UINT16(data + 24);
}
void AdlibSoundDriverADL::loadInstrument(const byte *data, AdlibSoundInstrument *asi) {
void AdLibSoundDriverADL::loadInstrument(const byte *data, AdLibSoundInstrument *asi) {
asi->mode = *data++;
asi->channel = *data++;
asi->waveSelectMod = *data++ & 3;
@ -518,9 +518,9 @@ void AdlibSoundDriverADL::loadInstrument(const byte *data, AdlibSoundInstrument
loadRegisterInstrument(data, &asi->regCar); data += 26;
}
void AdlibSoundDriverADL::setChannelFrequency(int channel, int frequency) {
void AdLibSoundDriverADL::setChannelFrequency(int channel, int frequency) {
assert(channel < 5);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
if (ins->mode != 0) {
channel = ins->channel;
if (channel == 9) {
@ -553,12 +553,12 @@ void AdlibSoundDriverADL::setChannelFrequency(int channel, int frequency) {
}
}
void AdlibSoundDriverADL::playSample(const byte *data, int size, int channel, int volume) {
void AdLibSoundDriverADL::playSample(const byte *data, int size, int channel, int volume) {
assert(channel < 5);
adjustVolume(channel, 127);
setupInstrument(data, channel);
AdlibSoundInstrument *ins = &_instrumentsTable[channel];
AdLibSoundInstrument *ins = &_instrumentsTable[channel];
if (ins->mode != 0 && ins->channel == 6) {
OPLWriteReg(_opl, 0xB0 | channel, 0);
}
@ -780,7 +780,7 @@ void PCSoundFxPlayer::doSync(Common::Serializer &s) {
PCSound::PCSound(Audio::Mixer *mixer, CruiseEngine *vm) {
_vm = vm;
_mixer = mixer;
_soundDriver = new AdlibSoundDriverADL(_mixer);
_soundDriver = new AdLibSoundDriverADL(_mixer);
_player = new PCSoundFxPlayer(_soundDriver);
}

View file

@ -133,7 +133,7 @@ int DraciEngine::init() {
_music = new MusicPlayer(_midiDriver, musicPathMask);
_music->setNativeMT32(native_mt32);
//_music->setAdlib(adlib);
//_music->setAdLib(adlib);
// Load the game's fonts
_smallFont = new Font(kFontSmall);

View file

@ -45,7 +45,7 @@ MusicPlayer::MusicPlayer(MidiDriver *driver, const char *pathMask) : _parser(0),
_midiMusicData = NULL;
// TODO: Load cmf.ins with the instrument table. It seems that an
// interface for such an operation is supported for Adlib. Maybe for
// interface for such an operation is supported for AdLib. Maybe for
// this card, setting instruments is necessary.
}

File diff suppressed because it is too large Load diff

View file

@ -207,8 +207,8 @@ bool GobEngine::is640() const {
return (_features & kFeatures640) != 0;
}
bool GobEngine::hasAdlib() const {
return (_features & kFeaturesAdlib) != 0;
bool GobEngine::hasAdLib() const {
return (_features & kFeaturesAdLib) != 0;
}
bool GobEngine::isSCNDemo() const {

View file

@ -121,7 +121,7 @@ enum Features {
kFeaturesNone = 0,
kFeaturesCD = 1 << 0,
kFeaturesEGA = 1 << 1,
kFeaturesAdlib = 1 << 2,
kFeaturesAdLib = 1 << 2,
kFeatures640 = 1 << 3,
kFeaturesSCNDemo = 1 << 4,
kFeaturesBATDemo = 1 << 5,
@ -208,7 +208,7 @@ public:
bool isCD() const;
bool isEGA() const;
bool is640() const;
bool hasAdlib() const;
bool hasAdLib() const;
bool isSCNDemo() const;
bool isBATDemo() const;
bool is800x600() const;

View file

@ -59,7 +59,7 @@ void AdLib::init() {
_rate = _mixer->getOutputRate();
_opl = makeAdlibOPL(_rate);
_opl = makeAdLibOPL(_rate);
_first = true;
_ended = false;

View file

@ -51,7 +51,7 @@ Sound::Sound(GobEngine *vm) : _vm(vm) {
_cdrom = 0;
_bgatmos = 0;
_hasAdLib = (!_vm->_noMusic && _vm->hasAdlib());
_hasAdLib = (!_vm->_noMusic && _vm->hasAdLib());
if (!_vm->_noMusic && (_vm->getPlatform() == Common::kPlatformAmiga)) {
_infogrames = new Infogrames(*_vm->_mixer);
@ -130,13 +130,13 @@ bool Sound::sampleLoad(SoundDesc *sndDesc, SoundType type, const char *fileName,
return sndDesc->load(type, data, size);
}
void Sound::sampleFree(SoundDesc *sndDesc, bool noteAdlib, int index) {
void Sound::sampleFree(SoundDesc *sndDesc, bool noteAdLib, int index) {
if (!sndDesc || sndDesc->empty())
return;
if (sndDesc->getType() == SOUND_ADL) {
if (noteAdlib) {
if (noteAdLib) {
if (_adlPlayer)
if ((index == -1) || (_adlPlayer->getIndex() == index))
_adlPlayer->stopPlay();
@ -241,7 +241,7 @@ bool Sound::adlibLoadADL(const char *fileName) {
if (!_adlPlayer)
_adlPlayer = new ADLPlayer(*_vm->_mixer);
debugC(1, kDebugSound, "Adlib: Loading ADL data (\"%s\")", fileName);
debugC(1, kDebugSound, "AdLib: Loading ADL data (\"%s\")", fileName);
return _adlPlayer->load(fileName);
}
@ -253,7 +253,7 @@ bool Sound::adlibLoadADL(byte *data, uint32 size, int index) {
if (!_adlPlayer)
_adlPlayer = new ADLPlayer(*_vm->_mixer);
debugC(1, kDebugSound, "Adlib: Loading ADL data (%d)", index);
debugC(1, kDebugSound, "AdLib: Loading ADL data (%d)", index);
return _adlPlayer->load(data, size, index);
}
@ -262,7 +262,7 @@ void Sound::adlibUnload() {
if (!_hasAdLib)
return;
debugC(1, kDebugSound, "Adlib: Unloading data");
debugC(1, kDebugSound, "AdLib: Unloading data");
if (_adlPlayer)
_adlPlayer->unload();
@ -277,7 +277,7 @@ bool Sound::adlibLoadMDY(const char *fileName) {
if (!_mdyPlayer)
_mdyPlayer = new MDYPlayer(*_vm->_mixer);
debugC(1, kDebugSound, "Adlib: Loading MDY data (\"%s\")", fileName);
debugC(1, kDebugSound, "AdLib: Loading MDY data (\"%s\")", fileName);
if (!_vm->_dataIO->existData(fileName)) {
warning("Can't open MDY file \"%s\"", fileName);
@ -305,7 +305,7 @@ bool Sound::adlibLoadTBR(const char *fileName) {
return false;
}
debugC(1, kDebugSound, "Adlib: Loading MDY instruments (\"%s\")", fileName);
debugC(1, kDebugSound, "AdLib: Loading MDY instruments (\"%s\")", fileName);
DataStream *stream = _vm->_dataIO->getDataStream(fileName);
@ -326,7 +326,7 @@ void Sound::adlibPlayTrack(const char *trackname) {
if (_adlPlayer->isPlaying())
return;
debugC(1, kDebugSound, "Adlib: Playing ADL track \"%s\"", trackname);
debugC(1, kDebugSound, "AdLib: Playing ADL track \"%s\"", trackname);
_adlPlayer->unload();
_adlPlayer->load(trackname);
@ -370,7 +370,7 @@ void Sound::adlibPlay() {
if (!_hasAdLib)
return;
debugC(1, kDebugSound, "Adlib: Starting playback");
debugC(1, kDebugSound, "AdLib: Starting playback");
if (_adlPlayer)
_adlPlayer->startPlay();
@ -382,7 +382,7 @@ void Sound::adlibStop() {
if (!_hasAdLib)
return;
debugC(1, kDebugSound, "Adlib: Stopping playback");
debugC(1, kDebugSound, "AdLib: Stopping playback");
if (_adlPlayer)
_adlPlayer->stopPlay();

View file

@ -55,7 +55,7 @@ public:
int sampleGetNextFreeSlot() const;
bool sampleLoad(SoundDesc *sndDesc, SoundType type, const char *fileName, bool tryExist = true);
void sampleFree(SoundDesc *sndDesc, bool noteAdlib = false, int index = -1);
void sampleFree(SoundDesc *sndDesc, bool noteAdLib = false, int index = -1);
// SoundBlaster

View file

@ -558,7 +558,7 @@ void MusicPlayerXMI::setTimbreAD(byte channel, const Timbre &timbre) {
// Prepare the AdLib Instrument array from the GTL entry
//
// struct AdlibInstrument used by our AdLib MIDI synth is 30 bytes.
// struct AdLibInstrument used by our AdLib MIDI synth is 30 bytes.
// Since we pass data + 2 for non percussion instruments we need to
// have a buffer of size 32, so there are no invalid memory reads,
// when setting up an AdLib instrument.

View file

@ -120,7 +120,7 @@ Common::Error KyraEngine_v1::init() {
} else if (_flags.platform == Common::kPlatformAmiga) {
_sound = new SoundAmiga(this, _mixer);
} else if (midiDriver == MD_ADLIB) {
_sound = new SoundAdlibPC(this, _mixer);
_sound = new SoundAdLibPC(this, _mixer);
} else {
Sound::kType type;
@ -149,9 +149,9 @@ Common::Error KyraEngine_v1::init() {
// Unlike some SCUMM games, it's not that the MIDI sounds are
// missing. It's just that at least at the time of writing they
// are decidedly inferior to the Adlib ones.
// are decidedly inferior to the AdLib ones.
if (ConfMan.getBool("multi_midi")) {
SoundAdlibPC *adlib = new SoundAdlibPC(this, _mixer);
SoundAdLibPC *adlib = new SoundAdLibPC(this, _mixer);
assert(adlib);
_sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);

View file

@ -429,7 +429,7 @@ Common::Error LoLEngine::init() {
KyraEngine_v1::init();
initStaticResource();
_envSfxDistThreshold = _sound->getSfxType() == Sound::kAdlib ? 15 : 3;
_envSfxDistThreshold = _sound->getSfxType() == Sound::kAdLib ? 15 : 3;
_gui = new GUI_LoL(this);
assert(_gui);

View file

@ -117,7 +117,7 @@ void KyraEngine_HoF::enterNewScene(uint16 newScene, int facing, int unk1, int un
_sceneExit4 = scene.exit4;
if (newSoundFile) {
if (_sound->getMusicType() == Sound::kAdlib) {
if (_sound->getMusicType() == Sound::kAdLib) {
while (_sound->isPlaying())
_system->delayMillis(10);
} else {

View file

@ -827,7 +827,7 @@ int KyraEngine_HoF::o2_showLetter(EMCState *script) {
int KyraEngine_HoF::o2_playFireflyScore(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playFireflyScore(%p) ()", (const void *)script);
if (_sound->getSfxType() == Sound::kAdlib || _sound->getSfxType() == Sound::kPCSpkr ||
if (_sound->getSfxType() == Sound::kAdLib || _sound->getSfxType() == Sound::kPCSpkr ||
_sound->getSfxType() == Sound::kMidiMT32 || _sound->getSfxType() == Sound::kMidiGM) {
snd_playWanderScoreViaMap(86, 1);
return 1;
@ -1329,7 +1329,7 @@ int KyraEngine_HoF::o2_midiSoundFadeout(EMCState *script) {
int KyraEngine_HoF::o2_getSfxDriver(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getSfxDriver(%p) ()", (const void *)script);
if (_sound->getSfxType() == Sound::kAdlib)
if (_sound->getSfxType() == Sound::kAdLib)
return 1;
else if (_sound->getSfxType() == Sound::kPCSpkr)
return 4;
@ -1349,7 +1349,7 @@ int KyraEngine_HoF::o2_getVocSupport(EMCState *script) {
int KyraEngine_HoF::o2_getMusicDriver(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getMusicDriver(%p) ()", (const void *)script);
if (_sound->getMusicType() == Sound::kAdlib)
if (_sound->getMusicType() == Sound::kAdLib)
return 1;
else if (_sound->getMusicType() == Sound::kPCSpkr)
return 4;

View file

@ -51,7 +51,7 @@ public:
virtual ~Sound();
enum kType {
kAdlib,
kAdLib,
kMidiMT32,
kMidiGM,
kTowns,

File diff suppressed because it is too large Load diff

View file

@ -47,7 +47,7 @@
#include "common/mutex.h"
namespace Kyra {
class AdlibDriver;
class AdLibDriver;
/**
* AdLib implementation of the sound output device.
@ -57,15 +57,15 @@ class AdlibDriver;
* Kyrandia 1 are using exact the same format, the
* one of Kyrandia 2 slightly differs.
*
* See AdlibDriver for more information.
* @see AdlibDriver
* See AdLibDriver for more information.
* @see AdLibDriver
*/
class SoundAdlibPC : public Sound {
class SoundAdLibPC : public Sound {
public:
SoundAdlibPC(KyraEngine_v1 *vm, Audio::Mixer *mixer);
~SoundAdlibPC();
SoundAdLibPC(KyraEngine_v1 *vm, Audio::Mixer *mixer);
~SoundAdLibPC();
kType getMusicType() const { return kAdlib; }
kType getMusicType() const { return kAdLib; }
bool init();
void process();
@ -89,7 +89,7 @@ private:
void unk1();
void unk2();
AdlibDriver *_driver;
AdLibDriver *_driver;
bool _v2;
uint8 _trackEntries[500];

View file

@ -577,7 +577,7 @@ void AnimviewView::readNextCommand() {
{
char buffer[100];
strcpy(buffer, aaFile.soundName.c_str());
buffer[0] = 'A'; // A for Adlib resource
buffer[0] = 'A'; // A for AdLib resource
/*Common::SeekableReadStream *stream = */_vm->_resourceManager->get(buffer);

View file

@ -105,7 +105,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
_music = new MusicPlayer(driver);
_music->setNativeMT32(native_mt32);
//_music->setAdlib(adlib);
//_music->setAdLib(adlib);
// Set default sound frequency
switch (getGameID()) {

View file

@ -30,13 +30,13 @@
namespace Queen {
class AdlibMidiChannel;
class AdLibMidiChannel;
class AdlibMidiDriver : public MidiDriver_Emulated {
class AdLibMidiDriver : public MidiDriver_Emulated {
public:
AdlibMidiDriver(Audio::Mixer *mixer) : MidiDriver_Emulated(mixer) {}
~AdlibMidiDriver() {}
AdLibMidiDriver(Audio::Mixer *mixer) : MidiDriver_Emulated(mixer) {}
~AdLibMidiDriver() {}
// MidiDriver
int open();
@ -123,9 +123,9 @@ private:
static const int16 _midiNoteFreqTable[];
};
int AdlibMidiDriver::open() {
int AdLibMidiDriver::open() {
MidiDriver_Emulated::open();
_opl = makeAdlibOPL(getRate());
_opl = makeAdLibOPL(getRate());
adlibSetupCard();
for (int i = 0; i < 11; ++i) {
_adlibChannelsVolume[i] = 0;
@ -136,12 +136,12 @@ int AdlibMidiDriver::open() {
return 0;
}
void AdlibMidiDriver::close() {
void AdLibMidiDriver::close() {
_mixer->stopHandle(_mixerSoundHandle);
OPLDestroy(_opl);
}
void AdlibMidiDriver::send(uint32 b) {
void AdLibMidiDriver::send(uint32 b) {
int channel = b & 15;
int cmd = (b >> 4) & 7;
int param1 = (b >> 8) & 255;
@ -168,7 +168,7 @@ void AdlibMidiDriver::send(uint32 b) {
}
}
void AdlibMidiDriver::metaEvent(byte type, byte *data, uint16 length) {
void AdLibMidiDriver::metaEvent(byte type, byte *data, uint16 length) {
int event = 0;
if (length > 4 && READ_BE_UINT32(data) == 0x3F00) {
event = data[4];
@ -196,12 +196,12 @@ void AdlibMidiDriver::metaEvent(byte type, byte *data, uint16 length) {
warning("Unhandled meta event %d len %d", event, length);
}
void AdlibMidiDriver::generateSamples(int16 *data, int len) {
void AdLibMidiDriver::generateSamples(int16 *data, int len) {
memset(data, 0, sizeof(int16) * len);
YM3812UpdateOne(_opl, data, len);
}
void AdlibMidiDriver::handleSequencerSpecificMetaEvent1(int channel, const uint8 *data) {
void AdLibMidiDriver::handleSequencerSpecificMetaEvent1(int channel, const uint8 *data) {
for (int i = 0; i < 28; ++i) {
_adlibMetaSequenceData[i] = data[i];
}
@ -219,17 +219,17 @@ void AdlibMidiDriver::handleSequencerSpecificMetaEvent1(int channel, const uint8
}
}
void AdlibMidiDriver::handleSequencerSpecificMetaEvent2(uint8 value) {
void AdLibMidiDriver::handleSequencerSpecificMetaEvent2(uint8 value) {
_adlibRhythmEnabled = value;
_midiNumberOfChannels = _adlibRhythmEnabled ? 11 : 9;
adlibSetAmpVibratoRhythm();
}
void AdlibMidiDriver::handleSequencerSpecificMetaEvent3(uint8 value) {
void AdLibMidiDriver::handleSequencerSpecificMetaEvent3(uint8 value) {
adlibSetNoteMul(value);
}
void AdlibMidiDriver::handleMidiEvent0x90_NoteOn(int channel, int param1, int param2) { // note, volume
void AdLibMidiDriver::handleMidiEvent0x90_NoteOn(int channel, int param1, int param2) { // note, volume
if (param2 == 0) {
adlibTurnNoteOff(channel);
_adlibChannelsVolume[channel] = param2;
@ -241,11 +241,11 @@ void AdlibMidiDriver::handleMidiEvent0x90_NoteOn(int channel, int param1, int pa
}
}
void AdlibMidiDriver::adlibWrite(uint8 port, uint8 value) {
void AdLibMidiDriver::adlibWrite(uint8 port, uint8 value) {
OPLWriteReg(_opl, port, value);
}
void AdlibMidiDriver::adlibSetupCard() {
void AdLibMidiDriver::adlibSetupCard() {
for (int i = 1; i <= 0xF5; ++i) {
adlibWrite(i, 0);
}
@ -263,7 +263,7 @@ void AdlibMidiDriver::adlibSetupCard() {
adlibSetWaveformSelect(1);
}
void AdlibMidiDriver::adlibSetupChannels(int fl) {
void AdLibMidiDriver::adlibSetupChannels(int fl) {
if (fl != 0) {
_midiChannelsNote1Table[8] = 24;
_midiChannelsNote2Table[8] = 8192;
@ -282,7 +282,7 @@ void AdlibMidiDriver::adlibSetupChannels(int fl) {
adlibSetAmpVibratoRhythm();
}
void AdlibMidiDriver::adlibResetAmpVibratoRhythm(int am, int vib, int kso) {
void AdLibMidiDriver::adlibResetAmpVibratoRhythm(int am, int vib, int kso) {
_adlibAMDepthEq48 = am;
_adlibVibratoDepthEq14 = vib;
_adlibKeyboardSplitOn = kso;
@ -290,7 +290,7 @@ void AdlibMidiDriver::adlibResetAmpVibratoRhythm(int am, int vib, int kso) {
adlibSetCSMKeyboardSplit();
}
void AdlibMidiDriver::adlibResetChannels() {
void AdLibMidiDriver::adlibResetChannels() {
for (int i = 0; i < 18; ++i) {
adlibSetupChannelFromSequence(i, _adlibChannelsNoFeedback[i] ? _adlibInitSequenceData2 : _adlibInitSequenceData1, 0);
}
@ -304,7 +304,7 @@ void AdlibMidiDriver::adlibResetChannels() {
}
}
void AdlibMidiDriver::adlibSetAmpVibratoRhythm() {
void AdLibMidiDriver::adlibSetAmpVibratoRhythm() {
uint8 value = 0;
if (_adlibAMDepthEq48) {
value |= 0x80;
@ -318,12 +318,12 @@ void AdlibMidiDriver::adlibSetAmpVibratoRhythm() {
adlibWrite(0xBD, value | _adlibVibratoRhythm);
}
void AdlibMidiDriver::adlibSetCSMKeyboardSplit() {
void AdLibMidiDriver::adlibSetCSMKeyboardSplit() {
uint8 value = _adlibKeyboardSplitOn ? 0x40 : 0;
adlibWrite(8, value);
}
void AdlibMidiDriver::adlibSetNoteMul(int mul) {
void AdLibMidiDriver::adlibSetNoteMul(int mul) {
if (mul > 12) {
mul = 12;
} else if (mul < 1) {
@ -332,7 +332,7 @@ void AdlibMidiDriver::adlibSetNoteMul(int mul) {
_adlibNoteMul = mul;
}
void AdlibMidiDriver::adlibSetWaveformSelect(int fl) {
void AdLibMidiDriver::adlibSetWaveformSelect(int fl) {
_adlibWaveformSelect = fl ? 0x20 : 0;
for (int i = 0; i < 18; ++i) {
adlibWrite(0xE0 + _adlibChannelsMappingTable1[i], 0);
@ -340,7 +340,7 @@ void AdlibMidiDriver::adlibSetWaveformSelect(int fl) {
adlibWrite(1, _adlibWaveformSelect);
}
void AdlibMidiDriver::adlibSetPitchBend(int channel, int range) {
void AdLibMidiDriver::adlibSetPitchBend(int channel, int range) {
if ((_adlibRhythmEnabled && channel <= 6) || channel < 9) {
if (range > 16383) {
range = 16383;
@ -350,11 +350,11 @@ void AdlibMidiDriver::adlibSetPitchBend(int channel, int range) {
}
}
void AdlibMidiDriver::adlibPlayNote(int channel) {
void AdLibMidiDriver::adlibPlayNote(int channel) {
_midiChannelsFreqTable[channel] = adlibPlayNoteHelper(channel, _midiChannelsNote1Table[channel], _midiChannelsNote2Table[channel], _midiChannelsOctTable[channel]);
}
uint8 AdlibMidiDriver::adlibPlayNoteHelper(int channel, int note1, int note2, int oct) {
uint8 AdLibMidiDriver::adlibPlayNoteHelper(int channel, int note1, int note2, int oct) {
int n = ((note2 * _midiChannelsNoteTable[channel]) >> 8) - 8192;
if (n != 0) {
n >>= 5;
@ -383,7 +383,7 @@ uint8 AdlibMidiDriver::adlibPlayNoteHelper(int channel, int note1, int note2, in
return value;
}
void AdlibMidiDriver::adlibTurnNoteOff(int channel) {
void AdLibMidiDriver::adlibTurnNoteOff(int channel) {
if ((_adlibRhythmEnabled && channel <= 6) || channel < 9) {
_midiChannelsOctTable[channel] = 0;
_midiChannelsFreqTable[channel] &= ~0x20;
@ -394,7 +394,7 @@ void AdlibMidiDriver::adlibTurnNoteOff(int channel) {
}
}
void AdlibMidiDriver::adlibTurnNoteOn(int channel, int note) {
void AdLibMidiDriver::adlibTurnNoteOn(int channel, int note) {
note -= 12;
if (note < 0) {
note = 0;
@ -418,14 +418,14 @@ void AdlibMidiDriver::adlibTurnNoteOn(int channel, int note) {
}
}
void AdlibMidiDriver::adlibSetupChannelFromSequence(int channel, const uint8 *src, int fl) {
void AdLibMidiDriver::adlibSetupChannelFromSequence(int channel, const uint8 *src, int fl) {
for (int i = 0; i < 13; ++i) {
_adlibSetupChannelSequence2[i] = src[i];
}
adlibSetupChannel(channel, _adlibSetupChannelSequence2, fl);
}
void AdlibMidiDriver::adlibSetupChannel(int channel, const uint16 *src, int fl) {
void AdLibMidiDriver::adlibSetupChannel(int channel, const uint16 *src, int fl) {
for (int i = 0; i < 13; ++i) {
_adlibSetupChannelSequence1[14 * channel + i] = src[i];
}
@ -433,7 +433,7 @@ void AdlibMidiDriver::adlibSetupChannel(int channel, const uint16 *src, int fl)
adlibSetupChannelHelper(channel);
}
void AdlibMidiDriver::adlibSetNoteVolume(int channel, int volume) {
void AdLibMidiDriver::adlibSetNoteVolume(int channel, int volume) {
if (_midiNumberOfChannels > channel) {
if (volume > 127) {
volume = 127;
@ -452,7 +452,7 @@ void AdlibMidiDriver::adlibSetNoteVolume(int channel, int volume) {
}
}
void AdlibMidiDriver::adlibSetupChannelHelper(int channel) {
void AdLibMidiDriver::adlibSetupChannelHelper(int channel) {
adlibSetAmpVibratoRhythm();
adlibSetCSMKeyboardSplit();
adlibSetChannel0x40(channel);
@ -463,7 +463,7 @@ void AdlibMidiDriver::adlibSetupChannelHelper(int channel) {
adlibSetChannel0xE0(channel);
}
void AdlibMidiDriver::adlibSetChannel0x40(int channel) {
void AdLibMidiDriver::adlibSetChannel0x40(int channel) {
int index, value, fl;
if (_adlibRhythmEnabled) {
@ -488,7 +488,7 @@ void AdlibMidiDriver::adlibSetChannel0x40(int channel) {
adlibWrite(0x40 + _adlibChannelsMappingTable1[channel], value);
}
void AdlibMidiDriver::adlibSetChannel0xC0(int channel) {
void AdLibMidiDriver::adlibSetChannel0xC0(int channel) {
if (_adlibChannelsNoFeedback[channel] == 0) {
const uint8 *p = &_adlibSetupChannelSequence1[channel * 14];
uint8 value = p[2] << 1;
@ -499,19 +499,19 @@ void AdlibMidiDriver::adlibSetChannel0xC0(int channel) {
}
}
void AdlibMidiDriver::adlibSetChannel0x60(int channel) {
void AdLibMidiDriver::adlibSetChannel0x60(int channel) {
const uint8 *p = &_adlibSetupChannelSequence1[channel * 14];
uint8 value = (p[3] << 4) | (p[6] & 15);
adlibWrite(0x60 + _adlibChannelsMappingTable1[channel], value);
}
void AdlibMidiDriver::adlibSetChannel0x80(int channel) {
void AdLibMidiDriver::adlibSetChannel0x80(int channel) {
const uint8 *p = &_adlibSetupChannelSequence1[channel * 14];
uint8 value = (p[4] << 4) | (p[7] & 15);
adlibWrite(0x80 + _adlibChannelsMappingTable1[channel], value);
}
void AdlibMidiDriver::adlibSetChannel0x20(int channel) {
void AdLibMidiDriver::adlibSetChannel0x20(int channel) {
const uint8 *p = &_adlibSetupChannelSequence1[channel * 14];
uint8 value = p[1] & 15;
if (p[9]) {
@ -529,7 +529,7 @@ void AdlibMidiDriver::adlibSetChannel0x20(int channel) {
adlibWrite(0x20 + _adlibChannelsMappingTable1[channel], value);
}
void AdlibMidiDriver::adlibSetChannel0xE0(int channel) {
void AdLibMidiDriver::adlibSetChannel0xE0(int channel) {
uint8 value = 0;
if (_adlibWaveformSelect) {
const uint8 *p = &_adlibSetupChannelSequence1[channel * 14];
@ -538,71 +538,71 @@ void AdlibMidiDriver::adlibSetChannel0xE0(int channel) {
adlibWrite(0xE0 + _adlibChannelsMappingTable1[channel], value);
}
const uint8 AdlibMidiDriver::_adlibChannelsMappingTable1[] = {
const uint8 AdLibMidiDriver::_adlibChannelsMappingTable1[] = {
0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
};
const uint8 AdlibMidiDriver::_adlibChannelsNoFeedback[] = {
const uint8 AdLibMidiDriver::_adlibChannelsNoFeedback[] = {
0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1
};
const uint8 AdlibMidiDriver::_adlibChannelsMappingTable2[] = {
const uint8 AdLibMidiDriver::_adlibChannelsMappingTable2[] = {
0, 1, 2, 0, 1, 2, 3, 4, 5, 3, 4, 5, 6, 7, 8, 6, 7, 8
};
const uint8 AdlibMidiDriver::_adlibChannelsMappingTable3[] = {
const uint8 AdLibMidiDriver::_adlibChannelsMappingTable3[] = {
0, 1, 2, 0, 1, 2, 3, 4, 5, 3, 4, 5, 6, 10, 8, 6, 7, 9
};
const uint8 AdlibMidiDriver::_adlibChannelsKeyScalingTable1[] = {
const uint8 AdLibMidiDriver::_adlibChannelsKeyScalingTable1[] = {
0, 3, 1, 4, 2, 5, 6, 9, 7, 10, 8, 11, 12, 15, 13, 16, 14, 17
};
const uint8 AdlibMidiDriver::_adlibChannelsKeyScalingTable2[] = {
const uint8 AdLibMidiDriver::_adlibChannelsKeyScalingTable2[] = {
0, 3, 1, 4, 2, 5, 6, 9, 7, 10, 8, 11, 12, 15, 16, 255, 14, 255, 17, 255, 13, 255
};
const uint8 AdlibMidiDriver::_adlibChannelsVolumeTable[] = {
const uint8 AdLibMidiDriver::_adlibChannelsVolumeTable[] = {
128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128
};
const uint8 AdlibMidiDriver::_adlibInitSequenceData1[] = {
const uint8 AdLibMidiDriver::_adlibInitSequenceData1[] = {
1, 1, 3, 15, 5, 0, 1, 3, 15, 0, 0, 0, 1, 0
};
const uint8 AdlibMidiDriver::_adlibInitSequenceData2[] = {
const uint8 AdLibMidiDriver::_adlibInitSequenceData2[] = {
0, 1, 1, 15, 7, 0, 2, 4, 0, 0, 0, 1, 0, 0
};
const uint8 AdlibMidiDriver::_adlibInitSequenceData3[] = {
const uint8 AdLibMidiDriver::_adlibInitSequenceData3[] = {
0, 0, 0, 10, 4, 0, 8, 12, 11, 0, 0, 0, 1, 0
};
const uint8 AdlibMidiDriver::_adlibInitSequenceData4[] = {
const uint8 AdLibMidiDriver::_adlibInitSequenceData4[] = {
0, 0, 0, 13, 4, 0, 6, 15, 0, 0, 0, 0, 1, 0
};
const uint8 AdlibMidiDriver::_adlibInitSequenceData5[] = {
const uint8 AdLibMidiDriver::_adlibInitSequenceData5[] = {
0, 12, 0, 15, 11, 0, 8, 5, 0, 0, 0, 0, 0, 0
};
const uint8 AdlibMidiDriver::_adlibInitSequenceData6[] = {
const uint8 AdLibMidiDriver::_adlibInitSequenceData6[] = {
0, 4, 0, 15, 11, 0, 7, 5, 0, 0, 0, 0, 0, 0
};
const uint8 AdlibMidiDriver::_adlibInitSequenceData7[] = {
const uint8 AdLibMidiDriver::_adlibInitSequenceData7[] = {
0, 1, 0, 15, 11, 0, 5, 5, 0, 0, 0, 0, 0, 0
};
const uint8 AdlibMidiDriver::_adlibInitSequenceData8[] = {
const uint8 AdLibMidiDriver::_adlibInitSequenceData8[] = {
0, 1, 0, 15, 11, 0, 7, 5, 0, 0, 0, 0, 0, 0
};
const int16 AdlibMidiDriver::_midiChannelsNoteTable[] = {
const int16 AdLibMidiDriver::_midiChannelsNoteTable[] = {
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256
};
const int16 AdlibMidiDriver::_midiNoteFreqTable[] = {
const int16 AdLibMidiDriver::_midiNoteFreqTable[] = {
690, 692, 695, 697, 700, 702, 705, 707, 710, 713, 715, 718,
720, 723, 726, 728, 731, 733, 736, 739, 741, 744, 747, 749,
752, 755, 758, 760, 763, 766, 769, 771, 774, 777, 780, 783,
@ -621,8 +621,8 @@ const int16 AdlibMidiDriver::_midiNoteFreqTable[] = {
-363, -361, -359, -356, -354, -351, -349, -347, -344, -342, -339, -337
};
MidiDriver *C_Player_CreateAdlibMidiDriver(Audio::Mixer *mixer) {
return new AdlibMidiDriver(mixer);
MidiDriver *C_Player_CreateAdLibMidiDriver(Audio::Mixer *mixer) {
return new AdLibMidiDriver(mixer);
}
} // End of namespace Queen

View file

@ -36,7 +36,7 @@
namespace Queen {
extern MidiDriver *C_Player_CreateAdlibMidiDriver(Audio::Mixer *);
extern MidiDriver *C_Player_CreateAdLibMidiDriver(Audio::Mixer *);
MidiMusic::MidiMusic(QueenEngine *vm)
: _isPlaying(false), _looping(false), _randomLoop(false), _masterVolume(192), _buf(0) {
@ -68,9 +68,9 @@ MidiMusic::MidiMusic(QueenEngine *vm)
if (_adlib) {
// int infoOffset = _numSongs * 4 + 2;
// if (READ_LE_UINT16(_musicData + 2) != infoOffset) {
// defaultAdlibVolume = _musicData[infoOffset];
// defaultAdLibVolume = _musicData[infoOffset];
// }
_driver = C_Player_CreateAdlibMidiDriver(vm->_mixer);
_driver = C_Player_CreateAdLibMidiDriver(vm->_mixer);
} else {
_driver = MidiDriver::createMidi(midiDriver);
if (_nativeMT32) {

View file

@ -370,9 +370,9 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
// file, and I've tentatively reached the conclusion
// that they are both General MIDI. My guess is that
// the FM file has been reorchestrated to sound better
// on Adlib and other FM synths.
// on AdLib and other FM synths.
//
// Sev says the Adlib music does not sound like in the
// Sev says the AdLib music does not sound like in the
// original, but I still think assuming General MIDI is
// the right thing to do. Some music, like the End
// Title (song 0) sound absolutely atrocious when piped
@ -391,7 +391,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
// Note that the IHNM demo has only got one music file
// (music.rsc). It is assumed that it contains FM music
if (hasAdlib() || _vm->getFeatures() & GF_IHNM_DEMO) {
if (hasAdLib() || _vm->getFeatures() & GF_IHNM_DEMO) {
context = _vm->_resource->getContext(GAME_MUSICFILE_FM);
} else {
context = _vm->_resource->getContext(GAME_MUSICFILE_GM);

View file

@ -109,8 +109,8 @@ public:
~Music();
void setNativeMT32(bool b) { _player->setNativeMT32(b); }
bool hasNativeMT32() { return _player->hasNativeMT32(); }
void setAdlib(bool b) { _adlib = b; }
bool hasAdlib() { return _adlib; }
void setAdLib(bool b) { _adlib = b; }
bool hasAdLib() { return _adlib; }
void setPassThrough(bool b) { _player->setPassThrough(b); }
bool isPlaying();
bool hasDigitalMusic() { return _digitalMusic; }

View file

@ -237,7 +237,7 @@ Common::Error SagaEngine::run() {
_music = new Music(this, _mixer, _driver);
_music->setNativeMT32(native_mt32);
_music->setAdlib(adlib);
_music->setAdLib(adlib);
_render = new Render(this, _system);
if (!_render->initialized()) {
return Common::kUnknownError;

View file

@ -2057,14 +2057,14 @@ int SoundResource::getChannelFilterMask(int hardwareMask) {
case SCI_VERSION_0_EARLY:
// TODO: MT32 driver uses no hardware mask at all and uses all channels
switch (hardwareMask) {
case 0x01: // Adlib needs an additional reverse check against bit 3
case 0x01: // AdLib needs an additional reverse check against bit 3
reverseHardwareMask = 0x08;
break;
}
data++; // Skip over digital sample flag
// Now all 16 channels follow. Each one is specified by a single byte
// Upper 4 bits of the byte is a voices count
// Lower 4 bits -> bit 0 means use as Adlib driver
// Lower 4 bits -> bit 0 means use as AdLib driver
// bit 1 means use as PCjr driver
// bit 3 means is control channel (bit 0 needs to be unset)
for (int channelNr = 0; channelNr < 16; channelNr++) {

View file

@ -227,11 +227,11 @@ Common::Error SfxPlayer::init(ResourceManager *resMan, int expected_latency) {
switch (musicDriver) {
case MD_ADLIB:
// FIXME: There's no Amiga sound option, so we hook it up to Adlib
// FIXME: There's no Amiga sound option, so we hook it up to AdLib
if (((SciEngine *)g_engine)->getPlatform() == Common::kPlatformAmiga)
_mididrv = MidiPlayer_Amiga_create();
else
_mididrv = MidiPlayer_Adlib_create();
_mididrv = MidiPlayer_AdLib_create();
break;
case MD_PCJR:
_mididrv = MidiPlayer_PCJr_create();

View file

@ -1075,7 +1075,7 @@ void Sci1SongIterator::init() {
priority = 0;
_ccc = 0;
_deviceId = 0x00; // Default to Sound Blaster/Adlib for purposes of cue computation
_deviceId = 0x00; // Default to Sound Blaster/AdLib for purposes of cue computation
_numChannels = 0;
_initialised = false;
_delayRemaining = 0;

View file

@ -32,7 +32,7 @@
/*
Sound drivers info: (from driver cmd0)
Adlib/SB : track 0 , voices 9 , patch 3 ah=1
AdLib/SB : track 0 , voices 9 , patch 3 ah=1
ProAudioSp: track 0 , voices 9 , patch 3 ah=17
GenerlMIDI: track 7 , voices 32, patch 4 ah=1 SCI1.1
Game Blast: track 9 , voices 12, patch 101 ah=1

View file

@ -64,11 +64,11 @@ void SciMusic::init() {
switch (midiType) {
case MD_ADLIB:
// FIXME: There's no Amiga sound option, so we hook it up to Adlib
// FIXME: There's no Amiga sound option, so we hook it up to AdLib
if (((SciEngine *)g_engine)->getPlatform() == Common::kPlatformAmiga)
_pMidiDrv = MidiPlayer_Amiga_create();
else
_pMidiDrv = MidiPlayer_Adlib_create();
_pMidiDrv = MidiPlayer_AdLib_create();
break;
case MD_PCJR:
_pMidiDrv = MidiPlayer_PCJr_create();

View file

@ -42,7 +42,7 @@
namespace Sci {
enum TrackType {
kTrackAdlib = 0,
kTrackAdLib = 0,
kTrackGameBlaster = 9,
kTrackMT32 = 12,
kTrackSpeaker = 18,
@ -217,8 +217,8 @@ protected:
MidiPlayer *_pMidiDrv;
uint32 _dwTempo;
// Mixed Adlib/MIDI mode: when enabled from the ScummVM sound options screen,
// and a sound has a digital track, the sound from the Adlib track is played
// Mixed AdLib/MIDI mode: when enabled from the ScummVM sound options screen,
// and a sound has a digital track, the sound from the AdLib track is played
bool _bMultiMidi;
private:
static void miditimerCallback(void *p);

View file

@ -42,15 +42,15 @@ namespace Sci {
// FIXME: We don't seem to be sending the polyphony init data, so disable this for now
#define ADLIB_DISABLE_VOICE_MAPPING
class MidiDriver_Adlib : public MidiDriver_Emulated {
class MidiDriver_AdLib : public MidiDriver_Emulated {
public:
enum {
kVoices = 9,
kRhythmKeys = 62
};
MidiDriver_Adlib(Audio::Mixer *mixer) : MidiDriver_Emulated(mixer), _playSwitch(true), _masterVolume(15), _rhythmKeyMap(0), _opl(0) { }
virtual ~MidiDriver_Adlib() { }
MidiDriver_AdLib(Audio::Mixer *mixer) : MidiDriver_Emulated(mixer), _playSwitch(true), _masterVolume(15), _rhythmKeyMap(0), _opl(0) { }
virtual ~MidiDriver_AdLib() { }
// MidiDriver
int open(bool isSCI0);
@ -77,7 +77,7 @@ private:
kRightChannel = 2
};
struct AdlibOperator {
struct AdLibOperator {
bool amplitudeMod;
bool vibrato;
bool envelopeType;
@ -92,14 +92,14 @@ private:
byte waveForm; // (0-3)
};
struct AdlibModulator {
struct AdLibModulator {
byte feedback; // (0-7)
bool algorithm;
};
struct AdlibPatch {
AdlibOperator op[2];
AdlibModulator mod;
struct AdLibPatch {
AdLibOperator op[2];
AdLibModulator mod;
};
struct Channel {
@ -116,7 +116,7 @@ private:
pitchWheel(8192), lastVoice(0), enableVelocity(false) { }
};
struct AdlibVoice {
struct AdLibVoice {
int8 channel; // MIDI channel that this voice is assigned to or -1
int8 note; // Currently playing MIDI note or -1
int patch; // Currently playing patch or -1
@ -124,7 +124,7 @@ private:
bool isSustained; // Flag indicating a note that is being sustained by the hold pedal
uint16 age; // Age of the current note
AdlibVoice() : channel(-1), note(-1), patch(-1), velocity(0), isSustained(false), age(0) { }
AdLibVoice() : channel(-1), note(-1), patch(-1), velocity(0), isSustained(false), age(0) { }
};
bool _stereo;
@ -133,9 +133,9 @@ private:
bool _playSwitch;
int _masterVolume;
Channel _channels[MIDI_CHANNELS];
AdlibVoice _voices[kVoices];
AdLibVoice _voices[kVoices];
byte *_rhythmKeyMap;
Common::Array<AdlibPatch> _patches;
Common::Array<AdLibPatch> _patches;
void loadInstrument(const byte *ins);
void voiceOn(int voice, int note, int velocity);
@ -143,7 +143,7 @@ private:
void setPatch(int voice, int patch);
void setNote(int voice, int note, bool key);
void setVelocity(int voice);
void setOperator(int oper, AdlibOperator &op);
void setOperator(int oper, AdLibOperator &op);
void setRegister(int reg, int value, int channels = kLeftChannel | kRightChannel);
void renewNotes(int channel, bool key);
void noteOn(int channel, int note, int velocity);
@ -158,23 +158,23 @@ private:
int calcVelocity(int voice, int op);
};
class MidiPlayer_Adlib : public MidiPlayer {
class MidiPlayer_AdLib : public MidiPlayer {
public:
MidiPlayer_Adlib() { _driver = new MidiDriver_Adlib(g_system->getMixer()); }
~MidiPlayer_Adlib() {}
MidiPlayer_AdLib() { _driver = new MidiDriver_AdLib(g_system->getMixer()); }
~MidiPlayer_AdLib() {}
int open(ResourceManager *resMan);
void close();
byte getPlayId(SciVersion soundVersion);
int getPolyphony() const { return MidiDriver_Adlib::kVoices; }
int getPolyphony() const { return MidiDriver_AdLib::kVoices; }
bool hasRhythmChannel() const { return false; }
void setVolume(byte volume) { static_cast<MidiDriver_Adlib *>(_driver)->setVolume(volume); }
void playSwitch(bool play) { static_cast<MidiDriver_Adlib *>(_driver)->playSwitch(play); }
void setVolume(byte volume) { static_cast<MidiDriver_AdLib *>(_driver)->setVolume(volume); }
void playSwitch(bool play) { static_cast<MidiDriver_AdLib *>(_driver)->playSwitch(play); }
void loadInstrument(int idx, byte *data);
};
static const byte registerOffset[MidiDriver_Adlib::kVoices] = {
static const byte registerOffset[MidiDriver_AdLib::kVoices] = {
0x00, 0x01, 0x02, 0x08, 0x09, 0x0A, 0x10, 0x11, 0x12
};
@ -206,7 +206,7 @@ static const int ym3812_note[13] = {
0x2ae
};
int MidiDriver_Adlib::open(bool isSCI0) {
int MidiDriver_AdLib::open(bool isSCI0) {
int rate = _mixer->getOutputRate();
_stereo = STEREO;
@ -238,20 +238,20 @@ int MidiDriver_Adlib::open(bool isSCI0) {
return 0;
}
void MidiDriver_Adlib::close() {
void MidiDriver_AdLib::close() {
_mixer->stopHandle(_mixerSoundHandle);
delete _opl;
delete[] _rhythmKeyMap;
}
void MidiDriver_Adlib::setVolume(byte volume) {
void MidiDriver_AdLib::setVolume(byte volume) {
_masterVolume = volume;
renewNotes(-1, true);
}
// MIDI messages can be found at http://www.midi.org/techspecs/midimessages.php
void MidiDriver_Adlib::send(uint32 b) {
void MidiDriver_AdLib::send(uint32 b) {
byte command = b & 0xf0;
byte channel = b & 0xf;
byte op1 = (b >> 8) & 0xff;
@ -321,7 +321,7 @@ void MidiDriver_Adlib::send(uint32 b) {
}
}
void MidiDriver_Adlib::generateSamples(int16 *data, int len) {
void MidiDriver_AdLib::generateSamples(int16 *data, int len) {
if (isStereo())
len <<= 1;
_opl->readBuffer(data, len);
@ -333,8 +333,8 @@ void MidiDriver_Adlib::generateSamples(int16 *data, int len) {
}
}
void MidiDriver_Adlib::loadInstrument(const byte *ins) {
AdlibPatch patch;
void MidiDriver_AdLib::loadInstrument(const byte *ins) {
AdLibPatch patch;
// Set data for the operators
for (int i = 0; i < 2; i++) {
@ -361,7 +361,7 @@ void MidiDriver_Adlib::loadInstrument(const byte *ins) {
_patches.push_back(patch);
}
void MidiDriver_Adlib::voiceMapping(int channel, int voices) {
void MidiDriver_AdLib::voiceMapping(int channel, int voices) {
int curVoices = 0;
for (int i = 0; i < kVoices; i++)
@ -380,7 +380,7 @@ void MidiDriver_Adlib::voiceMapping(int channel, int voices) {
}
}
void MidiDriver_Adlib::assignVoices(int channel, int voices) {
void MidiDriver_AdLib::assignVoices(int channel, int voices) {
assert(voices > 0);
for (int i = 0; i < kVoices; i++)
@ -393,7 +393,7 @@ void MidiDriver_Adlib::assignVoices(int channel, int voices) {
_channels[channel].extraVoices += voices;
}
void MidiDriver_Adlib::releaseVoices(int channel, int voices) {
void MidiDriver_AdLib::releaseVoices(int channel, int voices) {
if (_channels[channel].extraVoices >= voices) {
_channels[channel].extraVoices -= voices;
return;
@ -420,7 +420,7 @@ void MidiDriver_Adlib::releaseVoices(int channel, int voices) {
}
}
void MidiDriver_Adlib::donateVoices() {
void MidiDriver_AdLib::donateVoices() {
int freeVoices = 0;
for (int i = 0; i < kVoices; i++)
@ -443,7 +443,7 @@ void MidiDriver_Adlib::donateVoices() {
}
}
void MidiDriver_Adlib::renewNotes(int channel, bool key) {
void MidiDriver_AdLib::renewNotes(int channel, bool key) {
for (int i = 0; i < kVoices; i++) {
// Update all notes playing this channel
if ((channel == -1) || (_voices[i].channel == channel)) {
@ -453,7 +453,7 @@ void MidiDriver_Adlib::renewNotes(int channel, bool key) {
}
}
void MidiDriver_Adlib::noteOn(int channel, int note, int velocity) {
void MidiDriver_AdLib::noteOn(int channel, int note, int velocity) {
if (velocity == 0)
return noteOff(channel, note);
@ -486,7 +486,7 @@ void MidiDriver_Adlib::noteOn(int channel, int note, int velocity) {
}
// FIXME: Temporary, see comment at top of file regarding ADLIB_DISABLE_VOICE_MAPPING
int MidiDriver_Adlib::findVoiceBasic(int channel) {
int MidiDriver_AdLib::findVoiceBasic(int channel) {
int voice = -1;
int oldestVoice = -1;
int oldestAge = -1;
@ -521,7 +521,7 @@ int MidiDriver_Adlib::findVoiceBasic(int channel) {
return voice;
}
int MidiDriver_Adlib::findVoice(int channel) {
int MidiDriver_AdLib::findVoice(int channel) {
int voice = -1;
int oldestVoice = -1;
uint32 oldestAge = 0;
@ -558,7 +558,7 @@ int MidiDriver_Adlib::findVoice(int channel) {
return voice;
}
void MidiDriver_Adlib::noteOff(int channel, int note) {
void MidiDriver_AdLib::noteOff(int channel, int note) {
for (int i = 0; i < kVoices; i++) {
if ((_voices[i].channel == channel) && (_voices[i].note == note)) {
if (_channels[channel].holdPedal)
@ -570,7 +570,7 @@ void MidiDriver_Adlib::noteOff(int channel, int note) {
}
}
void MidiDriver_Adlib::voiceOn(int voice, int note, int velocity) {
void MidiDriver_AdLib::voiceOn(int voice, int note, int velocity) {
int channel = _voices[voice].channel;
int patch;
@ -590,14 +590,14 @@ void MidiDriver_Adlib::voiceOn(int voice, int note, int velocity) {
setNote(voice, note, true);
}
void MidiDriver_Adlib::voiceOff(int voice) {
void MidiDriver_AdLib::voiceOff(int voice) {
_voices[voice].isSustained = false;
setNote(voice, _voices[voice].note, 0);
_voices[voice].note = -1;
_voices[voice].age = 0;
}
void MidiDriver_Adlib::setNote(int voice, int note, bool key) {
void MidiDriver_AdLib::setNote(int voice, int note, bool key) {
int channel = _voices[voice].channel;
int n, fre, oct;
float delta;
@ -636,8 +636,8 @@ void MidiDriver_Adlib::setNote(int voice, int note, bool key) {
setVelocity(voice);
}
void MidiDriver_Adlib::setVelocity(int voice) {
AdlibPatch &patch = _patches[_voices[voice].patch];
void MidiDriver_AdLib::setVelocity(int voice) {
AdLibPatch &patch = _patches[_voices[voice].patch];
int pan = _channels[_voices[voice].channel].pan;
setVelocityReg(registerOffset[voice] + 3, calcVelocity(voice, 1), patch.op[1].kbScaleLevel, pan);
@ -646,7 +646,7 @@ void MidiDriver_Adlib::setVelocity(int voice) {
setVelocityReg(registerOffset[voice], calcVelocity(voice, 0), patch.op[0].kbScaleLevel, pan);
}
int MidiDriver_Adlib::calcVelocity(int voice, int op) {
int MidiDriver_AdLib::calcVelocity(int voice, int op) {
if (_isSCI0) {
int velocity = _masterVolume;
@ -666,7 +666,7 @@ int MidiDriver_Adlib::calcVelocity(int voice, int op) {
// Early SCI0 does (velocity * (insVelocity / 15))
return velocity * insVelocity / 15;
} else {
AdlibOperator &oper = _patches[_voices[voice].patch].op[op];
AdLibOperator &oper = _patches[_voices[voice].patch].op[op];
int velocity = _channels[_voices[voice].channel].volume + 1;
velocity = velocity * (velocityMap1[_voices[voice].velocity] + 1) / 64;
velocity = velocity * (_masterVolume + 1) / 16;
@ -678,7 +678,7 @@ int MidiDriver_Adlib::calcVelocity(int voice, int op) {
}
}
void MidiDriver_Adlib::setVelocityReg(int regOffset, int velocity, int kbScaleLevel, int pan) {
void MidiDriver_AdLib::setVelocityReg(int regOffset, int velocity, int kbScaleLevel, int pan) {
if (!_playSwitch)
velocity = 0;
@ -698,14 +698,14 @@ void MidiDriver_Adlib::setVelocityReg(int regOffset, int velocity, int kbScaleLe
}
}
void MidiDriver_Adlib::setPatch(int voice, int patch) {
void MidiDriver_AdLib::setPatch(int voice, int patch) {
if ((patch < 0) || ((uint)patch >= _patches.size())) {
warning("ADLIB: Invalid patch %i requested", patch);
patch = 0;
}
_voices[voice].patch = patch;
AdlibModulator &mod = _patches[patch].mod;
AdLibModulator &mod = _patches[patch].mod;
// Set the common settings for both operators
setOperator(registerOffset[voice], _patches[patch].op[0]);
@ -716,7 +716,7 @@ void MidiDriver_Adlib::setPatch(int voice, int patch) {
setRegister(0xC0 + voice, (mod.feedback << 1) | algorithm);
}
void MidiDriver_Adlib::setOperator(int reg, AdlibOperator &op) {
void MidiDriver_AdLib::setOperator(int reg, AdLibOperator &op) {
setRegister(0x40 + reg, (op.kbScaleLevel << 6) | op.totalLevel);
setRegister(0x60 + reg, (op.attackRate << 4) | op.decayRate);
setRegister(0x80 + reg, (op.sustainLevel << 4) | op.releaseRate);
@ -725,7 +725,7 @@ void MidiDriver_Adlib::setOperator(int reg, AdlibOperator &op) {
setRegister(0xE0 + reg, op.waveForm);
}
void MidiDriver_Adlib::setRegister(int reg, int value, int channels) {
void MidiDriver_AdLib::setRegister(int reg, int value, int channels) {
if (channels & kLeftChannel) {
_opl->write(0x220, reg);
_opl->write(0x221, value);
@ -739,12 +739,12 @@ void MidiDriver_Adlib::setRegister(int reg, int value, int channels) {
}
}
void MidiDriver_Adlib::playSwitch(bool play) {
void MidiDriver_AdLib::playSwitch(bool play) {
_playSwitch = play;
renewNotes(-1, play);
}
bool MidiDriver_Adlib::loadResource(const byte *data, uint size) {
bool MidiDriver_AdLib::loadResource(const byte *data, uint size) {
if ((size != 1344) && (size != 2690) && (size != 5382)) {
warning("ADLIB: Unsupported patch format (%i bytes)", size);
return false;
@ -766,7 +766,7 @@ bool MidiDriver_Adlib::loadResource(const byte *data, uint size) {
return true;
}
uint32 MidiDriver_Adlib::property(int prop, uint32 param) {
uint32 MidiDriver_AdLib::property(int prop, uint32 param) {
switch(prop) {
case MIDI_PROP_MASTER_VOLUME:
if (param != 0xffff)
@ -779,7 +779,7 @@ uint32 MidiDriver_Adlib::property(int prop, uint32 param) {
}
int MidiPlayer_Adlib::open(ResourceManager *resMan) {
int MidiPlayer_AdLib::open(ResourceManager *resMan) {
assert(resMan != NULL);
// Load up the patch.003 file, parse out the instruments
@ -787,7 +787,7 @@ int MidiPlayer_Adlib::open(ResourceManager *resMan) {
bool ok = false;
if (res) {
ok = static_cast<MidiDriver_Adlib *>(_driver)->loadResource(res->data, res->size);
ok = static_cast<MidiDriver_AdLib *>(_driver)->loadResource(res->data, res->size);
} else {
// Early SCI0 games have the sound bank embedded in the adlib driver
@ -801,7 +801,7 @@ int MidiPlayer_Adlib::open(ResourceManager *resMan) {
byte *buf = new byte[patchSize];
if (f.seek(0x45a) && (f.read(buf, patchSize) == patchSize))
ok = static_cast<MidiDriver_Adlib *>(_driver)->loadResource(buf, patchSize);
ok = static_cast<MidiDriver_AdLib *>(_driver)->loadResource(buf, patchSize);
delete[] buf;
}
@ -813,10 +813,10 @@ int MidiPlayer_Adlib::open(ResourceManager *resMan) {
return -1;
}
return static_cast<MidiDriver_Adlib *>(_driver)->open(getSciVersion() <= SCI_VERSION_0_LATE);
return static_cast<MidiDriver_AdLib *>(_driver)->open(getSciVersion() <= SCI_VERSION_0_LATE);
}
void MidiPlayer_Adlib::close() {
void MidiPlayer_AdLib::close() {
if (_driver) {
_driver->close();
delete _driver;
@ -824,7 +824,7 @@ void MidiPlayer_Adlib::close() {
}
}
byte MidiPlayer_Adlib::getPlayId(SciVersion soundVersion) {
byte MidiPlayer_AdLib::getPlayId(SciVersion soundVersion) {
switch (soundVersion) {
case SCI_VERSION_0_EARLY:
return 0x01;
@ -835,8 +835,8 @@ byte MidiPlayer_Adlib::getPlayId(SciVersion soundVersion) {
}
}
MidiPlayer *MidiPlayer_Adlib_create() {
return new MidiPlayer_Adlib();
MidiPlayer *MidiPlayer_AdLib_create() {
return new MidiPlayer_AdLib();
}
} // End of namespace Sci

View file

@ -102,7 +102,7 @@ public:
}
};
extern MidiPlayer *MidiPlayer_Adlib_create();
extern MidiPlayer *MidiPlayer_AdLib_create();
extern MidiPlayer *MidiPlayer_Amiga_create();
extern MidiPlayer *MidiPlayer_PCJr_create();
extern MidiPlayer *MidiPlayer_PCSpeaker_create();

View file

@ -152,7 +152,7 @@ bool IMuseInternal::isMT32(int sound) {
tag = READ_BE_UINT32(ptr + 4);
switch (tag) {
case MKID_BE('ADL '):
case MKID_BE('ASFX'): // Special AD class for old Adlib sound effects
case MKID_BE('ASFX'): // Special AD class for old AdLib sound effects
case MKID_BE('SPK '):
return false;
@ -199,7 +199,7 @@ bool IMuseInternal::isMIDI(int sound) {
tag = READ_BE_UINT32(ptr + 4);
switch (tag) {
case MKID_BE('ADL '):
case MKID_BE('ASFX'): // Special AD class for old Adlib sound effects
case MKID_BE('ASFX'): // Special AD class for old AdLib sound effects
case MKID_BE('SPK '):
return false;
@ -235,7 +235,7 @@ MidiDriver *IMuseInternal::getBestMidiDriver(int sound) {
if (_midi_native) {
driver = _midi_native;
} else {
// Route it through Adlib anyway.
// Route it through AdLib anyway.
driver = _midi_adlib;
}
} else {
@ -1709,13 +1709,13 @@ void IMuseInternal::reallocateMidiChannels(MidiDriver *midi) {
}
}
void IMuseInternal::setGlobalAdlibInstrument(byte slot, byte *data) {
void IMuseInternal::setGlobalAdLibInstrument(byte slot, byte *data) {
if (slot < 32) {
_global_adlib_instruments[slot].adlib(data);
}
}
void IMuseInternal::copyGlobalAdlibInstrument(byte slot, Instrument *dest) {
void IMuseInternal::copyGlobalAdLibInstrument(byte slot, Instrument *dest) {
if (slot >= 32)
return;
_global_adlib_instruments[slot].copy_to(dest);

View file

@ -503,8 +503,8 @@ protected:
int setImuseMasterVolume(uint vol);
void reallocateMidiChannels(MidiDriver *midi);
void setGlobalAdlibInstrument(byte slot, byte *data);
void copyGlobalAdlibInstrument(byte slot, Instrument *dest);
void setGlobalAdLibInstrument(byte slot, byte *data);
void copyGlobalAdLibInstrument(byte slot, Instrument *dest);
bool isNativeMT32() { return _native_mt32; }
protected:

View file

@ -200,7 +200,7 @@ void Part::set_instrument(byte * data) {
}
void Part::load_global_instrument(byte slot) {
_player->_se->copyGlobalAdlibInstrument(slot, &_instrument);
_player->_se->copyGlobalAdLibInstrument(slot, &_instrument);
if (clearToTransmit())
_instrument.send(_mc);
}

View file

@ -374,7 +374,7 @@ void Player::sysEx(const byte *p, uint16 len) {
_midi->sysEx_customInstrument(p[0], 'EUP ', p + 1);
} else {
// SysEx manufacturer 0x97 has been spotted in the
// Monkey Island 2 Adlib music, so don't make this a
// Monkey Island 2 AdLib music, so don't make this a
// fatal error. See bug #1481383.
if (a == 0)
warning("Unknown SysEx manufacturer 0x00 0x%02X 0x%02X", p[0], p[1]);

View file

@ -144,12 +144,12 @@ public:
: (MidiDriver::_mt32ToGm[_program] < 128)); }
};
class Instrument_Adlib : public InstrumentInternal {
class Instrument_AdLib : public InstrumentInternal {
private:
#include "common/pack-start.h" // START STRUCT PACKING
struct AdlibInstrument {
struct AdLibInstrument {
byte flags_1;
byte oplvl_1;
byte atdec_1;
@ -170,11 +170,11 @@ private:
#include "common/pack-end.h" // END STRUCT PACKING
AdlibInstrument _instrument;
AdLibInstrument _instrument;
public:
Instrument_Adlib(const byte *data);
Instrument_Adlib(Serializer *s);
Instrument_AdLib(const byte *data);
Instrument_AdLib(Serializer *s);
void saveOrLoad(Serializer *s);
void send(MidiChannel *mc);
void copy_to(Instrument *dest) { dest->adlib((byte *)&_instrument); }
@ -290,8 +290,8 @@ void Instrument::adlib(const byte *instrument) {
clear();
if (!instrument)
return;
_type = itAdlib;
_instrument = new Instrument_Adlib(instrument);
_type = itAdLib;
_instrument = new Instrument_AdLib(instrument);
}
void Instrument::roland(const byte *instrument) {
@ -316,8 +316,8 @@ void Instrument::saveOrLoad (Serializer *s) {
case itProgram:
_instrument = new Instrument_Program(s);
break;
case itAdlib:
_instrument = new Instrument_Adlib(s);
case itAdLib:
_instrument = new Instrument_AdLib(s);
break;
case itRoland:
_instrument = new Instrument_Roland(s);
@ -371,29 +371,29 @@ void Instrument_Program::send(MidiChannel *mc) {
////////////////////////////////////////
//
// Instrument_Adlib class members
// Instrument_AdLib class members
//
////////////////////////////////////////
Instrument_Adlib::Instrument_Adlib(const byte *data) {
Instrument_AdLib::Instrument_AdLib(const byte *data) {
memcpy(&_instrument, data, sizeof(_instrument));
}
Instrument_Adlib::Instrument_Adlib(Serializer *s) {
Instrument_AdLib::Instrument_AdLib(Serializer *s) {
if (!s->isSaving())
saveOrLoad(s);
else
memset(&_instrument, 0, sizeof(_instrument));
}
void Instrument_Adlib::saveOrLoad(Serializer *s) {
void Instrument_AdLib::saveOrLoad(Serializer *s) {
if (s->isSaving())
s->saveBytes(&_instrument, sizeof(_instrument));
else
s->loadBytes(&_instrument, sizeof(_instrument));
}
void Instrument_Adlib::send(MidiChannel *mc) {
void Instrument_AdLib::send(MidiChannel *mc) {
mc->sysEx_customInstrument('ADL ', (byte *)&_instrument);
}

View file

@ -54,7 +54,7 @@ public:
enum {
itNone = 0,
itProgram = 1,
itAdlib = 2,
itAdLib = 2,
itRoland = 3
};

View file

@ -103,7 +103,7 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
case 2: // Start of song. Ignore for now.
break;
case 16: // Adlib instrument definition(Part)
case 16: // AdLib instrument definition(Part)
a = *p++ & 0x0F;
++p; // Skip hardware type
part = player->getPart(a);
@ -118,11 +118,11 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
}
break;
case 17: // Adlib instrument definition(Global)
case 17: // AdLib instrument definition(Global)
p += 2; // Skip hardware type and... whatever came right before it
a = *p++;
player->decode_sysex_bytes(p, buf, len - 3);
se->setGlobalAdlibInstrument(a, buf);
se->setGlobalAdLibInstrument(a, buf);
break;
case 33: // Parameter adjust

View file

@ -1691,7 +1691,7 @@ void ScummEngine::setupMusic(int midi) {
if (missingFile) {
GUI::MessageDialog dialog(
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but " + fileName + " is missing. Using Adlib instead.", "Ok");
"but " + fileName + " is missing. Using AdLib instead.", "Ok");
dialog.runModal();
_musicType = MDT_ADLIB;
}

View file

@ -702,7 +702,7 @@ void ScummEngine::resetScummVars() {
// 0 PC Speaker
// 1 Tandy
// 2 CMS
// 3 Adlib
// 3 AdLib
// 4 Roland
switch (_musicType) {
case MDT_NONE:

View file

@ -31,7 +31,7 @@
namespace Sky {
AdlibChannel::AdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) {
AdLibChannel::AdLibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) {
_opl = opl;
_musicData = pMusicData;
_channelData.loopPoint = startOfData;
@ -79,15 +79,15 @@ AdlibChannel::AdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) {
_instruments = (InstrumentStruct*)(_instrumentMap+0x80);
}
AdlibChannel::~AdlibChannel() {
AdLibChannel::~AdLibChannel() {
stopNote();
}
bool AdlibChannel::isActive() {
bool AdLibChannel::isActive() {
return _channelData.channelActive;
}
void AdlibChannel::updateVolume(uint16 pVolume) {
void AdLibChannel::updateVolume(uint16 pVolume) {
// Do nothing. The mixer handles the music volume for us.
}
@ -95,21 +95,21 @@ void AdlibChannel::updateVolume(uint16 pVolume) {
asm driver did (_musicData[0xF5F..0x105E]), so the cache is indeed shared
by all instances of the class.
*/
void AdlibChannel::setRegister(uint8 regNum, uint8 value) {
void AdLibChannel::setRegister(uint8 regNum, uint8 value) {
if (_adlibRegMirror[regNum] != value) {
OPLWriteReg (_opl, regNum, value);
_adlibRegMirror[regNum] = value;
}
}
void AdlibChannel::stopNote() {
void AdLibChannel::stopNote() {
if (_channelData.note & 0x20) {
_channelData.note &= ~0x20;
setRegister(0xB0 | _channelData.adlibChannelNumber, _channelData.note);
}
}
int32 AdlibChannel::getNextEventTime() {
int32 AdLibChannel::getNextEventTime() {
int32 retV = 0;
uint8 cnt, lVal = 0;
for (cnt = 0; cnt < 4; cnt++) {
@ -125,7 +125,7 @@ int32 AdlibChannel::getNextEventTime() {
return retV;
}
uint8 AdlibChannel::process(uint16 aktTime) {
uint8 AdLibChannel::process(uint16 aktTime) {
if (!_channelData.channelActive) {
return 0;
}
@ -156,7 +156,7 @@ uint8 AdlibChannel::process(uint16 aktTime) {
case 12: com90_setLoopPoint(); break;
default:
error("AdlibChannel: Unknown music opcode 0x%02X", opcode);
error("AdLibChannel: Unknown music opcode 0x%02X", opcode);
break;
}
} else {
@ -185,7 +185,7 @@ uint8 AdlibChannel::process(uint16 aktTime) {
return returnVal;
}
void AdlibChannel::setupInstrument(uint8 opcode) {
void AdLibChannel::setupInstrument(uint8 opcode) {
uint16 nextNote;
if (_channelData.tremoVibro) {
uint8 newInstrument = _instrumentMap[opcode];
@ -205,7 +205,7 @@ void AdlibChannel::setupInstrument(uint8 opcode) {
_channelData.note = (uint8)((nextNote >> 8) | 0x20);
}
void AdlibChannel::setupChannelVolume(uint8 volume) {
void AdLibChannel::setupChannelVolume(uint8 volume) {
uint8 resultOp;
uint32 resVol = ((volume + 1) * (_channelData.instrumentData->totOutLev_Op2 + 1)) << 1;
resVol &= 0xFFFF;
@ -226,7 +226,7 @@ void AdlibChannel::setupChannelVolume(uint8 volume) {
setRegister(0x40 | _channelData.adlibReg1, resultOp);
}
void AdlibChannel::adlibSetupInstrument() {
void AdLibChannel::adlibSetupInstrument() {
setRegister(0x60 | _channelData.adlibReg1, _channelData.instrumentData->ad_Op1);
setRegister(0x60 | _channelData.adlibReg2, _channelData.instrumentData->ad_Op2);
setRegister(0x80 | _channelData.adlibReg1, _channelData.instrumentData->sr_Op1);
@ -238,7 +238,7 @@ void AdlibChannel::adlibSetupInstrument() {
setRegister(0x20 | _channelData.adlibReg2, _channelData.instrumentData->ampMod_Op2);
}
uint16 AdlibChannel::getNextNote(uint8 param) {
uint16 AdLibChannel::getNextNote(uint8 param) {
int16 freqIndex = ((int16)_channelData.freqOffset) - 0x40;
if (freqIndex >= 0x3F)
freqIndex++;
@ -255,18 +255,18 @@ uint16 AdlibChannel::getNextNote(uint8 param) {
//- command 90h routines
void AdlibChannel::com90_caseNoteOff() {
void AdLibChannel::com90_caseNoteOff() {
if (_musicData[_channelData.eventDataPtr] == _channelData.lastCommand)
stopNote();
_channelData.eventDataPtr++;
}
void AdlibChannel::com90_stopChannel() {
void AdLibChannel::com90_stopChannel() {
stopNote();
_channelData.channelActive = false;
}
void AdlibChannel::com90_setupInstrument() {
void AdLibChannel::com90_setupInstrument() {
_channelData.channelVolume = 0x7F;
_channelData.freqOffset = 0x40;
_channelData.assignedInstrument = _musicData[_channelData.eventDataPtr];
@ -275,11 +275,11 @@ void AdlibChannel::com90_setupInstrument() {
adlibSetupInstrument();
}
uint8 AdlibChannel::com90_updateTempo() {
uint8 AdLibChannel::com90_updateTempo() {
return _musicData[_channelData.eventDataPtr++];
}
void AdlibChannel::com90_getFreqOffset() {
void AdLibChannel::com90_getFreqOffset() {
_channelData.freqOffset = _musicData[_channelData.eventDataPtr++];
if (_channelData.note & 0x20) {
uint16 nextNote = getNextNote(
@ -290,23 +290,23 @@ void AdlibChannel::com90_getFreqOffset() {
}
}
void AdlibChannel::com90_getChannelVolume() {
void AdLibChannel::com90_getChannelVolume() {
_channelData.channelVolume = _musicData[_channelData.eventDataPtr++];
}
void AdlibChannel::com90_getTremoVibro() {
void AdLibChannel::com90_getTremoVibro() {
_channelData.tremoVibro = _musicData[_channelData.eventDataPtr++];
}
void AdlibChannel::com90_loopMusic() {
void AdLibChannel::com90_loopMusic() {
_channelData.eventDataPtr = _channelData.loopPoint;
}
void AdlibChannel::com90_keyOff() {
void AdLibChannel::com90_keyOff() {
stopNote();
}
void AdlibChannel::com90_setLoopPoint() {
void AdLibChannel::com90_setLoopPoint() {
_channelData.loopPoint = _channelData.eventDataPtr;
}

View file

@ -59,19 +59,19 @@ typedef struct {
uint8 tremoVibro;
uint8 freqOffset;
uint16 frequency;
} AdlibChannelType;
} AdLibChannelType;
class AdlibChannel : public ChannelBase {
class AdLibChannel : public ChannelBase {
public:
AdlibChannel (FM_OPL *opl, uint8 *pMusicData, uint16 startOfData);
virtual ~AdlibChannel();
AdLibChannel (FM_OPL *opl, uint8 *pMusicData, uint16 startOfData);
virtual ~AdLibChannel();
virtual uint8 process(uint16 aktTime);
virtual void updateVolume(uint16 pVolume);
virtual bool isActive();
private:
FM_OPL *_opl;
uint8 *_musicData;
AdlibChannelType _channelData;
AdLibChannelType _channelData;
InstrumentStruct *_instruments;
uint16 *_frequenceTable;

View file

@ -33,22 +33,22 @@
namespace Sky {
AdlibMusic::AdlibMusic(Audio::Mixer *pMixer, Disk *pDisk) : MusicBase(pDisk) {
AdLibMusic::AdLibMusic(Audio::Mixer *pMixer, Disk *pDisk) : MusicBase(pDisk) {
_driverFileBase = 60202;
_mixer = pMixer;
_sampleRate = pMixer->getOutputRate();
_opl = makeAdlibOPL(_sampleRate);
_opl = makeAdLibOPL(_sampleRate);
_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
}
AdlibMusic::~AdlibMusic() {
AdLibMusic::~AdLibMusic() {
OPLDestroy(_opl);
_mixer->stopHandle(_soundHandle);
}
int AdlibMusic::readBuffer(int16 *data, const int numSamples) {
int AdLibMusic::readBuffer(int16 *data, const int numSamples) {
if (_musicData == NULL) {
// no music loaded
memset(data, 0, numSamples * sizeof(int16));
@ -76,7 +76,7 @@ int AdlibMusic::readBuffer(int16 *data, const int numSamples) {
return numSamples;
}
void AdlibMusic::setupPointers() {
void AdLibMusic::setupPointers() {
if (SkyEngine::_systemVars.gameVersion == 109) {
// disk demo uses a different adlib driver version, some offsets have changed
//_musicDataLoc = (_musicData[0x11CC] << 8) | _musicData[0x11CB];
@ -94,16 +94,16 @@ void AdlibMusic::setupPointers() {
_nextMusicPoll = 0;
}
void AdlibMusic::setupChannels(uint8 *channelData) {
void AdLibMusic::setupChannels(uint8 *channelData) {
_numberOfChannels = channelData[0];
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
uint16 chDataStart = READ_LE_UINT16((uint16 *)channelData + cnt) + _musicDataLoc;
_channels[cnt] = new AdlibChannel(_opl, _musicData, chDataStart);
_channels[cnt] = new AdLibChannel(_opl, _musicData, chDataStart);
}
}
void AdlibMusic::startDriver() {
void AdLibMusic::startDriver() {
uint16 cnt = 0;
while (_initSequence[cnt] || _initSequence[cnt + 1]) {
OPLWriteReg (_opl, _initSequence[cnt], _initSequence[cnt + 1]);
@ -111,20 +111,20 @@ void AdlibMusic::startDriver() {
}
}
void AdlibMusic::setVolume(uint16 param) {
void AdLibMusic::setVolume(uint16 param) {
_musicVolume = param;
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, 2 * param);
}
bool AdlibMusic::isStereo() const {
bool AdLibMusic::isStereo() const {
return false;
}
bool AdlibMusic::endOfData() const {
bool AdLibMusic::endOfData() const {
return false;
}
int AdlibMusic::getRate() const {
int AdLibMusic::getRate() const {
return _sampleRate;
}

View file

@ -33,10 +33,10 @@
namespace Sky {
class AdlibMusic : public Audio::AudioStream, public MusicBase {
class AdLibMusic : public Audio::AudioStream, public MusicBase {
public:
AdlibMusic(Audio::Mixer *pMixer, Disk *pDisk);
~AdlibMusic();
AdLibMusic(Audio::Mixer *pMixer, Disk *pDisk);
~AdLibMusic();
// AudioStream API
int readBuffer(int16 *buffer, const int numSamples);

View file

@ -259,7 +259,7 @@ Common::Error SkyEngine::init() {
MidiDriverType midiDriver = MidiDriver::detectMusicDriver(MDT_ADLIB | MDT_MIDI | MDT_PREFER_MIDI);
if (midiDriver == MD_ADLIB) {
_systemVars.systemFlags |= SF_SBLASTER;
_skyMusic = new AdlibMusic(_mixer, _skyDisk);
_skyMusic = new AdLibMusic(_mixer, _skyDisk);
} else {
_systemVars.systemFlags |= SF_ROLAND;
if ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"))

View file

@ -861,7 +861,7 @@ TinselEngine::TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc)
_midiMusic = new MidiMusicPlayer(_driver);
_pcmMusic = new PCMMusicPlayer();
//_midiMusic->setNativeMT32(native_mt32);
//_midiMusic->setAdlib(adlib);
//_midiMusic->setAdLib(adlib);
_musicVolume = ConfMan.getInt("music_volume");

View file

@ -169,7 +169,7 @@ void YM3812UpdateOne(FM_OPL *OPL, int16 *buffer, int length) {
OPL->readBuffer(buffer, length);
}
FM_OPL *makeAdlibOPL(int rate) {
FM_OPL *makeAdLibOPL(int rate) {
FM_OPL *opl = OPL::Config::create();
if (opl) {

View file

@ -174,7 +174,7 @@ void YM3812UpdateOne(FM_OPL *OPL, int16 *buffer, int length);
*
* !You should not write any new code using the legacy API!
*/
FM_OPL *makeAdlibOPL(int rate);
FM_OPL *makeAdLibOPL(int rate);
#endif

View file

@ -33,11 +33,11 @@ static int tick;
#endif
class MidiDriver_ADLIB;
struct AdlibVoice;
struct AdLibVoice;
// We use packing for the following two structs, because the code
// does simply copy them over from byte streams, without any
// serialization. Check AdlibPart::sysEx_customInstrument for an
// serialization. Check AdLibPart::sysEx_customInstrument for an
// example of this.
//
// It might be very well possible, that none of the compilers we support
@ -48,7 +48,7 @@ struct InstrumentExtra {
byte a, b, c, d, e, f, g, h;
} PACKED_STRUCT;
struct AdlibInstrument {
struct AdLibInstrument {
byte mod_characteristic;
byte mod_scalingOutputLevel;
byte mod_attackDecay;
@ -66,16 +66,16 @@ struct AdlibInstrument {
InstrumentExtra extra_b;
byte duration;
AdlibInstrument() { memset(this, 0, sizeof(AdlibInstrument)); }
AdLibInstrument() { memset(this, 0, sizeof(AdLibInstrument)); }
} PACKED_STRUCT;
#include "common/pack-end.h"
class AdlibPart : public MidiChannel {
class AdLibPart : public MidiChannel {
friend class MidiDriver_ADLIB;
protected:
// AdlibPart *_prev, *_next;
AdlibVoice *_voice;
// AdLibPart *_prev, *_next;
AdLibVoice *_voice;
int16 _pitchbend;
byte _pitchbend_factor;
int8 _transpose_eff;
@ -85,7 +85,7 @@ protected:
bool _pedal;
byte _program;
byte _pri_eff;
AdlibInstrument _part_instr;
AdLibInstrument _part_instr;
protected:
MidiDriver_ADLIB *_owner;
@ -96,7 +96,7 @@ protected:
void allocate() { _allocated = true; }
public:
AdlibPart() {
AdLibPart() {
_voice = 0;
_pitchbend = 0;
_pitchbend_factor = 2;
@ -143,18 +143,18 @@ public:
};
// FYI (Jamieson630)
// It is assumed that any invocation to AdlibPercussionChannel
// It is assumed that any invocation to AdLibPercussionChannel
// will be done through the MidiChannel base class as opposed to the
// AdlibPart base class. If this were NOT the case, all the functions
// listed below would need to be virtual in AdlibPart as well as MidiChannel.
class AdlibPercussionChannel : public AdlibPart {
// AdLibPart base class. If this were NOT the case, all the functions
// listed below would need to be virtual in AdLibPart as well as MidiChannel.
class AdLibPercussionChannel : public AdLibPart {
friend class MidiDriver_ADLIB;
protected:
void init(MidiDriver_ADLIB *owner, byte channel);
public:
~AdlibPercussionChannel();
~AdLibPercussionChannel();
void noteOff(byte note);
void noteOn(byte note, byte velocity);
@ -173,7 +173,7 @@ public:
private:
byte _notes[256];
AdlibInstrument *_customInstruments[256];
AdLibInstrument *_customInstruments[256];
};
struct Struct10 {
@ -202,9 +202,9 @@ struct Struct11 {
Struct10 *s10;
};
struct AdlibVoice {
AdlibPart *_part;
AdlibVoice *_next, *_prev;
struct AdLibVoice {
AdLibPart *_part;
AdLibVoice *_next, *_prev;
byte _waitforpedal;
byte _note;
byte _channel;
@ -217,10 +217,10 @@ struct AdlibVoice {
Struct10 _s10b;
Struct11 _s11b;
AdlibVoice() { memset(this, 0, sizeof(AdlibVoice)); }
AdLibVoice() { memset(this, 0, sizeof(AdLibVoice)); }
};
struct AdlibSetParams {
struct AdLibSetParams {
byte a, b, c, d;
};
@ -236,7 +236,7 @@ static const byte channel_mappings_2[9] = {
21
};
static const AdlibSetParams adlib_setparam_table[] = {
static const AdLibSetParams adlib_setparam_table[] = {
{0x40, 0, 63, 63}, // level
{0xE0, 2, 0, 0}, // unused
{0x40, 6, 192, 0}, // level key scaling
@ -556,13 +556,13 @@ static void create_lookup_table() {
////////////////////////////////////////
//
// Adlib MIDI driver
// AdLib MIDI driver
//
////////////////////////////////////////
class MidiDriver_ADLIB : public MidiDriver_Emulated {
friend class AdlibPart;
friend class AdlibPercussionChannel;
friend class AdLibPart;
friend class AdLibPercussionChannel;
public:
MidiDriver_ADLIB(Audio::Mixer *mixer);
@ -597,20 +597,20 @@ private:
int _timer_p;
int _timer_q;
uint16 curnote_table[9];
AdlibVoice _voices[9];
AdlibPart _parts[32];
AdlibPercussionChannel _percussion;
AdLibVoice _voices[9];
AdLibPart _parts[32];
AdLibPercussionChannel _percussion;
void generateSamples(int16 *buf, int len);
void onTimer();
void part_key_on(AdlibPart *part, AdlibInstrument *instr, byte note, byte velocity);
void part_key_off(AdlibPart *part, byte note);
void part_key_on(AdLibPart *part, AdLibInstrument *instr, byte note, byte velocity);
void part_key_off(AdLibPart *part, byte note);
void adlib_key_off(int chan);
void adlib_note_on(int chan, byte note, int mod);
void adlib_note_on_ex(int chan, byte note, int mod);
int adlib_get_reg_value_param(int chan, byte data);
void adlib_setup_channel(int chan, AdlibInstrument * instr, byte vol_1, byte vol_2);
void adlib_setup_channel(int chan, AdLibInstrument * instr, byte vol_1, byte vol_2);
byte adlib_get_reg_value(byte reg) {
return _adlib_reg_cache[reg];
}
@ -619,54 +619,54 @@ private:
void adlib_write(byte reg, byte value);
void adlib_playnote(int channel, int note);
AdlibVoice *allocate_voice(byte pri);
AdLibVoice *allocate_voice(byte pri);
void mc_off(AdlibVoice * voice);
void mc_off(AdLibVoice * voice);
static void link_mc(AdlibPart *part, AdlibVoice *voice);
void mc_inc_stuff(AdlibVoice *voice, Struct10 * s10, Struct11 * s11);
void mc_init_stuff(AdlibVoice *voice, Struct10 * s10, Struct11 * s11, byte flags,
static void link_mc(AdLibPart *part, AdLibVoice *voice);
void mc_inc_stuff(AdLibVoice *voice, Struct10 * s10, Struct11 * s11);
void mc_init_stuff(AdLibVoice *voice, Struct10 * s10, Struct11 * s11, byte flags,
InstrumentExtra * ie);
void struct10_init(Struct10 * s10, InstrumentExtra * ie);
static byte struct10_ontimer(Struct10 * s10, Struct11 * s11);
static void struct10_setup(Struct10 * s10);
static int random_nr(int a);
void mc_key_on(AdlibVoice *voice, AdlibInstrument *instr, byte note, byte velocity);
void mc_key_on(AdLibVoice *voice, AdLibInstrument *instr, byte note, byte velocity);
};
// MidiChannel method implementations
void AdlibPart::init(MidiDriver_ADLIB *owner, byte channel) {
void AdLibPart::init(MidiDriver_ADLIB *owner, byte channel) {
_owner = owner;
_channel = channel;
_pri_eff = 127;
programChange(0);
}
MidiDriver *AdlibPart::device() {
MidiDriver *AdLibPart::device() {
return _owner;
}
void AdlibPart::send(uint32 b) {
void AdLibPart::send(uint32 b) {
_owner->send(_channel, b);
}
void AdlibPart::noteOff(byte note) {
void AdLibPart::noteOff(byte note) {
#ifdef DEBUG_ADLIB
debug(6, "%10d: noteOff(%d)", tick, note);
#endif
_owner->part_key_off(this, note);
}
void AdlibPart::noteOn(byte note, byte velocity) {
void AdLibPart::noteOn(byte note, byte velocity) {
#ifdef DEBUG_ADLIB
debug(6, "%10d: noteOn(%d,%d)", tick, note, velocity);
#endif
_owner->part_key_on(this, &_part_instr, note, velocity);
}
void AdlibPart::programChange(byte program) {
void AdLibPart::programChange(byte program) {
if (program > 127)
return;
@ -675,13 +675,13 @@ void AdlibPart::programChange(byte program) {
for (i = 0; i < ARRAYSIZE(map_gm_to_fm[0]); ++i)
count += map_gm_to_fm[program][i];
if (!count)
warning("No Adlib instrument defined for GM program %d", (int) program);
warning("No AdLib instrument defined for GM program %d", (int) program);
_program = program;
memcpy(&_part_instr, &map_gm_to_fm[program], sizeof(AdlibInstrument));
memcpy(&_part_instr, &map_gm_to_fm[program], sizeof(AdLibInstrument));
}
void AdlibPart::pitchBend(int16 bend) {
AdlibVoice *voice;
void AdLibPart::pitchBend(int16 bend) {
AdLibVoice *voice;
_pitchbend = bend;
for (voice = _voice; voice; voice = voice->_next) {
@ -690,7 +690,7 @@ void AdlibPart::pitchBend(int16 bend) {
}
}
void AdlibPart::controlChange(byte control, byte value) {
void AdLibPart::controlChange(byte control, byte value) {
switch (control) {
case 0:
case 32:
@ -713,12 +713,12 @@ void AdlibPart::controlChange(byte control, byte value) {
break;
case 123: allNotesOff(); break;
default:
warning("Adlib: Unknown control change message %d (%d)", (int) control, (int)value);
warning("AdLib: Unknown control change message %d (%d)", (int) control, (int)value);
}
}
void AdlibPart::modulationWheel(byte value) {
AdlibVoice *voice;
void AdLibPart::modulationWheel(byte value) {
AdLibVoice *voice;
_modwheel = value;
for (voice = _voice; voice; voice = voice->_next) {
@ -729,8 +729,8 @@ void AdlibPart::modulationWheel(byte value) {
}
}
void AdlibPart::volume(byte value) {
AdlibVoice *voice;
void AdLibPart::volume(byte value) {
AdLibVoice *voice;
_vol_eff = value;
for (voice = _voice; voice; voice = voice->_next) {
@ -741,8 +741,8 @@ void AdlibPart::volume(byte value) {
}
}
void AdlibPart::pitchBendFactor(byte value) {
AdlibVoice *voice;
void AdLibPart::pitchBendFactor(byte value) {
AdLibVoice *voice;
_pitchbend_factor = value;
for (voice = _voice; voice; voice = voice->_next) {
@ -751,8 +751,8 @@ void AdlibPart::pitchBendFactor(byte value) {
}
}
void AdlibPart::detune(byte value) {
AdlibVoice *voice;
void AdLibPart::detune(byte value) {
AdLibVoice *voice;
_detune_eff = value;
for (voice = _voice; voice; voice = voice->_next) {
@ -761,12 +761,12 @@ void AdlibPart::detune(byte value) {
}
}
void AdlibPart::priority(byte value) {
void AdLibPart::priority(byte value) {
_pri_eff = value;
}
void AdlibPart::sustain(bool value) {
AdlibVoice *voice;
void AdLibPart::sustain(bool value) {
AdLibVoice *voice;
_pedal = value;
if (!value) {
@ -777,28 +777,28 @@ void AdlibPart::sustain(bool value) {
}
}
void AdlibPart::allNotesOff() {
void AdLibPart::allNotesOff() {
while (_voice)
_owner->mc_off(_voice);
}
void AdlibPart::sysEx_customInstrument(uint32 type, const byte *instr) {
void AdLibPart::sysEx_customInstrument(uint32 type, const byte *instr) {
if (type == 'ADL ') {
AdlibInstrument *i = &_part_instr;
memcpy(i, instr, sizeof(AdlibInstrument));
AdLibInstrument *i = &_part_instr;
memcpy(i, instr, sizeof(AdLibInstrument));
}
}
// MidiChannel method implementations for percussion
AdlibPercussionChannel::~AdlibPercussionChannel() {
AdLibPercussionChannel::~AdLibPercussionChannel() {
for (int i = 0; i < ARRAYSIZE(_customInstruments); ++i) {
delete _customInstruments[i];
}
}
void AdlibPercussionChannel::init(MidiDriver_ADLIB *owner, byte channel) {
AdlibPart::init(owner, channel);
void AdLibPercussionChannel::init(MidiDriver_ADLIB *owner, byte channel) {
AdLibPart::init(owner, channel);
_pri_eff = 0;
_vol_eff = 127;
@ -807,11 +807,11 @@ void AdlibPercussionChannel::init(MidiDriver_ADLIB *owner, byte channel) {
memset(_customInstruments, 0, sizeof(_customInstruments));
}
void AdlibPercussionChannel::noteOff(byte note) {
void AdLibPercussionChannel::noteOff(byte note) {
// Jamieson630: Unless I run into a specific instrument that
// may require a key off, I'm going to ignore this message.
// The rationale is that a percussion instrument should
// fade out of its own accord, and the Adlib instrument
// fade out of its own accord, and the AdLib instrument
// definitions used should follow this rule. Since
// percussion voices are allocated at the lowest priority
// anyway, we know that "hanging" percussion sounds will
@ -822,8 +822,8 @@ void AdlibPercussionChannel::noteOff(byte note) {
*/
}
void AdlibPercussionChannel::noteOn(byte note, byte velocity) {
AdlibInstrument *inst = NULL;
void AdLibPercussionChannel::noteOn(byte note, byte velocity) {
AdLibInstrument *inst = NULL;
// The custom instruments have priority over the default mapping
inst = _customInstruments[note];
@ -834,7 +834,7 @@ void AdlibPercussionChannel::noteOn(byte note, byte velocity) {
// Use the default GM to FM mapping as a fallback as a fallback
byte key = gm_percussion_lookup[note];
if (key != 0xFF)
inst = (AdlibInstrument *)&gm_percussion_to_fm[key];
inst = (AdLibInstrument *)&gm_percussion_to_fm[key];
}
if (!inst) {
@ -845,14 +845,14 @@ void AdlibPercussionChannel::noteOn(byte note, byte velocity) {
_owner->part_key_on(this, inst, note, velocity);
}
void AdlibPercussionChannel::sysEx_customInstrument(uint32 type, const byte *instr) {
void AdLibPercussionChannel::sysEx_customInstrument(uint32 type, const byte *instr) {
if (type == 'ADLP') {
byte note = instr[0];
_notes[note] = instr[1];
// Allocate memory for the new instruments
if (!_customInstruments[note]) {
_customInstruments[note] = new AdlibInstrument;
_customInstruments[note] = new AdLibInstrument;
}
// Save the new instrument data
@ -901,7 +901,7 @@ int MidiDriver_ADLIB::open() {
MidiDriver_Emulated::open();
int i;
AdlibVoice *voice;
AdLibVoice *voice;
for (i = 0, voice = _voices; i != ARRAYSIZE(_voices); i++, voice++) {
voice->_channel = i;
@ -911,7 +911,7 @@ int MidiDriver_ADLIB::open() {
_adlib_reg_cache = (byte *)calloc(256, 1);
_opl = makeAdlibOPL(getRate());
_opl = makeAdLibOPL(getRate());
adlib_write(1, 0x20);
adlib_write(8, 0x40);
@ -953,7 +953,7 @@ void MidiDriver_ADLIB::send(byte chan, uint32 b) {
byte param1 = (byte) ((b >> 8) & 0xFF);
byte cmd = (byte) (b & 0xF0);
AdlibPart *part;
AdLibPart *part;
if (chan == 9)
part = &_percussion;
else
@ -1008,8 +1008,8 @@ uint32 MidiDriver_ADLIB::property(int prop, uint32 param) {
}
void MidiDriver_ADLIB::setPitchBendRange(byte channel, uint range) {
AdlibVoice *voice;
AdlibPart *part = &_parts[channel];
AdLibVoice *voice;
AdLibPart *part = &_parts[channel];
part->_pitchbend_factor = range;
for (voice = part->_voice; voice; voice = voice->_next) {
@ -1023,7 +1023,7 @@ void MidiDriver_ADLIB::sysEx_customInstrument(byte channel, uint32 type, const b
}
MidiChannel *MidiDriver_ADLIB::allocateChannel() {
AdlibPart *part;
AdLibPart *part;
uint i;
for (i = 0; i < ARRAYSIZE(_parts); ++i) {
@ -1036,7 +1036,7 @@ MidiChannel *MidiDriver_ADLIB::allocateChannel() {
return NULL;
}
// All the code brought over from IMuseAdlib
// All the code brought over from IMuseAdLib
void MidiDriver_ADLIB::adlib_write(byte reg, byte value) {
if (_adlib_reg_cache[reg] == value)
@ -1055,7 +1055,7 @@ void MidiDriver_ADLIB::generateSamples(int16 *data, int len) {
}
void MidiDriver_ADLIB::onTimer() {
AdlibVoice *voice;
AdLibVoice *voice;
int i;
_adlib_timer_counter += _timer_p;
@ -1082,8 +1082,8 @@ void MidiDriver_ADLIB::onTimer() {
}
}
void MidiDriver_ADLIB::mc_off(AdlibVoice *voice) {
AdlibVoice *tmp;
void MidiDriver_ADLIB::mc_off(AdLibVoice *voice) {
AdLibVoice *tmp;
adlib_key_off(voice->_channel);
@ -1098,9 +1098,9 @@ void MidiDriver_ADLIB::mc_off(AdlibVoice *voice) {
voice->_part = NULL;
}
void MidiDriver_ADLIB::mc_inc_stuff(AdlibVoice *voice, Struct10 *s10, Struct11 *s11) {
void MidiDriver_ADLIB::mc_inc_stuff(AdLibVoice *voice, Struct10 *s10, Struct11 *s11) {
byte code;
AdlibPart *part = voice->_part;
AdLibPart *part = voice->_part;
code = struct10_ontimer(s10, s11);
@ -1192,7 +1192,7 @@ byte MidiDriver_ADLIB::struct10_ontimer(Struct10 *s10, Struct11 *s11) {
}
void MidiDriver_ADLIB::adlib_set_param(int channel, byte param, int value) {
const AdlibSetParams *as;
const AdLibSetParams *as;
byte reg;
assert(channel >= 0 && channel < 9);
@ -1331,8 +1331,8 @@ int MidiDriver_ADLIB::random_nr(int a) {
return _rand_seed * a >> 8;
}
void MidiDriver_ADLIB::part_key_off(AdlibPart *part, byte note) {
AdlibVoice *voice;
void MidiDriver_ADLIB::part_key_off(AdLibPart *part, byte note) {
AdLibVoice *voice;
for (voice = part->_voice; voice; voice = voice->_next) {
if (voice->_note == note) {
@ -1344,8 +1344,8 @@ void MidiDriver_ADLIB::part_key_off(AdlibPart *part, byte note) {
}
}
void MidiDriver_ADLIB::part_key_on(AdlibPart *part, AdlibInstrument *instr, byte note, byte velocity) {
AdlibVoice *voice;
void MidiDriver_ADLIB::part_key_on(AdLibPart *part, AdLibInstrument *instr, byte note, byte velocity) {
AdLibVoice *voice;
voice = allocate_voice(part->_pri_eff);
if (!voice)
@ -1355,8 +1355,8 @@ void MidiDriver_ADLIB::part_key_on(AdlibPart *part, AdlibInstrument *instr, byte
mc_key_on(voice, instr, note, velocity);
}
AdlibVoice *MidiDriver_ADLIB::allocate_voice(byte pri) {
AdlibVoice *ac, *best = NULL;
AdLibVoice *MidiDriver_ADLIB::allocate_voice(byte pri) {
AdLibVoice *ac, *best = NULL;
int i;
for (i = 0; i < 9; i++) {
@ -1382,9 +1382,9 @@ AdlibVoice *MidiDriver_ADLIB::allocate_voice(byte pri) {
return best;
}
void MidiDriver_ADLIB::link_mc(AdlibPart *part, AdlibVoice *voice) {
void MidiDriver_ADLIB::link_mc(AdLibPart *part, AdLibVoice *voice) {
voice->_part = part;
voice->_next = (AdlibVoice *)part->_voice;
voice->_next = (AdLibVoice *)part->_voice;
part->_voice = voice;
voice->_prev = NULL;
@ -1392,8 +1392,8 @@ void MidiDriver_ADLIB::link_mc(AdlibPart *part, AdlibVoice *voice) {
voice->_next->_prev = voice;
}
void MidiDriver_ADLIB::mc_key_on(AdlibVoice *voice, AdlibInstrument *instr, byte note, byte velocity) {
AdlibPart *part = voice->_part;
void MidiDriver_ADLIB::mc_key_on(AdLibVoice *voice, AdLibInstrument *instr, byte note, byte velocity) {
AdLibPart *part = voice->_part;
int c;
byte vol_1, vol_2;
@ -1444,7 +1444,7 @@ void MidiDriver_ADLIB::mc_key_on(AdlibVoice *voice, AdlibInstrument *instr, byte
}
}
void MidiDriver_ADLIB::adlib_setup_channel(int chan, AdlibInstrument *instr, byte vol_1, byte vol_2) {
void MidiDriver_ADLIB::adlib_setup_channel(int chan, AdLibInstrument *instr, byte vol_1, byte vol_2) {
byte channel;
assert(chan >= 0 && chan < 9);
@ -1476,9 +1476,9 @@ void MidiDriver_ADLIB::adlib_note_on_ex(int chan, byte note, int mod)
adlib_playnote(chan, code);
}
void MidiDriver_ADLIB::mc_init_stuff(AdlibVoice *voice, Struct10 * s10,
void MidiDriver_ADLIB::mc_init_stuff(AdLibVoice *voice, Struct10 * s10,
Struct11 * s11, byte flags, InstrumentExtra * ie) {
AdlibPart *part = voice->_part;
AdLibPart *part = voice->_part;
s11->modify_val = 0;
s11->flag0x40 = flags & 0x40;
s10->loop = flags & 0x20;
@ -1540,7 +1540,7 @@ void MidiDriver_ADLIB::struct10_init(Struct10 *s10, InstrumentExtra *ie) {
}
int MidiDriver_ADLIB::adlib_get_reg_value_param(int chan, byte param) {
const AdlibSetParams *as;
const AdLibSetParams *as;
byte val;
byte channel;
@ -1583,7 +1583,7 @@ void MidiDriver_ADLIB::adlib_note_on(int chan, byte note, int mod) {
// Plugin interface
class AdlibEmuMusicPlugin : public MusicPluginObject {
class AdLibEmuMusicPlugin : public MusicPluginObject {
public:
const char *getName() const {
return "AdLib Emulator";
@ -1597,13 +1597,13 @@ public:
Common::Error createInstance(MidiDriver **mididriver) const;
};
MusicDevices AdlibEmuMusicPlugin::getDevices() const {
MusicDevices AdLibEmuMusicPlugin::getDevices() const {
MusicDevices devices;
devices.push_back(MusicDevice(this, "", MT_ADLIB));
return devices;
}
Common::Error AdlibEmuMusicPlugin::createInstance(MidiDriver **mididriver) const {
Common::Error AdLibEmuMusicPlugin::createInstance(MidiDriver **mididriver) const {
*mididriver = new MidiDriver_ADLIB(g_system->getMixer());
return Common::kNoError;
@ -1612,14 +1612,14 @@ Common::Error AdlibEmuMusicPlugin::createInstance(MidiDriver **mididriver) const
MidiDriver *MidiDriver_ADLIB_create() {
MidiDriver *mididriver;
AdlibEmuMusicPlugin p;
AdLibEmuMusicPlugin p;
p.createInstance(&mididriver);
return mididriver;
}
//#if PLUGIN_ENABLED_DYNAMIC(ADLIB)
//REGISTER_PLUGIN_DYNAMIC(ADLIB, PLUGIN_TYPE_MUSIC, AdlibEmuMusicPlugin);
//REGISTER_PLUGIN_DYNAMIC(ADLIB, PLUGIN_TYPE_MUSIC, AdLibEmuMusicPlugin);
//#else
REGISTER_PLUGIN_STATIC(ADLIB, PLUGIN_TYPE_MUSIC, AdlibEmuMusicPlugin);
REGISTER_PLUGIN_STATIC(ADLIB, PLUGIN_TYPE_MUSIC, AdLibEmuMusicPlugin);
//#endif