shithub: ft²

ref: 60a3dd36bb82179a0768a4ebeb4f7c632cdd59bf
dir: /src/ft2_tables.c/

View raw version
#include <stdint.h>
#include <stdbool.h>
#include "ft2_palette.h" // pal16 typedef
#include "ft2_pattern_ed.h" // pattCoord_t/pattCoord2_t/pattCoordsMouse_t/markCoord_t typedef
#include "ft2_header.h" // MAX_VOICES
#include "ft2_config.h" // CONFIG_FILE_SIZE
#include "ft2_bmp.h"

/* ----------------------------------------------------------------------- */
/*                             REPLAYER TABLES                             */
/* ----------------------------------------------------------------------- */

const uint8_t arpTab[100] =
{
	0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,
	
	/* The following are overflown bytes from FT2's binary.
	** (confirmed to be the same on FT2.08 and FT2.09)
	*/
	0x00, 0x18, 0x31, 0x4A, 0x61, 0x78, 0x8D, 0xA1, 0xB4, 0xC5, 0xD4,
	0xE0, 0xEB, 0xF4, 0xFA, 0xFD, 0xFF, 0xFD, 0xFA, 0xF4, 0xEB, 0xE0,
	0xD4, 0xC5, 0xB4, 0xA1, 0x8D, 0x78, 0x61, 0x4A, 0x31, 0x18, 0x01,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x02,
	0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x06, 0x00, 0x00, 0x07, 0x00,
	0x01, 0x00, 0x02, 0x00, 0x03, 0x04, 0x05, 0x00, 0x00, 0x0B, 0x00,
	0x0A, 0x02, 0x01, 0x03, 0x04, 0x07, 0x00, 0x05, 0x06, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
};

const int8_t vibSineTab[256] = // for auto-vibrato
{
	  0,  -2,  -3,  -5,  -6,  -8,  -9, -11, -12, -14, -16, -17, -19, -20, -22, -23,
	-24, -26, -27, -29, -30, -32, -33, -34, -36, -37, -38, -39, -41, -42, -43, -44,
	-45, -46, -47, -48, -49, -50, -51, -52, -53, -54, -55, -56, -56, -57, -58, -59,
	-59, -60, -60, -61, -61, -62, -62, -62, -63, -63, -63, -64, -64, -64, -64, -64,
	-64, -64, -64, -64, -64, -64, -63, -63, -63, -62, -62, -62, -61, -61, -60, -60,
	-59, -59, -58, -57, -56, -56, -55, -54, -53, -52, -51, -50, -49, -48, -47, -46,
	-45, -44, -43, -42, -41, -39, -38, -37, -36, -34, -33, -32, -30, -29, -27, -26,
	-24, -23, -22, -20, -19, -17, -16, -14, -12, -11,  -9,  -8,  -6,  -5,  -3,  -2,
	  0,   2,   3,   5,   6,   8,   9,  11,  12,  14,  16,  17,  19,  20,  22,  23,
	 24,  26,  27,  29,  30,  32,  33,  34,  36,  37,  38,  39,  41,  42,  43,  44,
	 45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  56,  57,  58,  59,
	 59,  60,  60,  61,  61,  62,  62,  62,  63,  63,  63,  64,  64,  64,  64,  64,
	 64,  64,  64,  64,  64,  64,  63,  63,  63,  62,  62,  62,  61,  61,  60,  60,
	 59,  59,  58,  57,  56,  56,  55,  54,  53,  52,  51,  50,  49,  48,  47,  46,
	 45,  44,  43,  42,  41,  39,  38,  37,  36,  34,  33,  32,  30,  29,  27,  26,
	 24,  23,  22,  20,  19,  17,  16,  14,  12,  11,   9,   8,   6,   5,   3,   2
};

const uint8_t vibTab[32] = // for normal vibrato/tremolo
{
	  0, 24, 49, 74, 97,120,141,161,180,197,212,224,235,244,250,253,
	255,253,250,244,235,224,212,197,180,161,141,120, 97, 74, 49, 24
};

const uint16_t amigaPeriod[12 * 8] = // used for .MOD loading/saving
{
	6848, 6464, 6096, 5760, 5424, 5120, 4832, 4560, 4304, 4064, 3840, 3624,
	3424, 3232, 3048, 2880, 2712, 2560, 2416, 2280, 2152, 2032, 1920, 1812,
	1712, 1616, 1524, 1440, 1356, 1280, 1208, 1140, 1076, 1016,  960,  906,
	 856,  808,  762,  720,  678,  640,  604,  570,  538,  508,  480,  453,
	 428,  404,  381,  360,  339,  320,  302,  285,  269,  254,  240,  226,
	 214,  202,  190,  180,  170,  160,  151,  143,  135,  127,  120,  113,
	 107,  101,   95,   90,   85,   80,   75,   71,   67,   63,   60,   56,
	  53,   50,   47,   45,   42,   40,   37,   35,   33,   31,   30,   28
};

