mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 11:22:17 -05:00
2308ab8823
* Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
125 lines
4.0 KiB
C
125 lines
4.0 KiB
C
#include "global.h"
|
|
#include <string.h>
|
|
#include "soh/OTRGlobals.h"
|
|
|
|
void func_800C3C80(AudioMgr* audioMgr) {
|
|
AudioTask* task;
|
|
|
|
task = audioMgr->rspTask;
|
|
if (audioMgr->rspTask->taskQueue != NULL) {
|
|
osSendMesgPtr(task->taskQueue, NULL, OS_MESG_BLOCK);
|
|
}
|
|
}
|
|
|
|
void AudioMgr_HandleRetrace(AudioMgr* audioMgr) {
|
|
AudioTask* rspTask;
|
|
|
|
if (SREG(20) > 0) {
|
|
audioMgr->rspTask = NULL;
|
|
}
|
|
if (audioMgr->rspTask != NULL) {
|
|
audioMgr->audioTask.next = NULL;
|
|
audioMgr->audioTask.flags = 2;
|
|
audioMgr->audioTask.framebuffer = NULL;
|
|
|
|
audioMgr->audioTask.list = audioMgr->rspTask->task;
|
|
audioMgr->audioTask.msgQ = &audioMgr->unk_AC;
|
|
|
|
audioMgr->audioTask.msg.ptr = NULL;
|
|
osSendMesgPtr(&audioMgr->sched->cmdQ, &audioMgr->audioTask, OS_MESG_BLOCK);
|
|
Sched_SendEntryMsg(audioMgr->sched);
|
|
}
|
|
|
|
D_8016A550 = osGetTime();
|
|
if (SREG(20) >= 2) {
|
|
rspTask = NULL;
|
|
} else {
|
|
rspTask = func_800E4FE0();
|
|
}
|
|
D_8016A558 += osGetTime() - D_8016A550;
|
|
D_8016A550 = 0;
|
|
if (audioMgr->rspTask != NULL) {
|
|
osRecvMesg(&audioMgr->unk_AC, NULL, OS_MESG_BLOCK);
|
|
func_800C3C80(audioMgr);
|
|
}
|
|
audioMgr->rspTask = rspTask;
|
|
}
|
|
|
|
void AudioMgr_HandlePRENMI(AudioMgr* audioMgr) {
|
|
// "Audio manager received OS_SC_PRE_NMI_MSG"
|
|
osSyncPrintf("オーディオマネージャが OS_SC_PRE_NMI_MSG を受け取りました\n");
|
|
Audio_PreNMI();
|
|
}
|
|
|
|
void AudioMgr_ThreadEntry(void* arg0) {
|
|
AudioMgr* audioMgr = (AudioMgr*)arg0;
|
|
s16* msg = NULL;
|
|
|
|
//while (true) {
|
|
osRecvMesg(&audioMgr->unk_74, (OSMesg*)&msg, OS_MESG_BLOCK);
|
|
AudioMgr_HandleRetrace(audioMgr);
|
|
/*switch (*msg) {
|
|
case OS_SC_RETRACE_MSG:
|
|
AudioMgr_HandleRetrace(audioMgr);
|
|
while (audioMgr->unk_74.validCount != 0) {
|
|
osRecvMesg(&audioMgr->unk_74, (OSMesg*)&msg, OS_MESG_BLOCK);
|
|
switch (*msg) {
|
|
case OS_SC_RETRACE_MSG:
|
|
break;
|
|
case OS_SC_PRE_NMI_MSG:
|
|
AudioMgr_HandlePRENMI(audioMgr);
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
case OS_SC_PRE_NMI_MSG:
|
|
AudioMgr_HandlePRENMI(audioMgr);
|
|
break;
|
|
}*/
|
|
//}
|
|
}
|
|
|
|
void AudioMgr_Unlock(AudioMgr* audioMgr) {
|
|
osRecvMesg(&audioMgr->unk_C8, NULL, OS_MESG_BLOCK);
|
|
}
|
|
|
|
void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedContext* sched, IrqMgr* irqMgr) {
|
|
// AudioPlayer_Init();
|
|
|
|
memset(audioMgr,0, sizeof(AudioMgr));
|
|
|
|
audioMgr->sched = sched;
|
|
audioMgr->irqMgr = irqMgr;
|
|
audioMgr->rspTask = NULL;
|
|
|
|
osCreateMesgQueue(&audioMgr->unk_AC, &audioMgr->unk_C4, 1);
|
|
osCreateMesgQueue(&audioMgr->unk_74, &audioMgr->unk_8C, 8);
|
|
osCreateMesgQueue(&audioMgr->unk_C8, &audioMgr->unk_E0, 1);
|
|
|
|
osSendMesgPtr(&audioMgr->unk_AC, NULL, OS_MESG_BLOCK);
|
|
|
|
static bool hasInitialized = false;
|
|
|
|
if (!hasInitialized) {
|
|
IrqMgrClient irqClient;
|
|
|
|
osSyncPrintf("オーディオマネージャスレッド実行開始\n"); // "Start running audio manager thread"
|
|
Audio_Init();
|
|
AudioLoad_SetDmaHandler(DmaMgr_DmaHandler);
|
|
Audio_InitSound();
|
|
osSendMesgPtr(&audioMgr->unk_C8, NULL, OS_MESG_BLOCK);
|
|
|
|
Audio_SetGameVolume(SEQ_PLAYER_BGM_MAIN, CVarGetFloat("gMainMusicVolume", 1.0f));
|
|
Audio_SetGameVolume(SEQ_PLAYER_BGM_SUB, CVarGetFloat("gSubMusicVolume", 1.0f));
|
|
Audio_SetGameVolume(SEQ_PLAYER_FANFARE, CVarGetFloat("gFanfareVolume", 1.0f));
|
|
Audio_SetGameVolume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f));
|
|
|
|
// Removed due to crash
|
|
//IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->unk_74);
|
|
hasInitialized = true;
|
|
}
|
|
|
|
//osCreateThread(&audioMgr->unk_E8, id, AudioMgr_ThreadEntry, audioMgr, stack, pri);
|
|
//osStartThread(&audioMgr->unk_E8);
|
|
}
|