From 02701e48d9c2f2fe4e0b706b68eb859707e87293 Mon Sep 17 00:00:00 2001 From: mtabachenko Date: Thu, 28 Nov 2013 14:40:14 +0000 Subject: [PATCH] the BIAS register set to 0x200 on fake boot. --- desmume/src/NDSSystem.cpp | 2 +- desmume/src/SPU.cpp | 6 +++++- desmume/src/SPU.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 7ef8501b5..4fdf9c7e8 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -2394,7 +2394,7 @@ void NDS_Reset() memcpy(FW_Mac, (MMU.fw.data + 0x36), 6); SPU_DeInit(); - SPU_ReInit(); + SPU_ReInit(!canBootFromFirmware && bootResult); //this needs to happen last, pretty much, since it establishes the correct scheduling state based on all of the above initialization initSchedule(); diff --git a/desmume/src/SPU.cpp b/desmume/src/SPU.cpp index 996f21866..cd98a7255 100644 --- a/desmume/src/SPU.cpp +++ b/desmume/src/SPU.cpp @@ -184,9 +184,13 @@ SoundInterface_struct *SPU_SoundCore() return SNDCore; } -void SPU_ReInit() +void SPU_ReInit(bool fakeBoot) { SPU_Init(SNDCoreId, buffersize); + + // Firmware set BIAS to 0x200 + if (fakeBoot) + SPU_WriteWord(0x04000504, 0x0200); } int SPU_Init(int coreid, int buffersize) diff --git a/desmume/src/SPU.h b/desmume/src/SPU.h index df43ac3e5..e398fbc0e 100644 --- a/desmume/src/SPU.h +++ b/desmume/src/SPU.h @@ -194,7 +194,7 @@ public: int SPU_ChangeSoundCore(int coreid, int buffersize); SoundInterface_struct *SPU_SoundCore(); -void SPU_ReInit(); +void SPU_ReInit(bool fakeBoot = false); int SPU_Init(int coreid, int buffersize); void SPU_Pause(int pause); void SPU_SetVolume(int volume);