FF7/PSX/Sound/Opcodes/0xb4b5

From Final Fantasy Inside
< FF7
Jump to navigation Jump to search

LFO

LFO Forms

The two zeros are a special prefix for moving the LFO pointer, and the following value indicates the relative offset to move to.

const int16_t LFO_FORM_00[] = {
  -0x1FFF,  0x3FFF, -0x3FFF,  0x5FFF, -0x5FFF,
   0x7FFF, -0x7FFF,
   0, 0, -2
};

const int16_t LFO_FORM_01[] = {
   0x7FFF, -0x7FFF,
   0, 0, -2
};

const int16_t LFO_FORM_02[] = {
   0x1FFF,  0x0000,  0x3FFF,  0x0000,  0x5FFF,
   0x0000,  0x7FFF,
   0, 0, -2
};

const int16_t LFO_FORM_03[] = {
   0x7FFF,
   0x0000,  0x7FFF,
   0, 0, -2
};

const int16_t LFO_FORM_04[] = {
  -0x1FFF,  0x0000, -0x3FFF,  0x0000, -0x5FFF,
   0x0000, -0x7FFF,
   0, 0, -2
};

const int16_t LFO_FORM_05[] = {
  -0x7FFF,
   0x0000, -0x7FFF,
   0, 0, -2
};

const int16_t LFO_FORM_06[] = {
   0x0000,  0x0500,  0x09E2,  0x12CD,  0x169E,  0x19E1,  0x1C81,  0x1E6D,
   0x1F9A,  0x1FFF,  0x1F9C,  0x1E71,  0x1C86,  0x19E8,  0x16A7,  0x12D7,
   0x0E90,  0x09EE,  0x050D,  0x0000, -0x04F4, -0x09D6, -0x0E7A, -0x12C3,
  -0x1696, -0x19DA, -0x1C7C, -0x1E6A, -0x1F99, -0x2000, -0x1F9F, -0x1E76,
  -0x1C8D, -0x19F1, -0x16B1, -0x12E3, -0x0E9D, -0x09FC, -0x051B,  0x0000,
   0x0A01,  0x13C4,  0x259A,  0x2D3C,  0x33C2,  0x3902,  0x3CDA,  0x3F34,
   0x3FFF,  0x3F38,  0x3CE2,  0x390D,  0x33D1,  0x2D4F,  0x25AF,  0x1D21,
   0x13DD,  0x0A1B,  0x0000, -0x09E8, -0x13AC, -0x1CF4, -0x2585, -0x2D2B,
  -0x33B3, -0x38F7, -0x3CD3, -0x3F31, -0x4000, -0x3F3D, -0x3CEB, -0x391A,
  -0x33E1, -0x2D62, -0x25C5, -0x1D3A, -0x13F7, -0x0A36,  0x0000,  0x0F02,
   0x1DA6,  0x3867,  0x43DA,  0x4DA3,  0x5583,  0x5B47,  0x5ECE,  0x5FFF,
   0x5ED4,  0x5B53,  0x5594,  0x4DBA,  0x43F6,  0x3886,  0x2BB2,  0x1DCB,
   0x0F29,  0x0000, -0x0EDC, -0x1D82, -0x2B6E, -0x3848, -0x43C0, -0x4D8D,
  -0x5572, -0x5B3D, -0x5EC9, -0x6000, -0x5EDC, -0x5B61, -0x55A7, -0x4DD2,
  -0x4413, -0x38A7, -0x2BD7, -0x1DF2, -0x0F51,
   0x0000,  0x1403,  0x2788,  0x4B34,  0x5A79,  0x6784,  0x7204,  0x79B5,
   0x7E68,  0x7FFF,  0x7E71,  0x79C5,  0x721B,  0x67A3,  0x5A9E,  0x4B5E,
   0x3A43,  0x27BA,  0x1437,  0x0000, -0x13D0, -0x2758, -0x39E7, -0x4B0A,
  -0x5A55, -0x6766, -0x71ED, -0x79A6, -0x7E61, -0x8000, -0x7E7A, -0x79D6,
  -0x7234, -0x67C2, -0x5AC3, -0x4B89, -0x3A73, -0x27ED, -0x146B,
   0, 0, -39
};

const int16_t LFO_FORM_07[] = {
   0x0000,  0x1403,  0x2788,  0x4B34,  0x5A79,  0x6784,  0x7204,  0x79B5,
   0x7E68,  0x7FFF,  0x7E71,  0x79C5,  0x721B,  0x67A3,  0x5A9E,  0x4B5E,
   0x3A43,  0x27BA,  0x1437,  0x0000, -0x13D0, -0x2758, -0x39E7, -0x4B0A,
  -0x5A55, -0x6766, -0x71ED, -0x79A6, -0x7E61, -0x8000, -0x7E7A, -0x79D6,
  -0x7234, -0x67C2, -0x5AC3, -0x4B89, -0x3A73, -0x27ED, -0x146B,
   0, 0, -39
};