const uint16_t linearPeriods[1936] = // bit-exact to FT2 table
{
	7744, 7740, 7736, 7732, 7728, 7724, 7720, 7716, 7712, 7708, 7704, 7700, 7696, 7692, 7688, 7684,
	7680, 7676, 7672, 7668, 7664, 7660, 7656, 7652, 7648, 7644, 7640, 7636, 7632, 7628, 7624, 7620,
	7616, 7612, 7608, 7604, 7600, 7596, 7592, 7588, 7584, 7580, 7576, 7572, 7568, 7564, 7560, 7556,
	7552, 7548, 7544, 7540, 7536, 7532, 7528, 7524, 7520, 7516, 7512, 7508, 7504, 7500, 7496, 7492,
	7488, 7484, 7480, 7476, 7472, 7468, 7464, 7460, 7456, 7452, 7448, 7444, 7440, 7436, 7432, 7428,
	7424, 7420, 7416, 7412, 7408, 7404, 7400, 7396, 7392, 7388, 7384, 7380, 7376, 7372, 7368, 7364,
	7360, 7356, 7352, 7348, 7344, 7340, 7336, 7332, 7328, 7324, 7320, 7316, 7312, 7308, 7304, 7300,
	7296, 7292, 7288, 7284, 7280, 7276, 7272, 7268, 7264, 7260, 7256, 7252, 7248, 7244, 7240, 7236,
	7232, 7228, 7224, 7220, 7216, 7212, 7208, 7204, 7200, 7196, 7192, 7188, 7184, 7180, 7176, 7172,
	7168, 7164, 7160, 7156, 7152, 7148, 7144, 7140, 7136, 7132, 7128, 7124, 7120, 7116, 7112, 7108,
	7104, 7100, 7096, 7092, 7088, 7084, 7080, 7076, 7072, 7068, 7064, 7060, 7056, 7052, 7048, 7044,
	7040, 7036, 7032, 7028, 7024, 7020, 7016, 7012, 7008, 7004, 7000, 6996, 6992, 6988, 6984, 6980,
	6976, 6972, 6968, 6964, 6960, 6956, 6952, 6948, 6944, 6940, 6936, 6932, 6928, 6924, 6920, 6916,
	6912, 6908, 6904, 6900, 6896, 6892, 6888, 6884, 6880, 6876, 6872, 6868, 6864, 6860, 6856, 6852,
	6848, 6844, 6840, 6836, 6832, 6828, 6824, 6820, 6816, 6812, 6808, 6804, 6800, 6796, 6792, 6788,
	6784, 6780, 6776, 6772, 6768, 6764, 6760, 6756, 6752, 6748, 6744, 6740, 6736, 6732, 6728, 6724,
	6720, 6716, 6712, 6708, 6704, 6700, 6696, 6692, 6688, 6684, 6680, 6676, 6672, 6668, 6664, 6660,
	6656, 6652, 6648, 6644, 6640, 6636, 6632, 6628, 6624, 6620, 6616, 6612, 6608, 6604, 6600, 6596,
	6592, 6588, 6584, 6580, 6576, 6572, 6568, 6564, 6560, 6556, 6552, 6548, 6544, 6540, 6536, 6532,
	6528, 6524, 6520, 6516, 6512, 6508, 6504, 6500, 6496, 6492, 6488, 6484, 6480, 6476, 6472, 6468,
	6464, 6460, 6456, 6452, 6448, 6444, 6440, 6436, 6432, 6428, 6424, 6420, 6416, 6412, 6408, 6404,
	6400, 6396, 6392, 6388, 6384, 6380, 6376, 6372, 6368, 6364, 6360, 6356, 6352, 6348, 6344, 6340,
	6336, 6332, 6328, 6324, 6320, 6316, 6312, 6308, 6304, 6300, 6296, 6292, 6288, 6284, 6280, 6276,
	6272, 6268, 6264, 6260, 6256, 6252, 6248, 6244, 6240, 6236, 6232, 6228, 6224, 6220, 6216, 6212,
	6208, 6204, 6200, 6196, 6192, 6188, 6184, 6180, 6176, 6172, 6168, 6164, 6160, 6156, 6152, 6148,
	6144, 6140, 6136, 6132, 6128, 6124, 6120, 6116, 6112, 6108, 6104, 6100, 6096, 6092, 6088, 6084,
	6080, 6076, 6072, 6068, 6064, 6060, 6056, 6052, 6048, 6044, 6040, 6036, 6032, 6028, 6024, 6020,
	6016, 6012, 6008, 6004, 6000, 5996, 5992, 5988, 5984, 5980, 5976, 5972, 5968, 5964, 5960, 5956,
	5952, 5948, 5944, 5940, 5936, 5932, 5928, 5924, 5920, 5916, 5912, 5908, 5904, 5900, 5896, 5892,
	5888, 5884, 5880, 5876, 5872, 5868, 5864, 5860, 5856, 5852, 5848, 5844, 5840, 5836, 5832, 5828,
	5824, 5820, 5816, 5812, 5808, 5804, 5800, 5796, 5792, 5788, 5784, 5780, 5776, 5772, 5768, 5764,
	5760, 5756, 5752, 5748, 5744, 5740, 5736, 5732, 5728, 5724, 5720, 5716, 5712, 5708, 5704, 5700,
	5696, 5692, 5688, 5684, 5680, 5676, 5672, 5668, 5664, 5660, 5656, 5652, 5648, 5644, 5640, 5636,
	5632, 5628, 5624, 5620, 5616, 5612, 5608, 5604, 5600, 5596, 5592, 5588, 5584, 5580, 5576, 5572,
	5568, 5564, 5560, 5556, 5552, 5548, 5544, 5540, 5536, 5532, 5528, 5524, 5520, 5516, 5512, 5508,
	5504, 5500, 5496, 5492, 5488, 5484, 5480, 5476, 5472, 5468, 5464, 5460, 5456, 5452, 5448, 5444,
	5440, 5436, 5432, 5428, 5424, 5420, 5416, 5412, 5408, 5404, 5400, 5396, 5392, 5388, 5384, 5380,
	5376, 5372, 5368, 5364, 5360, 5356, 5352, 5348, 5344, 5340, 5336, 5332, 5328, 5324, 5320, 5316,
	5312, 5308, 5304, 5300, 5296, 5292, 5288, 5284, 5280, 5276, 5272, 5268, 5264, 5260, 5256, 5252,
	5248, 5244, 5240, 5236, 5232, 5228, 5224, 5220, 5216, 5212, 5208, 5204, 5200, 5196, 5192, 5188,
	5184, 5180, 5176, 5172, 5168, 5164, 5160, 5156, 5152, 5148, 5144, 5140, 5136, 5132, 5128, 5124,
	5120, 5116, 5112, 5108, 5104, 5100, 5096, 5092, 5088, 5084, 5080, 5076, 5072, 5068, 5064, 5060,
	5056, 5052, 5048, 5044, 5040, 5036, 5032, 5028, 5024, 5020, 5016, 5012, 5008, 5004, 5000, 4996,
	4992, 4988, 4984, 4980, 4976, 4972, 4968, 4964, 4960, 4956, 4952, 4948, 4944, 4940, 4936, 4932,
	4928, 4924, 4920, 4916, 4912, 4908, 4904, 4900, 4896, 4892, 4888, 4884, 4880, 4876, 4872, 4868,
	4864, 4860, 4856, 4852, 4848, 4844, 4840, 4836, 4832, 4828, 4824, 4820, 4816, 4812, 4808, 4804,
	4800, 4796, 4792, 4788, 4784, 4780, 4776, 4772, 4768, 4764, 4760, 4756, 4752, 4748, 4744, 4740,
	4736, 4732, 4728, 4724, 4720, 4716, 4712, 4708, 4704, 4700, 4696, 4692, 4688, 4684, 4680, 4676,
	4672, 4668, 4664, 4660, 4656, 4652, 4648, 4644, 4640, 4636, 4632, 4628, 4624, 4620, 4616, 4612,
	4608, 4604, 4600, 4596, 4592, 4588, 4584, 4580, 4576, 4572, 4568, 4564, 4560, 4556, 4552, 4548,
	4544, 4540, 4536, 4532, 4528, 4524, 4520, 4516, 4512, 4508, 4504, 4500, 4496, 4492, 4488, 4484,
	4480, 4476, 4472, 4468, 4464, 4460, 4456, 4452, 4448, 4444, 4440, 4436, 4432, 4428, 4424, 4420,
	4416, 4412, 4408, 4404, 4400, 4396, 4392, 4388, 4384, 4380, 4376, 4372, 4368, 4364, 4360, 4356,
	4352, 4348, 4344, 4340, 4336, 4332, 4328, 4324, 4320, 4316, 4312, 4308, 4304, 4300, 4296, 4292,
	4288, 4284, 4280, 4276, 4272, 4268, 4264, 4260, 4256, 4252, 4248, 4244, 4240, 4236, 4232, 4228,
	4224, 4220, 4216, 4212, 4208, 4204, 4200, 4196, 4192, 4188, 4184, 4180, 4176, 4172, 4168, 4164,
	4160, 4156, 4152, 4148, 4144, 4140, 4136, 4132, 4128, 4124, 4120, 4116, 4112, 4108, 4104, 4100,
	4096, 4092, 4088, 4084, 4080, 4076, 4072, 4068, 4064, 4060, 4056, 4052, 4048, 4044, 4040, 4036,
	4032, 4028, 4024, 4020, 4016, 4012, 4008, 4004, 4000, 3996, 3992, 3988, 3984, 3980, 3976, 3972,
	3968, 3964, 3960, 3956, 3952, 3948, 3944, 3940, 3936, 3932, 3928, 3924, 3920, 3916, 3912, 3908,
	3904, 3900, 3896, 3892, 3888, 3884, 3880, 3876, 3872, 3868, 3864, 3860, 3856, 3852, 3848, 3844,
	3840, 3836, 3832, 3828, 3824, 3820, 3816, 3812, 3808, 3804, 3800, 3796, 3792, 3788, 3784, 3780,
	3776, 3772, 3768, 3764, 3760, 3756, 3752, 3748, 3744, 3740, 3736, 3732, 3728, 3724, 3720, 3716,
	3712, 3708, 3704, 3700, 3696, 3692, 3688, 3684, 3680, 3676, 3672, 3668, 3664, 3660, 3656, 3652,
	3648, 3644, 3640, 3636, 3632, 3628, 3624, 3620, 3616, 3612, 3608, 3604, 3600, 3596, 3592, 3588,
	3584, 3580, 3576, 3572, 3568, 3564, 3560, 3556, 3552, 3548, 3544, 3540, 3536, 3532, 3528, 3524,
	3520, 3516, 3512, 3508, 3504, 3500, 3496, 3492, 3488, 3484, 3480, 3476, 3472, 3468, 3464, 3460,
	3456, 3452, 3448, 3444, 3440, 3436, 3432, 3428, 3424, 3420, 3416, 3412, 3408, 3404, 3400, 3396,
	3392, 3388, 3384, 3380, 3376, 3372, 3368, 3364, 3360, 3356, 3352, 3348, 3344, 3340, 3336, 3332,
	3328, 3324, 3320, 3316, 3312, 3308, 3304, 3300, 3296, 3292, 3288, 3284, 3280, 3276, 3272, 3268,
	3264, 3260, 3256, 3252, 3248, 3244, 3240, 3236, 3232, 3228, 3224, 3220, 3216, 3212, 3208, 3204,
	3200, 3196, 3192, 3188, 3184, 3180, 3176, 3172, 3168, 3164, 3160, 3156, 3152, 3148, 3144, 3140,
	3136, 3132, 3128, 3124, 3120, 3116, 3112, 3108, 3104, 3100, 3096, 3092, 3088, 3084, 3080, 3076,
	3072, 3068, 3064, 3060, 3056, 3052, 3048, 3044, 3040, 3036, 3032, 3028, 3024, 3020, 3016, 3012,
	3008, 3004, 3000, 2996, 2992, 2988, 2984, 2980, 2976, 2972, 2968, 2964, 2960, 2956, 2952, 2948,
	2944, 2940, 2936, 2932, 2928, 2924, 2920, 2916, 2912, 2908, 2904, 2900, 2896, 2892, 2888, 2884,
	2880, 2876, 2872, 2868, 2864, 2860, 2856, 2852, 2848, 2844, 2840, 2836, 2832, 2828, 2824, 2820,
	2816, 2812, 2808, 2804, 2800, 2796, 2792, 2788, 2784, 2780, 2776, 2772, 2768, 2764, 2760, 2756,
	2752, 2748, 2744, 2740, 2736, 2732, 2728, 2724, 2720, 2716, 2712, 2708, 2704, 2700, 2696, 2692,
	2688, 2684, 2680, 2676, 2672, 2668, 2664, 2660, 2656, 2652, 2648, 2644, 2640, 2636, 2632, 2628,
	2624, 2620, 2616, 2612, 2608, 2604, 2600, 2596, 2592, 2588, 2584, 2580, 2576, 2572, 2568, 2564,
	2560, 2556, 2552, 2548, 2544, 2540, 2536, 2532, 2528, 2524, 2520, 2516, 2512, 2508, 2504, 2500,
	2496, 2492, 2488, 2484, 2480, 2476, 2472, 2468, 2464, 2460, 2456, 2452, 2448, 2444, 2440, 2436,
	2432, 2428, 2424, 2420, 2416, 2412, 2408, 2404, 2400, 2396, 2392, 2388, 2384, 2380, 2376, 2372,
	2368, 2364, 2360, 2356, 2352, 2348, 2344, 2340, 2336, 2332, 2328, 2324, 2320, 2316, 2312, 2308,
	2304, 2300, 2296, 2292, 2288, 2284, 2280, 2276, 2272, 2268, 2264, 2260, 2256, 2252, 2248, 2244,
	2240, 2236, 2232, 2228, 2224, 2220, 2216, 2212, 2208, 2204, 2200, 2196, 2192, 2188, 2184, 2180,
	2176, 2172, 2168, 2164, 2160, 2156, 2152, 2148, 2144, 2140, 2136, 2132, 2128, 2124, 2120, 2116,
	2112, 2108, 2104, 2100, 2096, 2092, 2088, 2084, 2080, 2076, 2072, 2068, 2064, 2060, 2056, 2052,
	2048, 2044, 2040, 2036, 2032, 2028, 2024, 2020, 2016, 2012, 2008, 2004, 2000, 1996, 1992, 1988,
	1984, 1980, 1976, 1972, 1968, 1964, 1960, 1956, 1952, 1948, 1944, 1940, 1936, 1932, 1928, 1924,
	1920, 1916, 1912, 1908, 1904, 1900, 1896, 1892, 1888, 1884, 1880, 1876, 1872, 1868, 1864, 1860,
	1856, 1852, 1848, 1844, 1840, 1836, 1832, 1828, 1824, 1820, 1816, 1812, 1808, 1804, 1800, 1796,
	1792, 1788, 1784, 1780, 1776, 1772, 1768, 1764, 1760, 1756, 1752, 1748, 1744, 1740, 1736, 1732,
	1728, 1724, 1720, 1716, 1712, 1708, 1704, 1700, 1696, 1692, 1688, 1684, 1680, 1676, 1672, 1668,
	1664, 1660, 1656, 1652, 1648, 1644, 1640, 1636, 1632, 1628, 1624, 1620, 1616, 1612, 1608, 1604,
	1600, 1596, 1592, 1588, 1584, 1580, 1576, 1572, 1568, 1564, 1560, 1556, 1552, 1548, 1544, 1540,
	1536, 1532, 1528, 1524, 1520, 1516, 1512, 1508, 1504, 1500, 1496, 1492, 1488, 1484, 1480, 1476,
	1472, 1468, 1464, 1460, 1456, 1452, 1448, 1444, 1440, 1436, 1432, 1428, 1424, 1420, 1416, 1412,
	1408, 1404, 1400, 1396, 1392, 1388, 1384, 1380, 1376, 1372, 1368, 1364, 1360, 1356, 1352, 1348,
	1344, 1340, 1336, 1332, 1328, 1324, 1320, 1316, 1312, 1308, 1304, 1300, 1296, 1292, 1288, 1284,
	1280, 1276, 1272, 1268, 1264, 1260, 1256, 1252, 1248, 1244, 1240, 1236, 1232, 1228, 1224, 1220,
	1216, 1212, 1208, 1204, 1200, 1196, 1192, 1188, 1184, 1180, 1176, 1172, 1168, 1164, 1160, 1156,
	1152, 1148, 1144, 1140, 1136, 1132, 1128, 1124, 1120, 1116, 1112, 1108, 1104, 1100, 1096, 1092,
	1088, 1084, 1080, 1076, 1072, 1068, 1064, 1060, 1056, 1052, 1048, 1044, 1040, 1036, 1032, 1028,
	1024, 1020, 1016, 1012, 1008, 1004, 1000,  996,  992,  988,  984,  980,  976,  972,  968,  964,
	 960,  956,  952,  948,  944,  940,  936,  932,  928,  924,  920,  916,  912,  908,  904,  900,
	 896,  892,  888,  884,  880,  876,  872,  868,  864,  860,  856,  852,  848,  844,  840,  836,
	 832,  828,  824,  820,  816,  812,  808,  804,  800,  796,  792,  788,  784,  780,  776,  772,
	 768,  764,  760,  756,  752,  748,  744,  740,  736,  732,  728,  724,  720,  716,  712,  708,
	 704,  700,  696,  692,  688,  684,  680,  676,  672,  668,  664,  660,  656,  652,  648,  644,
	 640,  636,  632,  628,  624,  620,  616,  612,  608,  604,  600,  596,  592,  588,  584,  580,
	 576,  572,  568,  564,  560,  556,  552,  548,  544,  540,  536,  532,  528,  524,  520,  516,
	 512,  508,  504,  500,  496,  492,  488,  484,  480,  476,  472,  468,  464,  460,  456,  452,
	 448,  444,  440,  436,  432,  428,  424,  420,  416,  412,  408,  404,  400,  396,  392,  388,
	 384,  380,  376,  372,  368,  364,  360,  356,  352,  348,  344,  340,  336,  332,  328,  324,
	 320,  316,  312,  308,  304,  300,  296,  292,  288,  284,  280,  276,  272,  268,  264,  260,
	 256,  252,  248,  244,  240,  236,  232,  228,  224,  220,  216,  212,  208,  204,  200,  196,
	 192,  188,  184,  180,  176,  172,  168,  164,  160,  156,  152,  148,  144,  140,  136,  132,
	 128,  124,  120,  116,  112,  108,  104,  100,   96,   92,   88,   84,   80,   76,   72,   68,
	  64,   60,   56,   52,   48,   44,   40,   36,   32,   28,   24,   20,   16,   12,    8,    4
};

