Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
303c0_len_3e10.c
Go to the documentation of this file.
1#include "common.h"
2#include "audio.h"
3
4typedef struct BufferEntry {
5 /* 0x0 */ u16 fileIndex;
6 /* 0x2 */ u8 bankIndex;
7 /* 0x3 */ u8 bankGroup;
8} BufferEntry; // size = 4
9
10void au_load_BK_headers(AuGlobals* globals, ALHeap* heap) {
11 SBNFileEntry fileEntry;
12 BufferEntry buffer[80];
13 s32 i;
14
15 au_read_rom(globals->bkFileListOffset, &buffer, globals->bkListLength);
16
17 for (i = 0; i < ARRAY_COUNT(buffer); i++) {
18 if (buffer[i].fileIndex == 0xFFFF) {
19 break;
20 }
21
22 au_fetch_SBN_file(buffer[i].fileIndex, AU_FMT_BK, &fileEntry);
23 au_load_BK_to_bank(fileEntry.offset, NULL, buffer[i].bankIndex, buffer[i].bankGroup);
24 }
25}
SoundBank * au_load_BK_to_bank(s32 bkFileOffset, SoundBank *bank, s32 bankIndex, s32 bankGroup)
void au_read_rom(s32 romAddr, void *buffer, u32 size)
AuResult au_fetch_SBN_file(u32 fileIdx, AuFileFormat format, SBNFileEntry *outEntry)
void au_load_BK_headers(AuGlobals *globals, ALHeap *heap)
s32 bkFileListOffset
Definition audio.h:900
s32 bkListLength
Definition audio.h:901
s32 offset
Definition audio.h:835
@ AU_FMT_BK
Definition enums.h:1776
#define ARRAY_COUNT(arr)
Definition macros.h:40