const int16_t LFO_FORM_0A[] = {
   0x0000,  0x09E2,  0x12CD,  0x19E1,  0x1E6D,  0x1FFF,  0x1E71,  0x19E8,
   0x12D7,  0x09EE,  0x000D, -0x09D6, -0x12C3, -0x19DA, -0x1E6A, -0x2000,
  -0x1E76, -0x19F1, -0x12E3, -0x09FC,  0x0000,  0x13C4,  0x259A,  0x33C2,
   0x3CDA,  0x3FFF,  0x3CE2,  0x33D1,  0x25AF,  0x13DD,  0x001A, -0x13AC,
  -0x2585, -0x33B3, -0x3CD3, -0x4000, -0x3CEB, -0x33E1, -0x25C5, -0x13F7,
   0x0000,  0x1DA6,  0x3867,  0x4DA3,  0x5B47,  0x5FFF,  0x5B53,  0x4DBA,
   0x3886,  0x1DCB,  0x0027, -0x1D82, -0x3848, -0x4D8D, -0x5B3D, -0x6000,
  -0x5B61, -0x4DD2, -0x38A7, -0x1DF2,
   0x0000,  0x2788,  0x4B34,  0x6784,  0x79B5,  0x7FFF,  0x79C5,  0x67A3,
   0x4B5E,  0x27BA,  0x0034, -0x2758, -0x4B0A, -0x6766, -0x79A6, -0x8000,
  -0x79D6, -0x67C2, -0x4B89, -0x27ED,
   0, 0, -20
};

const int16_t LFO_FORM_0B[] = {
   0x0000,  0x2788,  0x4B34,  0x6784,  0x79B5,  0x7FFF,  0x79C5,  0x67A3,
   0x4B5E,  0x27BA,  0x0034, -0x2758, -0x4B0A, -0x6766, -0x79A6, -0x8000,
  -0x79D6, -0x67C2, -0x4B89, -0x27ED,
   0, 0, -20
};

const int16_t LFO_FORM_08[] = {
   0x0000,  0x07FF,  0x0FFF,  0x17FF,  0x1FFF,  0x17FF,  0x0FFF,  0x07FF,
   0x0000, -0x07FF, -0x0FFF, -0x17FF, -0x1FFF, -0x17FF, -0x0FFF, -0x07FF,
   0x0000,  0x0FFF,  0x1FFF,  0x2FFF,  0x3FFF,  0x2FFF,  0x1FFF,  0x0FFF,
   0x0000, -0x0FFF, -0x1FFF, -0x2FFF, -0x3FFF, -0x2FFF, -0x1FFF, -0x0FFF,
   0x0000,  0x17FF,  0x2FFF,  0x47FF,  0x5FFF,  0x47FF,  0x2FFF,  0x17FF,
   0x0000, -0x17FF, -0x2FFF, -0x47FF, -0x5FFF, -0x47FF, -0x2FFF, -0x17FF,
   0x0000,  0x1FFF,  0x3FFF,  0x5FFF,  0x7FFF,  0x5FFF,  0x3FFF,  0x1FFF,
   0x0000, -0x1FFF, -0x3FFF, -0x5FFF, -0x7FFF, -0x5FFF, -0x3FFF, -0x1FFF,
   0, 0, -16
};

const int16_t LFO_FORM_09[] = {
   0x0000,  0x1FFF,  0x3FFF,  0x5FFF,  0x7FFF,  0x5FFF,  0x3FFF,  0x1FFF,
   0x0000, -0x1FFF, -0x3FFF, -0x5FFF, -0x7FFF, -0x5FFF, -0x3FFF, -0x1FFF,
   0, 0, -16
};

