diff --git a/src/Synth_Dexed.mk b/src/Synth_Dexed.mk index 443d606..6aa4a49 100644 --- a/src/Synth_Dexed.mk +++ b/src/Synth_Dexed.mk @@ -22,6 +22,9 @@ OBJS += \ $(SYNTH_DEXED_DIR)/pitchenv.o \ $(SYNTH_DEXED_DIR)/porta.o \ $(SYNTH_DEXED_DIR)/sin.o \ + $(SYNTH_DEXED_DIR)/EngineMkI.o\ + $(SYNTH_DEXED_DIR)/EngineOpl.o\ + $(SYNTH_DEXED_DIR)/EngineMsfa.o\ $(CMSIS_DSP_SOURCE_DIR)/SupportFunctions/SupportFunctions.o \ $(CMSIS_DSP_SOURCE_DIR)/BasicMathFunctions/BasicMathFunctions.o \ $(CMSIS_DSP_SOURCE_DIR)/FastMathFunctions/FastMathFunctions.o \ diff --git a/src/config.cpp b/src/config.cpp index c40d29a..9a64f50 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -21,6 +21,7 @@ // along with this program. If not, see . // #include "config.h" +#include "../Synth_Dexed/src/dexed.h" CConfig::CConfig (FATFS *pFileSystem) : m_Properties ("minidexed.ini", pFileSystem) @@ -46,6 +47,15 @@ void CConfig::Load (void) m_nDACI2CAddress = m_Properties.GetNumber ("DACI2CAddress", 0); m_bChannelsSwapped = m_Properties.GetNumber ("ChannelsSwapped", 0) != 0; + unsigned newEngineType = m_Properties.GetNumber ("EngineType", 1); + if (newEngineType == 2) { + m_EngineType = MKI; + } else if (newEngineType == 3) { + m_EngineType = OPL; + } else { + m_EngineType = MSFA; + } + m_nMIDIBaudRate = m_Properties.GetNumber ("MIDIBaudRate", 31250); const char *pMIDIThru = m_Properties.GetString ("MIDIThru"); @@ -151,6 +161,11 @@ bool CConfig::GetChannelsSwapped (void) const return m_bChannelsSwapped; } +unsigned CConfig::GetEngineType (void) const +{ + return m_EngineType; +} + unsigned CConfig::GetMIDIBaudRate (void) const { return m_nMIDIBaudRate; @@ -400,3 +415,5 @@ bool CConfig::GetPerformanceSelectToLoad (void) const { return m_bPerformanceSelectToLoad; } + + diff --git a/src/config.h b/src/config.h index a316be8..c34cdf5 100644 --- a/src/config.h +++ b/src/config.h @@ -69,6 +69,7 @@ public: unsigned GetChunkSize (void) const; unsigned GetDACI2CAddress (void) const; // 0 for auto probing bool GetChannelsSwapped (void) const; + unsigned GetEngineType (void) const; // MIDI unsigned GetMIDIBaudRate (void) const; @@ -152,6 +153,7 @@ private: unsigned m_nChunkSize; unsigned m_nDACI2CAddress; bool m_bChannelsSwapped; + unsigned m_EngineType; unsigned m_nMIDIBaudRate; std::string m_MIDIThruIn; @@ -212,6 +214,8 @@ private: bool m_bMIDIDumpEnabled; bool m_bProfileEnabled; bool m_bPerformanceSelectToLoad; + + }; #endif diff --git a/src/minidexed.cpp b/src/minidexed.cpp index fafeff8..83de52d 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -93,7 +93,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt, m_pTG[i] = new CDexedAdapter (CConfig::MaxNotes, pConfig->GetSampleRate ()); assert (m_pTG[i]); - + + m_pTG[i]->setEngineType(pConfig->GetEngineType ()); m_pTG[i]->activate (); } diff --git a/src/minidexed.ini b/src/minidexed.ini index 27d622c..f58b44c 100644 --- a/src/minidexed.ini +++ b/src/minidexed.ini @@ -10,6 +10,8 @@ SampleRate=48000 #ChunkSize=256 DACI2CAddress=0 ChannelsSwapped=0 +# Engine Type ( 1=Modern ; 2=Mark I ; 3=OPL ) +EngineType=1 # MIDI MIDIBaudRate=31250 diff --git a/submod.sh b/submod.sh index e941660..dcdf2af 100755 --- a/submod.sh +++ b/submod.sh @@ -10,4 +10,6 @@ cd - cd circle-stdlib/libs/circle-newlib git checkout 48bf91d # needed for circle ec09d7e cd - - +cd Synth_Dexed/ +git checkout c9f5274 +cd -