const uint16_t amigaPeriods[1936] = // bit-exact to FT2 table
{
	29024, 28912, 28800, 28704, 28608, 28496, 28384, 28288, 28192, 28096, 28000, 27888, 27776, 27680, 27584, 27488,
	27392, 27296, 27200, 27104, 27008, 26912, 26816, 26720, 26624, 26528, 26432, 26336, 26240, 26144, 26048, 25952,
	25856, 25760, 25664, 25568, 25472, 25392, 25312, 25216, 25120, 25024, 24928, 24848, 24768, 24672, 24576, 24480,
	24384, 24304, 24224, 24144, 24064, 23968, 23872, 23792, 23712, 23632, 23552, 23456, 23360, 23280, 23200, 23120,
	23040, 22960, 22880, 22784, 22688, 22608, 22528, 22448, 22368, 22288, 22208, 22128, 22048, 21968, 21888, 21792,
	21696, 21648, 21600, 21520, 21440, 21360, 21280, 21200, 21120, 21040, 20960, 20896, 20832, 20752, 20672, 20576,
	20480, 20416, 20352, 20288, 20224, 20160, 20096, 20016, 19936, 19872, 19808, 19728, 19648, 19584, 19520, 19424,
	19328, 19280, 19232, 19168, 19104, 19024, 18944, 18880, 18816, 18752, 18688, 18624, 18560, 18480, 18400, 18320,
	18240, 18192, 18144, 18080, 18016, 17952, 17888, 17824, 17760, 17696, 17632, 17568, 17504, 17440, 17376, 17296,
	17216, 17168, 17120, 17072, 17024, 16960, 16896, 16832, 16768, 16704, 16640, 16576, 16512, 16464, 16416, 16336,
	16256, 16208, 16160, 16112, 16064, 16000, 15936, 15872, 15808, 15760, 15712, 15648, 15584, 15536, 15488, 15424,
	15360, 15312, 15264, 15216, 15168, 15104, 15040, 14992, 14944, 14880, 14816, 14768, 14720, 14672, 14624, 14568,
	14512, 14456, 14400, 14352, 14304, 14248, 14192, 14144, 14096, 14048, 14000, 13944, 13888, 13840, 13792, 13744,
	13696, 13648, 13600, 13552, 13504, 13456, 13408, 13360, 13312, 13264, 13216, 13168, 13120, 13072, 13024, 12976,
	12928, 12880, 12832, 12784, 12736, 12696, 12656, 12608, 12560, 12512, 12464, 12424, 12384, 12336, 12288, 12240,
	12192, 12152, 12112, 12072, 12032, 11984, 11936, 11896, 11856, 11816, 11776, 11728, 11680, 11640, 11600, 11560,
	11520, 11480, 11440, 11392, 11344, 11304, 11264, 11224, 11184, 11144, 11104, 11064, 11024, 10984, 10944, 10896,
	10848, 10824, 10800, 10760, 10720, 10680, 10640, 10600, 10560, 10520, 10480, 10448, 10416, 10376, 10336, 10288,
	10240, 10208, 10176, 10144, 10112, 10080, 10048, 10008,  9968,  9936,  9904,  9864,  9824,  9792,  9760,  9712,
	 9664,  9640,  9616,  9584,  9552,  9512,  9472,  9440,  9408,  9376,  9344,  9312,  9280,  9240,  9200,  9160,
	 9120,  9096,  9072,  9040,  9008,  8976,  8944,  8912,  8880,  8848,  8816,  8784,  8752,  8720,  8688,  8648,
	 8608,  8584,  8560,  8536,  8512,  8480,  8448,  8416,  8384,  8352,  8320,  8288,  8256,  8232,  8208,  8168,
	 8128,  8104,  8080,  8056,  8032,  8000,  7968,  7936,  7904,  7880,  7856,  7824,  7792,  7768,  7744,  7712,
	 7680,  7656,  7632,  7608,  7584,  7552,  7520,  7496,  7472,  7440,  7408,  7384,  7360,  7336,  7312,  7284,
	 7256,  7228,  7200,  7176,  7152,  7124,  7096,  7072,  7048,  7024,  7000,  6972,  6944,  6920,  6896,  6872,
	 6848,  6824,  6800,  6776,  6752,  6728,  6704,  6680,  6656,  6632,  6608,  6584,  6560,  6536,  6512,  6488,
	 6464,  6440,  6416,  6392,  6368,  6348,  6328,  6304,  6280,  6256,  6232,  6212,  6192,  6168,  6144,  6120,
	 6096,  6076,  6056,  6036,  6016,  5992,  5968,  5948,  5928,  5908,  5888,  5864,  5840,  5820,  5800,  5780,
	 5760,  5740,  5720,  5696,  5672,  5652,  5632,  5612,  5592,  5572,  5552,  5532,  5512,  5492,  5472,  5448,
	 5424,  5412,  5400,  5380,  5360,  5340,  5320,  5300,  5280,  5260,  5240,  5224,  5208,  5188,  5168,  5144,
	 5120,  5104,  5088,  5072,  5056,  5040,  5024,  5004,  4984,  4968,  4952,  4932,  4912,  4896,  4880,  4856,
	 4832,  4820,  4808,  4792,  4776,  4756,  4736,  4720,  4704,  4688,  4672,  4656,  4640,  4620,  4600,  4580,
	 4560,  4548,  4536,  4520,  4504,  4488,  4472,  4456,  4440,  4424,  4408,  4392,  4376,  4360,  4344,  4324,
	 4304,  4292,  4280,  4268,  4256,  4240,  4224,  4208,  4192,  4176,  4160,  4144,  4128,  4116,  4104,  4084,
	 4064,  4052,  4040,  4028,  4016,  4000,  3984,  3968,  3952,  3940,  3928,  3912,  3896,  3884,  3872,  3856,
	 3840,  3828,  3816,  3804,  3792,  3776,  3760,  3748,  3736,  3720,  3704,  3692,  3680,  3668,  3656,  3642,
	 3628,  3614,  3600,  3588,  3576,  3562,  3548,  3536,  3524,  3512,  3500,  3486,  3472,  3460,  3448,  3436,
	 3424,  3412,  3400,  3388,  3376,  3364,  3352,  3340,  3328,  3316,  3304,  3292,  3280,  3268,  3256,  3244,
	 3232,  3220,  3208,  3196,  3184,  3174,  3164,  3152,  3140,  3128,  3116,  3106,  3096,  3084,  3072,  3060,
	 3048,  3038,  3028,  3018,  3008,  2996,  2984,  2974,  2964,  2954,  2944,  2932,  2920,  2910,  2900,  2890,
	 2880,  2870,  2860,  2848,  2836,  2826,  2816,  2806,  2796,  2786,  2776,  2766,  2756,  2746,  2736,  2724,
	 2712,  2706,  2700,  2690,  2680,  2670,  2660,  2650,  2640,  2630,  2620,  2612,  2604,  2594,  2584,  2572,
	 2560,  2552,  2544,  2536,  2528,  2520,  2512,  2502,  2492,  2484,  2476,  2466,  2456,  2448,  2440,  2428,
	 2416,  2410,  2404,  2396,  2388,  2378,  2368,  2360,  2352,  2344,  2336,  2328,  2320,  2310,  2300,  2290,
	 2280,  2274,  2268,  2260,  2252,  2244,  2236,  2228,  2220,  2212,  2204,  2196,  2188,  2180,  2172,  2162,
	 2152,  2146,  2140,  2134,  2128,  2120,  2112,  2104,  2096,  2088,  2080,  2072,  2064,  2058,  2052,  2042,
	 2032,  2026,  2020,  2014,  2008,  2000,  1992,  1984,  1976,  1970,  1964,  1956,  1948,  1942,  1936,  1928,
	 1920,  1914,  1908,  1902,  1896,  1888,  1880,  1874,  1868,  1860,  1852,  1846,  1840,  1834,  1828,  1821,
	 1814,  1807,  1800,  1794,  1788,  1781,  1774,  1768,  1762,  1756,  1750,  1743,  1736,  1730,  1724,  1718,
	 1712,  1706,  1700,  1694,  1688,  1682,  1676,  1670,  1664,  1658,  1652,  1646,  1640,  1634,  1628,  1622,
	 1616,  1610,  1604,  1598,  1592,  1587,  1582,  1576,  1570,  1564,  1558,  1553,  1548,  1542,  1536,  1530,
	 1524,  1519,  1514,  1509,  1504,  1498,  1492,  1487,  1482,  1477,  1472,  1466,  1460,  1455,  1450,  1445,
	 1440,  1435,  1430,  1424,  1418,  1413,  1408,  1403,  1398,  1393,  1388,  1383,  1378,  1373,  1368,  1362,
	 1356,  1353,  1350,  1345,  1340,  1335,  1330,  1325,  1320,  1315,  1310,  1306,  1302,  1297,  1292,  1286,
	 1280,  1276,  1272,  1268,  1264,  1260,  1256,  1251,  1246,  1242,  1238,  1233,  1228,  1224,  1220,  1214,
	 1208,  1205,  1202,  1198,  1194,  1189,  1184,  1180,  1176,  1172,  1168,  1164,  1160,  1155,  1150,  1145,
	 1140,  1137,  1134,  1130,  1126,  1122,  1118,  1114,  1110,  1106,  1102,  1098,  1094,  1090,  1086,  1081,
	 1076,  1073,  1070,  1067,  1064,  1060,  1056,  1052,  1048,  1044,  1040,  1036,  1032,  1029,  1026,  1021,
	 1016,  1013,  1010,  1007,  1004,  1000,   996,   992,   988,   985,   982,   978,   974,   971,   968,   964,
	  960,   957,   954,   951,   948,   944,   940,   937,   934,   930,   926,   923,   920,   917,   914,   910,
	  907,   903,   900,   897,   894,   890,   887,   884,   881,   878,   875,   871,   868,   865,   862,   859,
	  856,   853,   850,   847,   844,   841,   838,   835,   832,   829,   826,   823,   820,   817,   814,   811,
	  808,   805,   802,   799,   796,   793,   791,   788,   785,   782,   779,   776,   774,   771,   768,   765,
	  762,   759,   757,   754,   752,   749,   746,   743,   741,   738,   736,   733,   730,   727,   725,   722,
	  720,   717,   715,   712,   709,   706,   704,   701,   699,   696,   694,   691,   689,   686,   684,   681,
	  678,   676,   675,   672,   670,   667,   665,   662,   660,   657,   655,   653,   651,   648,   646,   643,
	  640,   638,   636,   634,   632,   630,   628,   625,   623,   621,   619,   616,   614,   612,   610,   607,
	  604,   602,   601,   599,   597,   594,   592,   590,   588,   586,   584,   582,   580,   577,   575,   572,
	  570,   568,   567,   565,   563,   561,   559,   557,   555,   553,   551,   549,   547,   545,   543,   540,
	  538,   536,   535,   533,   532,   530,   528,   526,   524,   522,   520,   518,   516,   514,   513,   510,
	  508,   506,   505,   503,   502,   500,   498,   496,   494,   492,   491,   489,   487,   485,   484,   482,
	  480,   478,   477,   475,   474,   472,   470,   468,   467,   465,   463,   461,   460,   458,   457,   455,
	  453,   451,   450,   448,   447,   445,   443,   441,   440,   438,   437,   435,   434,   432,   431,   429,
	  428,   426,   425,   423,   422,   420,   419,   417,   416,   414,   413,   411,   410,   408,   407,   405,
	  404,   402,   401,   399,   398,   396,   395,   393,   392,   390,   389,   388,   387,   385,   384,   382,
	  381,   379,   378,   377,   376,   374,   373,   371,   370,   369,   368,   366,   365,   363,   362,   361,
	  360,   358,   357,   355,   354,   353,   352,   350,   349,   348,   347,   345,   344,   343,   342,   340,
	  339,   338,   337,   336,   335,   333,   332,   331,   330,   328,   327,   326,   325,   324,   323,   321,
	  320,   319,   318,   317,   316,   315,   314,   312,   311,   310,   309,   308,   307,   306,   305,   303,
	  302,   301,   300,   299,   298,   297,   296,   295,   294,   293,   292,   291,   290,   288,   287,   286,
	  285,   284,   283,   282,   281,   280,   279,   278,   277,   276,   275,   274,   273,   272,   271,   270,
	  269,   268,   267,   266,   266,   265,   264,   263,   262,   261,   260,   259,   258,   257,   256,   255,
	  254,   253,   252,   251,   251,   250,   249,   248,   247,   246,   245,   244,   243,   242,   242,   241,
	  240,   239,   238,   237,   237,   236,   235,   234,   233,   232,   231,   230,   230,   229,   228,   227,
	  227,   226,   225,   224,   223,   222,   222,   221,   220,   219,   219,   218,   217,   216,   215,   214,
	  214,   213,   212,   211,   211,   210,   209,   208,   208,   207,   206,   205,   205,   204,   203,   202,
	  202,   201,   200,   199,   199,   198,   198,   197,   196,   195,   195,   194,   193,   192,   192,   191,
	  190,   189,   189,   188,   188,   187,   186,   185,   185,   184,   184,   183,   182,   181,   181,   180,
	  180,   179,   179,   178,   177,   176,   176,   175,   175,   174,   173,   172,   172,   171,   171,   170,
	  169,   169,   169,   168,   167,   166,   166,   165,   165,   164,   164,   163,   163,   162,   161,   160,
	  160,   159,   159,   158,   158,   157,   157,   156,   156,   155,   155,   154,   153,   152,   152,   151,
	  151,   150,   150,   149,   149,   148,   148,   147,   147,   146,   146,   145,   145,   144,   144,   143,
	  142,   142,   142,   141,   141,   140,   140,   139,   139,   138,   138,   137,   137,   136,   136,   135,
	  134,   134,   134,   133,   133,   132,   132,   131,   131,   130,   130,   129,   129,   128,   128,   127,
	  127,   126,   126,   125,   125,   124,   124,   123,   123,   123,   123,   122,   122,   121,   121,   120,
	  120,   119,   119,   118,   118,   117,   117,   117,   117,   116,   116,   115,   115,   114,   114,   113,
	  113,   112,   112,   112,   112,   111,   111,   110,   110,   109,   109,   108,   108,   108,   108,   107,
	  107,   106,   106,   105,   105,   105,   105,   104,   104,   103,   103,   102,   102,   102,   102,   101,
	  101,   100,   100,    99,    99,    99,    99,    98,    98,    97,    97,    97,    97,    96,    96,    95,
	   95,    95,    95,    94,    94,    93,    93,    93,    93,    92,    92,    91,    91,    91,    91,    90,
	   90,    89,    89,    89,    89,    88,    88,    87,    87,    87,    87,    86,    86,    85,    85,    85,
	   85,    84,    84,    84,    84,    83,    83,    82,    82,    82,    82,    81,    81,    81,    81,    80,
	   80,    79,    79,    79,    79,    78,    78,    78,    78,    77,    77,    77,    77,    76,    76,    75,
	   75,    75,    75,    75,    75,    74,    74,    73,    73,    73,    73,    72,    72,    72,    72,    71,
	   71,    71,    71,    70,    70,    70,    70,    69,    69,    69,    69,    68,    68,    68,    68,    67,
	   67,    67,    67,    66,    66,    66,    66,    65,    65,    65,    65,    64,    64,    64,    64,    63,
	   63,    63,    63,    63,    63,    62,    62,    62,    62,    61,    61,    61,    61,    60,    60,    60,
	   60,    60,    60,    59,    59,    59,    59,    58,    58,    58,    58,    57,    57,    57,    57,    57,
	   57,    56,    56,    56,    56,    55,    55,    55,    55,    55,    55,    54,    54,    54,    54,    53,
	   53,    53,    53,    53,    53,    52,    52,    52,    52,    52,    52,    51,    51,    51,    51,    50,
	   50,    50,    50,    50,    50,    49,    49,    49,    49,    49,    49,    48,    48,    48,    48,    48,
	   48,    47,    47,    47,    47,    47,    47,    46,    46,    46,    46,    46,    46,    45,    45,    45,
	   45,    45,    45,    44,    44,    44,    44,    44,    44,    43,    43,    43,    43,    43,    43,    42,
	   42,    42,    42,    42,    42,    42,    42,    41,    41,    41,    41,    41,    41,    40,    40,    40,
	   40,    40,    40,    39,    39,    39,    39,    39,    39,    39,    39,    38,    38,    38,    38,    38,
	   38,    38,    38,    37,    37,    37,    37,    37,    37,    36,    36,    36,    36,    36,    36,    36,
	   36,    35,    35,    35,    35,    35,    35,    35,    35,    34,    34,    34,    34,    34,    34,    34,
	   34,    33,    33,    33,    33,    33,    33,    33,    33,    32,    32,    32,    32,    32,    32,    32,
	   32,    32,    32,    31,    31,    31,    31,    31,    31,    31,    31,    30,    30,    30,    30,    30,
	   30,    30,    30,    30,    30,    29,    29,    29,    29,    29,    29,    29,    29,    29,    29,    22,
	   16,     8,     0,    16,    32,    24,    16,     8,     0,    16,    32,    24,    16,     8,     0,     0
	   // the last 17 values are off (but identical to FT2) because of a bug in how FT2 calculates this table
};

