SAGA: Add ITE MT-32 display message

This adds the message that the DOS version of Inherit The Earth displays on the
MT-32 when quitting the game.
This commit is contained in:
Coen Rampen 2021-07-22 20:25:30 +02:00
parent 12974b29e4
commit e63b556015
5 changed files with 25 additions and 0 deletions

View File

@ -75,6 +75,9 @@ const uint8 MidiDriver_MT32GM::GS_DRUMKIT_FALLBACK_MAP[128] = {
0, 0, 0, 0, 0, 0, 0, 127 // No drumkit defined; CM-64/32L (127)
};
const uint8 MidiDriver_MT32GM::MT32_DISPLAY_NUM_CHARS;
const uint32 MidiDriver_MT32GM::MT32_DISPLAY_MEMORY_ADDRESS;
// Callback hooked up to the driver wrapped by the MIDI driver
// object. Executes onTimer and the external callback set by
// the setTimerCallback function.

View File

@ -118,6 +118,9 @@ public:
// Map for correcting Roland GS drumkit numbers.
static const uint8 GS_DRUMKIT_FALLBACK_MAP[128];
static const uint8 MT32_DISPLAY_NUM_CHARS = 20;
static const uint32 MT32_DISPLAY_MEMORY_ADDRESS = 0x20 << 14;
protected:
static const uint8 MAXIMUM_MT32_ACTIVE_NOTES = 48;
static const uint8 MAXIMUM_GM_ACTIVE_NOTES = 96;

View File

@ -44,6 +44,8 @@
namespace Saga {
const uint8 Music::MT32_GOODBYE_MSG[] = { 0x47, 0x6F, 0x6F, 0x64, 0x62, 0x79, 0x65, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
Music::Music(SagaEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _parser(0), _driver(0), _driverPC98(0), _musicContext(0) {
_currentVolume = 0;
_currentMusicBuffer = NULL;
@ -173,6 +175,18 @@ Music::~Music() {
}
}
void Music::close() {
if (_parser)
_parser->stopPlaying();
if (_vm->getGameId() == GID_ITE && _vm->getPlatform() == Common::kPlatformDOS && _driver) {
MidiDriver_MT32GM *mt32Driver = dynamic_cast<MidiDriver_MT32GM *>(_driver);
if (mt32Driver)
mt32Driver->sysExMT32(MT32_GOODBYE_MSG, MidiDriver_MT32GM::MT32_DISPLAY_NUM_CHARS,
MidiDriver_MT32GM::MT32_DISPLAY_MEMORY_ADDRESS, false, false);
}
}
void Music::musicVolumeGaugeCallback(void *refCon) {
((Music *)refCon)->musicVolumeGauge();
}

View File

@ -27,6 +27,7 @@
#include "audio/mididrv.h"
#include "audio/mididrv_ms.h"
#include "audio/mt32gm.h"
#include "audio/midiparser.h"
#include "audio/mixer.h"
#include "audio/softsynth/fmtowns_pc98/towns_pc98_driver.h"
@ -43,10 +44,12 @@ enum MusicFlags {
class Music {
private:
static const uint8 MUSIC_SUNSPOT = 26;
static const uint8 MT32_GOODBYE_MSG[MidiDriver_MT32GM::MT32_DISPLAY_NUM_CHARS];
public:
Music(SagaEngine *vm, Audio::Mixer *mixer);
~Music();
void close();
bool isPlaying();
bool hasDigitalMusic() { return _digitalMusic; }

View File

@ -366,6 +366,8 @@ Common::Error SagaEngine::run() {
_system->delayMillis(10);
}
_music->close();
return Common::kNoError;
}