aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorJerome Fisher2005-04-03 22:01:38 +0000
committerJerome Fisher2005-04-03 22:01:38 +0000
commiteda317924ec0573d5c2a8407feaa8dafb6d4a9bc (patch)
tree7613d4f6e4af714ffd33af7cee8feba5533d2168 /scumm
parente62d6773ef629e11f966e4b4c3086db8cea58a0b (diff)
downloadscummvm-rg350-eda317924ec0573d5c2a8407feaa8dafb6d4a9bc.tar.gz
scummvm-rg350-eda317924ec0573d5c2a8407feaa8dafb6d4a9bc.tar.bz2
scummvm-rg350-eda317924ec0573d5c2a8407feaa8dafb6d4a9bc.zip
Committed patch #1168149 (Shared GM/MT-32 mapping) by eriktorbjorn as-is. This does the following:
- Replaces multiple identical MT-32-to-General MIDI mapping tables with a common one in MidiDriver. - Changes Sky's GmChannel class to allow NULL instrument and velocity mapping tables, giving a 1-to-1 mapping without creating a dummy table. svn-id: r17361
Diffstat (limited to 'scumm')
-rw-r--r--scumm/instrument.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/scumm/instrument.cpp b/scumm/instrument.cpp
index f45da061b8..03145cb6d9 100644
--- a/scumm/instrument.cpp
+++ b/scumm/instrument.cpp
@@ -29,29 +29,6 @@ namespace Scumm {
static bool _native_mt32 = false;
-static const byte 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
- 88, 95, 52, 98, 97, 99, 14, 54, 102, 96, 53, 102, 81, 100, 14, 80, // 2x
- 48, 48, 49, 45, 41, 40, 42, 42, 43, 46, 45, 24, 25, 28, 27, 104, // 3x
- 32, 32, 34, 33, 36, 37, 35, 35, 79, 73, 72, 72, 74, 75, 64, 65, // 4x
- 66, 67, 71, 71, 68, 69, 70, 22, 56, 59, 57, 57, 60, 60, 58, 61, // 5x
- 61, 11, 11, 98, 14, 9, 14, 13, 12, 107, 107, 77, 78, 78, 76, 76, // 6x
- 47, 117, 127, 118, 118, 116, 115, 119, 115, 112, 55, 124, 123, 0, 14, 117 // 7x
-};
-
-static const byte gm_to_mt32[128] = {
- 5, 1, 2, 7, 3, 5, 16, 21, 22, 101, 101, 97, 104, 103, 102, 20,
- 8, 9, 11, 12, 14, 15, 87, 15, 59, 60, 61, 62, 67, 44, 79, 23,
- 64, 67, 66, 70, 68, 69, 28, 31, 52, 54, 55, 56, 49, 51, 57, 112,
- 48, 50, 45, 26, 34, 35, 45, 122, 89, 90, 94, 81, 92, 95, 24, 25,
- 80, 78, 79, 78, 84, 85, 86, 82, 74, 72, 76, 77, 110, 107, 108, 76,
- 47, 44, 111, 45, 44, 34, 44, 30, 32, 33, 88, 34, 35, 35, 38, 33,
- 41, 36, 100, 37, 40, 34, 43, 40, 63, 21, 99, 105, 103, 86, 55, 84,
- 101, 103, 100, 120, 117, 113, 99, 128, 128, 128, 128, 124, 123, 128, 128, 128,
-};
-
static struct {
const char *name;
byte program;
@@ -148,7 +125,7 @@ public:
void saveOrLoad (Serializer *s);
void send (MidiChannel *mc);
void copy_to (Instrument *dest) { dest->program (_program, _mt32); }
- bool is_valid() { return (_program < 128) && ((_native_mt32 == _mt32) || _native_mt32 ? (gm_to_mt32[_program] < 128) : (mt32_to_gm[_program] < 128)); }
+ bool is_valid() { return (_program < 128) && ((_native_mt32 == _mt32) || _native_mt32 ? (MidiDriver::_gmToMt32[_program] < 128) : (MidiDriver::_mt32ToGm[_program] < 128)); }
operator int() { return (_program < 128) ? _program : 255; }
};
@@ -360,7 +337,7 @@ void Instrument_Program::send (MidiChannel *mc) {
byte program = _program;
if (_native_mt32 != _mt32)
- program = _native_mt32 ? gm_to_mt32 [program] : mt32_to_gm [program];
+ program = _native_mt32 ? MidiDriver::_gmToMt32 [program] : MidiDriver::_mt32ToGm [program];
if (program < 128)
mc->programChange (program);
}