From ab0a759741c2a3dc693ac749c00ccec349f4a763 Mon Sep 17 00:00:00 2001 From: amanjagwani Date: Mon, 29 Apr 2024 21:39:10 +0100 Subject: [PATCH] fixes to baremetal build --- Top/csmodule.c | 4 ++++ Top/csound.c | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Top/csmodule.c b/Top/csmodule.c index ceaad6d4f9..13ba7ca680 100644 --- a/Top/csmodule.c +++ b/Top/csmodule.c @@ -1226,7 +1226,9 @@ extern int32_t newgabopc_ModuleInit(CSOUND *csound); extern int32_t csoundModuleInit_ampmidid(CSOUND *csound); extern int32_t csoundModuleInit_mixer(CSOUND *csound); extern int32_t csoundModuleInit_doppler(CSOUND *csound); +#ifndef BARE_METAL extern int32_t csoundModuleInit_ftsamplebank(CSOUND *csound); +#endif extern int32_t csoundModuleInit_signalflowgraph(CSOUND *csound); extern int32_t arrayops_init_modules(CSOUND *csound); extern int32_t lfsr_init_modules(CSOUND *csound); @@ -1317,7 +1319,9 @@ CS_NOINLINE int csoundInitStaticModules(CSOUND *csound) csoundModuleInit_ampmidid, csoundModuleInit_mixer, csoundModuleInit_doppler, +#ifndef BARE_METAL csoundModuleInit_ftsamplebank, + #endif csoundModuleInit_signalflowgraph, arrayops_init_modules, lfsr_init_modules, diff --git a/Top/csound.c b/Top/csound.c index c5cfdb74b6..b5ad85d01d 100644 --- a/Top/csound.c +++ b/Top/csound.c @@ -3644,11 +3644,13 @@ PUBLIC void csoundReset(CSOUND *csound) csoundAddStandardTypes(csound, csound->typePool); /* csoundLoadExternals(csound); */ } + int max_len = 21; + char *s; + #ifndef BARE_METAL /* allow selecting real time audio module */ - int max_len = 21; csoundCreateGlobalVariable(csound, "_RTAUDIO", (size_t) max_len); - char *s = csoundQueryGlobalVariable(csound, "_RTAUDIO"); + s = csoundQueryGlobalVariable(csound, "_RTAUDIO"); #ifndef LINUX #ifdef __HAIKU__ strcpy(s, "haiku"); @@ -3662,11 +3664,11 @@ PUBLIC void csoundReset(CSOUND *csound) 0, NULL, &max_len, Str("Real time audio module name"), NULL); #endif + /* initialise real time MIDI */ csound->midiGlobals = (MGLOBAL*) csound->Calloc(csound, sizeof(MGLOBAL)); csound->midiGlobals->bufp = &(csound->midiGlobals->mbuf[0]); csound->midiGlobals->endatp = csound->midiGlobals->bufp; -#ifndef BARE_METAL csoundCreateGlobalVariable(csound, "_RTMIDI", (size_t) max_len); csound->SetMIDIDeviceListCallback(csound, midi_dev_list_dummy); csound->SetExternalMidiInOpenCallback(csound, DummyMidiInOpen); @@ -3703,7 +3705,8 @@ PUBLIC void csoundReset(CSOUND *csound) CSOUNDCFG_BOOLEAN, 0, NULL, NULL, Str("Do not handle special MIDI controllers" " (sustain pedal etc.)"), NULL); - +#ifndef BARE_METAL + /* sound file tag options */ max_len = 201; i = (max_len + 7) & (~7);