From 4606f494f9ba2391eba0e49a4f00db8ae3d86385 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 21 Oct 2023 10:48:50 -0700 Subject: [PATCH] Add hw_lib_dummy for completeness Former-commit-id: acdd04a1e0f5fa069c6bbc5f6d9ba9de44838e93 --- configure.py | 1 + include/musyx/hardware.h | 2 ++ include/musyx/musyx_priv.h | 2 +- include/musyx/synth.h | 2 +- src/musyx/runtime/hw_lib_dummy.c | 4 ++++ src/musyx/runtime/synthvoice.c | 2 +- 6 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/musyx/runtime/hw_lib_dummy.c diff --git a/configure.py b/configure.py index 8b8eda8f..461517dc 100755 --- a/configure.py +++ b/configure.py @@ -1194,6 +1194,7 @@ config.libs = [ Object(Matching, "musyx/runtime/dsp_import.c"), Object(Matching, "musyx/runtime/hw_dolphin.c"), Object(Matching, "musyx/runtime/hw_memory.c"), + Object(Matching, "musyx/runtime/hw_lib_dummy.c"), Object(Matching, "musyx/runtime/CheapReverb/creverb_fx.c"), Object(Matching, "musyx/runtime/CheapReverb/creverb.c"), Object(Matching, "musyx/runtime/StdReverb/reverb_fx.c"), diff --git a/include/musyx/hardware.h b/include/musyx/hardware.h index da88f97d..dc4f1d36 100644 --- a/include/musyx/hardware.h +++ b/include/musyx/hardware.h @@ -35,6 +35,8 @@ void hwSetFilter(unsigned long v, unsigned char mode, unsigned short coefA, unsi void hwLowPassFrqToCoef(unsigned long frq, unsigned short* _a0, unsigned short* _b1); #endif +extern u32 aramSize; +extern u8* aramBase; #ifdef __cplusplus } #endif diff --git a/include/musyx/musyx_priv.h b/include/musyx/musyx_priv.h index 5fc82e2b..f28df748 100644 --- a/include/musyx/musyx_priv.h +++ b/include/musyx/musyx_priv.h @@ -513,7 +513,7 @@ typedef struct SYNTH_VOICE { u32 id; // offset 0xF4, size 0x4 VID_LIST* vidList; // offset 0xF8, size 0x4 VID_LIST* vidMasterList; // offset 0xFC, size 0x4 -#if MUSY_VERSION <= MUSY_VERSION_CHECK(2, 0, 0) +#if MUSY_VERSION > MUSY_VERSION_CHECK(1, 5, 3) && MUSY_VERSION <= MUSY_VERSION_CHECK(2, 0, 0) u16 allocId; // offset 0x100, size 0x2 #else u32 allocId; diff --git a/include/musyx/synth.h b/include/musyx/synth.h index 7a8c7e74..fc1c9d0d 100644 --- a/include/musyx/synth.h +++ b/include/musyx/synth.h @@ -36,7 +36,7 @@ bool synthIsFadeOutActive(u8 vGroup); /* TODO: Move this where it belongs */ void hwSetAUXProcessingCallbacks(u8 studio, SND_AUX_CALLBACK auxA, void* userA, SND_AUX_CALLBACK auxB, void* userB); - +u32 voiceBlock(u8 prio); MSTEP* dataGetMacro(u16 mid); u32 voiceAllocate(u8 priority, u8 maxVoices, u16 allocId, u8 fxFlag); diff --git a/src/musyx/runtime/hw_lib_dummy.c b/src/musyx/runtime/hw_lib_dummy.c new file mode 100644 index 00000000..c8856bd3 --- /dev/null +++ b/src/musyx/runtime/hw_lib_dummy.c @@ -0,0 +1,4 @@ +#include "musyx/musyx.h" + +u32 aramSize = 0; +u8* aramBase = NULL; diff --git a/src/musyx/runtime/synthvoice.c b/src/musyx/runtime/synthvoice.c index f7fad91c..6a837897 100644 --- a/src/musyx/runtime/synthvoice.c +++ b/src/musyx/runtime/synthvoice.c @@ -350,7 +350,7 @@ void synthInitAllocationAids() { voiceMusicRunning = 0; } -u32 voiceBlock(unsigned char prio) { +u32 voiceBlock(u8 prio) { u32 voice; if ((voice = voiceAllocate(prio, 0xFF, 0xFFFF, 1)) != 0xFFFFFFFF) {