From acb0917556fc33681c1df5a530cf754193e67705 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sun, 7 Aug 2011 20:01:04 +0000 Subject: 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 --- apps/codecs/libgme/emutables.h | 170 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 apps/codecs/libgme/emutables.h (limited to 'apps/codecs/libgme/emutables.h') 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 @@ +#ifndef _EMUTABLES_H_ +#define _EMUTABLES_H_ + +/* Precalculated emu2413 tables for use in Rockbox, + Calculated for 44Khz sampling rate */ + +#include "emutypes.h" + +static const e_uint16 sin_coeff[] ICONST_ATTR = { + 255, 203, 171, 152, 139, 129, 120, + 113, 107, 102, 97, 92, 88, 85, + 81, 78, 75, 72, 70, 67, 65, + 63, 61, 59, 57, 55, 53, 52, + 50, 48, 47, 45, 44, 43, 41, + 40, 39, 38, 37, 35, 34, 33, + 32, 31, 30, 29, 28, 28, 27, + 26, 25, 24, 23, 23, 22, 21, + 21, 20, 19, 19, 18, 17, 17, + 16, 16, 15, 14, 14, 13, 13, + 12, 12, 11, 11, 11, 10, 10, + 9, 9, 8, 8, 8, 7, 7, + 7, 6, 6, 6, 5, 5, 5, + 4, 4, 4, 4, 3, 3, 3, + 3, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, +}; + +static const e_int32 pm_coeff[] ICONST_ATTR = { + 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, + 258, 258, 258, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 257, + 257, 257, 257, 257, 257, 257, 256, + 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 254, + 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 253, 254, 254, 254, + 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 254, 254, + 254, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, +}; + +static const e_int16 db2lin_coeff[] ICONST_ATTR = { + 255, 249, 244, 239, 233, 228, 224, + 219, 214, 209, 205, 201, 196, 192, + 188, 184, 180, 176, 172, 169, 165, + 162, 158, 155, 151, 148, 145, 142, + 139, 136, 133, 130, 127, 125, 122, + 119, 117, 114, 112, 109, 107, 105, + 102, 100, 98, 96, 94, 92, 90, + 88, 86, 84, 82, 81, 79, 77, + 76, 74, 72, 71, 69, 68, 66, + 65, 64, 62, 61, 60, 58, 57, + 56, 55, 53, 52, 51, 50, 49, + 48, 47, 46, 45, 44, 43, 42, + 41, 40, 39, 38, 38, 37, 36, + 35, 34, 34, 33, 32, 32, 31, + 30, 30, 29, 28, 28, 27, 27, + 26, 25, 25, 24, 24, 23, 23, + 22, 22, 21, 21, 20, 20, 19, + 19, 19, 18, 18, 17, 17, 17, + 16, 16, 16, 15, 15, 15, 14, + 14, 14, 13, 13, 13, 12, 12, + 12, 12, 11, 11, 11, 11, 10, + 10, 10, 10, 10, 9, 9, 9, + 9, 8, 8, 8, 8, 8, 8, + 7, 7, 7, 7, 7, 7, 6, + 6, 6, 6, 6, 6, 6, 5, + 5, 5, 5, 5, 5, 5, 5, + 5, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, + 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, + 0, +}; + +static const e_uint16 ar_adjust_coeff[] ICONST_ATTR = { + 127, 108, 98, 90, 84, 80, 75, + 72, 69, 66, 64, 61, 59, 57, + 56, 54, 52, 51, 49, 48, 47, + 45, 44, 43, 42, 41, 40, 39, + 38, 37, 36, 36, 35, 34, 33, + 33, 32, 31, 30, 30, 29, 29, + 28, 27, 27, 26, 26, 25, 24, + 24, 23, 23, 22, 22, 21, 21, + 21, 20, 20, 19, 19, 18, 18, + 17, 17, 17, 16, 16, 15, 15, + 15, 14, 14, 14, 13, 13, 13, + 12, 12, 12, 11, 11, 11, 10, + 10, 10, 9, 9, 9, 9, 8, + 8, 8, 7, 7, 7, 7, 6, + 6, 6, 6, 5, 5, 5, 4, + 4, 4, 4, 4, 3, 3, 3, + 3, 2, 2, 2, 2, 1, 1, + 1, 1, 1, 0, 0, 0, 0, + 0, +}; + +#endif -- cgit v1.2.3