[Scummvm-cvs-logs] SF.net SVN: scummvm:[41630] scummvm/trunk/engines/cruise/sound.cpp
dreammaster at users.sourceforge.net
dreammaster at users.sourceforge.net
Thu Jun 18 13:37:45 CEST 2009
Revision: 41630
http://scummvm.svn.sourceforge.net/scummvm/?rev=41630&view=rev
Author: dreammaster
Date: 2009-06-18 11:37:45 +0000 (Thu, 18 Jun 2009)
Log Message:
-----------
Removed redundant code that isn't used
Modified Paths:
--------------
scummvm/trunk/engines/cruise/sound.cpp
Modified: scummvm/trunk/engines/cruise/sound.cpp
===================================================================
--- scummvm/trunk/engines/cruise/sound.cpp 2009-06-18 11:34:45 UTC (rev 41629)
+++ scummvm/trunk/engines/cruise/sound.cpp 2009-06-18 11:37:45 UTC (rev 41630)
@@ -157,17 +157,6 @@
const int AdlibSoundDriver::_voiceOperatorsTableCount = ARRAYSIZE(_voiceOperatorsTable);
-// Future Wars Adlib driver
-class AdlibSoundDriverINS : public AdlibSoundDriver {
-public:
- AdlibSoundDriverINS(Audio::Mixer *mixer) : AdlibSoundDriver(mixer) {}
- virtual const char *getInstrumentExtension() const { return ".INS"; }
- 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 {
public:
AdlibSoundDriverADL(Audio::Mixer *mixer) : AdlibSoundDriver(mixer) {}
@@ -459,67 +448,6 @@
reg->freqMod = READ_LE_UINT16(data + 24);
}
-void AdlibSoundDriverINS::loadInstrument(const byte *data, AdlibSoundInstrument *asi) {
- asi->mode = *data++;
- asi->channel = *data++;
- loadRegisterInstrument(data, &asi->regMod); data += 26;
- loadRegisterInstrument(data, &asi->regCar); data += 26;
- asi->waveSelectMod = data[0] & 3; data += 2;
- asi->waveSelectCar = data[0] & 3; data += 2;
- asi->amDepth = data[0]; data += 2;
-}
-
-void AdlibSoundDriverINS::setChannelFrequency(int channel, int frequency) {
- assert(channel < 4);
- AdlibSoundInstrument *ins = &_instrumentsTable[channel];
- if (ins->mode != 0 && ins->channel == 6) {
- channel = 6;
- }
- if (ins->mode == 0 || ins->channel == 6) {
- int freq, note, oct;
- findNote(frequency, ¬e, &oct);
- if (channel == 6) {
- note %= 12;
- }
- freq = _freqTable[note % 12];
- OPLWriteReg(_opl, 0xA0 | channel, freq);
- freq = ((note / 12) << 2) | ((freq & 0x300) >> 8);
- if (ins->mode == 0) {
- freq |= 0x20;
- }
- OPLWriteReg(_opl, 0xB0 | channel, freq);
- }
- if (ins->mode != 0) {
- _vibrato |= 1 << (10 - ins->channel);
- OPLWriteReg(_opl, 0xBD, _vibrato);
- }
-}
-
-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];
- if (ins->mode != 0 && ins->channel == 6) {
- channel = 6;
- }
- if (ins->mode == 0 || channel == 6) {
- uint16 note = 12;
- int freq = _freqTable[note % 12];
- OPLWriteReg(_opl, 0xA0 | channel, freq);
- freq = ((note / 12) << 2) | ((freq & 0x300) >> 8);
- if (ins->mode == 0) {
- freq |= 0x20;
- }
- OPLWriteReg(_opl, 0xB0 | channel, freq);
- }
- if (ins->mode != 0) {
- _vibrato |= 1 << (10 - ins->channel);
- OPLWriteReg(_opl, 0xBD, _vibrato);
- }
-}
-
void AdlibSoundDriverADL::loadInstrument(const byte *data, AdlibSoundInstrument *asi) {
asi->mode = *data++;
asi->channel = *data++;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list