Skip to content

Commit

Permalink
submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
louist103 committed Nov 28, 2024
1 parent ec7eb5d commit 9d642a1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
24 changes: 13 additions & 11 deletions soh/include/z64audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@

//#define MAX_SEQUENCES 0x800
extern size_t sequenceMapSize;
extern size_t fontMapSize;

extern char* fontMap[256];
extern char** fontMap;

#define MAX_AUTHENTIC_SEQID 110

Expand Down Expand Up @@ -117,13 +118,15 @@ typedef struct {
/* 0x2 */ s16 arg;
} AdsrEnvelope; // size = 0x4

typedef struct {
typedef struct AdpcmLoop {
/* 0x00 */ uintptr_t start;
/* 0x04 */ uintptr_t end;
/* 0x08 */ u32 count;
/* 0x0C */ char unk_0C[0x4];
/* 0x10 */ s16 state[16]; // only exists if count != 0. 8-byte aligned
} AdpcmLoop; // size = 0x30 (or 0x10)
/* 0x04 */ uintptr_t loopEnd; // numSamples position into the sample where the loop ends
/* 0x08 */ u32 count; // The number of times the loop is played before the sound completes. Setting count to -1
// indicates that the loop should play indefinitely.
/* 0x0C */ u32 sampleEnd; // total number of s16-samples in the sample audio clip
/* 0x10 */ s16 predictorState[16]; // only exists if count != 0. 8-byte aligned
} AdpcmLoop; // size = 0x30 (or 0x10)


typedef struct {
/* 0x00 */ s32 order;
Expand All @@ -139,16 +142,15 @@ typedef struct
/* 0x00 */ u32 medium : 2;
/* 0x00 */ u32 unk_bit26 : 1;
/* 0x00 */ u32 unk_bit25 : 1; // this has been named isRelocated in zret
/* 0x01 */ u32 size : 24;
};
u32 asU32;
};
// SOH [Port][Custom Audio] Custom sample sizes will be too big to fit in the 24 bits given originally.
/* 0x01 */ u32 size;

/* 0x04 */ u8* sampleAddr;
/* 0x08 */ AdpcmLoop* loop;
/* 0x0C */ AdpcmBook* book;
u32 sampleRateMagicValue; // For wav samples only...
s32 sampleRate; // For wav samples only...
} SoundFontSample; // size = 0x10

typedef struct {
Expand Down Expand Up @@ -917,7 +919,7 @@ typedef struct {
/* 0x3420 */ AudioPoolSplit3 persistentCommonPoolSplit;
/* 0x342C */ AudioPoolSplit3 temporaryCommonPoolSplit;
/* 0x3438 */ u8 sampleFontLoadStatus[0x30];
/* 0x3468 */ u8 fontLoadStatus[0x30];
/* 0x3468 */ u8* fontLoadStatus;
/* 0x3498 */ u8* seqLoadStatus;
/* 0x3518 */ volatile u8 resetStatus;
/* 0x3519 */ u8 audioResetSpecIdToLoad;
Expand Down
5 changes: 5 additions & 0 deletions soh/soh/ResourceManagerHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,11 @@ extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) {
return *sequence;
}

extern "C" SequenceData* ResourceMgr_LoadSeqPtrByName(const char* path) {
SequenceData* sequence = (SequenceData*)ResourceGetDataByName(path);
return sequence;
}

extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path) {
return (SoundFontSample*) ResourceGetDataByName(path);
}
Expand Down
1 change: 1 addition & 0 deletions soh/soh/ResourceManagerHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ extern "C" {
Vtx* ResourceMgr_LoadVtxByName(char* path);
SoundFont* ResourceMgr_LoadAudioSoundFontByName(const char* path);
SequenceData ResourceMgr_LoadSeqByName(const char* path);
SequenceData* ResourceMgr_LoadSeqPtrByName(const char* path);
SoundFontSample* ResourceMgr_LoadAudioSample(const char* path);
CollisionHeader* ResourceMgr_LoadColByName(const char* path);
bool ResourceMgr_IsAltAssetsEnabled();
Expand Down

0 comments on commit 9d642a1

Please sign in to comment.