const int16_t LFO_FORM_0C[] = {
   0x0000,  0x31FD,  0x7D05, -0x0A03, -0x1312,  0x793C,  0x75D0,  0x07FC,
  -0x0BEF, -0x3D0B,  0x660F,  0x330E,  0x3FEA, -0x411F, -0x73EE,  0x1821,
  -0x5005,  0x4A00, -0x2C19, -0x0B0B, -0x1EC9, -0x182D,  0x520D,  0x1103,
  -0x5121,  0x4AF8,  0x0746,  0x70F4, -0x713F, -0x68E7,  0x3512, -0x0A00,
   0x1B00, -0x4B17,  0x3B1E, -0x51EB, -0x6338,  0x65F9, -0x3CDD,  0x71F8,
   0x2CF1, -0x59FC, -0x6D04, -0x36F2, -0x4FF7,  0x10E5,  0x0804, -0x7FFF,
   0x12FA,  0x1118, -0x18F7,  0x47F8, -0x6A27, -0x22E4,  0x1B09,  0x0BF4,
   0x7BFC,  0x20FF, -0x6BFC,  0x7DFC, -0x750B, -0x48E9,  0x74F9,  0x2AFC,
  -0x22FA, -0x280D, -0x0B03,  0x0608, -0x0DE8,  0x69DF, -0x43F9,  0x4AF7,
  -0x7615, -0x44D9,  0x1109,  0x7FEF,  0x3615, -0x1333,  0x7621, -0x67EB,
   0x56CF, -0x2BFA,  0x3322, -0x201A, -0x50F6, -0x460B, -0x31F8,  0x5D05,
  -0x4012, -0x0FE6,  0x20E8, -0x60EA, -0x730E, -0x3D19, -0x2DD2, -0x39FF,
  -0x4630, -0x7EF4,  0x4323,  0x28DD, -0x6909,  0x5C3C, -0x6022, -0x5118,
  -0x49E5,  0x3EF3,  0x1408, -0x2517,  0x2C0B, -0x4ECD, -0x571F,  0x05DA,
   0x0914,  0x4E22, -0x0018, -0x780F,  0x21F0, -0x72DB,  0x7DFC,  0x1CF0,
   0x5E11,  0x3DE8, -0x38F6, -0x70E9, -0x0010,  0x6A0D, -0x001D,  0x12F3,
   0x041F,  0x780C, -0x3B11,  0x5B02,  0x3D02,  0x02F2,  0x1519, -0x252B,
  -0x42F7, -0x6DE7, -0x0AFD,  0x62DD,  0x3806,  0x0F26, -0x5705, -0x1F02,
  -0x091D,  0x0E02,  0x0210,  0x4406, -0x6B2C, -0x2EF6, -0x57BA,  0x10F1,
   0x1ACC, -0x4203,  0x1A30, -0x5F15,  0x5FEA, -0x40F0, -0x4411, -0x20E5,
  -0x3DF4,  0x2AE0,  0x3EF2, -0x51D9,  0x5001, -0x0623,  0x3611, -0x52E6,
   0x07DF,  0x6D05,  0x1A0D, -0x4925,  0x6D2B,  0x3607, -0x0434,  0x4208,
   0x0F21,  0x36F6, -0x37FA,  0x0603, -0x0229,  0x7817,  0x0605, -0x50F5,
  -0x6A04,  0x10EC, -0x58F2, -0x520D,  0x660F, -0x420E, -0x2108, -0x1BDF,
  -0x4E19, -0x0313,  0x5B1C, -0x5EF7, -0x330E, -0x0A0D, -0x6505, -0x4BE9,
  -0x6D18,  0x7F08,  0x4BFA, -0x7603,  0x3C1C, -0x0311, -0x0D25,  0x4A1D,
   0x671D, -0x2901,  0x65DA, -0x0E04,  0x6E0A,  0x0A0C,  0x11F8,  0x4A02,
   0x5BFC, -0x14FA, -0x5A13,  0x30E6, -0x7FEF, -0x2DCC,  0x08F8,  0x43DC,
  -0x09F7, -0x590E, -0x65F3,  0x7006, -0x0A16, -0x6304, -0x7EE2, -0x521A,
  -0x19F2, -0x6A09, -0x4CFC, -0x6301, -0x1016, -0x0AE7, -0x0600,  0x3AF6,
  -0x382B,  0x2722, -0x44C8,  0x43D1,  0x77ED,  0x4908, -0x31FE, -0x54F1,
   0x3DEB, -0x24F6,  0x6401,  0x3FF9,  0x76F2, -0x6CF7, -0x2DF1,  0x74E5,
   0, 0, -256
};

const int16_t *LFO_FORMS[] = {
  LFO_FORM_00,  // 0x00
  LFO_FORM_01,  // 0x01
  LFO_FORM_02,  // 0x02
  LFO_FORM_03,  // 0x03
  LFO_FORM_04,  // 0x04
  LFO_FORM_05,  // 0x05
  LFO_FORM_06,  // 0x06
  LFO_FORM_07,  // 0x07
  LFO_FORM_08,  // 0x08
  LFO_FORM_09,  // 0x09
  LFO_FORM_0A,  // 0x0a
  LFO_FORM_0B,  // 0x0b
  LFO_FORM_0C,  // 0x0c
  LFO_FORM_09,  // 0x0d
  LFO_FORM_08,  // 0x0e
  LFO_FORM_09   // 0x0f
};