diff options
author | Max Horn | 2003-05-22 21:24:36 +0000 |
---|---|---|
committer | Max Horn | 2003-05-22 21:24:36 +0000 |
commit | c152233f80e90e2f54b8a5a558be9d777046f152 (patch) | |
tree | cdf27d203ebdf1483b86a3ccfa1b92943450cb9b /backends/midi/adlib.cpp | |
parent | 789d904c4c9b423fc862b64af8bba0687844b844 (diff) | |
download | scummvm-rg350-c152233f80e90e2f54b8a5a558be9d777046f152.tar.gz scummvm-rg350-c152233f80e90e2f54b8a5a558be9d777046f152.tar.bz2 scummvm-rg350-c152233f80e90e2f54b8a5a558be9d777046f152.zip |
get rid of some tables
svn-id: r7834
Diffstat (limited to 'backends/midi/adlib.cpp')
-rw-r--r-- | backends/midi/adlib.cpp | 46 |
1 files changed, 6 insertions, 40 deletions
diff --git a/backends/midi/adlib.cpp b/backends/midi/adlib.cpp index c856fca2d6..dc3898ed45 100644 --- a/backends/midi/adlib.cpp +++ b/backends/midi/adlib.cpp @@ -254,44 +254,6 @@ static const uint16 num_steps_table[] = { 600, 860, 1200, 1600 }; -static const byte octave_numbers[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7 -}; - -static const byte note_numbers[] = { - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, - 3, 4, 5, 6, 7, 8, 9, 10 -}; - static const byte note_to_f_num[] = { 90, 91, 92, 92, 93, 94, 94, 95, 96, 96, 97, 98, 98, 99, 100, 101, @@ -1279,8 +1241,12 @@ void MidiDriver_ADLIB::adlib_playnote(int channel, int note) { note2 = (note >> 7) - 4; - oct = octave_numbers[note2] << 2; - notex = note_numbers[note2]; + oct = (note2 / 12); + if (oct > 7) + oct = 7 << 2; + else + oct <<= 2; + notex = note2 % 12 + 3; old = adlib_read(channel + 0xB0); if (old & 0x20) { |