From 617fc1592e56dd7ae4800363886346da3f4d2eee Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Sun, 26 Nov 2017 05:00:27 +0300 Subject: Fix a support for tristate flags (Default, Force-On and Force-Off) --- src/adlmidi.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index e96c757..3b124eb 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -171,7 +171,7 @@ ADLMIDI_EXPORT void adl_setPercMode(ADL_MIDIPlayer *device, int percmod) { if(!device) return; MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); - play->m_setup.AdlPercussionMode = (percmod != 0); + play->m_setup.AdlPercussionMode = percmod; play->opl.AdlPercussionMode = play->m_setup.AdlPercussionMode; } @@ -179,7 +179,7 @@ ADLMIDI_EXPORT void adl_setHVibrato(ADL_MIDIPlayer *device, int hvibro) { if(!device) return; MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); - play->m_setup.HighVibratoMode = (hvibro != 0); + play->m_setup.HighVibratoMode = hvibro; play->opl.HighVibratoMode = play->m_setup.HighVibratoMode; } @@ -187,7 +187,7 @@ ADLMIDI_EXPORT void adl_setHTremolo(ADL_MIDIPlayer *device, int htremo) { if(!device) return; MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); - play->m_setup.HighTremoloMode = (htremo != 0); + play->m_setup.HighTremoloMode = htremo; play->opl.HighTremoloMode = play->m_setup.HighTremoloMode; } @@ -195,7 +195,7 @@ ADLMIDI_EXPORT void adl_setScaleModulators(ADL_MIDIPlayer *device, int smod) { if(!device) return; MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); - play->m_setup.ScaleModulators = (smod != 0); + play->m_setup.ScaleModulators = smod; play->opl.ScaleModulators = play->m_setup.ScaleModulators; } @@ -210,7 +210,7 @@ ADLMIDI_EXPORT void adl_setLogarithmicVolumes(struct ADL_MIDIPlayer *device, int { if(!device) return; MIDIplay *play = reinterpret_cast(device->adl_midiPlayer); - play->m_setup.LogarithmicVolumes = (logvol != 0); + play->m_setup.LogarithmicVolumes = logvol; play->opl.LogarithmicVolumes = play->m_setup.LogarithmicVolumes; } -- cgit v1.2.3 From aafd86539eb4e2441899190fda191deda3528386 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Tue, 28 Nov 2017 04:36:52 +0300 Subject: Give 4 four-op channels When melodic set is completely 2-operator but has some 4-op percussions Experimental fix for #35 --- src/adlmidi_private.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/adlmidi_private.cpp b/src/adlmidi_private.cpp index f06e30e..1fcf0b2 100644 --- a/src/adlmidi_private.cpp +++ b/src/adlmidi_private.cpp @@ -45,7 +45,7 @@ int adlRefreshNumCards(ADL_MIDIPlayer *device) play->m_setup.NumFourOps = (n_fourop[0] >= 128 * 7 / 8) ? play->m_setup.NumCards * 6 - : (n_fourop[0] < 128 * 1 / 8) ? 0 + : (n_fourop[0] < 128 * 1 / 8) ? (n_fourop[1] > 0 ? 4 : 0) : (play->m_setup.NumCards == 1 ? 1 : play->m_setup.NumCards * 4); } else -- cgit v1.2.3 From 1e4a04ac49c44e4014997ee4785b20a8a00cbdd0 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 1 Dec 2017 00:32:15 +0300 Subject: Some fixes on non-DOS OpenWatcom targets Unfortunately, std::fflush() causes a crash on Linux but works fine on DOS --- src/adlmidi_private.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 8058824..6ab9437 100644 --- a/src/adlmidi_private.hpp +++ b/src/adlmidi_private.hpp @@ -40,8 +40,12 @@ #endif #ifdef _WIN32 +#define NOMINMAX +#endif + +#if defined(_WIN32) && !defined(__WATCOMC__) # undef NO_OLDNAMES -# include +# include # ifdef _MSC_VER # ifdef _WIN64 typedef __int64 ssize_t; @@ -91,6 +95,9 @@ typedef int32_t ssize_t; #include // vector #include // deque #include // exp, log, ceil +#if defined(__WATCOMC__) +#include // round, sqrt +#endif #include #include #include // numeric_limit @@ -328,7 +335,7 @@ public: void openFile(const char *path) { - #ifndef _WIN32 + #if !defined(_WIN32) || defined(__WATCOMC__) fp = std::fopen(path, "rb"); #else wchar_t widePath[MAX_PATH]; -- cgit v1.2.3