mirror of
https://github.com/HarbourMasters/Starship
synced 2026-09-01 18:29:55 -04:00
First compilation, we just need more stupid assets
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "sys.h"
|
||||
#include "sf64audio_provisional.h"
|
||||
#include "context.h"
|
||||
#include "sf64context.h"
|
||||
#include "audiothread_cmd.h"
|
||||
#include "audioseq_cmd.h"
|
||||
|
||||
|
||||
+11
-22
@@ -296,7 +296,7 @@ s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId) {
|
||||
|
||||
void AudioLoad_AsyncLoadSampleBank(s32 sampleBankId, s32 nChunks, s32 retData, OSMesgQueue* retQueue) {
|
||||
if (AudioLoad_AsyncLoadInner(2, AudioLoad_GetLoadTableIndex(2, sampleBankId), nChunks, retData, retQueue) == NULL) {
|
||||
osSendMesg(retQueue, NULL, 0);
|
||||
osSendMesg(retQueue, OS_MESG_PTR(NULL), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -742,7 +742,7 @@ void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData,
|
||||
ramAddr = AudioLoad_SearchCaches(tableType, id);
|
||||
if (ramAddr != NULL) {
|
||||
loadStatus = 2;
|
||||
osSendMesg(retQueue, (void*) (retData << 0x18), 0);
|
||||
osSendMesg(retQueue, OS_MESG_32(retData << 0x18), 0);
|
||||
} else {
|
||||
table = AudioLoad_GetLoadTable(tableType);
|
||||
size = table->entries[id].size;
|
||||
@@ -842,21 +842,9 @@ void AudioLoad_Init(void) {
|
||||
for (; dwordsLeft >= 0; dwordsLeft--) {
|
||||
*clearContext++ = 0;
|
||||
}
|
||||
switch (osTvType) {
|
||||
case OS_TV_PAL:
|
||||
gMaxTempoTvTypeFactors = 20.03042f;
|
||||
gRefreshRate = 50;
|
||||
break;
|
||||
case OS_TV_MPAL:
|
||||
gMaxTempoTvTypeFactors = 16.546f;
|
||||
gRefreshRate = 60;
|
||||
break;
|
||||
default:
|
||||
case OS_TV_NTSC:
|
||||
gMaxTempoTvTypeFactors = 16.713f;
|
||||
gRefreshRate = 60;
|
||||
break;
|
||||
}
|
||||
// TODO: osTVType should be unnecessary
|
||||
gMaxTempoTvTypeFactors = 16.713f;
|
||||
gRefreshRate = 60;
|
||||
AudioThread_Init();
|
||||
for (i = 0; i < 3; i++) {
|
||||
gAiBuffLengths[i] = 0xA0;
|
||||
@@ -1084,7 +1072,7 @@ AudioAsyncLoad* AudioLoad_StartAsyncLoad(u32 devAddr, u8* ramAddr, u32 size, s32
|
||||
|
||||
asyncLoad->delay = 3;
|
||||
asyncLoad->medium = medium;
|
||||
asyncLoad->retMsg = retMesg;
|
||||
asyncLoad->retMsg = OS_MESG_32(retMesg);
|
||||
|
||||
osCreateMesgQueue(&asyncLoad->msgQueue, &asyncLoad->msg, 1);
|
||||
return asyncLoad;
|
||||
@@ -1128,7 +1116,7 @@ void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus) {
|
||||
}
|
||||
}
|
||||
if (asyncLoad->bytesRemaining == 0) {
|
||||
temp = asyncLoad->retMsg;
|
||||
temp = asyncLoad->retMsg.data32;
|
||||
pad1 = (temp >> 0x10) & 0xFF;
|
||||
sp24 = (temp >> 8) & 0xFF;
|
||||
pad2 = temp & 0xFF;
|
||||
@@ -1352,17 +1340,18 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) {
|
||||
s32 sampleAddr;
|
||||
u32 size;
|
||||
s32 nChunks;
|
||||
OSMesg mesg;
|
||||
|
||||
if (gPreloadSampleStackTop > 0) {
|
||||
if (resetStatus != 0) {
|
||||
if (osRecvMesg(&gPreloadSampleQueue, (OSMesg) &preloadIndex, 0)) {}
|
||||
if (osRecvMesg(&gPreloadSampleQueue, &mesg, 0)) {}
|
||||
gPreloadSampleStackTop = 0;
|
||||
return false;
|
||||
}
|
||||
if (osRecvMesg(&gPreloadSampleQueue, (OSMesg) &preloadIndex, 0) == -1) {
|
||||
if (osRecvMesg(&gPreloadSampleQueue, &mesg, 0) == -1) {
|
||||
return false;
|
||||
}
|
||||
// "Receive %d\n"
|
||||
preloadIndex = mesg.data32;
|
||||
preloadIndex >>= 0x18;
|
||||
|
||||
if (gPreloadSampleStack[preloadIndex].isFree == 0) {
|
||||
|
||||
@@ -1215,22 +1215,22 @@ Acmd* func_8000B51C(Acmd* aList, NoteSubEu* noteSub, NoteSynthesisState* synthSt
|
||||
switch (delaySide) {
|
||||
case 1:
|
||||
aEnvMixer(aList++, dmemSrc, aiBufLen, 0, 0, ((temp_a1 & 0x80) >> 7),
|
||||
noteSub->bitField0.stereoStrongRight, noteSub->bitField0.stereoStrongLeft, 0x65B1C9E1);
|
||||
noteSub->bitField0.stereoStrongRight, noteSub->bitField0.stereoStrongLeft, 0x65B1C9E1, 0);
|
||||
break;
|
||||
case 2:
|
||||
aEnvMixer(aList++, dmemSrc, aiBufLen, 0, 0, ((temp_a1 & 0x80) >> 7),
|
||||
noteSub->bitField0.stereoStrongRight, noteSub->bitField0.stereoStrongLeft, 0x9965C9E1);
|
||||
noteSub->bitField0.stereoStrongRight, noteSub->bitField0.stereoStrongLeft, 0x9965C9E1, 0);
|
||||
break;
|
||||
default:
|
||||
aEnvMixer(aList++, dmemSrc, aiBufLen, 0, 0, ((temp_a1 & 0x80) >> 7),
|
||||
noteSub->bitField0.stereoStrongRight, noteSub->bitField0.stereoStrongLeft, 0x99B1C9E1);
|
||||
noteSub->bitField0.stereoStrongRight, noteSub->bitField0.stereoStrongLeft, 0x99B1C9E1, 0);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
aEnvSetup1(aList++, (temp_a1 & 0x7F), var_a2, var_t0, var_a3);
|
||||
aEnvSetup2(aList++, temp_t1, temp_t2);
|
||||
aEnvMixer(aList++, dmemSrc, aiBufLen, 0, 0, ((temp_a1 & 0x80) >> 7), noteSub->bitField0.stereoStrongRight,
|
||||
noteSub->bitField0.stereoStrongLeft, 0x99B1C9E1);
|
||||
noteSub->bitField0.stereoStrongLeft, 0x99B1C9E1, 0);
|
||||
}
|
||||
|
||||
return aList;
|
||||
|
||||
+18
-18
@@ -49,15 +49,15 @@ SPTask* AudioThread_CreateTask(void) {
|
||||
OSTask_t* task;
|
||||
u16* sp40;
|
||||
s32 pad3C;
|
||||
u32 sp38;
|
||||
u32 sp34;
|
||||
OSMesg sp38;
|
||||
OSMesg sp34;
|
||||
s32 pad30;
|
||||
|
||||
gAudioTaskCountQ++;
|
||||
if ((gAudioTaskCountQ % gAudioBufferParams.specUnk4) != 0) {
|
||||
return gWaitingAudioTask;
|
||||
}
|
||||
osSendMesg(gAudioTaskStartQueue, (OSMesg) gAudioTaskCountQ, 0);
|
||||
osSendMesg(gAudioTaskStartQueue, OS_MESG_32(gAudioTaskCountQ), 0);
|
||||
gAudioTaskIndexQ ^= 1;
|
||||
gCurAiBuffIndex++;
|
||||
gCurAiBuffIndex %= 3;
|
||||
@@ -71,15 +71,15 @@ SPTask* AudioThread_CreateTask(void) {
|
||||
gCurAudioFrameDmaCount = 0;
|
||||
AudioLoad_DecreaseSampleDmaTtls();
|
||||
AudioLoad_ProcessLoads(gResetStatus);
|
||||
if (osRecvMesg(gAudioUnkQueue, (OSMesg) &sp38, 0) != -1) {
|
||||
if (osRecvMesg(gAudioUnkQueue, &sp38, 0) != -1) {
|
||||
if (gResetStatus == 0) {
|
||||
gResetStatus = 5;
|
||||
}
|
||||
gAudioSpecId = sp38;
|
||||
gAudioSpecId = sp38.data32;
|
||||
}
|
||||
if ((gResetStatus != 0) && (AudioHeap_ResetStep() == 0)) {
|
||||
if (gResetStatus == 0) {
|
||||
osSendMesg(gAudioResetQueue, (OSMesg) (s32) gAudioSpecId, 0);
|
||||
osSendMesg(gAudioResetQueue, OS_MESG_32((s32) gAudioSpecId), 0);
|
||||
}
|
||||
gWaitingAudioTask = NULL;
|
||||
return NULL;
|
||||
@@ -102,8 +102,8 @@ SPTask* AudioThread_CreateTask(void) {
|
||||
if (gAiBuffLengths[sp4C] > gAudioBufferParams.maxAiBufferLength) {
|
||||
gAiBuffLengths[sp4C] = gAudioBufferParams.maxAiBufferLength;
|
||||
}
|
||||
while (osRecvMesg(gThreadCmdProcQueue, (OSMesg) &sp34, 0) != -1) {
|
||||
AudioThread_ProcessCmds(sp34);
|
||||
while (osRecvMesg(gThreadCmdProcQueue, &sp34, 0) != -1) {
|
||||
AudioThread_ProcessCmds(sp34.data32);
|
||||
}
|
||||
gCurAbiCmdBuffer = func_80009B64(gCurAbiCmdBuffer, &sp50, sp40, gAiBuffLengths[sp4C]);
|
||||
gAudioRandom = osGetCount() * (gAudioRandom + gAudioTaskCountQ);
|
||||
@@ -112,19 +112,19 @@ SPTask* AudioThread_CreateTask(void) {
|
||||
sp4C = gAudioTaskIndexQ;
|
||||
|
||||
gAudioCurTask->msgQueue = NULL;
|
||||
gAudioCurTask->msg = NULL;
|
||||
gAudioCurTask->msg = OS_MESG_PTR(NULL);
|
||||
|
||||
task = &gAudioCurTask->task.t;
|
||||
|
||||
task->type = 2;
|
||||
task->flags = 0;
|
||||
task->ucode_boot = rspbootTextStart;
|
||||
task->ucode_boot_size = (uintptr_t) rspbootTextEnd - (uintptr_t) rspbootTextStart;
|
||||
|
||||
task->ucode = aspMainTextStart;
|
||||
task->ucode_data = aspMainDataStart;
|
||||
task->ucode_size = SP_UCODE_SIZE;
|
||||
task->ucode_data_size = (aspMainDataEnd - aspMainDataStart) * 8;
|
||||
// task->ucode_boot = rspbootTextStart;
|
||||
// task->ucode_boot_size = (uintptr_t) rspbootTextEnd - (uintptr_t) rspbootTextStart;
|
||||
//
|
||||
// task->ucode = aspMainTextStart;
|
||||
// task->ucode_data = aspMainDataStart;
|
||||
// task->ucode_size = SP_UCODE_SIZE;
|
||||
// task->ucode_data_size = (aspMainDataEnd - aspMainDataStart) * 8;
|
||||
|
||||
task->dram_stack = NULL;
|
||||
task->dram_stack_size = 0;
|
||||
@@ -282,7 +282,7 @@ void AudioThread_ScheduleProcessCmds(void) {
|
||||
D_800C7C70 = (u8) (gThreadCmdWritePos - gThreadCmdReadPos + 0x100);
|
||||
}
|
||||
msg = (((gThreadCmdReadPos & 0xFF) << 8) | (gThreadCmdWritePos & 0xFF));
|
||||
osSendMesg(gThreadCmdProcQueue, (OSMesg) msg, 0);
|
||||
osSendMesg(gThreadCmdProcQueue, OS_MESG_32(msg), 0);
|
||||
gThreadCmdReadPos = gThreadCmdWritePos;
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ void AudioThread_ResetAudioHeap(s32 specId) {
|
||||
// clang-format on
|
||||
|
||||
AudioThread_ResetCmdQueue();
|
||||
osSendMesg(gAudioUnkQueue, (OSMesg) specId, 0);
|
||||
osSendMesg(gAudioUnkQueue, OS_MESG_32(specId), 0);
|
||||
}
|
||||
|
||||
void AudioThread_PreNMIReset(void) {
|
||||
|
||||
Reference in New Issue
Block a user