summaryrefslogtreecommitdiff
path: root/soh/src/code/audio_load.c
diff options
context:
space:
mode:
authorRandom <28494085+Random06457@users.noreply.github.com>2022-05-12 02:18:24 +0900
committerGitHub <noreply@github.com>2022-05-11 13:18:24 -0400
commit09432ee7f44ec1230826ca3ac3cdcf4b5a1f342d (patch)
tree86a51be3e3727f6058446fe8757ac970ecff0746 /soh/src/code/audio_load.c
parent2e1a0b51449ef223c3b10403a643c191ba0100ba (diff)
Linux/GCC Support (#28)
* Initial Linux/GCC support commit * Add instructins for linux in the README * apply suggestions by @Erotemic and @Emill * Fix python 3.10 symlink line * Fix func_80041E80 type mismatch (#3) Type mismatch functions.h:664 * Makefile: clean OTRExporter/libultraship/ZAPDTR with distclean and fix CXX_FILES * Makefile: find C/CXX_FILES automatically * Makefile: remove ugly conditions in find commands * cleanup _MSC_VER usage * fix Windows build * cleanup extraction scripts * fix Windows build * Fix Windows path separator issue * fix rumble support for linux * use glew-cmake in dockerfile * add pulseaudio backend * fix ZAPDTR linkage * Check for "soh.elf" in directory (#6) hide second button if `soh.exe` or `soh.elf` is present * Fix hardcoded segment addresses (#5) * fix condition * hack lus -> soh dep for ZAPDTR Co-authored-by: sholdee <102821812+sholdee@users.noreply.github.com> Co-authored-by: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Co-authored-by: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com>
Diffstat (limited to 'soh/src/code/audio_load.c')
-rw-r--r--soh/src/code/audio_load.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c
index ec8b7be86..7af9037a6 100644
--- a/soh/src/code/audio_load.c
+++ b/soh/src/code/audio_load.c
@@ -1058,7 +1058,7 @@ void AudioLoad_InitSwapFontSampleHeaders(SoundFontSample* sample, uintptr_t romA
size_t maxSoundFontSize = 0x3AA0; // soundFont 0 is the largest size at 0x3AA0
AdpcmLoop* loop;
AdpcmBook* book;
-
+
if (((uintptr_t)sample->loop > maxSoundFontSize) || ((uintptr_t)sample->book > maxSoundFontSize) ) {
bswapSoundFontSample(sample);
@@ -1093,7 +1093,7 @@ void AudioLoad_InitSwapFont(void) {
SoundFontSound* sfxList;
SoundFontSound* sfx;
Instrument** instList;
- Instrument* inst;
+ Instrument* inst;
// Only up to (numFonts - 1) as final font has garbage data to prevent corruption and is never used
for (fontId = 0; fontId < (numFonts - 1); fontId++) {
@@ -1110,12 +1110,12 @@ void AudioLoad_InitSwapFont(void) {
numInstruments = font->numInstruments;
// drums
- ptrs[0] = (void*)_byteswap_ulong((uintptr_t)ptrs[0]);
+ ptrs[0] = (void*)BOMSWAP32((uintptr_t)ptrs[0]);
if ((ptrs[0] != NULL) && (numDrums != 0)) {
drumList = (Drum**)BASE_ROM_OFFSET(ptrs[0]);
for (i = 0; i < numDrums; i++) {
- drumList[i] = (Drum*)_byteswap_ulong((uintptr_t)drumList[i]);
+ drumList[i] = (Drum*)BOMSWAP32((uintptr_t)drumList[i]);
if (drumList[i] != NULL) {
drum = (Drum*)BASE_ROM_OFFSET(drumList[i]);
@@ -1128,7 +1128,7 @@ void AudioLoad_InitSwapFont(void) {
}
// sfxs
- ptrs[1] = (void*)_byteswap_ulong((u32)ptrs[1]);
+ ptrs[1] = (void*)BOMSWAP32((u32)ptrs[1]);
if ((ptrs[1] != NULL) && (numSfxs != 0)) {
sfxList = (SoundFontSound*)BASE_ROM_OFFSET(ptrs[1]);
@@ -1151,7 +1151,7 @@ void AudioLoad_InitSwapFont(void) {
instList = (Instrument**)(&ptrs[2]);
for (i = 0; i < numInstruments; i++) {
- instList[i] = (Instrument*)_byteswap_ulong((uintptr_t)instList[i]);
+ instList[i] = (Instrument*)BOMSWAP32((uintptr_t)instList[i]);
if (instList[i] != NULL) {
inst = BASE_ROM_OFFSET(instList[i]);
@@ -1159,15 +1159,15 @@ void AudioLoad_InitSwapFont(void) {
if (inst->normalRangeLo != 0) {
sample = (SoundFontSample*)BASE_ROM_OFFSET(inst->lowNotesSound.sample);
- AudioLoad_InitSwapFontSampleHeaders(sample, romAddr);
+ AudioLoad_InitSwapFontSampleHeaders(sample, romAddr);
}
sample = (SoundFontSample*)BASE_ROM_OFFSET(inst->normalNotesSound.sample);
- AudioLoad_InitSwapFontSampleHeaders(sample, romAddr);
-
+ AudioLoad_InitSwapFontSampleHeaders(sample, romAddr);
+
if (inst->normalRangeHi != 0x7F) {
sample = (SoundFontSample*)BASE_ROM_OFFSET(inst->highNotesSound.sample);
- AudioLoad_InitSwapFontSampleHeaders(sample, romAddr);
+ AudioLoad_InitSwapFontSampleHeaders(sample, romAddr);
}
}
}