1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-12 09:50:50 +00:00

[Audio 6/?] Build Soundfonts and the Soundfont Table (#2056)

* [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>
This commit is contained in:
Tharo 2024-08-28 02:09:59 +01:00 committed by GitHub
parent 17debe8620
commit aa97586659
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 2775 additions and 87 deletions

View file

@ -0,0 +1,50 @@
#include "attributes.h"
#include "z64audio.h"
// Symbol definition
extern AudioTable gSoundFontTable;
#pragma weak gSoundFontTable = sSoundFontTableHeader
// Externs for table
#define DEFINE_SOUNDFONT(name, medium, cachePolicy, sampleBankNormal, sampleBankDD, nInstruments, nDrums, nSfx) \
extern u8 name##_Start[]; \
extern u8 name##_Size[];
#include "assets/audio/soundfont_table.h"
#undef DEFINE_SOUNDFONT
// Table header
NO_REORDER AudioTableHeader sSoundFontTableHeader = {
// The table contains the number of soundfonts, count them with the preprocessor
#define DEFINE_SOUNDFONT(name, medium, cachePolicy, sampleBankNormal, sampleBankDD, nInstruments, nDrums, nSfx) 1 +
#include "assets/audio/soundfont_table.h"
0,
#undef DEFINE_SOUNDFONT
0,
0x00000000,
{ 0, 0, 0, 0, 0, 0, 0, 0 },
};
// Table body
NO_REORDER AudioTableEntry sSoundFontTableEntries[] = {
#define DEFINE_SOUNDFONT(name, medium, cachePolicy, sampleBankNormal, sampleBankDD, nInstruments, nDrums, nSfx) \
{ (u32)name##_Start, \
(u32)name##_Size, \
(medium), \
(cachePolicy), \
((sampleBankNormal) << 8) | (sampleBankDD), \
((nInstruments) << 8) | (nDrums), \
(nSfx) },
#include "assets/audio/soundfont_table.h"
#undef DEFINE_SOUNDFONT
};