/* ----------------------------------------------------------------------- */
/*                               GUI TABLES                                */
/* ----------------------------------------------------------------------- */

const char *dec2StrTab[100] =
{
	"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15",
	"16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31",
	"32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47",
	"48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63",
	"64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79",
	"80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95",
	"96","97","98","99"
};

const char *dec3StrTab[256] =
{
	"000","001","002","003","004","005","006","007","008","009","010","011","012","013","014","015",
	"016","017","018","019","020","021","022","023","024","025","026","027","028","029","030","031",
	"032","033","034","035","036","037","038","039","040","041","042","043","044","045","046","047",
	"048","049","050","051","052","053","054","055","056","057","058","059","060","061","062","063",
	"064","065","066","067","068","069","070","071","072","073","074","075","076","077","078","079",
	"080","081","082","083","084","085","086","087","088","089","090","091","092","093","094","095",
	"096","097","098","099","100","101","102","103","104","105","106","107","108","109","110","111",
	"112","113","114","115","116","117","118","119","120","121","122","123","124","125","126","127",
	"128","129","130","131","132","133","134","135","136","137","138","139","140","141","142","143",
	"144","145","146","147","148","149","150","151","152","153","154","155","156","157","158","159",
	"160","161","162","163","164","165","166","167","168","169","170","171","172","173","174","175",
	"176","177","178","179","180","181","182","183","184","185","186","187","188","189","190","191",
	"192","193","194","195","196","197","198","199","200","201","202","203","204","205","206","207",
	"208","209","210","211","212","213","214","215","216","217","218","219","220","221","222","223",
	"224","225","226","227","228","229","230","231","232","233","234","235","236","237","238","239",
	"240","241","242","243","244","245","246","247","248","249","250","251","252","253","254","255"
};

const uint8_t font1Widths[128] = // normal font
{
	8,8,4,6,7,6,7,6,6,6,6,6,6,6,8,8,
	6,6,6,7,7,7,7,7,7,8,7,8,8,8,8,8,
	4,3,8,8,8,8,8,4,5,5,8,7,4,7,3,8,
	7,7,7,7,7,7,7,7,7,7,3,8,8,8,8,8,
	8,8,8,8,8,8,8,8,8,3,8,8,8,9,9,8,
	8,8,8,8,9,8,8,9,9,9,8,8,8,8,4,8,
	8,7,7,7,7,7,5,7,7,3,5,7,3,9,7,7,
	7,7,5,7,5,7,8,9,8,7,7,8,2,6,7,1
};

const uint8_t font2Widths[128] = // big font
{
	16,16,16,16,14,16,14,16,16,16,16,16,16,16,16,16,
	16,16,16,16,14,16,16,16,16,16,16,16,16,16,16,16,
	10, 8,16,16,16,16,16,10,12,12,16,16,10,14, 8,16,
	16,16,16,16,16,16,16,16,16,16, 8,16,16,16,16,16,
	16,16,16,16,16,16,16,16,16, 6,14,16,15,16,16,16,
	16,17,16,16,16,16,16,16,16,16,17,16,16,16,16,16,
	16,14,14,14,14,14,12,14,14, 6,10,14, 6,17,14,14,
	14,14,13,14,12,14,14,17,16,14,16,16,16,16,16,16
};

