Skip to content

Commit 3aa93b9

Browse files
authored
Removed legacy audio mode and fixed ganon sound bug (HarbourMasters#657)
1 parent eab3b5b commit 3aa93b9

File tree

10 files changed

+141
-2140
lines changed

10 files changed

+141
-2140
lines changed

soh/include/variables.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,6 @@ extern "C"
171171
#define gTatumsPerBeat (D_8014A6C0[1])
172172
extern const AudioContextInitSizes D_8014A6C4;
173173
extern s16 gOcarinaSongItemMap[];
174-
extern u8 gSoundFontTable[];
175-
extern u8 gSequenceFontTable[];
176-
extern u8 gSequenceTable[];
177-
extern u8 gSampleBankTable[];
178174
extern u8 D_80155F50[];
179175
extern u8 D_80157580[];
180176
extern u8 D_801579A0[];

soh/include/z64audio.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#define CALC_RESAMPLE_FREQ(sampleRate) ((float)sampleRate / (s32)gAudioContext.audioBufferParameters.frequency)
2222

23-
extern bool gUseLegacySD;
2423
extern char* fontMap[256];
2524

2625
typedef enum {

soh/soh/OTRGlobals.cpp

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,57 +1351,6 @@ extern "C" int16_t OTRGetRectDimensionFromRightEdge(float v) {
13511351
return ((int)ceilf(OTRGetDimensionFromRightEdge(v)));
13521352
}
13531353

1354-
extern "C" void bswapSoundFontSound(SoundFontSound* swappable) {
1355-
swappable->sample = (SoundFontSample*)BOMSWAP32((u32)(uintptr_t(swappable->sample)));
1356-
swappable->tuningAsU32 = BOMSWAP32((u32)(swappable->tuningAsU32 & 0xFFFFFFFF));
1357-
}
1358-
1359-
extern "C" void bswapDrum(Drum* swappable) {
1360-
bswapSoundFontSound(&swappable->sound);
1361-
swappable->envelope = (AdsrEnvelope*)BOMSWAP32((u32)uintptr_t(swappable->envelope));
1362-
}
1363-
1364-
extern "C" void bswapInstrument(Instrument* swappable) {
1365-
swappable->envelope = (AdsrEnvelope*)BOMSWAP32((u32)uintptr_t(swappable->envelope));
1366-
bswapSoundFontSound(&swappable->lowNotesSound);
1367-
bswapSoundFontSound(&swappable->normalNotesSound);
1368-
bswapSoundFontSound(&swappable->highNotesSound);
1369-
}
1370-
1371-
extern "C" void bswapSoundFontSample(SoundFontSample* swappable) {
1372-
u32 origBitfield = BOMSWAP32(swappable->asU32);
1373-
1374-
swappable->codec = (origBitfield >> 28) & 0x0F;
1375-
swappable->medium = (origBitfield >> 24) & 0x03;
1376-
swappable->unk_bit26 = (origBitfield >> 22) & 0x01;
1377-
swappable->unk_bit25 = (origBitfield >> 21) & 0x01;
1378-
swappable->size = (origBitfield) & 0x00FFFFFF;
1379-
1380-
swappable->sampleAddr = (u8*)BOMSWAP32((u32)uintptr_t(swappable->sampleAddr));
1381-
swappable->loop = (AdpcmLoop*)BOMSWAP32((u32)uintptr_t(swappable->loop));
1382-
swappable->book = (AdpcmBook*)BOMSWAP32((u32)uintptr_t(swappable->book));
1383-
}
1384-
1385-
extern "C" void bswapAdpcmLoop(AdpcmLoop* swappable) {
1386-
swappable->start = (u32)BOMSWAP32((u32)swappable->start);
1387-
swappable->end = (u32)BOMSWAP32((u32)swappable->end);
1388-
swappable->count = (u32)BOMSWAP32((u32)swappable->count);
1389-
1390-
if (swappable->count != 0) {
1391-
for (int i = 0; i < 16; i++) {
1392-
swappable->state[i] = (s16)BOMSWAP16(swappable->state[i]);
1393-
}
1394-
}
1395-
}
1396-
1397-
extern "C" void bswapAdpcmBook(AdpcmBook* swappable) {
1398-
swappable->order = (u32)BOMSWAP32((u32)swappable->order);
1399-
swappable->npredictors = (u32)BOMSWAP32((u32)swappable->npredictors);
1400-
1401-
for (int i = 0; i < swappable->npredictors * swappable->order * sizeof(s16) * 4; i++)
1402-
swappable->book[i] = (s16)BOMSWAP16(swappable->book[i]);
1403-
}
1404-
14051354
extern "C" bool AudioPlayer_Init(void) {
14061355
if (OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer() != nullptr) {
14071356
return OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer()->Init();

soh/soh/OTRGlobals.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ float OTRGetDimensionFromLeftEdge(float v);
7777
float OTRGetDimensionFromRightEdge(float v);
7878
int16_t OTRGetRectDimensionFromLeftEdge(float v);
7979
int16_t OTRGetRectDimensionFromRightEdge(float v);
80-
void bswapDrum(Drum* swappable);
81-
void bswapInstrument(Instrument* swappable);
82-
bool bswapSoundFontSound(SoundFontSound* swappable);
83-
void bswapSoundFontSample(SoundFontSample* swappable);
84-
void bswapAdpcmLoop(AdpcmLoop* swappable);
85-
void bswapAdpcmBook(AdpcmBook* swappable);
8680
char* ResourceMgr_LoadFileRaw(const char* resName);
8781
bool AudioPlayer_Init(void);
8882
int AudioPlayer_Buffered(void);

0 commit comments

Comments
 (0)