Mario Kart 64
Loading...
Searching...
No Matches
load.h File Reference
#include <PR/ultratypes.h>
#include "audio/internal.h"
Include dependency graph for load.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SharedDma
 

Macros

#define AUDIO_FRAME_DMA_QUEUE_SIZE   0x40
 
#define PRELOAD_BANKS   2
 
#define PRELOAD_SEQUENCE   1
 
#define IS_SEQUENCE_CHANNEL_VALID(ptr)   ((uintptr_t) (ptr) != (uintptr_t) & gSequenceChannelNone)
 

Functions

void audio_dma_copy_immediate (u8 *devAddr, void *vAddr, size_t nbytes)
 
void audio_dma_copy_async (uintptr_t, void *, size_t, OSMesgQueue *, OSIoMesg *)
 
void audio_dma_partial_copy_async (uintptr_t *, u8 **, ssize_t *, OSMesgQueue *, OSIoMesg *)
 
void decrease_sample_dma_ttls (void)
 
void * dma_sample_data (uintptr_t, u32, s32, u8 *)
 
void func_800BB030 (s32)
 
s32 func_800BB304 (struct AudioBankSample *)
 
s32 func_800BB388 (s32 bankId, s32 instId, s32 arg2)
 
void func_800BB43C (ALSeqFile *, u8 *)
 
void patch_sound (struct AudioBankSound *sound, u8 *memBase, u8 *offsetBase)
 
void func_800BB584 (s32)
 
void patch_audio_bank (struct AudioBank *mem, u8 *offset, u32 numInstruments, u32 numDrums)
 
struct AudioBankbank_load_immediate (s32, s32)
 
struct AudioBankbank_load_async (s32, s32, struct SequencePlayer *)
 
void * sequence_dma_immediate (s32, s32)
 
void * sequence_dma_async (s32, s32, struct SequencePlayer *)
 
u8 get_missing_bank (u32 seqId, s32 *nonNullCount, s32 *nullCount)
 
struct AudioBankload_banks_immediate (s32, u8 *)
 
void preload_sequence (u32, u8)
 
void load_sequence (u32, u32, s32)
 
void load_sequence_internal (u32, u32, s32)
 

Variables

struct SequencePlayer gSequencePlayers [SEQUENCE_PLAYERS]
 
struct SequenceChannel gSequenceChannels [SEQUENCE_CHANNELS]
 
struct SequenceChannelLayer gSequenceLayers [SEQUENCE_LAYERS]
 
struct SequenceChannel gSequenceChannelNone
 
struct AudioListItem gLayerFreeList
 
struct NotePool gNoteFreeLists
 
OSMesgQueue gCurrAudioFrameDmaQueue
 
OSMesg gCurrAudioFrameDmaMesgBufs [AUDIO_FRAME_DMA_QUEUE_SIZE]
 
OSIoMesg gCurrAudioFrameDmaIoMesgBufs [AUDIO_FRAME_DMA_QUEUE_SIZE]
 
OSMesgQueue D_803B6720
 
OSMesg D_803B6738
 
OSIoMesg D_803B6740
 
struct SharedDma sSampleDmas [0x70]
 
u32 gSampleDmaNumListItems
 
u32 sSampleDmaListSize1
 
s32 D_803B6E60
 
s32 load_bss_pad
 
u8 sSampleDmaReuseQueue1 [256]
 
u8 sSampleDmaReuseQueue2 [256]
 
u8 sSampleDmaReuseQueueTail1
 
u8 sSampleDmaReuseQueueTail2
 
u8 sSampleDmaReuseQueueHead1
 
u8 sSampleDmaReuseQueueHead2
 
ALSeqFilegSeqFileHeader
 
ALSeqFilegAlCtlHeader
 
ALSeqFilegAlTbl
 
u8gAlBankSets
 
u16 gSequenceCount
 
struct CtlEntrygCtlEntries
 
