diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/adlmidi.cpp | 10 | ||||
-rw-r--r-- | src/adlmidi_private.cpp | 2 | ||||
-rw-r--r-- | src/adlmidi_private.hpp | 11 |
3 files changed, 15 insertions, 8 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index 9743d57..96ef32f 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<MIDIplay *>(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<MIDIplay *>(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<MIDIplay *>(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<MIDIplay *>(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<MIDIplay *>(device->adl_midiPlayer); - play->m_setup.LogarithmicVolumes = (logvol != 0); + play->m_setup.LogarithmicVolumes = logvol; play->opl.LogarithmicVolumes = play->m_setup.LogarithmicVolumes; } 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 diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp index 32c3637..2442fc2 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 <stdint.h> +# include <stdint.h> # ifdef _MSC_VER # ifdef _WIN64 typedef __int64 ssize_t; @@ -91,6 +95,9 @@ typedef int32_t ssize_t; #include <vector> // vector #include <deque> // deque #include <cmath> // exp, log, ceil +#if defined(__WATCOMC__) +#include <math.h> // round, sqrt +#endif #include <stdio.h> #include <stdlib.h> #include <limits> // 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]; |