aboutsummaryrefslogtreecommitdiff
path: root/sky/music
diff options
context:
space:
mode:
authorMax Horn2004-01-03 15:57:57 +0000
committerMax Horn2004-01-03 15:57:57 +0000
commit14f28d58f1094321b60a9f43b4a7988f71cdb239 (patch)
treedb2e58a7c74ba5543189d59e0ecbfb6c9db74f44 /sky/music
parentc1cddedca88a3a5c7ea01b81ecef5fc869717d5c (diff)
downloadscummvm-rg350-14f28d58f1094321b60a9f43b4a7988f71cdb239.tar.gz
scummvm-rg350-14f28d58f1094321b60a9f43b4a7988f71cdb239.tar.bz2
scummvm-rg350-14f28d58f1094321b60a9f43b4a7988f71cdb239.zip
remove 'Sky' name prefix for most stuff (not needed anymore since we are in namespace 'Sky' now)
svn-id: r12114
Diffstat (limited to 'sky/music')
-rw-r--r--sky/music/adlibchannel.cpp46
-rw-r--r--sky/music/adlibchannel.h4
-rw-r--r--sky/music/adlibmusic.cpp22
-rw-r--r--sky/music/adlibmusic.h6
-rw-r--r--sky/music/gmchannel.cpp38
-rw-r--r--sky/music/gmchannel.h4
-rw-r--r--sky/music/gmmusic.cpp26
-rw-r--r--sky/music/gmmusic.h6
-rw-r--r--sky/music/mt32music.cpp24
-rw-r--r--sky/music/mt32music.h6
-rw-r--r--sky/music/musicbase.cpp30
-rw-r--r--sky/music/musicbase.h14
12 files changed, 113 insertions, 113 deletions
diff --git a/sky/music/adlibchannel.cpp b/sky/music/adlibchannel.cpp
index 0d3802a23d..057f366fee 100644
--- a/sky/music/adlibchannel.cpp
+++ b/sky/music/adlibchannel.cpp
@@ -26,7 +26,7 @@
namespace Sky {
-SkyAdlibChannel::SkyAdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) {
+AdlibChannel::AdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfData) {
_opl = opl;
_musicData = pMusicData;
_channelData.startOfData = startOfData;
@@ -77,12 +77,12 @@ SkyAdlibChannel::SkyAdlibChannel(FM_OPL *opl, uint8 *pMusicData, uint16 startOfD
_musicVolume = 0x100;
}
-bool SkyAdlibChannel::isActive(void) {
+bool AdlibChannel::isActive(void) {
return _channelData.channelActive != 0;
}
-void SkyAdlibChannel::updateVolume(uint16 pVolume) {
+void AdlibChannel::updateVolume(uint16 pVolume) {
_musicVolume = pVolume;
}
@@ -91,7 +91,7 @@ void SkyAdlibChannel::updateVolume(uint16 pVolume) {
asm driver did (_musicData[0xF5F..0x105E]), so the cache is indeed shared
by all instances of the class.
*/
-void SkyAdlibChannel::setRegister(uint8 regNum, uint8 value) {
+void AdlibChannel::setRegister(uint8 regNum, uint8 value) {
if (_adlibRegMirror[regNum] != value) {
OPLWriteReg (_opl, regNum, value);
@@ -99,7 +99,7 @@ void SkyAdlibChannel::setRegister(uint8 regNum, uint8 value) {
}
}
-void SkyAdlibChannel::stopNote(void) {
+void AdlibChannel::stopNote(void) {
if (_channelData.note & 0x20) {
_channelData.note &= ~0x20;
@@ -107,7 +107,7 @@ void SkyAdlibChannel::stopNote(void) {
}
}
-int32 SkyAdlibChannel::getNextEventTime(void) {
+int32 AdlibChannel::getNextEventTime(void) {
int32 retV = 0;
uint8 cnt, lVal;
for (cnt = 0; cnt < 4; cnt++) {
@@ -122,7 +122,7 @@ int32 SkyAdlibChannel::getNextEventTime(void) {
}
-uint8 SkyAdlibChannel::process(uint16 aktTime) {
+uint8 AdlibChannel::process(uint16 aktTime) {
if (!_channelData.channelActive) {
return 0;
@@ -156,12 +156,12 @@ uint8 SkyAdlibChannel::process(uint16 aktTime) {
case 10: //com90_error();
case 11: //com90_doLodsb();
case 13: //com90_do_two_Lodsb();
- error("SkyChannel: dummy music routine 0x%02X was called",opcode);
+ error("Channel: dummy music routine 0x%02X was called",opcode);
_channelData.channelActive = 0;
break;
default:
// these opcodes aren't implemented in original music driver
- error("SkyChannel: Not existent routine 0x%02X was called",opcode);
+ error("Channel: Not existent routine 0x%02X was called",opcode);
_channelData.channelActive = 0;
break;
}
@@ -190,7 +190,7 @@ uint8 SkyAdlibChannel::process(uint16 aktTime) {
return returnVal;
}
-void SkyAdlibChannel::setupInstrument(uint8 opcode) {
+void AdlibChannel::setupInstrument(uint8 opcode) {
uint16 nextNote;
if (_channelData.tremoVibro) {
@@ -211,7 +211,7 @@ void SkyAdlibChannel::setupInstrument(uint8 opcode) {
_channelData.note = (uint8)((nextNote >> 8) | 0x20);
}
-void SkyAdlibChannel::setupChannelVolume(uint8 volume) {
+void AdlibChannel::setupChannelVolume(uint8 volume) {
uint8 resultOp;
uint32 resVol = ((volume + 1) * (_channelData.instrumentData->totOutLev_Op2 + 1)) << 1;
@@ -234,7 +234,7 @@ void SkyAdlibChannel::setupChannelVolume(uint8 volume) {
setRegister(0x40 | _channelData.adlibReg1, resultOp);
}
-void SkyAdlibChannel::adlibSetupInstrument(void) {
+void AdlibChannel::adlibSetupInstrument(void) {
setRegister(0x60 | _channelData.adlibReg1, _channelData.instrumentData->ad_Op1);
setRegister(0x60 | _channelData.adlibReg2, _channelData.instrumentData->ad_Op2);
@@ -253,7 +253,7 @@ void SkyAdlibChannel::adlibSetupInstrument(void) {
#define ENDIAN16(x) (x)
#endif
-uint16 SkyAdlibChannel::getNextNote(uint8 param) {
+uint16 AdlibChannel::getNextNote(uint8 param) {
int16 freqIndex = ((int16)_channelData.freqOffset) - 0x40;
if (freqIndex >= 0x3F) freqIndex++;
@@ -270,20 +270,20 @@ uint16 SkyAdlibChannel::getNextNote(uint8 param) {
//- command 90h routines
-void SkyAdlibChannel::com90_caseNoteOff(void) {
+void AdlibChannel::com90_caseNoteOff(void) {
if (_musicData[_channelData.eventDataPtr] == _channelData.lastCommand)
stopNote();
_channelData.eventDataPtr++;
}
-void SkyAdlibChannel::com90_stopChannel(void) {
+void AdlibChannel::com90_stopChannel(void) {
stopNote();
_channelData.channelActive = 0;
}
-void SkyAdlibChannel::com90_setupInstrument(void) {
+void AdlibChannel::com90_setupInstrument(void) {
_channelData.channelVolume = 0x7F;
_channelData.freqOffset = 0x40;
@@ -293,14 +293,14 @@ void SkyAdlibChannel::com90_setupInstrument(void) {
adlibSetupInstrument();
}
-uint8 SkyAdlibChannel::com90_updateTempo(void) {
+uint8 AdlibChannel::com90_updateTempo(void) {
uint8 retV = _musicData[_channelData.eventDataPtr];
_channelData.eventDataPtr++;
return retV;
}
-void SkyAdlibChannel::com90_getFreqOffset(void) {
+void AdlibChannel::com90_getFreqOffset(void) {
_channelData.freqOffset = _musicData[_channelData.eventDataPtr];
_channelData.eventDataPtr++;
@@ -313,29 +313,29 @@ void SkyAdlibChannel::com90_getFreqOffset(void) {
}
}
-void SkyAdlibChannel::com90_getChannelVolume(void) {
+void AdlibChannel::com90_getChannelVolume(void) {
_channelData.channelVolume = _musicData[_channelData.eventDataPtr];
_channelData.eventDataPtr++;
}
-void SkyAdlibChannel::com90_getTremoVibro(void) {
+void AdlibChannel::com90_getTremoVibro(void) {
_channelData.tremoVibro = _musicData[_channelData.eventDataPtr];
_channelData.eventDataPtr++;
}
-void SkyAdlibChannel::com90_rewindMusic(void) {
+void AdlibChannel::com90_rewindMusic(void) {
_channelData.eventDataPtr = _channelData.startOfData;
}
-void SkyAdlibChannel::com90_keyOff(void) {
+void AdlibChannel::com90_keyOff(void) {
stopNote();
}
-void SkyAdlibChannel::com90_setStartOfData(void) {
+void AdlibChannel::com90_setStartOfData(void) {
_channelData.startOfData = _channelData.eventDataPtr;
}
diff --git a/sky/music/adlibchannel.h b/sky/music/adlibchannel.h
index ab942992fb..879ba97e08 100644
--- a/sky/music/adlibchannel.h
+++ b/sky/music/adlibchannel.h
@@ -58,9 +58,9 @@ typedef struct {
uint16 frequency;
} AdlibChannelType;
-class SkyAdlibChannel : public SkyChannelBase {
+class AdlibChannel : public ChannelBase {
public:
- SkyAdlibChannel (FM_OPL *opl, uint8 *pMusicData, uint16 startOfData);
+ AdlibChannel (FM_OPL *opl, uint8 *pMusicData, uint16 startOfData);
virtual void stopNote(void);
virtual uint8 process(uint16 aktTime);
virtual void updateVolume(uint16 pVolume);
diff --git a/sky/music/adlibmusic.cpp b/sky/music/adlibmusic.cpp
index cc4e6cf9ee..b799ff9377 100644
--- a/sky/music/adlibmusic.cpp
+++ b/sky/music/adlibmusic.cpp
@@ -26,13 +26,13 @@
namespace Sky {
-void SkyAdlibMusic::passMixerFunc(void *param, int16 *buf, uint len) {
+void AdlibMusic::passMixerFunc(void *param, int16 *buf, uint len) {
- ((SkyAdlibMusic*)param)->premixerCall(buf, len);
+ ((AdlibMusic*)param)->premixerCall(buf, len);
}
-SkyAdlibMusic::SkyAdlibMusic(SoundMixer *pMixer, SkyDisk *pSkyDisk, OSystem *system)
- : SkyMusicBase(pSkyDisk, system) {
+AdlibMusic::AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system)
+ : MusicBase(pDisk, system) {
_driverFileBase = 60202;
_mixer = pMixer;
@@ -46,20 +46,20 @@ SkyAdlibMusic::SkyAdlibMusic(SoundMixer *pMixer, SkyDisk *pSkyDisk, OSystem *sys
_mixer->setupPremix(passMixerFunc, this);
}
-SkyAdlibMusic::~SkyAdlibMusic(void) {
+AdlibMusic::~AdlibMusic(void) {
_mixer->setupPremix(0, 0);
// YM3812Shutdown();
}
-void SkyAdlibMusic::setVolume(uint8 volume) {
+void AdlibMusic::setVolume(uint8 volume) {
_musicVolume = volume;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
_channels[cnt]->updateVolume(volume | 128);
}
-void SkyAdlibMusic::premixerCall(int16 *data, uint len) {
+void AdlibMusic::premixerCall(int16 *data, uint len) {
if (_musicData == NULL) {
// no music loaded
@@ -93,7 +93,7 @@ void SkyAdlibMusic::premixerCall(int16 *data, uint len) {
}
}
-void SkyAdlibMusic::setupPointers(void) {
+void AdlibMusic::setupPointers(void) {
if (SkyEngine::_systemVars.gameVersion == 109) {
// disk demo uses a different adlib driver version, some offsets have changed
@@ -112,18 +112,18 @@ void SkyAdlibMusic::setupPointers(void) {
_nextMusicPoll = 0;
}
-void SkyAdlibMusic::setupChannels(uint8 *channelData) {
+void AdlibMusic::setupChannels(uint8 *channelData) {
_numberOfChannels = channelData[0];
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc;
- _channels[cnt] = new SkyAdlibChannel(_opl, _musicData, chDataStart);
+ _channels[cnt] = new AdlibChannel(_opl, _musicData, chDataStart);
_channels[cnt]->updateVolume(_musicVolume | 128);
}
}
-void SkyAdlibMusic::startDriver(void) {
+void AdlibMusic::startDriver(void) {
uint16 cnt = 0;
while (_initSequence[cnt] || _initSequence[cnt+1]) {
diff --git a/sky/music/adlibmusic.h b/sky/music/adlibmusic.h
index 37c362dac0..55342fcd9f 100644
--- a/sky/music/adlibmusic.h
+++ b/sky/music/adlibmusic.h
@@ -29,10 +29,10 @@ class SoundMixer;
namespace Sky {
-class SkyAdlibMusic : public SkyMusicBase {
+class AdlibMusic : public MusicBase {
public:
- SkyAdlibMusic(SoundMixer *pMixer, SkyDisk *pSkyDisk, OSystem *system);
- ~SkyAdlibMusic(void);
+ AdlibMusic(SoundMixer *pMixer, Disk *pDisk, OSystem *system);
+ ~AdlibMusic(void);
virtual void setVolume(uint8 volume);
private:
FM_OPL *_opl;
diff --git a/sky/music/gmchannel.cpp b/sky/music/gmchannel.cpp
index 2ffcf67ea5..3493c27d2f 100644
--- a/sky/music/gmchannel.cpp
+++ b/sky/music/gmchannel.cpp
@@ -25,7 +25,7 @@
namespace Sky {
-SkyGmChannel::SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab) {
+GmChannel::GmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab) {
_musicData = pMusicData;
_midiDrv = pMidiDrv;
@@ -41,12 +41,12 @@ SkyGmChannel::SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pM
_lastVolume = 0xFF;
}
-bool SkyGmChannel::isActive(void) {
+bool GmChannel::isActive(void) {
return _channelData.channelActive != 0;
}
-void SkyGmChannel::updateVolume(uint16 pVolume) {
+void GmChannel::updateVolume(uint16 pVolume) {
_musicVolume = pVolume;
if (_musicVolume > 0)
@@ -57,12 +57,12 @@ void SkyGmChannel::updateVolume(uint16 pVolume) {
}
}
-void SkyGmChannel::stopNote(void) {
+void GmChannel::stopNote(void) {
_midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x7B00 | 0 | 0x79000000);
}
-int32 SkyGmChannel::getNextEventTime(void) {
+int32 GmChannel::getNextEventTime(void) {
int32 retV = 0;
uint8 cnt, lVal;
@@ -78,7 +78,7 @@ int32 SkyGmChannel::getNextEventTime(void) {
}
-uint8 SkyGmChannel::process(uint16 aktTime) {
+uint8 GmChannel::process(uint16 aktTime) {
if (!_channelData.channelActive)
return 0;
@@ -112,12 +112,12 @@ uint8 SkyGmChannel::process(uint16 aktTime) {
case 4: //com90_dummy();
case 7: //com90_skipTremoVibro();
case 10: //com90_error();
- error("SkyChannel: dummy music routine 0x%02X was called",opcode);
+ error("Channel: dummy music routine 0x%02X was called",opcode);
_channelData.channelActive = 0;
break;
default:
// these opcodes aren't implemented in original music driver
- error("SkyChannel: Not existent routine 0x%02X was called",opcode);
+ error("Channel: Not existent routine 0x%02X was called",opcode);
_channelData.channelActive = 0;
break;
}
@@ -139,66 +139,66 @@ uint8 SkyGmChannel::process(uint16 aktTime) {
//- command 90h routines
-void SkyGmChannel::com90_caseNoteOff(void) {
+void GmChannel::com90_caseNoteOff(void) {
_midiDrv->send((0x90 | _channelData.midiChannelNumber) | (_musicData[_channelData.eventDataPtr] << 8));
_channelData.eventDataPtr++;
}
-void SkyGmChannel::com90_stopChannel(void) {
+void GmChannel::com90_stopChannel(void) {
stopNote();
_channelData.channelActive = 0;
}
-void SkyGmChannel::com90_setupInstrument(void) {
+void GmChannel::com90_setupInstrument(void) {
_midiDrv->send((0xC0 | _channelData.midiChannelNumber) | (_mt32_to_gm[_musicData[_channelData.eventDataPtr]] << 8));
_channelData.eventDataPtr++;
}
-uint8 SkyGmChannel::com90_updateTempo(void) {
+uint8 GmChannel::com90_updateTempo(void) {
uint8 retV = _musicData[_channelData.eventDataPtr];
_channelData.eventDataPtr++;
return retV;
}
-void SkyGmChannel::com90_getPitch(void) {
+void GmChannel::com90_getPitch(void) {
_midiDrv->send((0xE0 | _channelData.midiChannelNumber) | 0 | (_musicData[_channelData.eventDataPtr] << 16));
_channelData.eventDataPtr++;
}
-void SkyGmChannel::com90_getChannelVolume(void) {
+void GmChannel::com90_getChannelVolume(void) {
_lastVolume = _musicData[_channelData.eventDataPtr];
uint8 newVol = (uint8)((_musicData[_channelData.eventDataPtr++] * _musicVolume) >> 7);
_midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x700 | (newVol << 16));
}
-void SkyGmChannel::com90_rewindMusic(void) {
+void GmChannel::com90_rewindMusic(void) {
_channelData.eventDataPtr = _channelData.startOfData;
}
-void SkyGmChannel::com90_keyOff(void) {
+void GmChannel::com90_keyOff(void) {
_midiDrv->send((0x90 | _channelData.midiChannelNumber) | (_channelData.note << 8) | 0);
}
-void SkyGmChannel::com90_setStartOfData(void) {
+void GmChannel::com90_setStartOfData(void) {
_channelData.startOfData = _channelData.eventDataPtr;
}
-void SkyGmChannel::com90_getChannelPanValue(void) {
+void GmChannel::com90_getChannelPanValue(void) {
_midiDrv->send((0xB0 | _channelData.midiChannelNumber) | 0x0A00 | (_musicData[_channelData.eventDataPtr] << 16));
_channelData.eventDataPtr++;
}
-void SkyGmChannel::com90_getChannelControl(void) {
+void GmChannel::com90_getChannelControl(void) {
uint8 conNum = _musicData[_channelData.eventDataPtr];
uint8 conDat = _musicData[_channelData.eventDataPtr + 1];
diff --git a/sky/music/gmchannel.h b/sky/music/gmchannel.h
index 17c5a0f261..97b0796c01 100644
--- a/sky/music/gmchannel.h
+++ b/sky/music/gmchannel.h
@@ -37,9 +37,9 @@ typedef struct {
uint8 channelActive;
} MidiChannelType;
-class SkyGmChannel : public SkyChannelBase {
+class GmChannel : public ChannelBase {
public:
- SkyGmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab);
+ GmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, byte *pInstMap, uint8 *veloTab);
virtual void stopNote(void);
virtual uint8 process(uint16 aktTime);
virtual void updateVolume(uint16 pVolume);
diff --git a/sky/music/gmmusic.cpp b/sky/music/gmmusic.cpp
index c4278c9c46..5d36d6bb98 100644
--- a/sky/music/gmmusic.cpp
+++ b/sky/music/gmmusic.cpp
@@ -27,13 +27,13 @@
namespace Sky {
-void SkyGmMusic::passTimerFunc(void *param) {
+void GmMusic::passTimerFunc(void *param) {
- ((SkyGmMusic*)param)->timerCall();
+ ((GmMusic*)param)->timerCall();
}
-SkyGmMusic::SkyGmMusic(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system)
- : SkyMusicBase(pSkyDisk, system) {
+GmMusic::GmMusic(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system)
+ : MusicBase(pDisk, system) {
_driverFileBase = 60200;
_midiDrv = pMidiDrv;
@@ -45,7 +45,7 @@ SkyGmMusic::SkyGmMusic(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system)
_ignoreNextPoll = false;
}
-SkyGmMusic::~SkyGmMusic(void) {
+GmMusic::~GmMusic(void) {
_midiDrv->setTimerCallback(NULL, NULL);
if (_currentMusic) stopMusic();
@@ -56,7 +56,7 @@ SkyGmMusic::~SkyGmMusic(void) {
delete _midiDrv;
}
-void SkyGmMusic::setVolume(uint8 volume) {
+void GmMusic::setVolume(uint8 volume) {
uint8 sysEx[6];
_musicVolume = volume;
@@ -66,7 +66,7 @@ void SkyGmMusic::setVolume(uint8 volume) {
_midiDrv->sysEx(sysEx, 6);
}
-void SkyGmMusic::timerCall(void) {
+void GmMusic::timerCall(void) {
// midi driver polls hundred times per sec. We only want 50 times.
_ignoreNextPoll = !_ignoreNextPoll;
@@ -76,7 +76,7 @@ void SkyGmMusic::timerCall(void) {
pollMusic();
}
-void SkyGmMusic::setupPointers(void) {
+void GmMusic::setupPointers(void) {
if (SkyEngine::_systemVars.gameVersion == 109) {
_musicDataLoc = (_musicData[0x79C] << 8) | _musicData[0x79B];
@@ -87,24 +87,24 @@ void SkyGmMusic::setupPointers(void) {
}
}
-void SkyGmMusic::setupChannels(uint8 *channelData) {
+void GmMusic::setupChannels(uint8 *channelData) {
_numberOfChannels = channelData[0];
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc;
- _channels[cnt] = new SkyGmChannel(_musicData, chDataStart, _midiDrv, _mt32_to_gm, _veloTab);
+ _channels[cnt] = new GmChannel(_musicData, chDataStart, _midiDrv, _mt32_to_gm, _veloTab);
_channels[cnt]->updateVolume(_musicVolume);
}
}
-void SkyGmMusic::startDriver(void) {
+void GmMusic::startDriver(void) {
//_midiDrv->send(0xFF); //ALSA can't handle this.
// skip all sysEx as it can't be handled anyways.
}
-byte SkyGmMusic::_mt32_to_gm[128] = {
+byte GmMusic::_mt32_to_gm[128] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
0, 1, 0, 2, 4, 4, 5, 3, 16, 17, 18, 16, 16, 19, 20, 21, // 0x
6, 6, 6, 7, 7, 7, 8, 112, 62, 62, 63, 63, 38, 38, 39, 39, // 1x
@@ -116,7 +116,7 @@ byte SkyGmMusic::_mt32_to_gm[128] = {
47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117, // 7x
};
-uint8 SkyGmMusic::_veloTab[128] = {
+uint8 GmMusic::_veloTab[128] = {
0x00, 0x40, 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x44, 0x44,
0x45, 0x45, 0x46, 0x46, 0x47, 0x47, 0x48, 0x48, 0x49, 0x49,
0x4A, 0x4A, 0x4B, 0x4B, 0x4C, 0x4C, 0x4D, 0x4D, 0x4E, 0x4E,
diff --git a/sky/music/gmmusic.h b/sky/music/gmmusic.h
index ab836ed98f..df77787266 100644
--- a/sky/music/gmmusic.h
+++ b/sky/music/gmmusic.h
@@ -28,10 +28,10 @@ class MidiDriver;
namespace Sky {
-class SkyGmMusic : public SkyMusicBase {
+class GmMusic : public MusicBase {
public:
- SkyGmMusic(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system);
- ~SkyGmMusic(void);
+ GmMusic(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system);
+ ~GmMusic(void);
virtual void setVolume(uint8 volume);
private:
static void passTimerFunc(void *param);
diff --git a/sky/music/mt32music.cpp b/sky/music/mt32music.cpp
index c65615f372..c0e1bea4ce 100644
--- a/sky/music/mt32music.cpp
+++ b/sky/music/mt32music.cpp
@@ -26,13 +26,13 @@
namespace Sky {
-void SkyMT32Music::passTimerFunc(void *param) {
+void MT32Music::passTimerFunc(void *param) {
- ((SkyMT32Music*)param)->timerCall();
+ ((MT32Music*)param)->timerCall();
}
-SkyMT32Music::SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system)
- : SkyMusicBase(pSkyDisk, system) {
+MT32Music::MT32Music(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system)
+ : MusicBase(pDisk, system) {
_driverFileBase = 60200;
_midiDrv = pMidiDrv;
@@ -46,14 +46,14 @@ SkyMT32Music::SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *sys
_dummyMap[cnt] = cnt;
}
-SkyMT32Music::~SkyMT32Music(void) {
+MT32Music::~MT32Music(void) {
_midiDrv->close();
_midiDrv->setTimerCallback(NULL, NULL);
delete _midiDrv;
}
-void SkyMT32Music::timerCall(void) {
+void MT32Music::timerCall(void) {
// midi driver polls hundred times per sec. We only want 50 times.
_ignoreNextPoll = !_ignoreNextPoll;
@@ -63,7 +63,7 @@ void SkyMT32Music::timerCall(void) {
pollMusic();
}
-void SkyMT32Music::setVolume(uint8 volume) {
+void MT32Music::setVolume(uint8 volume) {
uint8 sysEx[10] = "\x41\x10\x16\x12\x10\x00\x16\x00\x00";
_musicVolume = volume;
sysEx[7] = (volume > 100) ? 100 : volume;
@@ -74,25 +74,25 @@ void SkyMT32Music::setVolume(uint8 volume) {
_midiDrv->sysEx(sysEx, 9);
}
-void SkyMT32Music::setupPointers(void) {
+void MT32Music::setupPointers(void) {
_musicDataLoc = (_musicData[0x7DD] << 8) | _musicData[0x7DC];
_sysExSequence = ((_musicData[0x7E1] << 8) | _musicData[0x7E0]) + _musicData;
}
-void SkyMT32Music::setupChannels(uint8 *channelData) {
+void MT32Music::setupChannels(uint8 *channelData) {
_numberOfChannels = channelData[0];
channelData++;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc;
- _channels[cnt] = new SkyGmChannel(_musicData, chDataStart, _midiDrv, _dummyMap, _dummyMap);
+ _channels[cnt] = new GmChannel(_musicData, chDataStart, _midiDrv, _dummyMap, _dummyMap);
}
}
#define MIDI_PACK(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
-bool SkyMT32Music::processPatchSysEx(uint8 *sysExData) {
+bool MT32Music::processPatchSysEx(uint8 *sysExData) {
uint8 sysExBuf[15];
uint8 crc = 0;
@@ -117,7 +117,7 @@ bool SkyMT32Music::processPatchSysEx(uint8 *sysExData) {
return true;
}
-void SkyMT32Music::startDriver(void) {
+void MT32Music::startDriver(void) {
// setup timbres and patches using SysEx data
uint8* sysExData = _sysExSequence;
diff --git a/sky/music/mt32music.h b/sky/music/mt32music.h
index 928651b4ea..05d5fde89c 100644
--- a/sky/music/mt32music.h
+++ b/sky/music/mt32music.h
@@ -28,10 +28,10 @@ class MidiDriver;
namespace Sky {
-class SkyMT32Music : public SkyMusicBase {
+class MT32Music : public MusicBase {
public:
- SkyMT32Music(MidiDriver *pMidiDrv, SkyDisk *pSkyDisk, OSystem *system);
- ~SkyMT32Music(void);
+ MT32Music(MidiDriver *pMidiDrv, Disk *pDisk, OSystem *system);
+ ~MT32Music(void);
private:
static void passTimerFunc(void *param);
void timerCall(void);
diff --git a/sky/music/musicbase.cpp b/sky/music/musicbase.cpp
index 1843be84d3..74083431cb 100644
--- a/sky/music/musicbase.cpp
+++ b/sky/music/musicbase.cpp
@@ -25,11 +25,11 @@
namespace Sky {
-SkyMusicBase::SkyMusicBase(SkyDisk *pSkyDisk, OSystem *system) {
+MusicBase::MusicBase(Disk *pDisk, OSystem *system) {
_musicData = NULL;
_allowedCommands = 0;
- _skyDisk = pSkyDisk;
+ _skyDisk = pDisk;
_currentMusic = 0;
_musicVolume = 127;
_system = system;
@@ -37,13 +37,13 @@ SkyMusicBase::SkyMusicBase(SkyDisk *pSkyDisk, OSystem *system) {
_mutex = _system->create_mutex();
}
-SkyMusicBase::~SkyMusicBase(void) {
+MusicBase::~MusicBase(void) {
if (_musicData)
free(_musicData);
}
-void SkyMusicBase::loadSection(uint8 pSection) {
+void MusicBase::loadSection(uint8 pSection) {
_system->lock_mutex(_mutex);
if (_currentMusic)
@@ -65,7 +65,7 @@ void SkyMusicBase::loadSection(uint8 pSection) {
_system->unlock_mutex(_mutex);
}
-bool SkyMusicBase::musicIsPlaying(void) {
+bool MusicBase::musicIsPlaying(void) {
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
if (_channels[cnt]->isActive())
@@ -73,7 +73,7 @@ bool SkyMusicBase::musicIsPlaying(void) {
return false;
}
-void SkyMusicBase::musicCommand(uint16 command) {
+void MusicBase::musicCommand(uint16 command) {
if (_musicData == NULL) {
debug(1,"Got music command but driver is not yet loaded");
@@ -85,16 +85,16 @@ void SkyMusicBase::musicCommand(uint16 command) {
}
switch(command >> 8) {
case 0:
- debug(1,"SkyMusic: got call to startAdlibDriver(). Not necessary in this implementation.");
+ debug(1,"Music: got call to startAdlibDriver(). Not necessary in this implementation.");
break;
case 1:
- debug(1,"SkyMusic: got call to stopDriver(). Not necessary in this implementation.");
+ debug(1,"Music: got call to stopDriver(). Not necessary in this implementation.");
break;
case 2:
- debug(1,"SkyMusic: got call to SetTempo(). Tempo is fixed in this implementation.");
+ debug(1,"Music: got call to SetTempo(). Tempo is fixed in this implementation.");
break;
case 3:
- debug(1,"SkyMusic: ignored direct call to driverPoll().");
+ debug(1,"Music: ignored direct call to driverPoll().");
break;
case 4:
startMusic(command & 0xFF);
@@ -113,14 +113,14 @@ void SkyMusicBase::musicCommand(uint16 command) {
}
}
-void SkyMusicBase::setFMVolume(uint16 param) {
+void MusicBase::setFMVolume(uint16 param) {
_musicVolume = param;
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
_channels[cnt]->updateVolume(_musicVolume);
}
-void SkyMusicBase::stopMusic(void) {
+void MusicBase::stopMusic(void) {
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) {
_channels[cnt]->stopNote();
@@ -129,7 +129,7 @@ void SkyMusicBase::stopMusic(void) {
_numberOfChannels = 0;
}
-void SkyMusicBase::updateTempo(void) {
+void MusicBase::updateTempo(void) {
uint16 tempoMul = _musicTempo0 * _musicTempo1;
uint16 divisor = 0x4446390/ 23864;
@@ -137,7 +137,7 @@ void SkyMusicBase::updateTempo(void) {
_tempo |= (((tempoMul%divisor) << 16) | (tempoMul / divisor)) / divisor;
}
-void SkyMusicBase::loadNewMusic(void) {
+void MusicBase::loadNewMusic(void) {
uint16 musicPos;
if (_onNextPoll.musicToProcess > _musicData[_musicDataLoc]) {
@@ -163,7 +163,7 @@ void SkyMusicBase::loadNewMusic(void) {
}
}
-void SkyMusicBase::pollMusic(void) {
+void MusicBase::pollMusic(void) {
_system->lock_mutex(_mutex);
uint8 newTempo;
diff --git a/sky/music/musicbase.h b/sky/music/musicbase.h
index 43e993cef2..5e2b665737 100644
--- a/sky/music/musicbase.h
+++ b/sky/music/musicbase.h
@@ -30,7 +30,7 @@ class OSystem;
namespace Sky {
-class SkyDisk;
+class Disk;
#define FILES_PER_SECTION 4
@@ -39,7 +39,7 @@ typedef struct {
uint8 musicToProcess;
} Actions;
-class SkyChannelBase {
+class ChannelBase {
public:
virtual void stopNote(void) = 0;
virtual uint8 process(uint16 aktTime) = 0;
@@ -48,10 +48,10 @@ public:
private:
};
-class SkyMusicBase {
+class MusicBase {
public:
- SkyMusicBase(SkyDisk *pSkyDisk, OSystem *system);
- virtual ~SkyMusicBase(void);
+ MusicBase(Disk *pDisk, OSystem *system);
+ virtual ~MusicBase(void);
void loadSection(uint8 pSection);
void musicCommand(uint16 command);
void startMusic(uint16 param) { _onNextPoll.musicToProcess = param & 0xF; }; // 4
@@ -63,7 +63,7 @@ public:
protected:
OSystem *_system;
- SkyDisk *_skyDisk;
+ Disk *_skyDisk;
uint8 *_musicData;
uint8 _allowedCommands;
uint16 _musicDataLoc;
@@ -76,7 +76,7 @@ protected:
uint32 _tempo; // calculated from musicTempo0 and musicTempo1
uint32 _aktTime;
Actions _onNextPoll;
- SkyChannelBase *_channels[10];
+ ChannelBase *_channels[10];
OSystem::MutexRef _mutex;
virtual void setupPointers(void) = 0;