struct AudioBufferParametersEU gAudioBufferParameters
 
u32 D_803B70A8
 
s32 gMaxAudioCmds
 
s32 gMaxSimultaneousNotes
 
s16 gTempoInternalToExternal
 
s8 gAudioLibSoundMode
 
volatile s32 gAudioFrameCount
 
s32 gCurrAudioFrameDmaCount
 

Macro Definition Documentation

◆ AUDIO_FRAME_DMA_QUEUE_SIZE

#define AUDIO_FRAME_DMA_QUEUE_SIZE   0x40

◆ IS_SEQUENCE_CHANNEL_VALID

#define IS_SEQUENCE_CHANNEL_VALID ( ptr)    ((uintptr_t) (ptr) != (uintptr_t) & gSequenceChannelNone)

◆ PRELOAD_BANKS

#define PRELOAD_BANKS   2

◆ PRELOAD_SEQUENCE

#define PRELOAD_SEQUENCE   1

Function Documentation

◆ audio_dma_copy_async()

void audio_dma_copy_async ( uintptr_t devAddr,
void * vAddr,
size_t nbytes,
OSMesgQueue * queue,
OSIoMesg * mesg )

Performs an asynchronus (normal priority) DMA copy

Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_dma_copy_immediate()

void audio_dma_copy_immediate ( u8 * devAddr,
void * vAddr,
size_t nbytes )

Performs an immediate DMA copy

Here is the call graph for this function:
Here is the caller graph for this function:

◆ audio_dma_partial_copy_async()

void audio_dma_partial_copy_async ( uintptr_t * devAddr,
u8 ** vAddr,
ssize_t * remaining,
OSMesgQueue * queue,
OSIoMesg * mesg )

Performs a partial asynchronous (normal priority) DMA copy. This is limited to 0x1000 bytes transfer at once.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bank_load_async()

struct AudioBank * bank_load_async ( s32 bankId,
s32 arg1,
struct SequencePlayer * seqPlayer )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bank_load_immediate()

struct AudioBank * bank_load_immediate ( s32 bankId,
s32 arg1 )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decrease_sample_dma_ttls()

void decrease_sample_dma_ttls ( void )
Here is the caller graph for this function:

◆ dma_sample_data()

void * dma_sample_data ( uintptr_t devAddr,
u32 size,
s32 arg2,
u8 * dmaIndexRef )
Here is the call graph for this function:

◆ func_800BB030()

void func_800BB030 ( s32 )

◆ func_800BB304()

s32 func_800BB304 ( struct AudioBankSample * sample)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_800BB388()

s32 func_800BB388 ( s32 bankId,
s32 instId,
s32 arg2 )
Bug
missing return
Here is the call graph for this function:
Here is the caller graph for this function:

◆ func_800BB43C()

void func_800BB43C ( ALSeqFile * f,
u8 * base )

◆ func_800BB584()

void func_800BB584 ( s32 bankId)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_missing_bank()

u8 get_missing_bank ( u32 seqId,
s32 * nonNullCount,
s32 * nullCount )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_banks_immediate()

struct AudioBank * load_banks_immediate ( s32 seqId,
u8 * outDefaultBank )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_sequence()

void load_sequence ( u32 player,
u32 seqId,
s32 loadAsync )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_sequence_internal()

void load_sequence_internal ( u32 player,
u32 seqId,
s32 loadAsync )
Bug
This should set the last bank (i.e. the first in the JSON) as default, not the missing one. This code path never gets taken, though – all sequence loading is synchronous.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ patch_audio_bank()

void patch_audio_bank ( struct AudioBank * mem,
u8 * offset,
u32 numInstruments,
u32 numDrums )

Doesn't affect EU, but required for US/JP

Doesn't affect EU, but required for US/JP

Here is the call graph for this function:
Here is the caller graph for this function:

◆ patch_sound()

void patch_sound ( struct AudioBankSound * sound,
u8 * memBase,
u8 * offsetBase )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ preload_sequence()

