Misc fixes 1 (#1491)

* Some low-hanging UB

* document bug on z_file_nameset_NES.c

* ALIGNED on audio data

* document bug on decode

* document bugs on Message_Decode

* Format

* More ALIGNED

* Put the ALIGNED macro at the right like the other uses in the repo

* review

* fix Message Decode

(cherry picked from commit abfbc7068816756f7ea3fa4a36ee0fe664c54c72)

Co-authored-by: engineer124 <engineer124engineer124@gmail.com>

* remove comments

* Update src/overlays/gamestates/ovl_file_choose/z_file_choose_NES.c

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* format

---------

Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
Anghelo Carvajal
2023-11-14 08:46:22 -03:00
committed by GitHub
parent 60ddc5891e
commit 3d150f3e1d
14 changed files with 54 additions and 41 deletions
+12 -12
View File
@@ -1,6 +1,6 @@
#include "global.h"
s16 gLowPassFilterData[16 * 8] = {
s16 gLowPassFilterData[16 * 8] ALIGNED(16) = {
/* 0x0 */ 0, 0, 0, 32767, 0, 0, 0, 0, // Identity filter (delta function)
/* 0x1 */ 3854, 4188, 4398, 4469, 4398, 4188, 3854, 3416, // low-freq cutoff (more filtering)
/* 0x2 */ 3415, 4314, 4915, 5126, 4915, 4314, 3415, 2351,
@@ -19,7 +19,7 @@ s16 gLowPassFilterData[16 * 8] = {
/* 0xF */ 841, -853, 863, 26829, 863, -853, 841, -820, // high-freq cutoff (less filtering)
};
s16 gHighPassFilterData[15 * 8] = {
s16 gHighPassFilterData[15 * 8] ALIGNED(16) = {
/* 0x0 */ -289, -291, -289, 30736, -289, -291, -289, -290, // low-freq cutoff (less filtering)
/* 0x1 */ -464, -467, -467, 29506, -467, -467, -464, -463,
/* 0x2 */ -662, -670, -672, 28101, -672, -670, -662, -656,
@@ -38,7 +38,7 @@ s16 gHighPassFilterData[15 * 8] = {
};
// clang-format off
s16 gBandStopFilterData[105 * 8] = {
s16 gBandStopFilterData[105 * 8] ALIGNED(16) = {
// Block 0
/* 0x00 */ -43, -716, -1205, 28210, -1205, -716, -43, 629,
/* 0x01 */ 249, -919, -1819, 25489, -1819, -919, 249, 1301,
@@ -173,7 +173,7 @@ s16 gBandStopFilterData[105 * 8] = {
/* 0x68 */ 434, -453, 467, 29652, 467, -453, 434, -405,
};
s16 gBandPassFilterData[105 * 8] = {
s16 gBandPassFilterData[105 * 8] ALIGNED(16) = {
// Block 0
/* 0x00 */ 687, 4058, 6599, 7544, 6599, 4058, 687, -2532,
/* 0x01 */ -1303, 2777, 6337, 7745, 6337, 2777, -1303, -4185,
@@ -308,7 +308,7 @@ s16 gBandPassFilterData[105 * 8] = {
/* 0x68 */ -3854, 4188, -4398, 4469, -4398, 4188, -3854, 3415,
};
s16 gSawtoothWaveSample[] = {
s16 gSawtoothWaveSample[] ALIGNED(16) = {
// 1st Harmonic
0, 1023, 2047, 3071, 4095, 5119, 6143, 7167,
8191, 9215, 10239, 11263, 12287, 13311, 14335, 15359,
@@ -350,7 +350,7 @@ s16 gSawtoothWaveSample[] = {
0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
};
s16 gTriangleWaveSample[] = {
s16 gTriangleWaveSample[] ALIGNED(16) = {
// 1st Harmonic
0, 2047, 4095, 6143, 8191, 10239, 12287, 14335,
16383, 18431, 20479, 22527, 24575, 26623, 28671, 30719,
@@ -392,7 +392,7 @@ s16 gTriangleWaveSample[] = {
0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
};
s16 gSineWaveSample[] = {
s16 gSineWaveSample[] ALIGNED(16) = {
// 1st Harmonic
0, 3211, 6392, 9511, 12539, 15446, 18204, 20787,
23169, 25329, 27244, 28897, 30272, 31356, 32137, 32609,
@@ -434,7 +434,7 @@ s16 gSineWaveSample[] = {
0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
};
s16 gSquareWaveSample[] = {
s16 gSquareWaveSample[] ALIGNED(16) = {
// 1st Harmonic
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -476,7 +476,7 @@ s16 gSquareWaveSample[] = {
0, 0, 32767, 32767, 0, 0, -32767, -32767,
};
s16 gWhiteNoiseSample[] = {
s16 gWhiteNoiseSample[] ALIGNED(16) = {
// 1st Harmonic
0, -25689, -25791, 27803, -27568, -21030, 22174, 6298,
27071, -18531, 28649, 2284, 3380, 6890, -12682, -21114,
@@ -519,7 +519,7 @@ s16 gWhiteNoiseSample[] = {
};
// Sine White Noise?
s16 D_801D4790[] = {
s16 D_801D4790[] ALIGNED(16) = {
// 1st Harmonic
0, 16316, 20148, 20257, 27209, -32657, 29264, 27259,
-29394, -21494, -26410, 30770, 30033, 29130, 20206, 14129,
@@ -562,7 +562,7 @@ s16 D_801D4790[] = {
};
// Pulse Wave (duty cycle = 12.5%)
s16 gEighthPulseWaveSample[] = {
s16 gEighthPulseWaveSample[] ALIGNED(16) = {
// 1st Harmonic
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
@@ -605,7 +605,7 @@ s16 gEighthPulseWaveSample[] = {
};
// Pulse Wave (duty cycle = 25%)
s16 gQuarterPulseWaveSample[] = {
s16 gQuarterPulseWaveSample[] ALIGNED(16) = {
// 1st Harmonic
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,