summaryrefslogtreecommitdiff
path: root/tools/audio/aifc.c
AgeCommit message (Collapse)Author
2026-03-09Allow `atblgen` to process `sequence_order.in` with empty lines in between ↵Anghelo Carvajal
lines for building on Macos (#2718) The present changes are a direct copy-paste from https://github.com/zeldaret/mm/pull/1850 This fixes building on macos due to a kinda specific issue with Apple clang. When trying to build on Macos (specifically MacOS 12, Monteray with Apple clang 13.0.0 (clang-1300.0.29.30), idk if other versions have this issue too) `make` stops with the following error from `atblgen`: ``` Failed to match line 1: "" regexec error: "regexec() failed to match" Error: Malformed build/n64-us/assets/audio/sequence_order.in? ``` `atblgen` makes the assumption that the `sequence_order.in` file has no extra data, spaces, empty lines, etc. but the file somehow ends up having empty lines between each line on macos. This file is created by using the C preprocessor to process `include/tables/sequence_table.h`. In normal circumstances this file should look like this snip, ``` (Sequence_0,NA_BGM_GENERAL_SFX) (Sequence_1,NA_BGM_AMBIENCE) (Sequence_2,NA_BGM_TERMINA_FIELD) (Sequence_3,NA_BGM_CHASE) (Sequence_4,NA_BGM_MAJORAS_THEME) ``` but it ends up looking like this instead ``` (Sequence_0,NA_BGM_GENERAL_SFX) (Sequence_1,NA_BGM_AMBIENCE) (Sequence_2,NA_BGM_TERMINA_FIELD) (Sequence_3,NA_BGM_CHASE) (Sequence_4,NA_BGM_MAJORAS_THEME) ``` which `atblgen` doesn't like. I believe this happens because there are lines with comments between each macro in [`sequence_table.h`](https://github.com/zeldaret/mm/blob/0877ce4adf28a8e73e05c3c58682273b8bf28749/include/tables/sequence_table.h) and for some reason this Apple clang version decided to preserve those empty lines The fix just makes `atblgen` skip empty lines. I threw `atblgen` to valgrind to check the fix was working as intended and noted a bunch of memory that was being free before exit, so I fixed them. I also noted the tools/audio makefile was not using `OPTFLAGS` when building those tools, so I fixed that too.
2024-12-13[Audio 10/10] Loose ends (#2337)Tharo
* Introduce afile_sizes, generate headers of sizes for soundfonts and sequences * Initial tools/audio README * Versioning for samplebank extraction * Clean up the disassemble_sequence.py runnable interface * Add static assertions for maximum bank sizes * Boost optimization for audio tools * Samplebank XML doc * Soundfont XML doc * More docs in sampleconv for vadpcm * Various tools fixes/cleanup * VADPCM doc * Try to fix md formatting * VADPCM doc can come later * Fix merge with PR 9 * Fix blobs from MM * Try to fix bss * Try fix bss round 2 * Fix sampleconv memset bug * Suggested documentation tweaks
2024-08-27[Audio 6/?] Build Soundfonts and the Soundfont Table (#2056)Tharo
* [Audio 6/?] Build Soundfonts and the Soundfont Table * Improve lots of error messages * First suggested changes * Make audio build debugging more friendly Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Some fixes from MM review * Make soundfont_table.h generation depend on the samplebank xmls since they are read, report from which soundfont the invalid pointer indirect warning originates from --------- Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2024-08-14[Audio 4/?] Build Samplebanks, match Audiotable (#2032)Tharo
* [Audio 4/?] Build Samplebanks, match Audiotable * Fix some makefile formatting * Add missing scope in MARK chunk handling * Add comment to generate asm file when buffer bug data is emitted, remove duplicate CC4 definition * Adjust comment * SBCFLAGS * Remove unnecessary comments on notes_lut * Split build directories creation command into several to avoid it becoming too long * objcopy -j -> --only-section * Fix mkdir warning when extracted/VERSION/assets doesn't exist