diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-07 20:01:04 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2011-08-07 20:01:04 +0000 |
commit | acb0917556fc33681c1df5a530cf754193e67705 (patch) | |
tree | 052a47097009a210e4aed9c207bd6aa4828cc000 /apps/codecs/libgme/emutables.h | |
parent | 93c6f1329a5691a8be158cefe15641bd1daf9ef8 (diff) | |
download | rockbox-acb0917556fc33681c1df5a530cf754193e67705.tar.gz rockbox-acb0917556fc33681c1df5a530cf754193e67705.zip |
Submit initial patch from FS#12176. Adds support for several new game music formats (AY, GBS, HES, KSS, SGC, VGM and VGZ) and replaces the current NSF and NSFE with a new implementation based on a port of the Game Music Emu library 'GME'. This first submit does not cover the full functionality provided by the author's original patch: Coleco-SGV is not supported, some GME-specific m3u-support has been removed and IRAM is not used yet. Further changes are very likely to follow this submit. Thanks to Mauricio Garrido.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30264 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libgme/emutables.h')
-rw-r--r-- | apps/codecs/libgme/emutables.h | 170 |
1 files changed, 170 insertions, 0 deletions
diff --git a/apps/codecs/libgme/emutables.h b/apps/codecs/libgme/emutables.h new file mode 100644 index 0000000000..53fb324cdd --- /dev/null +++ b/apps/codecs/libgme/emutables.h | |||
@@ -0,0 +1,170 @@ | |||
1 | #ifndef _EMUTABLES_H_ | ||
2 | #define _EMUTABLES_H_ | ||
3 | |||
4 | /* Precalculated emu2413 tables for use in Rockbox, | ||
5 | Calculated for 44Khz sampling rate */ | ||
6 | |||
7 | #include "emutypes.h" | ||
8 | |||
9 | static const e_uint16 sin_coeff[] ICONST_ATTR = { | ||
10 | 255, 203, 171, 152, 139, 129, 120, | ||
11 | 113, 107, 102, 97, 92, 88, 85, | ||
12 | 81, 78, 75, 72, 70, 67, 65, | ||
13 | 63, 61, 59, 57, 55, 53, 52, | ||
14 | 50, 48, 47, 45, 44, 43, 41, | ||
15 | 40, 39, 38, 37, 35, 34, 33, | ||
16 | 32, 31, 30, 29, 28, 28, 27, | ||
17 | 26, 25, 24, 23, 23, 22, 21, | ||
18 | 21, 20, 19, 19, 18, 17, 17, | ||
19 | 16, 16, 15, 14, 14, 13, 13, | ||
20 | 12, 12, 11, 11, 11, 10, 10, | ||
21 | 9, 9, 8, 8, 8, 7, 7, | ||
22 | 7, 6, 6, 6, 5, 5, 5, | ||
23 | 4, 4, 4, 4, 3, 3, 3, | ||
24 | 3, 2, 2, 2, 2, 2, 2, | ||
25 | 1, 1, 1, 1, 1, 1, 1, | ||
26 | 0, 0, 0, 0, 0, 0, 0, | ||
27 | 0, 0, 0, 0, 0, 0, 0, | ||
28 | 0, 0, | ||
29 | }; | ||
30 | |||
31 | static const e_int32 pm_coeff[] ICONST_ATTR = { | ||
32 | 256, 256, 256, 256, 256, 256, 256, | ||
33 | 256, 256, 256, 256, 256, 256, 256, | ||
34 | 256, 256, 256, 256, 256, 256, 256, | ||
35 | 256, 256, 256, 256, 256, 256, 256, | ||
36 | 256, 256, 256, 256, 257, 257, 257, | ||
37 | 257, 257, 257, 257, 257, 257, 257, | ||
38 | 257, 257, 257, 257, 257, 257, 257, | ||
39 | 257, 257, 257, 257, 257, 257, 257, | ||
40 | 257, 257, 257, 257, 257, 257, 257, | ||
41 | 258, 258, 258, 257, 257, 257, 257, | ||
42 | 257, 257, 257, 257, 257, 257, 257, | ||
43 | 257, 257, 257, 257, 257, 257, 257, | ||
44 | 257, 257, 257, 257, 257, 257, 257, | ||
45 | 257, 257, 257, 257, 257, 257, 256, | ||
46 | 256, 256, 256, 256, 256, 256, 256, | ||
47 | 256, 256, 256, 256, 256, 256, 256, | ||
48 | 256, 256, 256, 256, 256, 256, 256, | ||
49 | 256, 256, 256, 256, 256, 256, 256, | ||
50 | 256, 256, 256, 255, 255, 255, 255, | ||
51 | 255, 255, 255, 255, 255, 255, 255, | ||
52 | 255, 255, 255, 255, 255, 255, 255, | ||
53 | 255, 255, 255, 255, 255, 255, 255, | ||
54 | 255, 255, 255, 255, 255, 255, 254, | ||
55 | 254, 254, 254, 254, 254, 254, 254, | ||
56 | 254, 254, 254, 254, 254, 254, 254, | ||
57 | 254, 254, 254, 254, 254, 254, 254, | ||
58 | 254, 254, 254, 254, 254, 254, 254, | ||
59 | 254, 254, 254, 253, 254, 254, 254, | ||
60 | 254, 254, 254, 254, 254, 254, 254, | ||
61 | 254, 254, 254, 254, 254, 254, 254, | ||
62 | 254, 254, 254, 254, 254, 254, 254, | ||
63 | 254, 254, 254, 254, 254, 254, 254, | ||
64 | 254, 255, 255, 255, 255, 255, 255, | ||
65 | 255, 255, 255, 255, 255, 255, 255, | ||
66 | 255, 255, 255, 255, 255, 255, 255, | ||
67 | 255, 255, 255, 255, 255, 255, 255, | ||
68 | 255, 255, 255, 255, | ||
69 | }; | ||
70 | |||
71 | static const e_int16 db2lin_coeff[] ICONST_ATTR = { | ||
72 | 255, 249, 244, 239, 233, 228, 224, | ||
73 | 219, 214, 209, 205, 201, 196, 192, | ||
74 | 188, 184, 180, 176, 172, 169, 165, | ||
75 | 162, 158, 155, 151, 148, 145, 142, | ||
76 | 139, 136, 133, 130, 127, 125, 122, | ||
77 | 119, 117, 114, 112, 109, 107, 105, | ||
78 | 102, 100, 98, 96, 94, 92, 90, | ||
79 | 88, 86, 84, 82, 81, 79, 77, | ||
80 | 76, 74, 72, 71, 69, 68, 66, | ||
81 | 65, 64, 62, 61, 60, 58, 57, | ||
82 | 56, 55, 53, 52, 51, 50, 49, | ||
83 | 48, 47, 46, 45, 44, 43, 42, | ||
84 | 41, 40, 39, 38, 38, 37, 36, | ||
85 | 35, 34, 34, 33, 32, 32, 31, | ||
86 | 30, 30, 29, 28, 28, 27, 27, | ||
87 | 26, 25, 25, 24, 24, 23, 23, | ||
88 | 22, 22, 21, 21, 20, 20, 19, | ||
89 | 19, 19, 18, 18, 17, 17, 17, | ||
90 | 16, 16, 16, 15, 15, 15, 14, | ||
91 | 14, 14, 13, 13, 13, 12, 12, | ||
92 | 12, 12, 11, 11, 11, 11, 10, | ||
93 | 10, 10, 10, 10, 9, 9, 9, | ||
94 | 9, 8, 8, 8, 8, 8, 8, | ||
95 | 7, 7, 7, 7, 7, 7, 6, | ||
96 | 6, 6, 6, 6, 6, 6, 5, | ||
97 | 5, 5, 5, 5, 5, 5, 5, | ||
98 | 5, 4, 4, 4, 4, 4, 4, | ||
99 | 4, 4, 4, 4, 3, 3, 3, | ||
100 | 3, 3, 3, 3, 3, 3, 3, | ||
101 | 3, 3, 3, 2, 2, 2, 2, | ||
102 | 2, 2, 2, 2, 2, 2, 2, | ||
103 | 2, 2, 2, 2, 2, 2, 2, | ||
104 | 2, 1, 1, 1, 1, 1, 1, | ||
105 | 1, 1, 1, 1, 1, 1, 1, | ||
106 | 1, 1, 1, 1, 1, 1, 1, | ||
107 | 1, 1, 1, 1, 1, 1, 1, | ||
108 | 1, 1, 1, 1, 1, 0, 0, | ||
109 | 0, 0, 0, 0, 0, 0, 0, | ||
110 | 0, 0, 0, 0, 0, 0, 0, | ||
111 | 0, 0, 0, 0, 0, 0, 0, | ||
112 | 0, 0, 0, 0, 0, 0, 0, | ||
113 | 0, 0, 0, 0, 0, 0, 0, | ||
114 | 0, 0, 0, 0, 0, 0, 0, | ||
115 | 0, 0, 0, 0, 0, 0, 0, | ||
116 | 0, 0, 0, 0, 0, 0, 0, | ||
117 | 0, 0, 0, 0, 0, 0, 0, | ||
118 | 0, 0, 0, 0, 0, 0, 0, | ||
119 | 0, 0, 0, 0, 0, 0, 0, | ||
120 | 0, 0, 0, 0, 0, 0, 0, | ||
121 | 0, 0, 0, 0, 0, 0, 0, | ||
122 | 0, 0, 0, 0, 0, 0, 0, | ||
123 | 0, 0, 0, 0, 0, 0, 0, | ||
124 | 0, 0, 0, 0, 0, 0, 0, | ||
125 | 0, 0, 0, 0, 0, 0, 0, | ||
126 | 0, 0, 0, 0, 0, 0, 0, | ||
127 | 0, 0, 0, 0, 0, 0, 0, | ||
128 | 0, 0, 0, 0, 0, 0, 0, | ||
129 | 0, 0, 0, 0, 0, 0, 0, | ||
130 | 0, 0, 0, 0, 0, 0, 0, | ||
131 | 0, 0, 0, 0, 0, 0, 0, | ||
132 | 0, 0, 0, 0, 0, 0, 0, | ||
133 | 0, 0, 0, 0, 0, 0, 0, | ||
134 | 0, 0, 0, 0, 0, 0, 0, | ||
135 | 0, 0, 0, 0, 0, 0, 0, | ||
136 | 0, 0, 0, 0, 0, 0, 0, | ||
137 | 0, 0, 0, 0, 0, 0, 0, | ||
138 | 0, 0, 0, 0, 0, 0, 0, | ||
139 | 0, 0, 0, 0, 0, 0, 0, | ||
140 | 0, 0, 0, 0, 0, 0, 0, | ||
141 | 0, 0, 0, 0, 0, 0, 0, | ||
142 | 0, 0, 0, 0, 0, 0, 0, | ||
143 | 0, 0, 0, 0, 0, 0, 0, | ||
144 | 0, 0, 0, 0, 0, 0, 0, | ||
145 | 0, | ||
146 | }; | ||
147 | |||
148 | static const e_uint16 ar_adjust_coeff[] ICONST_ATTR = { | ||
149 | 127, 108, 98, 90, 84, 80, 75, | ||
150 | 72, 69, 66, 64, 61, 59, 57, | ||
151 | 56, 54, 52, 51, 49, 48, 47, | ||
152 | 45, 44, 43, 42, 41, 40, 39, | ||
153 | 38, 37, 36, 36, 35, 34, 33, | ||
154 | 33, 32, 31, 30, 30, 29, 29, | ||
155 | 28, 27, 27, 26, 26, 25, 24, | ||
156 | 24, 23, 23, 22, 22, 21, 21, | ||
157 | 21, 20, 20, 19, 19, 18, 18, | ||
158 | 17, 17, 17, 16, 16, 15, 15, | ||
159 | 15, 14, 14, 14, 13, 13, 13, | ||
160 | 12, 12, 12, 11, 11, 11, 10, | ||
161 | 10, 10, 9, 9, 9, 9, 8, | ||
162 | 8, 8, 7, 7, 7, 7, 6, | ||
163 | 6, 6, 6, 5, 5, 5, 4, | ||
164 | 4, 4, 4, 4, 3, 3, 3, | ||
165 | 3, 2, 2, 2, 2, 1, 1, | ||
166 | 1, 1, 1, 0, 0, 0, 0, | ||
167 | 0, | ||
168 | }; | ||
169 | |||
170 | #endif | ||