[Scummvm-cvs-logs] CVS: scummvm/backends/midi adlib.cpp,1.24,1.25
Max Horn
fingolfin at users.sourceforge.net
Thu May 22 14:25:08 CEST 2003
Update of /cvsroot/scummvm/scummvm/backends/midi
In directory sc8-pr-cvs1:/tmp/cvs-serv952/backends/midi
Modified Files:
adlib.cpp
Log Message:
get rid of some tables
Index: adlib.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/midi/adlib.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- adlib.cpp 20 May 2003 14:17:18 -0000 1.24
+++ adlib.cpp 22 May 2003 21:24:36 -0000 1.25
@@ -254,44 +254,6 @@
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 @@
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) {
More information about the Scummvm-git-logs
mailing list