Permalink
Browse files

STARTREK: Play midi sounds on floppy version

  • Loading branch information...
Drenn1 authored and sev- committed Jul 28, 2018
1 parent a1107f0 commit 06d7656d42ec5e4ba540dc613b6f6793c9979cfc
Showing with 59 additions and 48 deletions.
  1. +3 −1 engines/startrek/sound.cpp
  2. +56 −47 engines/startrek/startrek.cpp
@@ -63,7 +63,9 @@ Sound::Sound(StarTrekEngine *vm) : _vm(vm) {
_midiSlotList.push_back(&_midiSlots[i]);
}

if (!SearchMan.hasFile("voc/speech.mrk")) {
if (!_vm->isCDEdition())
_vm->_sfxWorking = false;
else if (!SearchMan.hasFile("voc/speech.mrk")) {
warning("Couldn't find 'voc/speech.mrk'. The 'trekcd/voc/' directory should be dumped from the CD. Continuing without CD audio");
_vm->_sfxWorking = false;
}
@@ -55,6 +55,11 @@ StarTrekEngine::StarTrekEngine(OSystem *syst, const StarTrekGameDescription *gam
_redshirtActor(&_actorList[3]),
_sineTable(10) {

if (getPlatform() != Common::kPlatformDOS)
error("Only DOS versions of Star Trek: 25th Anniversary are currently supported");
else if (getGameType() == GType_STJR)
error("Star Trek: Judgment Rites not yet supported");

DebugMan.addDebugChannel(kDebugSound, "sound", "Sound");
DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics");
DebugMan.addDebugChannel(kDebugSavegame, "savegame", "Savegames");
@@ -524,54 +529,58 @@ void StarTrekEngine::runTransportSequence(const Common::String &name) {
}

void StarTrekEngine::playSoundEffectIndex(int index) {
switch (index) {
case 0x04:
_sound->playVoc("tricorde");
break;
case 0x05:
_sound->playVoc("STDOOR1");
break;
case 0x06:
_sound->playVoc("PHASSHOT");
break;
case 0x07:
_sound->playMidiTrack(index);
break;
case 0x08:
_sound->playVoc("TRANSDEM");
break;
case 0x09: // Beaming in?
_sound->playVoc("TRANSMAT");
break;
case 0x0a: // Beaming out?
_sound->playVoc("TRANSENE");
break;
case 0x10: // Menu selection sound
_sound->playMidiTrack(index);
break;
case 0x22:
_sound->playVoc("HAILING");
break;
case 0x24:
_sound->playVoc("PHASSHOT");
break;
case 0x25:
_sound->playVoc("PHOTSHOT");
break;
case 0x26:
_sound->playVoc("HITSHIEL");
break;
case 0x27:
if (!isCDEdition())
_sound->playMidiTrack(index);
break;
case 0x28:
_sound->playVoc("REDALERT");
break;
case 0x29:
_sound->playVoc("WARP");
break;
default:
break;
else {
switch (index) {
case 0x04:
_sound->playVoc("tricorde");
break;
case 0x05:
_sound->playVoc("STDOOR1");
break;
case 0x06:
_sound->playVoc("PHASSHOT");
break;
case 0x07:
_sound->playMidiTrack(index);
break;
case 0x08:
_sound->playVoc("TRANSDEM");
break;
case 0x09: // Beaming in?
_sound->playVoc("TRANSMAT");
break;
case 0x0a: // Beaming out?
_sound->playVoc("TRANSENE");
break;
case 0x10: // Menu selection sound
_sound->playMidiTrack(index);
break;
case 0x22:
_sound->playVoc("HAILING");
break;
case 0x24:
_sound->playVoc("PHASSHOT");
break;
case 0x25:
_sound->playVoc("PHOTSHOT");
break;
case 0x26:
_sound->playVoc("HITSHIEL");
break;
case 0x27:
_sound->playMidiTrack(index);
break;
case 0x28:
_sound->playVoc("REDALERT");
break;
case 0x29:
_sound->playVoc("WARP");
break;
default:
break;
}
}
}

0 comments on commit 06d7656

Please sign in to comment.