pal16 palTable[12][16] = // FT2 palettes (18-bit VGA RGB, 16 color palette)
{
	{
		{0, 0, 0},{30, 38, 63},{0, 0, 17},{63, 63, 63},
		{27, 36, 40},{63, 63, 63},{40, 40, 40},{0, 0, 0},
		{10, 13, 14},{49, 63, 63},{15, 15, 15},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{21, 40, 63},{0, 0, 17},{63, 63, 63},
		{6, 39, 35},{63, 63, 63},{40, 40, 40},{0, 0, 0},
		{2, 14, 13},{11, 63, 63},{16, 16, 16},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{39, 52, 63},{8, 8, 13},{57, 57, 63},
		{10, 21, 33},{63, 63, 63},{37, 37, 45},{0, 0, 0},
		{4, 8, 13},{18, 37, 58},{13, 13, 16},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{47, 47, 47},{9, 9, 9},{63, 63, 63},
		{37, 29, 7},{63, 63, 63},{40, 40, 40},{0, 0, 0},
		{11, 9, 2},{63, 58, 14},{15, 15, 15},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{46, 45, 46},{13, 9, 9},{63, 63, 63},
		{22, 19, 22},{63, 63, 63},{36, 32, 34},{0, 0, 0},
		{8, 7, 8},{39, 34, 39},{13, 12, 12},{63, 58, 62},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{19, 49, 54},{0, 11, 7},{52, 63, 61},
		{9, 31, 21},{63, 63, 63},{40, 40, 40},{0, 0, 0},
		{4, 13, 9},{15, 50, 34},{15, 15, 15},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{27, 37, 53},{0, 0, 20},{63, 63, 63},
		{7, 12, 21},{63, 63, 63},{38, 39, 39},{0, 0, 0},
		{2, 4, 7},{14, 23, 41},{13, 13, 13},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{63, 54, 62},{18, 3, 3},{63, 63, 63},
		{36, 19, 25},{63, 63, 63},{40, 40, 40},{0, 0, 0},
		{11, 6, 8},{63, 38, 50},{15, 15, 15},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{ // "Space Pigs" -> new "Dark mode"
		{0, 0, 0},{31, 36, 42},{6, 6, 9},{47, 50, 54},
		{11, 12, 13},{55, 55, 56},{32, 32, 33},{0, 0, 0},
		{3, 4, 4},{22, 24, 26},{15, 15, 15},{50, 50, 52},
		{55, 55, 56},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{50, 46, 63},{15, 0, 16},{59, 58, 63},
		{34, 21, 41},{63, 63, 63},{40, 40, 40},{0, 0, 0},
		{13, 8, 15},{61, 37, 63},{15, 15, 15},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{63, 63, 32},{10, 10, 10},{63, 63, 63},
		{18, 29, 32},{63, 63, 63},{39, 39, 39},{0, 0, 0},
		{6, 10, 11},{34, 54, 60},{15, 15, 15},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	},
	{
		{0, 0, 0},{36, 47, 63},{9, 9, 16},{63, 63, 63},
		{19, 24, 38},{63, 63, 63},{39, 39, 39},{0, 0, 0},
		{8, 10, 15},{32, 41, 63},{15, 15, 15},{63, 63, 63},
		{63, 63, 63},{63, 63, 63},{63, 63, 63},{63, 63, 63}
	}
};

const uint16_t chanWidths[6] = { 141, 141, 93, 69, 45, 45 };

const pattCoordsMouse_t pattCoordMouseTable[2][2][2] =
{
	/*
		uint16_t upperRowsY, midRowY, lowerRowsY;
		uint16_t numUpperRows;
	*/

	// no pattern stretch
	{
		// no pattern channel scroll
		{
			{ 177, 281, 293, 13 }, //   normal pattern editor
			{  57, 217, 229, 20 }, // extended pattern editor
		},

		// pattern channel scroll
		{
			{ 177, 274, 286, 12 }, //   normal pattern editor
			{  57, 210, 222, 19 }, // extended pattern editor
		}
	},

	// pattern stretch
	{
		// no pattern channel scroll
		{
			{ 176, 275, 286,  9 }, //   normal pattern editor
			{  56, 221, 232, 15 }, // extended pattern editor
		},

		// pattern channel scroll
		{
			{ 175, 274, 284,  9 }, //   normal pattern editor
			{  55, 209, 219, 14 }, // extended pattern editor
		},
	}
};

const uint8_t noteTab1[96] =
{
	0,1,2,3,4,5,6,7,8,9,10,11,
	0,1,2,3,4,5,6,7,8,9,10,11,
	0,1,2,3,4,5,6,7,8,9,10,11,
	0,1,2,3,4,5,6,7,8,9,10,11,
	0,1,2,3,4,5,6,7,8,9,10,11,
	0,1,2,3,4,5,6,7,8,9,10,11,
	0,1,2,3,4,5,6,7,8,9,10,11,
	0,1,2,3,4,5,6,7,8,9,10,11
};

const uint8_t noteTab2[96] =
{
	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
};

const uint8_t hex2Dec[256] =
{
	  0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
	 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
	 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
	 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
	 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
	 96, 97, 98, 99,100,101,102,103,104,105,
	112,113,114,115,116,117,118,119,120,121,
	128,129,130,131,132,133,134,135,136,137,
	144,145,146,147,148,149,150,151,152,153,

	  0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
	 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
	 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
	 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
	 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
	 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
	 96, 97, 98, 99,100,101,102,103,104,105,
	112,113,114,115,116,117,118,119,120,121,
	128,129,130,131,132,133,134,135,136,137,
	144,145,146,147,148,149,150,151,152,153,

	 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
	16,17,18,19,20,21,22,23,24,25,
	32,33,34,35,36,37,38,39,40,41,
	48,49,50,51,52,53,54,55,56,57,
	64,65,66,67,68,69,70,71,72,73,
	80,81,82,83,84,85
};

const pattCoord_t pattCoordTable[2][2][2] =
{
	// no pattern stretch
	{
		// no pattern channel scroll
		{
			{ 176, 292, 177, 283, 293, 13, 13 }, // normal pattern editor
			{  56, 228,  57, 219, 229, 20, 21 }, // extended pattern editor
		},

		// pattern channel scroll
		{
			{ 176, 285, 177, 276, 286, 12, 12 }, // normal pattern editor
			{  56, 221,  57, 212, 222, 19, 20 }, // extended pattern editor
		}
	},

	// pattern stretch
	{
		// no pattern channel scroll
		{
			{ 177, 286, 178, 277, 288,  9, 10 }, // normal pattern editor
			{  56, 232,  58, 223, 234, 15, 15 }, // extended pattern editor
		},

		// pattern channel scroll
		{
			{  176, 285, 177, 276, 286,  9,  9 }, // normal pattern editor
			{   56, 220,  57, 211, 221, 14, 15 }, // extended pattern editor
		},
	}
};

const pattCoord2_t pattCoord2Table[2][2][2] =
{
	// no pattern stretch
	{
		// no pattern channel scroll
		{
			{ 175, 291, 107, 107 }, //   normal pattern editor
			{  55, 227, 163, 171 }, // extended pattern editor
		},

		// pattern channel scroll
		{
			{ 175, 284, 100, 100 }, //   normal pattern editor
			{  55, 220, 156, 164 }, // extended pattern editor
		}
	},

	// pattern stretch
	{
		// no pattern channel scroll
		{
			{ 175, 285, 101, 113 }, //   normal pattern editor
			{  55, 231, 167, 167 }, // extended pattern editor
		},

		// pattern channel scroll
		{
			{ 175, 284, 100, 100 }, //   normal pattern editor
			{  55, 219, 155, 165 }, // extended pattern editor
		},
	}
};

const markCoord_t markCoordTable[2][2][2] =
{
	// no pattern stretch
	{
		// no pattern channel scroll
		{
			{ 177, 281, 293 }, //   normal pattern editor
			{  57, 217, 229 }, // extended pattern editor
		},

		// pattern channel scroll
		{
			{ 177, 274, 286 }, //   normal pattern editor
			{  57, 210, 222 }, // extended pattern editor
		}
	},

	// pattern stretch
	{
		// no pattern channel scroll
		{
			{ 176, 275, 286 }, //   normal pattern editor
			{  56, 221, 232 }, // extended pattern editor
		},

		// pattern channel scroll
		{
			{ 175, 274, 284 }, //   normal pattern editor
			{  55, 209, 219 }, // extended pattern editor
		},
	}
};

const uint8_t pattCursorXTab[2 * 4 * 8] =
{
	// no volume column shown
	32, 88, 104, 0, 0, 120, 136, 152, //  4 columns visible
	32, 80,  88, 0, 0,  96, 104, 112, //  6 columns visible
	32, 56,  64, 0, 0,  72,  80,  88, //  8 columns visible
	32, 52,  56, 0, 0,  60,  64,  68, // 12 columns visible

	// volume column shown
	32, 96, 104, 120, 128, 144, 152, 160, //  4 columns visible
	32, 56,  64,  80,  88,  96, 104, 112, //  6 columns visible
	32, 60,  64,  72,  76,  84,  88,  92, //  8 columns visible
	32, 60,  64,  72,  76,  84,  88,  92, // 12 columns visible
};

const uint8_t pattCursorWTab[2 * 4 * 8] =
{
	// no volume column shown
	48, 16, 16, 0, 0, 16, 16, 16, //  4 columns visible
	48,  8,  8, 0, 0,  8,  8,  8, //  6 columns visible
	24,  8,  8, 0, 0,  8,  8,  8, //  8 columns visible
	16,  4,  4, 0, 0,  4,  4,  4, // 12 columns visible

	// volume column shown
	48,  8,  8,  8,  8,  8,  8,  8, //  4 columns visible
	24,  8,  8,  8,  8,  8,  8,  8, //  6 columns visible
	24,  4,  4,  4,  4,  4,  4,  4, //  8 columns visible
	24,  4,  4,  4,  4,  4,  4,  4  // 12 columns visible
};

// these two are for channel numbering on pattern data/scopes
const char chDecTab1[MAX_VOICES+1] = 
{
	'0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
	'1', '1', '1', '1', '1', '1', '1', '1', '1', '1',
	'2', '2', '2', '2', '2', '2', '2', '2', '2', '2',
	'3', '3', '3'
};

const char chDecTab2[MAX_VOICES+1] = 
{
	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
	'0', '1', '2'
};

const int16_t sinusTables[256 * 5] = // for 3D stars in About screen
{
	     0,    201,    402,    603,    804,   1005,   1206,   1407,   1608,   1809,
	  2009,   2210,   2410,   2611,   2811,   3011,   3212,   3412,   3612,   3811,
	  4011,   4210,   4410,   4609,   4808,   5007,   5205,   5404,   5602,   5800,
	  5997,   6195,   6392,   6589,   6786,   6983,   7179,   7375,   7571,   7766,
	  7961,   8156,   8351,   8545,   8739,   8933,   9126,   9319,   9511,   9704,
	  9896,  10087,  10278,  10469,  10659,  10849,  11039,  11228,  11416,  11605,
	 11792,  11980,  12167,  12353,  12539,  12725,  12910,  13094,  13278,  13462,
	 13645,  13827,  14009,  14191,  14372,  14552,  14732,  14911,  15090,  15268,
	 15446,  15623,  15799,  15975,  16150,  16325,  16499,  16672,  16845,  17017,
	 17189,  17360,  17530,  17699,  17868,  18036,  18204,  18371,  18537,  18702,
	 18867,  19031,  19194,  19357,  19519,  19680,  19840,  20000,  20159,  20317,
	 20474,  20631,  20787,  20942,  21096,  21249,  21402,  21554,  21705,  21855,
	 22004,  22153,  22301,  22447,  22593,  22739,  22883,  23026,  23169,  23311,
	 23452,  23592,  23731,  23869,  24006,  24143,  24278,  24413,  24546,  24679,
	 24811,  24942,  25071,  25200,  25328,  25456,  25582,  25707,  25831,  25954,
	 26076,  26198,  26318,  26437,  26555,  26673,  26789,  26904,  27018,  27132,
	 27244,  27355,  27465,  27574,  27682,  27790,  27896,  28000,  28104,  28207,
	 28309,  28410,  28509,  28608,  28705,  28802,  28897,  28991,  29084,  29176,
	 29267,  29357,  29446,  29534,  29620,  29706,  29790,  29873,  29955,  30036,
	 30116,  30194,  30272,  30348,  30423,  30498,  30570,  30642,  30713,  30782,
	 30851,  30918,  30984,  31049,  31112,  31175,  31236,  31296,  31355,  31413,
	 31469,  31525,  31579,  31632,  31684,  31735,  31784,  31832,  31879,  31925,
	 31970,  32013,  32056,  32097,  32136,  32175,  32212,  32249,  32284,  32317,
	 32350,  32381,  32411,  32440,  32468,  32494,  32520,  32544,  32566,  32588,
	 32608,  32627,  32645,  32662,  32677,  32691,  32704,  32716,  32727,  32736,
	 32744,  32751,  32756,  32760,  32764,  32765,  32766,  32765,  32764,  32760,
	 32756,  32751,  32744,  32736,  32727,  32716,  32704,  32691,  32677,  32662,
	 32645,  32627,  32608,  32588,  32566,  32544,  32520,  32494,  32468,  32440,
	 32411,  32381,  32350,  32317,  32284,  32249,  32212,  32175,  32136,  32097,
	 32056,  32013,  31970,  31925,  31879,  31832,  31784,  31735,  31684,  31632,
	 31579,  31525,  31469,  31413,  31355,  31296,  31236,  31175,  31112,  31049,
	 30984,  30918,  30851,  30782,  30713,  30642,  30570,  30498,  30423,  30348,
	 30272,  30194,  30116,  30036,  29955,  29873,  29790,  29706,  29620,  29534,
	 29446,  29357,  29267,  29176,  29084,  28991,  28897,  28802,  28705,  28608,
	 28509,  28410,  28309,  28207,  28104,  28000,  27896,  27790,  27682,  27574,
	 27465,  27355,  27244,  27132,  27018,  26904,  26789,  26673,  26555,  26437,
	 26318,  26198,  26076,  25954,  25831,  25707,  25582,  25456,  25328,  25200,
	 25071,  24942,  24811,  24679,  24546,  24413,  24278,  24143,  24006,  23869,
	 23731,  23592,  23452,  23311,  23169,  23026,  22883,  22739,  22593,  22447,
	 22301,  22153,  22004,  21855,  21705,  21554,  21402,  21249,  21096,  20942,
	 20787,  20631,  20474,  20317,  20159,  20000,  19840,  19680,  19519,  19357,
	 19194,  19031,  18867,  18702,  18537,  18371,  18204,  18036,  17868,  17699,
	 17530,  17360,  17189,  17017,  16845,  16672,  16499,  16325,  16150,  15975,
	 15799,  15623,  15446,  15268,  15090,  14911,  14732,  14552,  14372,  14191,
	 14009,  13827,  13645,  13462,  13278,  13094,  12910,  12725,  12539,  12353,
	 12167,  11980,  11792,  11605,  11416,  11228,  11039,  10849,  10659,  10469,
	 10278,  10087,   9896,   9704,   9511,   9319,   9126,   8933,   8739,   8545,
	  8351,   8156,   7961,   7766,   7571,   7375,   7179,   6983,   6786,   6589,
	  6392,   6195,   5997,   5800,   5602,   5404,   5205,   5007,   4808,   4609,
	  4410,   4210,   4011,   3811,   3612,   3412,   3212,   3011,   2811,   2611,
	  2410,   2210,   2009,   1809,   1608,   1407,   1206,   1005,    804,    603,
	   402,    201,      0,   -201,   -402,   -603,   -804,  -1005,  -1206,  -1407,
	 -1608,  -1809,  -2009,  -2210,  -2410,  -2611,  -2811,  -3011,  -3212,  -3412,
	 -3612,  -3811,  -4011,  -4210,  -4410,  -4609,  -4808,  -5007,  -5205,  -5404,
	 -5602,  -5800,  -5997,  -6195,  -6392,  -6589,  -6786,  -6983,  -7179,  -7375,
	 -7571,  -7766,  -7961,  -8156,  -8351,  -8545,  -8739,  -8933,  -9126,  -9319,
	 -9511,  -9704,  -9896, -10087, -10278, -10469, -10659, -10849, -11039, -11228,
	-11416, -11605, -11792, -11980, -12167, -12353, -12539, -12725, -12910, -13094,
	-13278, -13462, -13645, -13827, -14009, -14191, -14372, -14552, -14732, -14911,
	-15090, -15268, -15446, -15623, -15799, -15975, -16150, -16325, -16499, -16672,
	-16845, -17017, -17189, -17360, -17530, -17699, -17868, -18036, -18204, -18371,
	-18537, -18702, -18867, -19031, -19194, -19357, -19519, -19680, -19840, -20000,
	-20159, -20317, -20474, -20631, -20787, -20942, -21096, -21249, -21402, -21554,
	-21705, -21855, -22004, -22153, -22301, -22447, -22593, -22739, -22883, -23026,
	-23169, -23311, -23452, -23592, -23731, -23869, -24006, -24143, -24278, -24413,
	-24546, -24679, -24811, -24942, -25071, -25200, -25328, -25456, -25582, -25707,
	-25831, -25954, -26076, -26198, -26318, -26437, -26555, -26673, -26789, -26904,
	-27018, -27132, -27244, -27355, -27465, -27574, -27682, -27790, -27896, -28000,
	-28104, -28207, -28309, -28410, -28509, -28608, -28705, -28802, -28897, -28991,
	-29084, -29176, -29267, -29357, -29446, -29534, -29620, -29706, -29790, -29873,
	-29955, -30036, -30116, -30194, -30272, -30348, -30423, -30498, -30570, -30642,
	-30713, -30782, -30851, -30918, -30984, -31049, -31112, -31175, -31236, -31296,
	-31355, -31413, -31469, -31525, -31579, -31632, -31684, -31735, -31784, -31832,
	-31879, -31925, -31970, -32013, -32056, -32097, -32136, -32175, -32212, -32249,
	-32284, -32317, -32350, -32381, -32411, -32440, -32468, -32494, -32520, -32544,
	-32566, -32588, -32608, -32627, -32645, -32662, -32677, -32691, -32704, -32716,
	-32727, -32736, -32744, -32751, -32756, -32760, -32764, -32765, -32766, -32765,
	-32764, -32760, -32756, -32751, -32744, -32736, -32727, -32716, -32704, -32691,
	-32677, -32662, -32645, -32627, -32608, -32588, -32566, -32544, -32520, -32494,
	-32468, -32440, -32411, -32381, -32350, -32317, -32284, -32249, -32212, -32175,
	-32136, -32097, -32056, -32013, -31970, -31925, -31879, -31832, -31784, -31735,
	-31684, -31632, -31579, -31525, -31469, -31413, -31355, -31296, -31236, -31175,
	-31112, -31049, -30984, -30918, -30851, -30782, -30713, -30642, -30570, -30498,
	-30423, -30348, -30272, -30194, -30116, -30036, -29955, -29873, -29790, -29706,
	-29620, -29534, -29446, -29357, -29267, -29176, -29084, -28991, -28897, -28802,
	-28705, -28608, -28509, -28410, -28309, -28207, -28104, -28000, -27896, -27790,
	-27682, -27574, -27465, -27355, -27244, -27132, -27018, -26904, -26789, -26673,
	-26555, -26437, -26318, -26198, -26076, -25954, -25831, -25707, -25582, -25456,
	-25328, -25200, -25071, -24942, -24811, -24679, -24546, -24413, -24278, -24143,
	-24006, -23869, -23731, -23592, -23452, -23311, -23169, -23026, -22883, -22739,
	-22593, -22447, -22301, -22153, -22004, -21855, -21705, -21554, -21402, -21249,
	-21096, -20942, -20787, -20631, -20474, -20317, -20159, -20000, -19840, -19680,
	-19519, -19357, -19194, -19031, -18867, -18702, -18537, -18371, -18204, -18036,
	-17868, -17699, -17530, -17360, -17189, -17017, -16845, -16672, -16499, -16325,
	-16150, -15975, -15799, -15623, -15446, -15268, -15090, -14911, -14732, -14552,
	-14372, -14191, -14009, -13827, -13645, -13462, -13278, -13094, -12910, -12725,
	-12539, -12353, -12167, -11980, -11792, -11605, -11416, -11228, -11039, -10849,
	-10659, -10469, -10278, -10087,  -9896,  -9704,  -9511,  -9319,  -9126,  -8933,
	 -8739,  -8545,  -8351,  -8156,  -7961,  -7766,  -7571,  -7375,  -7179,  -6983,
	 -6786,  -6589,  -6392,  -6195,  -5997,  -5800,  -5602,  -5404,  -5205,  -5007,
	 -4808,  -4609,  -4410,  -4210,  -4011,  -3811,  -3612,  -3412,  -3212,  -3011,
	 -2811,  -2611,  -2410,  -2210,  -2009,  -1809,  -1608,  -1407,  -1206,  -1005,
	  -804,   -603,   -402,   -201,      0,    201,    402,    603,    804,   1005,
	  1206,   1407,   1608,   1809,   2009,   2210,   2410,   2611,   2811,   3011,
	  3212,   3412,   3612,   3811,   4011,   4210,   4410,   4609,   4808,   5007,
	  5205,   5404,   5602,   5800,   5997,   6195,   6392,   6589,   6786,   6983,
	  7179,   7375,   7571,   7766,   7961,   8156,   8351,   8545,   8739,   8933,
	  9126,   9319,   9511,   9704,   9896,  10087,  10278,  10469,  10659,  10849,
	 11039,  11228,  11416,  11605,  11792,  11980,  12167,  12353,  12539,  12725,
	 12910,  13094,  13278,  13462,  13645,  13827,  14009,  14191,  14372,  14552,
	 14732,  14911,  15090,  15268,  15446,  15623,  15799,  15975,  16150,  16325,
	 16499,  16672,  16845,  17017,  17189,  17360,  17530,  17699,  17868,  18036,
	 18204,  18371,  18537,  18702,  18867,  19031,  19194,  19357,  19519,  19680,
	 19840,  20000,  20159,  20317,  20474,  20631,  20787,  20942,  21096,  21249,
	 21402,  21554,  21705,  21855,  22004,  22153,  22301,  22447,  22593,  22739,
	 22883,  23026,  23169,  23311,  23452,  23592,  23731,  23869,  24006,  24143,
	 24278,  24413,  24546,  24679,  24811,  24942,  25071,  25200,  25328,  25456,
	 25582,  25707,  25831,  25954,  26076,  26198,  26318,  26437,  26555,  26673,
	 26789,  26904,  27018,  27132,  27244,  27355,  27465,  27574,  27682,  27790,
	 27896,  28000,  28104,  28207,  28309,  28410,  28509,  28608,  28705,  28802,
	 28897,  28991,  29084,  29176,  29267,  29357,  29446,  29534,  29620,  29706,
	 29790,  29873,  29955,  30036,  30116,  30194,  30272,  30348,  30423,  30498,
	 30570,  30642,  30713,  30782,  30851,  30918,  30984,  31049,  31112,  31175,
	 31236,  31296,  31355,  31413,  31469,  31525,  31579,  31632,  31684,  31735,
	 31784,  31832,  31879,  31925,  31970,  32013,  32056,  32097,  32136,  32175,
	 32212,  32249,  32284,  32317,  32350,  32381,  32411,  32440,  32468,  32494,
	 32520,  32544,  32566,  32588,  32608,  32627,  32645,  32662,  32677,  32691,
	 32704,  32716,  32727,  32736,  32744,  32751,  32756,  32760,  32764,  32765
};

const SDL_Keycode key2VolTab[16] = 
{
	SDLK_0, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_MINUS, SDLK_PLUS, SDLK_d,
	SDLK_u, SDLK_s, SDLK_v, SDLK_p, SDLK_l, SDLK_r, SDLK_m
};

const SDL_Keycode key2EfxTab[36] = 
{
	SDLK_0, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6, SDLK_7,
	SDLK_8, SDLK_9, SDLK_a, SDLK_b, SDLK_c, SDLK_d, SDLK_e, SDLK_f,
	SDLK_g, SDLK_h, SDLK_i, SDLK_j, SDLK_k, SDLK_l, SDLK_m, SDLK_n,
	SDLK_o, SDLK_p, SDLK_q, SDLK_r, SDLK_s, SDLK_t, SDLK_u, SDLK_v,
	SDLK_w, SDLK_x, SDLK_y, SDLK_z
};

const SDL_Keycode key2HexTab[16] = 
{
	SDLK_0, SDLK_1, SDLK_2, SDLK_3, SDLK_4, SDLK_5, SDLK_6, SDLK_7,
	SDLK_8, SDLK_9, SDLK_a, SDLK_b, SDLK_c, SDLK_d, SDLK_e, SDLK_f
};

const uint8_t scopeMuteBMP_Widths[16] =
{
	162,111, 76, 56, 42, 35, 28, 24,
	 21, 21, 17, 17, 12, 12,  9,  9
};

const uint8_t scopeMuteBMP_Heights[16] =
{
	27, 27, 26, 25, 25, 25, 24, 24,
	24, 24, 24, 24, 24, 24, 24, 24
};

const uint16_t scopeMuteBMP_Offs[16] =
{
	 0*(162*27), 1*(162*27), 2*(162*27), 3*(162*27),
	 4*(162*27), 5*(162*27), 6*(162*27), 7*(162*27),
	 8*(162*27), 8*(162*27), 9*(162*27), 9*(162*27),
	10*(162*27),10*(162*27),11*(162*27),11*(162*27)
};

const uint16_t scopeLenTab[16][32] =
{
	/*  2 ch */ {285,285},
	/*  4 ch */ {141,141,141,141},
	/*  6 ch */ {93,93,93,93,93,93},
	/*  8 ch */ {69,69,69,69,69,69,69,69},
	/* 10 ch */ {55,55,55,54,54,55,55,55,54,54},
	/* 12 ch */ {45,45,45,45,45,45,45,45,45,45,45,45},
	/* 14 ch */ {39,38,38,38,38,38,38,39,38,38,38,38,38,38},
	/* 16 ch */ {33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33},
	/* 18 ch */ {29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29},
	/* 20 ch */ {26,26,26,26,26,26,26,26,25,25,26,26,26,26,26,26,26,26,25,25},
	/* 22 ch */ {24,24,23,23,23,23,23,23,23,23,23,24,24,23,23,23,23,23,23,23,23,23},
	/* 24 ch */ {21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21},
	/* 26 ch */ {20,20,19,19,19,19,19,19,19,19,19,19,19,20,20,19,19,19,19,19,19,19,19,19,19,19},
	/* 28 ch */ {18,18,18,18,18,18,18,18,17,17,17,17,17,17,18,18,18,18,18,18,18,18,17,17,17,17,17,17},
	/* 30 ch */ {17,17,17,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,16,16,16,16,16,16,16,16,16,16,16,16},
	/* 32 ch */ {15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15}
};

/* ----------------------------------------------------------------------- */
/*                              CONFIG TABLE                               */
/* ----------------------------------------------------------------------- */

// default FT2 clone FT2.CFG (unencrypted)
const uint8_t defConfigData[CONFIG_FILE_SIZE] =
{
	0x46,0x61,0x73,0x74,0x54,0x72,0x61,0x63,0x6B,0x65,0x72,0x20,0x32,0x2E,0x30,0x20,0x63,0x6F,0x6E,0x66,
	0x69,0x67,0x75,0x72,0x61,0x74,0x69,0x6F,0x6E,0x20,0x66,0x69,0x6C,0x65,0x1A,0x01,0x01,0x80,0xBB,0x00,
	0x00,0xFF,0x00,0x00,0x01,0xDC,0x00,0x00,0x00,0x01,0x01,0x00,0x03,0x00,0xFF,0x00,0x20,0x02,0x01,0x00,
	0x05,0x00,0x05,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01,0x04,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x24,0x2F,0x3F,0x09,0x09,0x10,0x3F,0x3F,0x3F,0x13,0x18,0x26,0x3F,0x3F,0x3F,0x27,0x27,
	0x27,0x00,0x00,0x00,0x08,0x0A,0x0F,0x20,0x29,0x3F,0x0F,0x0F,0x0F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,
	0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x01,0x0A,0x10,0x0A,0xE0,0x08,0xC0,0x08,0x40,0x08,0x20,0x08,
	0xF1,0x04,0xF2,0x04,0x81,0x04,0x82,0x04,0x20,0x30,0x40,0x50,0x61,0x62,0x71,0x72,0x91,0x92,0xF8,0x03,
	0x2D,0x88,0x18,0x00,0x66,0x88,0x18,0x00,0x00,0x01,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x01,0x01,0x10,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x64,0x00,0x01,0x01,
	0x01,0x01,0x12,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x01,0x60,0x00,0x05,0x56,0x6F,0x67,
	0x75,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x02,0x16,0x05,0x4D,0x72,0x2E,0x20,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x17,0x04,0x4C,0x6F,0x6F,0x74,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x07,
	0x0A,0x4C,0x69,0x7A,0x61,0x72,0x64,0x6B,0x69,0x6E,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x06,0x03,0x41,0x6C,0x74,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x05,0x03,0x55,0x62,0x65,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x04,0x00,0x04,0x06,0x4E,0x69,0x6B,0x6C,0x61,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x03,0x05,0x4A,0x65,0x6E,0x73,0x61,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x02,
	0x05,0x54,0x6F,0x62,0x62,0x65,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x01,0x08,0x4B,0x61,0x72,0x6F,0x6C,0x69,0x6E,0x61,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x02,0x00,
	0x00,0x00,0x00,0x99,0xE2,0x27,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x30,
	0x00,0x04,0x00,0x40,0x00,0x08,0x00,0x2C,0x00,0x0E,0x00,0x08,0x00,0x18,0x00,0x16,0x00,0x20,0x00,0x08,
	0x00,0x3C,0x00,0x00,0x00,0x46,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x5A,0x00,0x00,0x00,0x64,0x00,0x00,
	0x00,0x6E,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x0A,0x00,0x28,0x00,0x1E,0x00,0x18,0x00,0x32,0x00,0x20,
	0x00,0x3C,0x00,0x20,0x00,0x46,0x00,0x20,0x00,0x50,0x00,0x20,0x00,0x5A,0x00,0x20,0x00,0x64,0x00,0x20,
	0x00,0x6E,0x00,0x20,0x00,0x78,0x00,0x20,0x00,0x82,0x00,0x20,0x00,0x00,0x00,0x30,0x00,0x04,0x00,0x40,
	0x00,0x08,0x00,0x2C,0x00,0x0E,0x00,0x08,0x00,0x18,0x00,0x16,0x00,0x20,0x00,0x08,0x00,0x3C,0x00,0x00,
	0x00,0x46,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x5A,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x6E,0x00,0x00,
	0x00,0x00,0x00,0x20,0x00,0x0A,0x00,0x28,0x00,0x1E,0x00,0x18,0x00,0x32,0x00,0x20,0x00,0x3C,0x00,0x20,
	0x00,0x46,0x00,0x20,0x00,0x50,0x00,0x20,0x00,0x5A,0x00,0x20,0x00,0x64,0x00,0x20,0x00,0x6E,0x00,0x20,
	0x00,0x78,0x00,0x20,0x00,0x82,0x00,0x20,0x00,0x00,0x00,0x30,0x00,0x04,0x00,0x40,0x00,0x08,0x00,0x2C,
	0x00,0x0E,0x00,0x08,0x00,0x18,0x00,0x16,0x00,0x20,0x00,0x08,0x00,0x3C,0x00,0x00,0x00,0x46,0x00,0x00,
	0x00,0x50,0x00,0x00,0x00,0x5A,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x6E,0x00,0x00,0x00,0x00,0x00,0x20,
	0x00,0x0A,0x00,0x28,0x00,0x1E,0x00,0x18,0x00,0x32,0x00,0x20,0x00,0x3C,0x00,0x20,0x00,0x46,0x00,0x20,
	0x00,0x50,0x00,0x20,0x00,0x5A,0x00,0x20,0x00,0x64,0x00,0x20,0x00,0x6E,0x00,0x20,0x00,0x78,0x00,0x20,
	0x00,0x82,0x00,0x20,0x00,0x00,0x00,0x30,0x00,0x04,0x00,0x40,0x00,0x08,0x00,0x2C,0x00,0x0E,0x00,0x08,
	0x00,0x18,0x00,0x16,0x00,0x20,0x00,0x08,0x00,0x3C,0x00,0x00,0x00,0x46,0x00,0x00,0x00,0x50,0x00,0x00,
	0x00,0x5A,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x6E,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x0A,0x00,0x28,
	0x00,0x1E,0x00,0x18,0x00,0x32,0x00,0x20,0x00,0x3C,0x00,0x20,0x00,0x46,0x00,0x20,0x00,0x50,0x00,0x20,
	0x00,0x5A,0x00,0x20,0x00,0x64,0x00,0x20,0x00,0x6E,0x00,0x20,0x00,0x78,0x00,0x20,0x00,0x82,0x00,0x20,
	0x00,0x00,0x00,0x30,0x00,0x04,0x00,0x40,0x00,0x08,0x00,0x2C,0x00,0x0E,0x00,0x08,0x00,0x18,0x00,0x16,
	0x00,0x20,0x00,0x08,0x00,0x3C,0x00,0x00,0x00,0x46,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x5A,0x00,0x00,
	0x00,0x64,0x00,0x00,0x00,0x6E,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x0A,0x00,0x28,0x00,0x1E,0x00,0x18,
	0x00,0x32,0x00,0x20,0x00,0x3C,0x00,0x20,0x00,0x46,0x00,0x20,0x00,0x50,0x00,0x20,0x00,0x5A,0x00,0x20,
	0x00,0x64,0x00,0x20,0x00,0x6E,0x00,0x20,0x00,0x78,0x00,0x20,0x00,0x82,0x00,0x20,0x00,0x00,0x00,0x30,
	0x00,0x04,0x00,0x40,0x00,0x08,0x00,0x2C,0x00,0x0E,0x00,0x08,0x00,0x18,0x00,0x16,0x00,0x20,0x00,0x08,
	0x00,0x3C,0x00,0x00,0x00,0x46,0x00,0x00,0x00,0x50,0x00,0x00,0x00,0x5A,0x00,0x00,0x00,0x64,0x00,0x00,
	0x00,0x6E,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x0A,0x00,0x28,0x00,0x1E,0x00,0x18,0x00,0x32,0x00,0x20,
	0x00,0x3C,0x00,0x20,0x00,0x46,0x00,0x20,0x00,0x50,0x00,0x20,0x00,0x5A,0x00,0x20,0x00,0x64,0x00,0x20,
	0x00,0x6E,0x00,0x20,0x00,0x78,0x00,0x20,0x00,0x82,0x00,0x20,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,
	0x00,0x06,0x00,0x06,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x03,0x00,0x03,
	0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,
	0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x06,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,
	0x00,0x02,0x00,0x02,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x05,0x00,0x05,
	0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x05,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,0x00,0x80,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,0x00,0x07,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC8,0x00,0x03,0x00,0x40,0x1F,0x40,
	0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x40,
	0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x40,0x1F,0x01,0x00,0x00,0x08,0x00,0x00,0x00
};

/* ----------------------------------------------------------------------- */
/*                          MISCELLANEOUS TABLES                           */
/* ----------------------------------------------------------------------- */

/*
** const double dBpmMs1024 = 1024.0 / (bpm / 2.5); // milliseconds (scaled from 1000 to 1024)
** x = (uint64_t)floor((UINT32_MAX + 1.0) * dBpmMs1024);
*/
const uint64_t musicTimeTab64[MAX_BPM+1] =
{
	0x00000000000,0xA0000000000,0x50000000000,0x35555555555,0x28000000000,0x20000000000,
	0x1AAAAAAAAAA,0x16DB6DB6DB6,0x14000000000,0x11C71C71C71,0x10000000000,0x0E8BA2E8BA2,
	0x0D555555555,0x0C4EC4EC4EC,0x0B6DB6DB6DB,0x0AAAAAAAAAA,0x0A000000000,0x09696969696,
	0x08E38E38E38,0x086BCA1AF28,0x08000000000,0x079E79E79E7,0x0745D1745D1,0x06F4DE9BD37,
	0x06AAAAAAAAA,0x06666666666,0x06276276276,0x05ED097B425,0x05B6DB6DB6D,0x058469EE584,
	0x05555555555,0x05294A5294A,0x05000000000,0x04D9364D936,0x04B4B4B4B4B,0x04924924924,
	0x0471C71C71C,0x045306EB3E4,0x0435E50D794,0x041A41A41A4,0x04000000000,0x03E7063E706,
	0x03CF3CF3CF3,0x03B88EE23B8,0x03A2E8BA2E8,0x038E38E38E3,0x037A6F4DE9B,0x03677D46CEF,
	0x03555555555,0x0343EB1A1F5,0x03333333333,0x03232323232,0x0313B13B13B,0x0304D4873EC,
	0x02F684BDA12,0x02E8BA2E8BA,0x02DB6DB6DB6,0x02CE98B3A62,0x02C234F72C2,0x02B63CBEEA4,
	0x02AAAAAAAAA,0x029F79B4758,0x0294A5294A5,0x028A28A28A2,0x02800000000,0x02762762762,
	0x026C9B26C9B,0x026357E16EC,0x025A5A5A5A5,0x02519F89467,0x02492492492,0x0240E6C2B44,
	0x0238E38E38E,0x0231188C462,0x022983759F2,0x02222222222,0x021AF286BCA,0x0213F2B3884,
	0x020D20D20D2,0x02067B23A54,0x02000000000,0x01F9ADD3C0C,0x01F3831F383,0x01ED7E75346,
	0x01E79E79E79,0x01E1E1E1E1E,0x01DC47711DC,0x01D6CDFA1D6,0x01D1745D174,0x01CC398730E,
	0x01C71C71C71,0x01C21C21C21,0x01BD37A6F4D,0x01B86E1B86E,0x01B3BEA3677,0x01AF286BCA1,
	0x01AAAAAAAAA,0x01A6449E59B,0x01A1F58D0FA,0x019DBCC4867,0x01999999999,0x01958B67EBB,
	0x01919191919,0x018DAB7EC1D,0x0189D89D89D,0x01861861861,0x01826A439F6,0x017ECDC1CB5,
	0x017B425ED09,0x0177C7A20E1,0x01745D1745D,0x0171024E6A1,0x016DB6DB6DB,0x016A7A5616A,
	0x01674C59D31,0x01642C8590B,0x01611A7B961,0x015E15E15E1,0x015B1E5F752,0x015833A1583,
	0x01555555555,0x0152832C6E0,0x014FBCDA3AC,0x014D0214D02,0x014A5294A52,0x0147AE147AE,
	0x01451451451,0x0142850A142,0x01400000000,0x013D84F613D,0x013B13B13B1,0x0138ABF82EE,
	0x01364D9364D,0x0133F84CFE1,0x0131ABF0B76,0x012F684BDA1,0x012D2D2D2D2,0x012AFA64E7B,
	0x0128CFC4A33,0x0126AD1F4F3,0x01249249249,0x01227F179A5,0x012073615A2,0x011E6EFE35B,
	0x011C71C71C7,0x011A7B9611A,0x01188C46231,0x0116A3B35FC,0x0114C1BACF9,0x0112E63A6A8,
	0x01111111111,0x010F421E843,0x010D79435E5,0x010BB6610BB,0x0109F959C42,0x01084210842,
	0x01069069069,0x0104E447BEC,0x01033D91D2A,0x01019C2D14E,0x01000000000,0x00FE68F1B07,
	0x00FCD6E9E06,0x00FB49D0E22,0x00F9C18F9C1,0x00F83E0F83E,0x00F6BF3A9A3,0x00F544FB66B,
	0x00F3CF3CF3C,0x00F25DEACAF,0x00F0F0F0F0F,0x00EF883BE20,0x00EE23B88EE,0x00ECC35458C,
	0x00EB66FD0EB,0x00EA0EA0EA0,0x00E8BA2E8BA,0x00E76994F8C,0x00E61CC3987,0x00E4D3AA30A,
	0x00E38E38E38,0x00E24C602D4,0x00E10E10E10,0x00DFD33C272,0x00DE9BD37A6,0x00DD67C8A60,
	0x00DC370DC37,0x00DB0995382,0x00D9DF51B3B,0x00D8B8362E0,0x00D79435E50,0x00D673445B2,
	0x00D55555555,0x00D43A5CD98,0x00D3224F2CD,0x00D20D20D20,0x00D0FAC687D,0x00CFEB35477,
	0x00CEDE62433,0x00CDD442E4F,0x00CCCCCCCCC,0x00CBC7F5CF9,0x00CAC5B3F5D,0x00C9C5FD7A5,
	0x00C8C8C8C8C,0x00C7CE0C7CE,0x00C6D5BF60E,0x00C5DFD86CD,0x00C4EC4EC4E,0x00C3FB19B8F,
	0x00C30C30C30,0x00C21F8B86A,0x00C13521CFB,0x00C04CEB916,0x00BF66E0E5A,0x00BE82FA0BE,
	0x00BDA12F684,0x00BCC17982F,0x00BBE3D1070,0x00BB082EC20,0x00BA2E8BA2E,0x00B956E0B95,
	0x00B88127350,0x00B7AD58650,0x00B6DB6DB6D,0x00B60B60B60,0x00B53D2B0B5,0x00B470C67C0,
	0x00B3A62CE98,0x00B2DD58507,0x00B21642C85,0x00B150E682C,0x00B08D3DCB0,0x00AFCB43057,
	0x00AF0AF0AF0,0x00AE4C415C9,0x00AD8F2FBA9,0x00ACD3B68C6,0x00AC19D0AC1,0x00AB617909A,
	0x00AAAAAAAAA,0x00A9F560A9F,0x00A94196370,0x00A88F46959,0x00A7DE6D1D6,0x00A72F05397,
	0x00A6810A681,0x00A5D4783A0,0x00A5294A529,0x00A47F7C66C,0x00A3D70A3D7,0x00A32FEFAE6,
	0x00A28A28A28,0x00A1E5B1133,0x00A142850A1,0x00A0A0A0A0A,0x00A00000000,0x009F609F609,
	0x009EC27B09E,0x009E258F520,0x009D89D89D8,0x009CEF535F2,0x009C55FC177,0x009BBDCF54A,
	0x009B26C9B26,0x009A90E7D95,0x0099FC267F0,0x0099688265A,0x0098D5F85BB,0x009844853BF,
	0x0097B425ED0,0x009724D7614,0x00969696969,0x00960960960,0x00957D3273D,0x0094F2094F2,
	0x009467E2519,0x0093DEBAAF9,0x0093568FA79,0x0092CF5E824,0x00924924924,0x0091C3DF33E,
	0x00913F8BCD2,0x0090BC27CD5,0x009039B0AD1,0x008FB823EE0,0x008F377F1AD,0x008EB7BFC6E,
	0x008E38E38E3,0x008DBAE8154,0x008D3DCB08D,0x008CC18A1DE,0x008C4623118,0x008BCB93A8A,
	0x008B51D9AFE,0x008AD8F2FBA,0x008A60DD67C,0x0089E996D77,0x0089731D354,0x0088FD6E72B,
	0x00888888888,0x00881469763,0x0087A10F421,0x00872E77F93,0x0086BCA1AF2,0x00864B8A7DE,
	0x0085DB3085D,0x00856B91EDA,0x0084FCACE21,0x00848E7F95F,0x00842108421,0x0083B445250,
	0x00834834834,0x0082DCD4A6D,0x00827223DF6,0x00820820820,0x00819EC8E95,0x0081361B751,
	0x0080CE168A7,0x008066B893A,0x00800000000,0x007F99EB43C,0x007F3478D83,0x007ECFA73B7,
	0x007E6B74F03,0x007E07E07E0,0x007DA4E8711,0x007D428B5A0,0x007CE0C7CE0,0x007C7F9C66B,
	0x007C1F07C1F,0x007BBF0881E,0x007B5F9D4D1,0x007B00C4CE0,0x007AA27DB35,0x007A44C6AFC,
	0x0079E79E79E,0x00798B03CC5,0x00792EF5657,0x0078D372078,0x00787878787,0x00781E0781E,
	0x0077C41DF10,0x00776ABA96C,0x007711DC477,0x0076B981DAE,0x007661AA2C6,0x00760A541A8,
	0x0075B37E875,0x00755D28580,0x00750750750,0x0074B1F5CA0,0x00745D1745D,0x007408B3DA4,
	0x0073B4CA7C6,0x0073615A240,0x00730E61CC3,0x0072BBE072B,0x007269D5185,0x0072183EC08,
	0x0071C71C71C,0x0071766D352,0x0071263016A,0x0070D66424A,0x00708708708,0x0070381C0E0,
	0x006FE99E139,0x006F9B8D9A2,0x006F4DE9BD3,0x006F00B19AB,0x006EB3E4530,0x006E678108F,
	0x006E1B86E1B,0x006DCFF504C,0x006D84CA9C1,0x006D3A06D3A,0x006CEFA8D9D,0x006CA5AFDF6,
	0x006C5C1B170,0x006C12E9B5B,0x006BCA1AF28,0x006B81AE06B,0x006B39A22D9,0x006AF1F6A46,
	0x006AAAAAAAA,0x006A63BD81A,0x006A1D2E6CC,0x0069D6FCB14,0x00699127966,0x00694BAE655,
	0x00690690690,0x0068C1CCEE5,0x00687D6343E,0x00683952BA4,0x0067F59AA3B,0x0067B23A544,
	0x00676F31219,0x00672C7E634,0x0066EA21727,0x0066A819AA0,0x00666666666,0x0066250705B,
	0x0065E3FAE7C,0x0065A3416DE,0x006562D9FAE,0x006522C3F35,0x0064E2FEBD2,0x0064A389BFD,
	0x00646464646,0x0064258E154,0x0063E7063E7,0x0063A8CC4D3,0x00636ADFB07,0x00632D3FD85,
	0x0062EFEC366,0x0062B2E43DA,0x00627627627,0x006239B51A6,0x0061FD8CDC7,0x0061C1AE20F,
	0x00618618618,0x00614ACB18E,0x00610FC5C35,0x0060D507DE1,0x00609A90E7D,0x00606060606,
	0x00602675C8B,0x005FECD0A31,0x005FB37072D,0x005F7A54BC9,0x005F417D05F,0x005F08E8D5D,
	0x005ED097B42,0x005E988929F,0x005E60BCC17,0x005E293205E,0x005DF1E8838,0x005DBADFC7C,
	0x005D8417610,0x005D4D8EDEC,0x005D1745D17,0x005CE13BCA9,0x005CAB705CA,0x005C75E31B2,
	0x005C40939A8,0x005C0B81702,0x005BD6AC328,0x005BA21378D,0x005B6DB6DB6,0x005B3995F37,
	0x005B05B05B0,0x005AD205AD2,0x005A9E9585A,0x005A6B5F816,0x005A38633E0,0x005A05A05A0,
	0x0059D31674C,0x0059A0C52E7,0x00596EAC283,0x00593CCB03E,0x00590B21642,0x0058D9AEEC9,
	0x0058A873416,0x0058776E07B,0x0058469EE58,0x00581605816,0x0057E5A182B,0x0057B57291D,
	0x00578578578,0x005755B27D8,0x00572620AE4,0x0056F6C294E,0x0056C797DD4,0x005698A033F,
	0x005669DB463,0x00563B48C20,0x00560CE8560,0x0055DEB9B1A,0x0055B0BC84D,0x005582F0804,
	0x00555555555,0x005527EAB60,0x0054FAB054F,0x0054CDA5E57,0x0054A0CB1B8,0x0054741FAB8,
	0x005447A34AC,0x00541B55AF0,0x0053EF368EB,0x0053C345A0B,0x005397829CB,0x00536BED3AE,
	0x00534085340,0x0053154A416,0x0052EA3C1D0,0x0052BF5A814,0x005294A5294,0x00526A1BD09,
	0x00523FBE336,0x0052158C0E5,0x0051EB851EB,0x0051C1A9223,0x005197F7D73,0x00516E70FC6,
	0x00514514514,0x00511BE1958,0x0050F2D8899,0x0050C9F8EE5,0x0050A142850,0x005078B50F9,
	0x00505050505,0x005028140A0,0x00500000000,0x004FD813F60,0x004FB04FB04,0x004F88B2F39,
	0x004F613D84F,0x004F39EF2A1,0x004F12C7A90,0x004EEBC6C84,0x004EC4EC4EC,0x004E9E3803E,
	0x004E77A9AF9,0x004E514119F,0x004E2AFE0BB,0x004E04E04E0,0x004DDEE7AA5,0x004DB913EAA,
	0x004D9364D93,0x004D6DDA40D,0x004D4873ECA,0x004D2331A84,0x004CFE133F8,0x004CD9187EC,
	0x004CB44132D,0x004C8F8D28A,0x004C6AFC2DD,0x004C468E103,0x004C22429DF,0x004BFE19A5C,
	0x004BDA12F68,0x004BB62E5F9,0x004B926BB0A,0x004B6ECAB9C,0x004B4B4B4B4,0x004B27ED360,
	0x004B04B04B0,0x004AE1945BB,0x004ABE9939E,0x004A9BBEB7B,0x004A7904A79,0x004A566ADC3,
	0x004A33F128C,0x004A119760C,0x0049EF5D57C,0x0049CD42E20,0x0049AB47D3C,0x0049896C01D,
	0x004967AF412,0x00494611670,0x00492492492,0x00490331BD6,0x0048E1EF99F,0x0048C0CBB56,
	0x00489FC5E69,0x00487EDE048,0x00485E13E6A,0x00483D6764A,0x00481CD8568,0x0047FC66947,
	0x0047DC11F70,0x0047BBDA56F,0x00479BBF8D6,0x00477BC173B,0x00475BDFE37,0x00473C1AB68,
	0x00471C71C71,0x0046FCE4EF9,0x0046DD740AA,0x0046BE1EF32,0x00469EE5846,0x00467FC799C,
	0x004660C50EF,0x004641DDBFE,0x0046231188C,0x00460460460,0x0045E5C9D45,0x0045C74E109,
	0x0045A8ECD7F,0x00458AA607D,0x00456C797DD,0x00454E6717D,0x0045306EB3E,0x00451290305,
	0x0044F4CB6BB,0x0044D72044D,0x0044B98E9AA,0x00449C164C5,0x00447EB7395,0x00446171416,
	0x00444444444,0x00442730221,0x00440A34BB1,0x0043ED51EFD,0x0043D087A10,0x0043B3D5AF9,
	0x0043973BFC9,0x00437ABA696,0x00435E50D79,0x004341FF28C,0x004325C53EF,0x004309A2FC3,
	0x0042ED9842E,0x0042D1A4F58,0x0042B5C8F6D,0x00429A0429A,0x00427E56710,0x004262BFB05,
	0x0042473FCAF,0x00422BD6A49,0x00421084210,0x0041F548244,0x0041DA22928,0x0041BF13502,
	0x0041A41A41A,0x004189374BC,0x00416E6A536,0x004153B33DA,0x00413911EFB,0x00411E864EF,
	0x00410410410,0x0040E9AFAB9,0x0040CF6474A,0x0040B52E823,0x00409B0DBA8,0x00408102040,
	0x0040670B453,0x00404D2964D,0x0040335C49D,0x004019A3DB2,0x00400000000,0x003FE6709FC,
	0x003FCCF5A1E,0x003FB38EEE1,0x003F9A3C6C1,0x003F80FE03F,0x003F67D39DB,0x003F4EBD21A,
	0x003F35BA781,0x003F1CCB89A,0x003F03F03F0,0x003EEB2880F,0x003ED274388,0x003EB9D34EC,
	0x003EA145AD0,0x003E88CB3C9,0x003E7063E70,0x003E580F960,0x003E3FCE335,0x003E279FA8F,
	0x003E0F83E0F,0x003DF77AC58,0x003DDF8440F,0x003DC7A03DC,0x003DAFCEA68,0x003D980F660,
	0x003D8062670,0x003D68C7948,0x003D513ED9A,0x003D39C821A,0x003D226357E,0x003D0B1067C,
	0x003CF3CF3CF,0x003CDC9FC32,0x003CC581E62,0x003CAE75920,0x003C977AB2B,0x003C8091348,
	0x003C69B903C,0x003C52F20CD,0x003C3C3C3C3,0x003C25977EA,0x003C0F03C0F,0x003BF880EFE,
	0x003BE20EF88,0x003BCBADC7F,0x003BB55D4B6,0x003B9F1D702,0x003B88EE23B,0x003B72CF539,
	0x003B5CC0ED7,0x003B46C2DF0,0x003B30D5163,0x003B1AF780E,0x003B052A0D4,0x003AEF6CA97,
	0x003AD9BF43A,0x003AC421CA6,0x003AAE942C0,0x003A9916572,0x003A83A83A8,0x003A6E49C4D,
	0x003A58FAE50,0x003A43BB8A0,0x003A2E8BA2E,0x003A196B1ED,0x003A0459ED2,0x0039EF57FD1,
	0x0039DA653E3,0x0039C5819FF,0x0039B0AD120,0x00399BE7842,0x00398730E61,0x0039728927D,
	0x00395DF0395,0x003949660AB,0x003934EA8C2,0x0039207DADE,0x00390C1F604,0x0038F7CF93C,
	0x0038E38E38E,0x0038CF5B404,0x0038BB369A9,0x0038A72038A,0x003893180B5,0x00387F1E038,
	0x00386B32125,0x0038575428D,0x00384384384,0x00382FC231D,0x00381C0E070,0x00380867A92,
	0x0037F4CF09C,0x0037E1441A8,0x0037CDC6CD1,0x0037BA57132,0x0037A6F4DE9,0x003793A0215,
	0x00378058CD5,0x00376D1ED4B,0x003759F2298,0x003746D2BE0,0x003733C0847,0x003720BB6F4,
	0x00370DC370D,0x0036FAD87BB,0x0036E7FA826,0x0036D529779,0x0036C2654E0,0x0036AFADF87,
	0x00369D0369D,0x00368A6594F,0x003677D46CE,0x0036654FE4C,0x003652D7EFB,0x0036406C80D,
	0x00362E0D8B8,0x00361BBB030,0x00360974DAD,0x0035F73B066,0x0035E50D794,0x0035D2EC270,
	0x0035C0D7035,0x0035AECE020,0x00359CD116C,0x00358AE0358,0x003578FB523,0x0035672260C,
	0x00355555555,0x0035439423F,0x003531DEC0D,0x00352035203,0x00350E97366,0x0034FD04F7B,
	0x0034EB7E58A,0x0034DA034DA,0x0034C893CB3,0x0034B72FC60,0x0034A5D732A,0x0034948A05E,
	0x00348348348,0x00347211B34,0x003460E6772,0x00344FC6750,0x00343EB1A1F,0x00342DA7F2F,
	0x00341CA95D2,0x00340BB5D5B,0x0033FACD51D,0x0033E9EFC6E,0x0033D91D2A2,0x0033C85570F,
	0x0033B79890C,0x0033A6E67F3,0x0033963F31A,0x003385A29DC,0x00337510B93,0x0033648979B,
	0x0033540CD50,0x0033439AC0E,0x00333333333,0x003322D621E,0x0033128382D,0x0033023B4C3,
	0x0032F1FD73E,0x0032E1C9F01,0x0032D1A0B6F,0x0032C181BEA,0x0032B16CFD7,0x0032A16269B,
	0x00329161F9A,0x0032816BA3D,0x0032717F5E9,0x0032619D206,0x003251C4DFE,0x003241F693A,
	0x00323232323,0x00322277B24,0x003212C70AA,0x00320320320,0x0031F3831F3,0x0031E3EFC91,
	0x0031D466269,0x0031C4E62EA,0x0031B56FD83,0x0031A6031A6,0x0031969FEC2,0x0031874644B,
	0x003177F61B3,0x003168AF66D,0x003159721ED,0x00314A3E3A8,0x00313B13B13,0x00312BF27A5,
	0x00311CDA8D3,0x00310DCBE15,0x0030FEC66E3,0x0030EFCA2B6,0x0030E0D7107,0x0030D1ED150,
	0x0030C30C30C,0x0030B4345B5,0x0030A5658C7,0x0030969FBBF,0x003087E2E1A,0x0030792EF56,
	0x00306A83EF0,0x00305BE1C69,0x00304D4873E,0x00303EB7EF1,0x00303030303,0x003021B12F3,
	0x0030133AE45,0x003004CD47B,0x002FF668518,0x002FE80BFA0,0x002FD9B8396,0x002FCB6D081,
	0x002FBD2A5E4,0x002FAEF0347,0x002FA0BE82F,0x002F9295424,0x002F84746AE,0x002F765BF55,
	0x002F684BDA1,0x002F5A4411C,0x002F4C4494F,0x002F3E4D5C6,0x002F305E60B,0x002F22779AA,
	0x002F149902F,0x002F06C2925,0x002EF8F441C,0x002EEB2E09F,0x002EDD6FE3E,0x002ECFB9C86,
	0x002EC20BB08,0x002EB465952,0x002EA6C76F6,0x002E9931383,0x002E8BA2E8B,0x002E7E1C7A0,
	0x002E709DE54,0x002E632723A,0x002E55B82E5,0x002E4850FE8,0x002E3AF18D9,0x002E2D99D4B,
	0x002E2049CD4,0x002E1301709,0x002E05C0B81,0x002DF8879D2,0x002DEB56194,0x002DDE2C25D,
	0x002DD109BC6,0x002DC3EED68,0x002DB6DB6DB,0x002DA9CF7B9,0x002D9CCAF9B,0x002D8FCDE1D,
	0x002D82D82D8,0x002D75E9D68,0x002D6902D69,0x002D5C23276,0x002D4F4AC2D,0x002D4279A2A,
	0x002D35AFC0B,0x002D28ED16D,0x002D1C319F0,0x002D0F7D531,0x002D02D02D0,0x002CF62A26C,
	0x002CE98B3A6,0x002CDCF361D,0x002CD062973,0x002CC3D8D4A,0x002CB756141,0x002CAADA4FD,
	0x002C9E6581F,0x002C91F7A4A,0x002C8590B21,0x002C7930A48,0x002C6CD7764,0x002C6085218,
	0x002C5439A0B,0x002C47F4EE0,0x002C3BB703D,0x002C2F7FDCA,0x002C234F72C,0x002C1725C09,
	0x002C0B02C0B,0x002BFEE66D7,0x002BF2D0C15,0x002BE6C1B70,0x002BDAB948E,0x002BCEB771A,
	0x002BC2BC2BC,0x002BB6C771E,0x002BAAD93EC,0x002B9EF18CF,0x002B9310572,0x002B8735981,
	0x002B7B614A7,0x002B6F93690,0x002B63CBEEA,0x002B580AD60,0x002B4C5019F,0x002B409BB56,
	0x002B34EDA31,0x002B2945DE0,0x002B1DA4610,0x002B1209270,0x002B06742B0,0x002AFAE567F,
	0x002AEF5CD8D,0x002AE3DA78A,0x002AD85E426,0x002ACCE8313,0x002AC178402,0x002AB60E6A3,
	0x002AAAAAAAA,0x002A9F4CFC8,0x002A93F55B0,0x002A88A3C14,0x002A7D582A7,0x002A721291E,
	0x002A66D2F2B,0x002A5B99484,0x002A50658DC,0x002A4537BE7,0x002A3A0FD5C,0x002A2EEDCEF,
	0x002A23D1A56,0x002A18BB547,0x002A0DAAD78,0x002A02A02A0,0x0029F79B475,0x0029EC9C2AF,
	0x0029E1A2D05,0x0029D6AF32F,0x0029CBC14E5,0x0029C0D91E0,0x0029B5F69D7,0x0029AB19C84,
	0x0029A0429A0,0x002995710E4,0x00298AA520B,0x00297FDECCE,0x0029751E0E8,0x00296A62E13,
	0x00295FAD40A,0x002954FD288,0x00294A5294A,0x00293FAD80A,0x0029350DE84,0x00292A73C76,
	0x00291FDF19B,0x0029154FDB0,0x00290AC6072,0x002900419A0
};