diff --git a/configure.py b/configure.py index 33222ae5..619766fe 100644 --- a/configure.py +++ b/configure.py @@ -769,7 +769,7 @@ config.libs = [ Object(NonMatching, "jaudio_NES/internal/driver.c"), Object(NonMatching, "jaudio_NES/internal/driverinterface.c"), Object(Matching, "jaudio_NES/internal/dsp_cardunlock.c"), - Object(NonMatching, "jaudio_NES/internal/dsp_GBAKey.c"), + Object(Matching, "jaudio_NES/internal/dsp_GBAKey.c"), Object(NonMatching, "jaudio_NES/internal/dspdriver.c"), Object(NonMatching, "jaudio_NES/internal/dspinterface.c"), Object(NonMatching, "jaudio_NES/internal/effect.c"), diff --git a/include/GBA/GBAPriv.h b/include/GBA/GBAPriv.h index 05ce2ab1..2c7359b9 100644 --- a/include/GBA/GBAPriv.h +++ b/include/GBA/GBAPriv.h @@ -76,7 +76,7 @@ s32 __GBASync(s32 chan); OSTime __GBASetDelay(s32 chan, OSTime delay); s32 __GBATransfer(s32 chan, u32 outputBytes, u32 inputBytes, GBATransferCallback proc); void __GBAX01(s32 chan, s32 ret); -void __GBAX02(s32 chan, u8* readbuf); +// void __GBAX02(s32 chan, u8* readbuf); #ifdef __cplusplus } diff --git a/include/jaudio_NES/dsp_GBAKey.h b/include/jaudio_NES/dsp_GBAKey.h new file mode 100644 index 00000000..6a028fec --- /dev/null +++ b/include/jaudio_NES/dsp_GBAKey.h @@ -0,0 +1,16 @@ +#ifndef JAUDIO_DSP_GBAKEY_H +#define JAUDIO_DSP_GBAKEY_H + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void __GBAX02(s32 chan, u8* readbuf); + +#ifdef __cplusplus +} +#endif + +#endif /* JAUDIO_DSP_GBAKEY_H */ diff --git a/include/jaudio_NES/ipldec.h b/include/jaudio_NES/ipldec.h index e20a0cd0..7f6fd828 100644 --- a/include/jaudio_NES/ipldec.h +++ b/include/jaudio_NES/ipldec.h @@ -8,6 +8,7 @@ // Global functions (all C++, so no extern C wrap). BOOL DspExtraTaskCheck(); void Jac_DSPcardDecodeAsync(void*, void*, DSPCallback); +void Jac_DSPagbDecodeAsync(void* task, void* cmd, DSPCallback callback); // IPL Decode specific structs. diff --git a/src/static/dolphin/gba/GBAJoyBoot.c b/src/static/dolphin/gba/GBAJoyBoot.c index 8346f51f..e64583e3 100644 --- a/src/static/dolphin/gba/GBAJoyBoot.c +++ b/src/static/dolphin/gba/GBAJoyBoot.c @@ -1,5 +1,7 @@ #include "GBA/GBAPriv.h" +#include "jaudio_NES/dsp_GBAKey.h" + static volatile u8 D54[] = { 0x18, 0xFC, 0xC0, 0x80, 0x7f, 0x40, 0x3f, 0x01, 0x00, 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x4b, 0x61, 0x77, 0x61, 0x73, 0x65, 0x64, 0x6f, 0x00, diff --git a/src/static/dolphin/gba/GBAKey.c b/src/static/dolphin/gba/GBAKey.c deleted file mode 100644 index b523a765..00000000 --- a/src/static/dolphin/gba/GBAKey.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "gba/GBAPriv.h" -#include "dolphin/dsp.h" - -static s32 F152(DSPTaskInfo* task) { - s32 chan; // r31 - GBAControl* gba = &__GBA[chan]; // r29 - - for (chan = 0; chan < 4; chan++) { - if (&gba->task == task) { - return chan; - } - } - - ASSERTLINE(168, 0 <= chan && chan < 4); - ASSERTMSGLINE(169, FALSE, "GBA - unexpected dsp call"); - return -1; -} - -void __GBAX02(s32 chan, u8* readbuf) { - -} diff --git a/src/static/jaudio_NES/dsp_GBAKey.c b/src/static/jaudio_NES/internal/dsp_GBAKey.c similarity index 80% rename from src/static/jaudio_NES/dsp_GBAKey.c rename to src/static/jaudio_NES/internal/dsp_GBAKey.c index 386bbfbe..281f37d4 100644 --- a/src/static/jaudio_NES/dsp_GBAKey.c +++ b/src/static/jaudio_NES/internal/dsp_GBAKey.c @@ -1,9 +1,12 @@ -#include "gba/GBAPriv.h" -#include "dolphin/os.h" -#include "_mem.h" +#undef DEBUG +#define DEBUG 1 -//TODO: remove this once ipldec is decompiled -extern void Jac_DSPagbDecodeAsync(void*, void*, void (*)(void*)); +#include "jaudio_NES/dsp_GBAKey.h" + +#include "jaudio_NES/ipldec.h" +#include "gba/GBAPriv.h" +#include "dolphin/dsp.h" +#include "_mem.h" static s32 F152(DSPTaskInfo* task) { s32 chan; // r31 @@ -16,7 +19,7 @@ static s32 F152(DSPTaskInfo* task) { } } - (void)((0 <= chan && chan < 4) || (OSPanic(__FILE__, 173, "Failed assertion 0 <= chan && chan < 4"), 0)); + ASSERTLINE(173, 0 <= chan && chan < 4); OSPanic(__FILE__, 174, "GBA - unexpected dsp call"); return -1; }