aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dfsound/gauss_i.h421
-rw-r--r--plugins/dfsound/spu.c10
-rw-r--r--plugins/dfsound/xa.c60
3 files changed, 326 insertions, 165 deletions
diff --git a/plugins/dfsound/gauss_i.h b/plugins/dfsound/gauss_i.h
index 4405e57..012cf70 100644
--- a/plugins/dfsound/gauss_i.h
+++ b/plugins/dfsound/gauss_i.h
@@ -5,6 +5,7 @@
copyright : (C) 2003 by Chris Moeller, eh, whatever
email : chris@kode54.tk
***************************************************************************/
+
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
@@ -15,136 +16,296 @@
* *
***************************************************************************/
+//*************************************************************************//
+// History of changes:
+//
+// 2003/02/08 - kode54
+// - generated by interleaving table from gauss.h from the libopenspc
+// project; a gaussian bell curve table logged from the SPC-700,
+// though Neill says he logged the same curve from a PSX SPU. Also
+// says that interleaving the coefficients together runs faster. Meh.
+//
+//*************************************************************************//
+
#ifndef GAUSS_H
#define GAUSS_H
-static const short gauss[]={
- 0x172, 0x519, 0x176, 0x000, 0x16E, 0x519, 0x17A, 0x000,
- 0x16A, 0x518, 0x17D, 0x000, 0x166, 0x518, 0x181, 0x000,
- 0x162, 0x518, 0x185, 0x000, 0x15F, 0x518, 0x189, 0x000,
- 0x15B, 0x518, 0x18D, 0x000, 0x157, 0x517, 0x191, 0x000,
- 0x153, 0x517, 0x195, 0x000, 0x150, 0x517, 0x19A, 0x000,
- 0x14C, 0x516, 0x19E, 0x000, 0x148, 0x516, 0x1A2, 0x000,
- 0x145, 0x515, 0x1A6, 0x000, 0x141, 0x514, 0x1AA, 0x000,
- 0x13E, 0x514, 0x1AE, 0x000, 0x13A, 0x513, 0x1B2, 0x000,
- 0x137, 0x512, 0x1B7, 0x001, 0x133, 0x511, 0x1BB, 0x001,
- 0x130, 0x511, 0x1BF, 0x001, 0x12C, 0x510, 0x1C3, 0x001,
- 0x129, 0x50F, 0x1C8, 0x001, 0x125, 0x50E, 0x1CC, 0x001,
- 0x122, 0x50D, 0x1D0, 0x001, 0x11E, 0x50C, 0x1D5, 0x001,
- 0x11B, 0x50B, 0x1D9, 0x001, 0x118, 0x50A, 0x1DD, 0x001,
- 0x114, 0x508, 0x1E2, 0x001, 0x111, 0x507, 0x1E6, 0x002,
- 0x10E, 0x506, 0x1EB, 0x002, 0x10B, 0x504, 0x1EF, 0x002,
- 0x107, 0x503, 0x1F3, 0x002, 0x104, 0x502, 0x1F8, 0x002,
- 0x101, 0x500, 0x1FC, 0x002, 0x0FE, 0x4FF, 0x201, 0x002,
- 0x0FB, 0x4FD, 0x205, 0x003, 0x0F8, 0x4FB, 0x20A, 0x003,
- 0x0F5, 0x4FA, 0x20F, 0x003, 0x0F2, 0x4F8, 0x213, 0x003,
- 0x0EF, 0x4F6, 0x218, 0x003, 0x0EC, 0x4F5, 0x21C, 0x004,
- 0x0E9, 0x4F3, 0x221, 0x004, 0x0E6, 0x4F1, 0x226, 0x004,
- 0x0E3, 0x4EF, 0x22A, 0x004, 0x0E0, 0x4ED, 0x22F, 0x004,
- 0x0DD, 0x4EB, 0x233, 0x005, 0x0DA, 0x4E9, 0x238, 0x005,
- 0x0D7, 0x4E7, 0x23D, 0x005, 0x0D4, 0x4E5, 0x241, 0x005,
- 0x0D2, 0x4E3, 0x246, 0x006, 0x0CF, 0x4E0, 0x24B, 0x006,
- 0x0CC, 0x4DE, 0x250, 0x006, 0x0C9, 0x4DC, 0x254, 0x006,
- 0x0C7, 0x4D9, 0x259, 0x007, 0x0C4, 0x4D7, 0x25E, 0x007,
- 0x0C1, 0x4D5, 0x263, 0x007, 0x0BF, 0x4D2, 0x267, 0x008,
- 0x0BC, 0x4D0, 0x26C, 0x008, 0x0BA, 0x4CD, 0x271, 0x008,
- 0x0B7, 0x4CB, 0x276, 0x009, 0x0B4, 0x4C8, 0x27B, 0x009,
- 0x0B2, 0x4C5, 0x280, 0x009, 0x0AF, 0x4C3, 0x284, 0x00A,
- 0x0AD, 0x4C0, 0x289, 0x00A, 0x0AB, 0x4BD, 0x28E, 0x00A,
- 0x0A8, 0x4BA, 0x293, 0x00B, 0x0A6, 0x4B7, 0x298, 0x00B,
- 0x0A3, 0x4B5, 0x29D, 0x00B, 0x0A1, 0x4B2, 0x2A2, 0x00C,
- 0x09F, 0x4AF, 0x2A6, 0x00C, 0x09C, 0x4AC, 0x2AB, 0x00D,
- 0x09A, 0x4A9, 0x2B0, 0x00D, 0x098, 0x4A6, 0x2B5, 0x00E,
- 0x096, 0x4A2, 0x2BA, 0x00E, 0x093, 0x49F, 0x2BF, 0x00F,
- 0x091, 0x49C, 0x2C4, 0x00F, 0x08F, 0x499, 0x2C9, 0x00F,
- 0x08D, 0x496, 0x2CE, 0x010, 0x08B, 0x492, 0x2D3, 0x010,
- 0x089, 0x48F, 0x2D8, 0x011, 0x086, 0x48C, 0x2DC, 0x011,
- 0x084, 0x488, 0x2E1, 0x012, 0x082, 0x485, 0x2E6, 0x013,
- 0x080, 0x481, 0x2EB, 0x013, 0x07E, 0x47E, 0x2F0, 0x014,
- 0x07C, 0x47A, 0x2F5, 0x014, 0x07A, 0x477, 0x2FA, 0x015,
- 0x078, 0x473, 0x2FF, 0x015, 0x076, 0x470, 0x304, 0x016,
- 0x075, 0x46C, 0x309, 0x017, 0x073, 0x468, 0x30E, 0x017,
- 0x071, 0x465, 0x313, 0x018, 0x06F, 0x461, 0x318, 0x018,
- 0x06D, 0x45D, 0x31D, 0x019, 0x06B, 0x459, 0x322, 0x01A,
- 0x06A, 0x455, 0x326, 0x01B, 0x068, 0x452, 0x32B, 0x01B,
- 0x066, 0x44E, 0x330, 0x01C, 0x064, 0x44A, 0x335, 0x01D,
- 0x063, 0x446, 0x33A, 0x01D, 0x061, 0x442, 0x33F, 0x01E,
- 0x05F, 0x43E, 0x344, 0x01F, 0x05E, 0x43A, 0x349, 0x020,
- 0x05C, 0x436, 0x34E, 0x020, 0x05A, 0x432, 0x353, 0x021,
- 0x059, 0x42E, 0x357, 0x022, 0x057, 0x42A, 0x35C, 0x023,
- 0x056, 0x425, 0x361, 0x024, 0x054, 0x421, 0x366, 0x024,
- 0x053, 0x41D, 0x36B, 0x025, 0x051, 0x419, 0x370, 0x026,
- 0x050, 0x415, 0x374, 0x027, 0x04E, 0x410, 0x379, 0x028,
- 0x04D, 0x40C, 0x37E, 0x029, 0x04C, 0x408, 0x383, 0x02A,
- 0x04A, 0x403, 0x388, 0x02B, 0x049, 0x3FF, 0x38C, 0x02C,
- 0x047, 0x3FB, 0x391, 0x02D, 0x046, 0x3F6, 0x396, 0x02E,
- 0x045, 0x3F2, 0x39B, 0x02F, 0x043, 0x3ED, 0x39F, 0x030,
- 0x042, 0x3E9, 0x3A4, 0x031, 0x041, 0x3E5, 0x3A9, 0x032,
- 0x040, 0x3E0, 0x3AD, 0x033, 0x03E, 0x3DC, 0x3B2, 0x034,
- 0x03D, 0x3D7, 0x3B7, 0x035, 0x03C, 0x3D2, 0x3BB, 0x036,
- 0x03B, 0x3CE, 0x3C0, 0x037, 0x03A, 0x3C9, 0x3C5, 0x038,
- 0x038, 0x3C5, 0x3C9, 0x03A, 0x037, 0x3C0, 0x3CE, 0x03B,
- 0x036, 0x3BB, 0x3D2, 0x03C, 0x035, 0x3B7, 0x3D7, 0x03D,
- 0x034, 0x3B2, 0x3DC, 0x03E, 0x033, 0x3AD, 0x3E0, 0x040,
- 0x032, 0x3A9, 0x3E5, 0x041, 0x031, 0x3A4, 0x3E9, 0x042,
- 0x030, 0x39F, 0x3ED, 0x043, 0x02F, 0x39B, 0x3F2, 0x045,
- 0x02E, 0x396, 0x3F6, 0x046, 0x02D, 0x391, 0x3FB, 0x047,
- 0x02C, 0x38C, 0x3FF, 0x049, 0x02B, 0x388, 0x403, 0x04A,
- 0x02A, 0x383, 0x408, 0x04C, 0x029, 0x37E, 0x40C, 0x04D,
- 0x028, 0x379, 0x410, 0x04E, 0x027, 0x374, 0x415, 0x050,
- 0x026, 0x370, 0x419, 0x051, 0x025, 0x36B, 0x41D, 0x053,
- 0x024, 0x366, 0x421, 0x054, 0x024, 0x361, 0x425, 0x056,
- 0x023, 0x35C, 0x42A, 0x057, 0x022, 0x357, 0x42E, 0x059,
- 0x021, 0x353, 0x432, 0x05A, 0x020, 0x34E, 0x436, 0x05C,
- 0x020, 0x349, 0x43A, 0x05E, 0x01F, 0x344, 0x43E, 0x05F,
- 0x01E, 0x33F, 0x442, 0x061, 0x01D, 0x33A, 0x446, 0x063,
- 0x01D, 0x335, 0x44A, 0x064, 0x01C, 0x330, 0x44E, 0x066,
- 0x01B, 0x32B, 0x452, 0x068, 0x01B, 0x326, 0x455, 0x06A,
- 0x01A, 0x322, 0x459, 0x06B, 0x019, 0x31D, 0x45D, 0x06D,
- 0x018, 0x318, 0x461, 0x06F, 0x018, 0x313, 0x465, 0x071,
- 0x017, 0x30E, 0x468, 0x073, 0x017, 0x309, 0x46C, 0x075,
- 0x016, 0x304, 0x470, 0x076, 0x015, 0x2FF, 0x473, 0x078,
- 0x015, 0x2FA, 0x477, 0x07A, 0x014, 0x2F5, 0x47A, 0x07C,
- 0x014, 0x2F0, 0x47E, 0x07E, 0x013, 0x2EB, 0x481, 0x080,
- 0x013, 0x2E6, 0x485, 0x082, 0x012, 0x2E1, 0x488, 0x084,
- 0x011, 0x2DC, 0x48C, 0x086, 0x011, 0x2D8, 0x48F, 0x089,
- 0x010, 0x2D3, 0x492, 0x08B, 0x010, 0x2CE, 0x496, 0x08D,
- 0x00F, 0x2C9, 0x499, 0x08F, 0x00F, 0x2C4, 0x49C, 0x091,
- 0x00F, 0x2BF, 0x49F, 0x093, 0x00E, 0x2BA, 0x4A2, 0x096,
- 0x00E, 0x2B5, 0x4A6, 0x098, 0x00D, 0x2B0, 0x4A9, 0x09A,
- 0x00D, 0x2AB, 0x4AC, 0x09C, 0x00C, 0x2A6, 0x4AF, 0x09F,
- 0x00C, 0x2A2, 0x4B2, 0x0A1, 0x00B, 0x29D, 0x4B5, 0x0A3,
- 0x00B, 0x298, 0x4B7, 0x0A6, 0x00B, 0x293, 0x4BA, 0x0A8,
- 0x00A, 0x28E, 0x4BD, 0x0AB, 0x00A, 0x289, 0x4C0, 0x0AD,
- 0x00A, 0x284, 0x4C3, 0x0AF, 0x009, 0x280, 0x4C5, 0x0B2,
- 0x009, 0x27B, 0x4C8, 0x0B4, 0x009, 0x276, 0x4CB, 0x0B7,
- 0x008, 0x271, 0x4CD, 0x0BA, 0x008, 0x26C, 0x4D0, 0x0BC,
- 0x008, 0x267, 0x4D2, 0x0BF, 0x007, 0x263, 0x4D5, 0x0C1,
- 0x007, 0x25E, 0x4D7, 0x0C4, 0x007, 0x259, 0x4D9, 0x0C7,
- 0x006, 0x254, 0x4DC, 0x0C9, 0x006, 0x250, 0x4DE, 0x0CC,
- 0x006, 0x24B, 0x4E0, 0x0CF, 0x006, 0x246, 0x4E3, 0x0D2,
- 0x005, 0x241, 0x4E5, 0x0D4, 0x005, 0x23D, 0x4E7, 0x0D7,
- 0x005, 0x238, 0x4E9, 0x0DA, 0x005, 0x233, 0x4EB, 0x0DD,
- 0x004, 0x22F, 0x4ED, 0x0E0, 0x004, 0x22A, 0x4EF, 0x0E3,
- 0x004, 0x226, 0x4F1, 0x0E6, 0x004, 0x221, 0x4F3, 0x0E9,
- 0x004, 0x21C, 0x4F5, 0x0EC, 0x003, 0x218, 0x4F6, 0x0EF,
- 0x003, 0x213, 0x4F8, 0x0F2, 0x003, 0x20F, 0x4FA, 0x0F5,
- 0x003, 0x20A, 0x4FB, 0x0F8, 0x003, 0x205, 0x4FD, 0x0FB,
- 0x002, 0x201, 0x4FF, 0x0FE, 0x002, 0x1FC, 0x500, 0x101,
- 0x002, 0x1F8, 0x502, 0x104, 0x002, 0x1F3, 0x503, 0x107,
- 0x002, 0x1EF, 0x504, 0x10B, 0x002, 0x1EB, 0x506, 0x10E,
- 0x002, 0x1E6, 0x507, 0x111, 0x001, 0x1E2, 0x508, 0x114,
- 0x001, 0x1DD, 0x50A, 0x118, 0x001, 0x1D9, 0x50B, 0x11B,
- 0x001, 0x1D5, 0x50C, 0x11E, 0x001, 0x1D0, 0x50D, 0x122,
- 0x001, 0x1CC, 0x50E, 0x125, 0x001, 0x1C8, 0x50F, 0x129,
- 0x001, 0x1C3, 0x510, 0x12C, 0x001, 0x1BF, 0x511, 0x130,
- 0x001, 0x1BB, 0x511, 0x133, 0x001, 0x1B7, 0x512, 0x137,
- 0x000, 0x1B2, 0x513, 0x13A, 0x000, 0x1AE, 0x514, 0x13E,
- 0x000, 0x1AA, 0x514, 0x141, 0x000, 0x1A6, 0x515, 0x145,
- 0x000, 0x1A2, 0x516, 0x148, 0x000, 0x19E, 0x516, 0x14C,
- 0x000, 0x19A, 0x517, 0x150, 0x000, 0x195, 0x517, 0x153,
- 0x000, 0x191, 0x517, 0x157, 0x000, 0x18D, 0x518, 0x15B,
- 0x000, 0x189, 0x518, 0x15F, 0x000, 0x185, 0x518, 0x162,
- 0x000, 0x181, 0x518, 0x166, 0x000, 0x17D, 0x518, 0x16A,
- 0x000, 0x17A, 0x519, 0x16E, 0x000, 0x176, 0x519, 0x172};
-#endif
+
+/*
+128 * 4 table
+- 0 = past #3
+- 1 = past #2
+- 2 = past #1
+- 3 = past #0
+
+
+offset 0
+for(0) + for(256) + rev(256) + rev(0)
+*/
+
+
+// NOTE: Dr. Hell
+// - Excel NORMDIST($A6,2,0.567,FALSE) [0-4] = 98%
+
+
+// Mednafen's table (PSX) 99-100%
+const int gauss[]={
+ 0x12c7, 0x59b3, 0x1307, 0xffffffff,
+ 0x1288, 0x59b2, 0x1347, 0xffffffff,
+ 0x1249, 0x59b0, 0x1388, 0xffffffff,
+ 0x120b, 0x59ad, 0x13c9, 0xffffffff,
+ 0x11cd, 0x59a9, 0x140b, 0xffffffff,
+ 0x118f, 0x59a4, 0x144d, 0xffffffff,
+ 0x1153, 0x599e, 0x1490, 0xffffffff,
+ 0x1116, 0x5997, 0x14d4, 0xffffffff,
+ 0x10db, 0x598f, 0x1517, 0xffffffff,
+ 0x109f, 0x5986, 0x155c, 0xffffffff,
+ 0x1065, 0x597c, 0x15a0, 0xffffffff,
+ 0x102a, 0x5971, 0x15e6, 0xffffffff,
+ 0x0ff1, 0x5965, 0x162c, 0xffffffff,
+ 0x0fb7, 0x5958, 0x1672, 0xffffffff,
+ 0x0f7f, 0x5949, 0x16b9, 0xffffffff,
+ 0x0f46, 0x593a, 0x1700, 0xffffffff,
+ 0x0f0f, 0x592a, 0x1747, 0x0000,
+ 0x0ed7, 0x5919, 0x1790, 0x0000,
+ 0x0ea1, 0x5907, 0x17d8, 0x0000,
+ 0x0e6b, 0x58f4, 0x1821, 0x0000,
+ 0x0e35, 0x58e0, 0x186b, 0x0000,
+ 0x0e00, 0x58cb, 0x18b5, 0x0000,
+ 0x0dcb, 0x58b5, 0x1900, 0x0000,
+ 0x0d97, 0x589e, 0x194b, 0x0001,
+ 0x0d63, 0x5886, 0x1996, 0x0001,
+ 0x0d30, 0x586d, 0x19e2, 0x0001,
+ 0x0cfd, 0x5853, 0x1a2e, 0x0001,
+ 0x0ccb, 0x5838, 0x1a7b, 0x0002,
+ 0x0c99, 0x581c, 0x1ac8, 0x0002,
+ 0x0c68, 0x57ff, 0x1b16, 0x0002,
+ 0x0c38, 0x57e2, 0x1b64, 0x0003,
+ 0x0c07, 0x57c3, 0x1bb3, 0x0003,
+ 0x0bd8, 0x57a3, 0x1c02, 0x0003,
+ 0x0ba9, 0x5782, 0x1c51, 0x0004,
+ 0x0b7a, 0x5761, 0x1ca1, 0x0004,
+ 0x0b4c, 0x573e, 0x1cf1, 0x0005,
+ 0x0b1e, 0x571b, 0x1d42, 0x0005,
+ 0x0af1, 0x56f6, 0x1d93, 0x0006,
+ 0x0ac4, 0x56d1, 0x1de5, 0x0007,
+ 0x0a98, 0x56ab, 0x1e37, 0x0007,
+ 0x0a6c, 0x5684, 0x1e89, 0x0008,
+ 0x0a40, 0x565b, 0x1edc, 0x0009,
+ 0x0a16, 0x5632, 0x1f2f, 0x0009,
+ 0x09eb, 0x5609, 0x1f82, 0x000a,
+ 0x09c1, 0x55de, 0x1fd6, 0x000b,
+ 0x0998, 0x55b2, 0x202a, 0x000c,
+ 0x096f, 0x5585, 0x207f, 0x000d,
+ 0x0946, 0x5558, 0x20d4, 0x000e,
+ 0x091e, 0x5529, 0x2129, 0x000f,
+ 0x08f7, 0x54fa, 0x217f, 0x0010,
+ 0x08d0, 0x54ca, 0x21d5, 0x0011,
+ 0x08a9, 0x5499, 0x222c, 0x0012,
+ 0x0883, 0x5467, 0x2282, 0x0013,
+ 0x085d, 0x5434, 0x22da, 0x0015,
+ 0x0838, 0x5401, 0x2331, 0x0016,
+ 0x0813, 0x53cc, 0x2389, 0x0018,
+ 0x07ef, 0x5397, 0x23e1, 0x0019,
+ 0x07cb, 0x5361, 0x2439, 0x001b,
+ 0x07a7, 0x532a, 0x2492, 0x001c,
+ 0x0784, 0x52f3, 0x24eb, 0x001e,
+ 0x0762, 0x52ba, 0x2545, 0x0020,
+ 0x0740, 0x5281, 0x259e, 0x0021,
+ 0x071e, 0x5247, 0x25f8, 0x0023,
+ 0x06fd, 0x520c, 0x2653, 0x0025,
+ 0x06dc, 0x51d0, 0x26ad, 0x0027,
+ 0x06bb, 0x5194, 0x2708, 0x0029,
+ 0x069b, 0x5156, 0x2763, 0x002c,
+ 0x067c, 0x5118, 0x27be, 0x002e,
+ 0x065c, 0x50da, 0x281a, 0x0030,
+ 0x063e, 0x509a, 0x2876, 0x0033,
+ 0x061f, 0x505a, 0x28d2, 0x0035,
+ 0x0601, 0x5019, 0x292e, 0x0038,
+ 0x05e4, 0x4fd7, 0x298b, 0x003a,
+ 0x05c7, 0x4f95, 0x29e7, 0x003d,
+ 0x05aa, 0x4f52, 0x2a44, 0x0040,
+ 0x058e, 0x4f0e, 0x2aa1, 0x0043,
+ 0x0572, 0x4ec9, 0x2aff, 0x0046,
+ 0x0556, 0x4e84, 0x2b5c, 0x0049,
+ 0x053b, 0x4e3e, 0x2bba, 0x004d,
+ 0x0520, 0x4df7, 0x2c18, 0x0050,
+ 0x0506, 0x4db0, 0x2c76, 0x0054,
+ 0x04ec, 0x4d68, 0x2cd4, 0x0057,
+ 0x04d2, 0x4d20, 0x2d33, 0x005b,
+ 0x04b9, 0x4cd7, 0x2d91, 0x005f,
+ 0x04a0, 0x4c8d, 0x2df0, 0x0063,
+ 0x0488, 0x4c42, 0x2e4f, 0x0067,
+ 0x0470, 0x4bf7, 0x2eae, 0x006b,
+ 0x0458, 0x4bac, 0x2f0d, 0x006f,
+ 0x0441, 0x4b5f, 0x2f6c, 0x0074,
+ 0x042a, 0x4b13, 0x2fcc, 0x0078,
+ 0x0413, 0x4ac5, 0x302b, 0x007d,
+ 0x03fc, 0x4a77, 0x308b, 0x0082,
+ 0x03e7, 0x4a29, 0x30ea, 0x0087,
+ 0x03d1, 0x49d9, 0x314a, 0x008c,
+ 0x03bc, 0x498a, 0x31aa, 0x0091,
+ 0x03a7, 0x493a, 0x3209, 0x0096,
+ 0x0392, 0x48e9, 0x3269, 0x009c,
+ 0x037e, 0x4898, 0x32c9, 0x00a1,
+ 0x036a, 0x4846, 0x3329, 0x00a7,
+ 0x0356, 0x47f4, 0x3389, 0x00ad,
+ 0x0343, 0x47a1, 0x33e9, 0x00b3,
+ 0x0330, 0x474e, 0x3449, 0x00ba,
+ 0x031d, 0x46fa, 0x34a9, 0x00c0,
+ 0x030b, 0x46a6, 0x3509, 0x00c7,
+ 0x02f9, 0x4651, 0x3569, 0x00cd,
+ 0x02e7, 0x45fc, 0x35c9, 0x00d4,
+ 0x02d6, 0x45a6, 0x3629, 0x00db,
+ 0x02c4, 0x4550, 0x3689, 0x00e3,
+ 0x02b4, 0x44fa, 0x36e8, 0x00ea,
+ 0x02a3, 0x44a3, 0x3748, 0x00f2,
+ 0x0293, 0x444c, 0x37a8, 0x00fa,
+ 0x0283, 0x43f4, 0x3807, 0x0101,
+ 0x0273, 0x439c, 0x3867, 0x010a,
+ 0x0264, 0x4344, 0x38c6, 0x0112,
+ 0x0255, 0x42eb, 0x3926, 0x011b,
+ 0x0246, 0x4292, 0x3985, 0x0123,
+ 0x0237, 0x4239, 0x39e4, 0x012c,
+ 0x0229, 0x41df, 0x3a43, 0x0135,
+ 0x021b, 0x4185, 0x3aa2, 0x013f,
+ 0x020d, 0x412a, 0x3b00, 0x0148,
+ 0x0200, 0x40d0, 0x3b5f, 0x0152,
+ 0x01f2, 0x4074, 0x3bbd, 0x015c,
+ 0x01e5, 0x4019, 0x3c1b, 0x0166,
+ 0x01d9, 0x3fbd, 0x3c79, 0x0171,
+ 0x01cc, 0x3f62, 0x3cd7, 0x017b,
+ 0x01c0, 0x3f05, 0x3d35, 0x0186,
+ 0x01b4, 0x3ea9, 0x3d92, 0x0191,
+ 0x01a8, 0x3e4c, 0x3def, 0x019c,
+ 0x019c, 0x3def, 0x3e4c, 0x01a8,
+ 0x0191, 0x3d92, 0x3ea9, 0x01b4,
+ 0x0186, 0x3d35, 0x3f05, 0x01c0,
+ 0x017b, 0x3cd7, 0x3f62, 0x01cc,
+ 0x0171, 0x3c79, 0x3fbd, 0x01d9,
+ 0x0166, 0x3c1b, 0x4019, 0x01e5,
+ 0x015c, 0x3bbd, 0x4074, 0x01f2,
+ 0x0152, 0x3b5f, 0x40d0, 0x0200,
+ 0x0148, 0x3b00, 0x412a, 0x020d,
+ 0x013f, 0x3aa2, 0x4185, 0x021b,
+ 0x0135, 0x3a43, 0x41df, 0x0229,
+ 0x012c, 0x39e4, 0x4239, 0x0237,
+ 0x0123, 0x3985, 0x4292, 0x0246,
+ 0x011b, 0x3926, 0x42eb, 0x0255,
+ 0x0112, 0x38c6, 0x4344, 0x0264,
+ 0x010a, 0x3867, 0x439c, 0x0273,
+ 0x0101, 0x3807, 0x43f4, 0x0283,
+ 0x00fa, 0x37a8, 0x444c, 0x0293,
+ 0x00f2, 0x3748, 0x44a3, 0x02a3,
+ 0x00ea, 0x36e8, 0x44fa, 0x02b4,
+ 0x00e3, 0x3689, 0x4550, 0x02c4,
+ 0x00db, 0x3629, 0x45a6, 0x02d6,
+ 0x00d4, 0x35c9, 0x45fc, 0x02e7,
+ 0x00cd, 0x3569, 0x4651, 0x02f9,
+ 0x00c7, 0x3509, 0x46a6, 0x030b,
+ 0x00c0, 0x34a9, 0x46fa, 0x031d,
+ 0x00ba, 0x3449, 0x474e, 0x0330,
+ 0x00b3, 0x33e9, 0x47a1, 0x0343,
+ 0x00ad, 0x3389, 0x47f4, 0x0356,
+ 0x00a7, 0x3329, 0x4846, 0x036a,
+ 0x00a1, 0x32c9, 0x4898, 0x037e,
+ 0x009c, 0x3269, 0x48e9, 0x0392,
+ 0x0096, 0x3209, 0x493a, 0x03a7,
+ 0x0091, 0x31aa, 0x498a, 0x03bc,
+ 0x008c, 0x314a, 0x49d9, 0x03d1,
+ 0x0087, 0x30ea, 0x4a29, 0x03e7,
+ 0x0082, 0x308b, 0x4a77, 0x03fc,
+ 0x007d, 0x302b, 0x4ac5, 0x0413,
+ 0x0078, 0x2fcc, 0x4b13, 0x042a,
+ 0x0074, 0x2f6c, 0x4b5f, 0x0441,
+ 0x006f, 0x2f0d, 0x4bac, 0x0458,
+ 0x006b, 0x2eae, 0x4bf7, 0x0470,
+ 0x0067, 0x2e4f, 0x4c42, 0x0488,
+ 0x0063, 0x2df0, 0x4c8d, 0x04a0,
+ 0x005f, 0x2d91, 0x4cd7, 0x04b9,
+ 0x005b, 0x2d33, 0x4d20, 0x04d2,
+ 0x0057, 0x2cd4, 0x4d68, 0x04ec,
+ 0x0054, 0x2c76, 0x4db0, 0x0506,
+ 0x0050, 0x2c18, 0x4df7, 0x0520,
+ 0x004d, 0x2bba, 0x4e3e, 0x053b,
+ 0x0049, 0x2b5c, 0x4e84, 0x0556,
+ 0x0046, 0x2aff, 0x4ec9, 0x0572,
+ 0x0043, 0x2aa1, 0x4f0e, 0x058e,
+ 0x0040, 0x2a44, 0x4f52, 0x05aa,
+ 0x003d, 0x29e7, 0x4f95, 0x05c7,
+ 0x003a, 0x298b, 0x4fd7, 0x05e4,
+ 0x0038, 0x292e, 0x5019, 0x0601,
+ 0x0035, 0x28d2, 0x505a, 0x061f,
+ 0x0033, 0x2876, 0x509a, 0x063e,
+ 0x0030, 0x281a, 0x50da, 0x065c,
+ 0x002e, 0x27be, 0x5118, 0x067c,
+ 0x002c, 0x2763, 0x5156, 0x069b,
+ 0x0029, 0x2708, 0x5194, 0x06bb,
+ 0x0027, 0x26ad, 0x51d0, 0x06dc,
+ 0x0025, 0x2653, 0x520c, 0x06fd,
+ 0x0023, 0x25f8, 0x5247, 0x071e,
+ 0x0021, 0x259e, 0x5281, 0x0740,
+ 0x0020, 0x2545, 0x52ba, 0x0762,
+ 0x001e, 0x24eb, 0x52f3, 0x0784,
+ 0x001c, 0x2492, 0x532a, 0x07a7,
+ 0x001b, 0x2439, 0x5361, 0x07cb,
+ 0x0019, 0x23e1, 0x5397, 0x07ef,
+ 0x0018, 0x2389, 0x53cc, 0x0813,
+ 0x0016, 0x2331, 0x5401, 0x0838,
+ 0x0015, 0x22da, 0x5434, 0x085d,
+ 0x0013, 0x2282, 0x5467, 0x0883,
+ 0x0012, 0x222c, 0x5499, 0x08a9,
+ 0x0011, 0x21d5, 0x54ca, 0x08d0,
+ 0x0010, 0x217f, 0x54fa, 0x08f7,
+ 0x000f, 0x2129, 0x5529, 0x091e,
+ 0x000e, 0x20d4, 0x5558, 0x0946,
+ 0x000d, 0x207f, 0x5585, 0x096f,
+ 0x000c, 0x202a, 0x55b2, 0x0998,
+ 0x000b, 0x1fd6, 0x55de, 0x09c1,
+ 0x000a, 0x1f82, 0x5609, 0x09eb,
+ 0x0009, 0x1f2f, 0x5632, 0x0a16,
+ 0x0009, 0x1edc, 0x565b, 0x0a40,
+ 0x0008, 0x1e89, 0x5684, 0x0a6c,
+ 0x0007, 0x1e37, 0x56ab, 0x0a98,
+ 0x0007, 0x1de5, 0x56d1, 0x0ac4,
+ 0x0006, 0x1d93, 0x56f6, 0x0af1,
+ 0x0005, 0x1d42, 0x571b, 0x0b1e,
+ 0x0005, 0x1cf1, 0x573e, 0x0b4c,
+ 0x0004, 0x1ca1, 0x5761, 0x0b7a,
+ 0x0004, 0x1c51, 0x5782, 0x0ba9,
+ 0x0003, 0x1c02, 0x57a3, 0x0bd8,
+ 0x0003, 0x1bb3, 0x57c3, 0x0c07,
+ 0x0003, 0x1b64, 0x57e2, 0x0c38,
+ 0x0002, 0x1b16, 0x57ff, 0x0c68,
+ 0x0002, 0x1ac8, 0x581c, 0x0c99,
+ 0x0002, 0x1a7b, 0x5838, 0x0ccb,
+ 0x0001, 0x1a2e, 0x5853, 0x0cfd,
+ 0x0001, 0x19e2, 0x586d, 0x0d30,
+ 0x0001, 0x1996, 0x5886, 0x0d63,
+ 0x0001, 0x194b, 0x589e, 0x0d97,
+ 0x0000, 0x1900, 0x58b5, 0x0dcb,
+ 0x0000, 0x18b5, 0x58cb, 0x0e00,
+ 0x0000, 0x186b, 0x58e0, 0x0e35,
+ 0x0000, 0x1821, 0x58f4, 0x0e6b,
+ 0x0000, 0x17d8, 0x5907, 0x0ea1,
+ 0x0000, 0x1790, 0x5919, 0x0ed7,
+ 0x0000, 0x1747, 0x592a, 0x0f0f,
+ 0xffffffff, 0x1700, 0x593a, 0x0f46,
+ 0xffffffff, 0x16b9, 0x5949, 0x0f7f,
+ 0xffffffff, 0x1672, 0x5958, 0x0fb7,
+ 0xffffffff, 0x162c, 0x5965, 0x0ff1,
+ 0xffffffff, 0x15e6, 0x5971, 0x102a,
+ 0xffffffff, 0x15a0, 0x597c, 0x1065,
+ 0xffffffff, 0x155c, 0x5986, 0x109f,
+ 0xffffffff, 0x1517, 0x598f, 0x10db,
+ 0xffffffff, 0x14d4, 0x5997, 0x1116,
+ 0xffffffff, 0x1490, 0x599e, 0x1153,
+ 0xffffffff, 0x144d, 0x59a4, 0x118f,
+ 0xffffffff, 0x140b, 0x59a9, 0x11cd,
+ 0xffffffff, 0x13c9, 0x59ad, 0x120b,
+ 0xffffffff, 0x1388, 0x59b0, 0x1249,
+ 0xffffffff, 0x1347, 0x59b2, 0x1288,
+ 0xffffffff, 0x1307, 0x59b3, 0x12c7,
+};
+
+#endif \ No newline at end of file
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c
index 0058ad2..a64927e 100644
--- a/plugins/dfsound/spu.c
+++ b/plugins/dfsound/spu.c
@@ -345,11 +345,11 @@ INLINE int iGetInterpolationVal(int *SB, int sinc, int spos, int fmod_freq)
int vl, vr;int gpos;
vl = (spos >> 6) & ~3;
gpos = SB[28];
- vr=(gauss[vl]*(int)gval0)&~2047;
- vr+=(gauss[vl+1]*gval(1))&~2047;
- vr+=(gauss[vl+2]*gval(2))&~2047;
- vr+=(gauss[vl+3]*gval(3))&~2047;
- fa = vr>>11;
+ vr=(gauss[vl]*(int)gval0) >> 15;
+ vr+=(gauss[vl+1]*gval(1)) >> 15;
+ vr+=(gauss[vl+2]*gval(2)) >> 15;
+ vr+=(gauss[vl+3]*gval(3)) >> 15;
+ fa = vr;
} break;
//--------------------------------------------------//
case 1: // simple interpolation
diff --git a/plugins/dfsound/xa.c b/plugins/dfsound/xa.c
index ad7e824..bfebe3e 100644
--- a/plugins/dfsound/xa.c
+++ b/plugins/dfsound/xa.c
@@ -189,16 +189,16 @@ INLINE void FeedXA(xa_decode_t *xap)
spos -= 0x10000L;
}
vl = (spos >> 6) & ~3;
- vr=(gauss[vl]*gvall0)&~2047;
- vr+=(gauss[vl+1]*gvall(1))&~2047;
- vr+=(gauss[vl+2]*gvall(2))&~2047;
- vr+=(gauss[vl+3]*gvall(3))&~2047;
- l= (vr >> 11) & 0xffff;
- vr=(gauss[vl]*gvalr0)&~2047;
- vr+=(gauss[vl+1]*gvalr(1))&~2047;
- vr+=(gauss[vl+2]*gvalr(2))&~2047;
- vr+=(gauss[vl+3]*gvalr(3))&~2047;
- l |= vr << 5;
+ vr=(gauss[vl]*gvall0) >> 15;
+ vr+=(gauss[vl+1]*gvall(1)) >> 15;
+ vr+=(gauss[vl+2]*gvall(2)) >> 15;
+ vr+=(gauss[vl+3]*gvall(3)) >> 15;
+ l= vr & 0xffff;
+ vr=(gauss[vl]*gvalr0) >> 15;
+ vr+=(gauss[vl+1]*gvalr(1)) >> 15;
+ vr+=(gauss[vl+2]*gvalr(2)) >> 15;
+ vr+=(gauss[vl+3]*gvalr(3)) >> 15;
+ l |= vr << 16;
}
else
{
@@ -246,16 +246,16 @@ INLINE void FeedXA(xa_decode_t *xap)
spos -= 0x10000L;
}
vl = (spos >> 6) & ~3;
- vr=(gauss[vl]*gvall0)&~2047;
- vr+=(gauss[vl+1]*gvall(1))&~2047;
- vr+=(gauss[vl+2]*gvall(2))&~2047;
- vr+=(gauss[vl+3]*gvall(3))&~2047;
- l= (vr >> 11) & 0xffff;
- vr=(gauss[vl]*gvalr0)&~2047;
- vr+=(gauss[vl+1]*gvalr(1))&~2047;
- vr+=(gauss[vl+2]*gvalr(2))&~2047;
- vr+=(gauss[vl+3]*gvalr(3))&~2047;
- l |= vr << 5;
+ vr=(gauss[vl]*gvall0) >> 15;
+ vr+=(gauss[vl+1]*gvall(1)) >> 15;
+ vr+=(gauss[vl+2]*gvall(2)) >> 15;
+ vr+=(gauss[vl+3]*gvall(3)) >> 15;
+ l= vr & 0xffff;
+ vr=(gauss[vl]*gvalr0) >> 15;
+ vr+=(gauss[vl+1]*gvalr(1)) >> 15;
+ vr+=(gauss[vl+2]*gvalr(2)) >> 15;
+ vr+=(gauss[vl+3]*gvalr(3)) >> 15;
+ l |= vr << 16;
}
else
{
@@ -298,11 +298,11 @@ INLINE void FeedXA(xa_decode_t *xap)
spos -= 0x10000L;
}
vl = (spos >> 6) & ~3;
- vr=(gauss[vl]*gvall0)&~2047;
- vr+=(gauss[vl+1]*gvall(1))&~2047;
- vr+=(gauss[vl+2]*gvall(2))&~2047;
- vr+=(gauss[vl+3]*gvall(3))&~2047;
- l1=s= vr >> 11;
+ vr=(gauss[vl]*gvall0) >> 15;
+ vr+=(gauss[vl+1]*gvall(1)) >> 15;
+ vr+=(gauss[vl+2]*gvall(2)) >> 15;
+ vr+=(gauss[vl+3]*gvall(3)) >> 15;
+ l1=s= vr;
l1 &= 0xffff;
}
else
@@ -343,11 +343,11 @@ INLINE void FeedXA(xa_decode_t *xap)
spos -= 0x10000L;
}
vl = (spos >> 6) & ~3;
- vr=(gauss[vl]*gvall0)&~2047;
- vr+=(gauss[vl+1]*gvall(1))&~2047;
- vr+=(gauss[vl+2]*gvall(2))&~2047;
- vr+=(gauss[vl+3]*gvall(3))&~2047;
- l=s= vr >> 11;
+ vr=(gauss[vl]*gvall0) >> 15;
+ vr+=(gauss[vl+1]*gvall(1)) >> 15;
+ vr+=(gauss[vl+2]*gvall(2)) >> 15;
+ vr+=(gauss[vl+3]*gvall(3)) >> 15;
+ l=s= vr;
}
else
{