summaryrefslogtreecommitdiff
path: root/src/audio/tables/soundfont_table.c
blob: 85c58094e5bd7d24d7985a1fded385258363fbac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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"

#undef DEFINE_SOUNDFONT
    0,

    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
};