void preload_sequence ( u32 seqId,
u8 preloadMask )
Bug
should be IS_SEQ_LOAD_COMPLETE
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sequence_dma_async()

void * sequence_dma_async ( s32 seqId,
s32 arg1,
struct SequencePlayer * seqPlayer )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sequence_dma_immediate()

void * sequence_dma_immediate ( s32 seqId,
s32 arg1 )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ D_803B6720

OSMesgQueue D_803B6720
extern

◆ D_803B6738

OSMesg D_803B6738
extern

◆ D_803B6740

OSIoMesg D_803B6740
extern

◆ D_803B6E60

s32 D_803B6E60
extern

◆ D_803B70A8

u32 D_803B70A8
extern

◆ gAlBankSets

u8* gAlBankSets
extern

◆ gAlCtlHeader

ALSeqFile* gAlCtlHeader
extern

◆ gAlTbl

ALSeqFile* gAlTbl
extern

◆ gAudioBufferParameters

struct AudioBufferParametersEU gAudioBufferParameters
extern

◆ gAudioFrameCount

volatile s32 gAudioFrameCount
extern

◆ gAudioLibSoundMode

s8 gAudioLibSoundMode
extern

◆ gCtlEntries

struct CtlEntry* gCtlEntries
extern

◆ gCurrAudioFrameDmaCount

s32 gCurrAudioFrameDmaCount
extern

◆ gCurrAudioFrameDmaIoMesgBufs

OSIoMesg gCurrAudioFrameDmaIoMesgBufs[AUDIO_FRAME_DMA_QUEUE_SIZE]
extern

◆ gCurrAudioFrameDmaMesgBufs

OSMesg gCurrAudioFrameDmaMesgBufs[AUDIO_FRAME_DMA_QUEUE_SIZE]
extern

◆ gCurrAudioFrameDmaQueue

OSMesgQueue gCurrAudioFrameDmaQueue
extern

◆ gLayerFreeList

struct AudioListItem gLayerFreeList
extern

◆ gMaxAudioCmds

s32 gMaxAudioCmds
extern

◆ gMaxSimultaneousNotes

s32 gMaxSimultaneousNotes
extern

◆ gNoteFreeLists

struct NotePool gNoteFreeLists
extern

◆ gSampleDmaNumListItems

u32 gSampleDmaNumListItems
extern

◆ gSeqFileHeader

ALSeqFile* gSeqFileHeader
extern

◆ gSequenceChannelNone

struct SequenceChannel gSequenceChannelNone
extern

◆ gSequenceChannels

struct SequenceChannel gSequenceChannels[SEQUENCE_CHANNELS]
extern

◆ gSequenceCount

u16 gSequenceCount
extern

◆ gSequenceLayers

struct SequenceChannelLayer gSequenceLayers[SEQUENCE_LAYERS]
extern

◆ gSequencePlayers

struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS]
extern

◆ gTempoInternalToExternal

s16 gTempoInternalToExternal
extern

◆ load_bss_pad

s32 load_bss_pad
extern

◆ sSampleDmaListSize1

u32 sSampleDmaListSize1
extern

◆ sSampleDmaReuseQueue1

u8 sSampleDmaReuseQueue1[256]
extern

◆ sSampleDmaReuseQueue2

u8 sSampleDmaReuseQueue2[256]
extern

◆ sSampleDmaReuseQueueHead1

u8 sSampleDmaReuseQueueHead1
extern

◆ sSampleDmaReuseQueueHead2

u8 sSampleDmaReuseQueueHead2
extern

◆ sSampleDmaReuseQueueTail1

u8 sSampleDmaReuseQueueTail1
extern

◆ sSampleDmaReuseQueueTail2

u8 sSampleDmaReuseQueueTail2
extern

◆ sSampleDmas

struct SharedDma sSampleDmas[0x70]
extern