Mario Kart 64
Loading...
Searching...
No Matches
heap.h
Go to the documentation of this file.
1#ifndef AUDIO_HEAP_H
2#define AUDIO_HEAP_H
3
4#include <PR/ultratypes.h>
5
6#include "internal.h"
7
8#define SOUND_LOAD_STATUS_NOT_LOADED 0
9#define SOUND_LOAD_STATUS_IN_PROGRESS 1
10#define SOUND_LOAD_STATUS_COMPLETE 2
11#define SOUND_LOAD_STATUS_DISCARDABLE 3
12#define SOUND_LOAD_STATUS_4 4
13#define SOUND_LOAD_STATUS_5 5
14
15#define IS_BANK_LOAD_COMPLETE(bankId) (gBankLoadStatus[bankId] >= SOUND_LOAD_STATUS_COMPLETE)
16#define IS_SEQ_LOAD_COMPLETE(seqId) (gSeqLoadStatus[seqId] >= SOUND_LOAD_STATUS_COMPLETE)
17
24
30}; // size = 0xC
31
33 /*0x00*/ u32 numEntries;
34 /*0x04*/ struct SoundAllocPool pool;
35 /*0x14*/ struct SeqOrBankEntry entries[32];
36}; // size = 0x194
37
39 /*EU, SH*/
40 /*0x00, 0x00*/ u32 nextSide;
41 /*0x04, */ struct SoundAllocPool pool;
42 /*0x04, pool.start */
43 /*0x08, pool.cur */
44 /*0x0C, 0x0C pool.size */
45 /*0x10, 0x10 pool.numAllocatedEntries */
46 /*0x14, */ struct SeqOrBankEntry entries[2];
47 /*0x14, 0x14 entries[0].ptr */
48 /*0x18, entries[0].size*/
49 /*0x1C, 0x1E entries[0].id */
50 /*0x20, 0x20 entries[1].ptr */
51 /*0x24, entries[1].size*/
52 /*0x28, 0x2A entries[1].id */
53}; // size = 0x2C
54
56 /*0x000*/ struct PersistentPool persistent;
57 /*0x194*/ struct TemporaryPool temporary;
58 /* */ u32 pad2[4];
59}; // size = 0x1D0
60
61struct Unk1Pool {
64};
65
75
76struct UnkPool {
77 /*0x00*/ struct SoundAllocPool pool;
78 /*0x10*/ struct UnkEntry entries[64];
79 /*0x510*/ s32 numEntries;
80 /*0x514*/ u32 unk514;
81};
82
89
90struct PoolSplit2 {
93}; // size = 0x8
94
96void discard_bank(s32 bankId);
97void discard_sequence(s32 seqId);
98void* soundAlloc(struct SoundAllocPool* pool, u32 size);
99void sound_alloc_pool_init(struct SoundAllocPool* pool, void* memAddr, u32 size);
100void persistent_pool_clear(struct PersistentPool* persistent);
101void temporary_pool_clear(struct TemporaryPool* temporary);
102void func_800B90E0(struct SoundAllocPool* pool);
104void func_800B914C(struct PoolSplit*);
105void seq_and_bank_pool_init(struct PoolSplit2* a);
106void persistent_pools_init(struct PoolSplit* a);
107void temporary_pools_init(struct PoolSplit* a);
108void* alloc_bank_or_seq(struct SoundMultiPool*, s32, s32, s32, s32);
109void* get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id);
110void* get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId);
111void func_800B9BE4(f32, f32, u16*);
112void decrease_reverb_gain(void);
114void audio_reset_session(void);
115void* unk_pool1_lookup(s32 poolIdx, s32 id);
116void func_800BA8B0(s32, s32);
117
118extern s32 D_800EA5D0;
119
120extern s32 gMaxAudioCmds;
122extern f32 D_803B7178;
123extern s32 gRefreshRate;
126
127// Note: In some .asm files D_803AFBC8 has been replaced with gLeftVolRampings
128// That is almost certainly incorrect, but I don't know how to fix it at this point
129extern s16 gVolume; // D_803AFBC0
130extern s8 gUseReverb;
131extern s8 gNumSynthesisReverbs; // D_803AFBC3
132extern struct NoteSubEu* gNoteSubsEu;
133extern struct SoundAllocPool gAudioSessionPool; // D_803AFBC8
134extern struct SoundAllocPool gAudioInitPool; // D_803AFBD8
136extern struct SoundAllocPool gPersistentCommonPool; // D_803AFC28
137extern struct SoundAllocPool gTemporaryCommonPool; // D_803AFC38
138extern struct SoundMultiPool gSeqLoadedPool; // D_803AFC48
139extern struct SoundMultiPool gBankLoadedPool; // D_803AFE18
141extern struct Unk1Pool gUnkPool1; // D_803B01B8
142extern struct PoolSplit sSessionPoolSplit; // D_803B0348
143extern struct PoolSplit2 sSeqAndBankPoolSplit; // D_803B0358
144extern struct PoolSplit sPersistentCommonPoolSplit; // D_803B0360;
145extern struct PoolSplit sTemporaryCommonPoolSplit; // D_803B0370;
146extern struct SoundMultiPool gUnusedLoadedPool; // D_803AFFE8
147extern struct SoundAllocPool gSeqAndBankPool; // D_803AFC18
148extern u8 gBankLoadStatus[64]; // D_803B03C0
149extern u8 gUnkLoadStatus[64];
150extern u8 gSeqLoadStatus[256]; // D_803B0400
151extern volatile u8 gAudioResetStatus; // D_803B0500
153extern s32 gAudioResetFadeOutFramesLeft; // D_803B0504
154extern struct Note* gNotes;
155
156#endif // AUDIO_HEAP_H
s32 D_800EA5D0
s32 gAudioResetFadeOutFramesLeft
Definition heap.c:42
s16 gTempoInternalToExternal
Definition load.c:53
void * get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id)
Definition heap.c:458
struct PoolSplit sSessionPoolSplit
Definition heap.c:31
s32 gMaxAudioCmds
Definition load.c:51
void * get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId)
Definition heap.c:468
s32 audio_shut_down_and_reset_step(void)
Definition heap.c:539
void persistent_pool_clear(struct PersistentPool *persistent)
Definition heap.c:174
struct SoundAllocPool gAudioSessionPool
Definition heap.c:17
void reset_bank_and_seq_load_status(void)
Definition heap.c:96
void persistent_pools_init(struct PoolSplit *a)
Definition heap.c:214
void func_800BA8B0(s32, s32)
Definition heap.c:715
void discard_bank(s32 bankId)
Definition heap.c:117
void * unk_pool1_lookup(s32 poolIdx, s32 id)
Definition heap.c:701
void * soundAlloc(struct SoundAllocPool *pool, u32 size)
Definition heap.c:149
u8 gSeqLoadStatus[256]
Definition heap.c:38
u8 gAudioResetPresetIdToLoad
Definition heap.c:41
struct SoundMultiPool gUnusedLoadedPool
Definition heap.h:146
void discard_sequence(s32 seqId)
Definition heap.c:139
struct SoundAllocPool gPersistentCommonPool
Definition heap.c:22
void sound_init_main_pools(s32)
Definition heap.c:196
void * alloc_bank_or_seq(struct SoundMultiPool *, s32, s32, s32, s32)
Definition heap.c:237
f32 D_803B7178
Definition data.c:321
struct Unk1Pool gUnkPool1
Definition heap.c:29
u32 gSampleDmaNumListItems
Definition load.c:31
void func_800B914C(struct PoolSplit *)
Definition heap.c:202
struct AudioSessionSettingsEU gAudioSessionPresets[]
Definition audio_session_presets.c:13
struct SoundAllocPool gTemporaryCommonPool
Definition heap.c:23
struct NoteSubEu * gNoteSubsEu
Definition heap.c:15
volatile u8 gAudioResetStatus
Definition heap.c:40
s8 gUseReverb
Definition heap.c:13
s16 gVolume
Definition heap.c:12
void seq_and_bank_pool_init(struct PoolSplit2 *a)
Definition heap.c:208
s32 gRefreshRate
Definition data.c:322
struct SoundAllocPool gNotesAndBuffersPool
Definition heap.c:19
void func_800B9BE4(f32, f32, u16 *)
Definition heap.c:512
struct SoundAllocPool gAudioInitPool
Definition heap.c:18
void decrease_reverb_gain(void)
Definition heap.c:532
struct SoundMultiPool gBankLoadedPool
Definition heap.c:26
void func_800B90E0(struct SoundAllocPool *pool)
Definition heap.c:190
void temporary_pool_clear(struct TemporaryPool *temporary)
Definition heap.c:180
struct PoolSplit sTemporaryCommonPoolSplit
Definition heap.c:34
struct Note * gNotes
Definition heap.c:46
void temporary_pools_init(struct PoolSplit *a)
Definition heap.c:226
struct PoolSplit sPersistentCommonPoolSplit
Definition heap.c:33
struct SoundAllocPool gSeqAndBankPool
Definition heap.c:21
void audio_reset_session(void)
Definition heap.c:598
u8 gBankLoadStatus[64]
Definition heap.c:37
struct SoundMultiPool gSeqLoadedPool
Definition heap.c:25
u8 gUnkLoadStatus[64]
Definition heap.c:36
struct PoolSplit2 sSeqAndBankPoolSplit
Definition heap.c:32
s8 gNumSynthesisReverbs
Definition heap.c:14
void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size)
Definition heap.c:168
Definition internal.h:502
Definition internal.h:408
Definition internal.h:433
Definition heap.h:32
u32 numEntries
Definition heap.h:33
struct SeqOrBankEntry entries[32]
Definition heap.h:35
struct SoundAllocPool pool
Definition heap.h:34
Definition heap.h:90
u32 wantTemporary
Definition heap.h:92
u32 wantPersistent
Definition heap.h:91
Definition heap.h:83
u32 wantSeq
Definition heap.h:84
u32 wantBank
Definition heap.h:85
u32 wantCustom
Definition heap.h:87
u32 wantUnused
Definition heap.h:86
Definition heap.h:25
u32 size
Definition heap.h:27
s16 id
Definition heap.h:29
u8 * ptr
Definition heap.h:26
s16 poolIndex
Definition heap.h:28
Definition heap.h:18
s32 numAllocatedEntries
Definition heap.h:22
u32 size
Definition heap.h:21
u8 * start
Definition heap.h:19
u8 * cur
Definition heap.h:20
Definition heap.h:55
u32 pad2[4]
Definition heap.h:58
struct TemporaryPool temporary
Definition heap.h:57
struct PersistentPool persistent
Definition heap.h:56
Definition heap.h:38
struct SoundAllocPool pool
Definition heap.h:41
struct SeqOrBankEntry entries[2]
Definition heap.h:46
u32 nextSide
Definition heap.h:40
Definition heap.h:61
struct SoundAllocPool pool
Definition heap.h:62
struct SeqOrBankEntry entries[32]
Definition heap.h:63
Definition heap.h:66
u32 pad
Definition heap.h:70
s8 used
Definition heap.h:67
s8 bankId
Definition heap.h:69
u32 size
Definition heap.h:73
s8 medium
Definition heap.h:68
u8 * srcAddr
Definition heap.h:71
u8 * dstAddr
Definition heap.h:72
Definition heap.h:76
s32 numEntries
Definition heap.h:79
struct UnkEntry entries[64]
Definition heap.h:78
struct SoundAllocPool pool
Definition heap.h:77
u32 unk514
Definition heap.h:80
signed int s32
Definition ultratypes.h:15
unsigned int u32
Definition ultratypes.h:16
signed char s8
Definition ultratypes.h:11
signed short int s16
Definition ultratypes.h:13
float f32
Definition ultratypes.h:34
unsigned short int u16
Definition ultratypes.h:14
unsigned char u8
Definition ultratypes.h:12