aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adlmidi.cpp35
-rw-r--r--src/adlmidi_midiplay.cpp2
-rw-r--r--src/adlmidi_private.hpp2
-rw-r--r--src/chips/dosbox_opl3.cpp20
-rw-r--r--src/chips/dosbox_opl3.h20
-rw-r--r--src/chips/nuked/nukedopl3.c17
-rw-r--r--src/chips/nuked/nukedopl3.h17
-rw-r--r--src/chips/nuked_opl3.cpp20
-rw-r--r--src/chips/nuked_opl3.h20
-rw-r--r--src/chips/nuked_opl3_v174.cpp20
-rw-r--r--src/chips/nuked_opl3_v174.h20
-rw-r--r--src/chips/opl_chip_base.h18
12 files changed, 192 insertions, 19 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index 3a1923a..8d1595a 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -123,8 +123,8 @@ ADLMIDI_EXPORT int adl_setBank(ADL_MIDIPlayer *device, int bank)
ADL_UNUSED(bank);
MidiPlayer *play = GET_MIDI_PLAYER(device);
play->setErrorString("This build of libADLMIDI has no embedded banks. "
- "Please load bank by using of adl_openBankFile() or "
- "adl_openBankData() functions instead of adl_setBank()");
+ "Please load banks by using adl_openBankFile() or "
+ "adl_openBankData() functions instead of adl_setBank().");
return -1;
#else
const uint32_t NumBanks = static_cast<uint32_t>(maxAdlBanks());
@@ -304,6 +304,37 @@ ADLMIDI_EXPORT int adl_setInstrument(ADL_MIDIPlayer *device, ADL_Bank *bank, uns
return 0;
}
+ADLMIDI_EXPORT int adl_loadEmbeddedBank(struct ADL_MIDIPlayer *device, ADL_Bank *bank, int num)
+{
+ if(!device)
+ return -1;
+ MidiPlayer *play = GET_MIDI_PLAYER(device);
+ if (!play)
+ return -1;
+
+#ifdef DISABLE_EMBEDDED_BANKS
+ ADL_UNUSED(bank);
+ ADL_UNUSED(num);
+ play->setErrorString("This build of libADLMIDI has no embedded banks. "
+ "Please load banks by using adl_openBankFile() or "
+ "adl_openBankData() functions instead of adl_loadEmbeddedBank().");
+ return -1;
+#else
+ if(num < 0 || num >= maxAdlBanks())
+ return -1;
+
+ OPL3::BankMap::iterator it = OPL3::BankMap::iterator::from_ptrs(bank->pointer);
+ size_t id = it->first;
+
+ for (unsigned i = 0; i < 128; ++i) {
+ size_t insno = i + ((id & OPL3::PercussionTag) ? 128 : 0);
+ size_t adlmeta = ::banks[num][insno];
+ it->second.ins[i] = adlinsdata2(::adlins[adlmeta]);
+ }
+ return 0;
+#endif
+}
+
ADLMIDI_EXPORT int adl_setNumFourOpsChn(ADL_MIDIPlayer *device, int ops4)
{
if(!device)
diff --git a/src/adlmidi_midiplay.cpp b/src/adlmidi_midiplay.cpp
index cd8a5d6..b256d79 100644
--- a/src/adlmidi_midiplay.cpp
+++ b/src/adlmidi_midiplay.cpp
@@ -397,7 +397,7 @@ bool MIDIplay::realTime_NoteOn(uint8_t channel, uint8_t note, uint8_t velocity)
if((m_synth.m_rhythmMode == 1) && PercussionMap[midiins & 0xFF])
voices[1] = voices[0];//i[1] = i[0];
- bool isBlankNote = (ains->flags & adlinsdata::Flag_NoSound);
+ bool isBlankNote = (ains->flags & adlinsdata::Flag_NoSound) != 0;
if(hooks.onDebugMessage)
{
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp
index 858e33d..770b862 100644
--- a/src/adlmidi_private.hpp
+++ b/src/adlmidi_private.hpp
@@ -35,8 +35,6 @@
# endif
#endif
-// Require declarations of unstable API for extern "C"
-#define ADLMIDI_UNSTABLE_API
#ifdef _WIN32
#define NOMINMAX 1
diff --git a/src/chips/dosbox_opl3.cpp b/src/chips/dosbox_opl3.cpp
index 30fa38e..f783afe 100644
--- a/src/chips/dosbox_opl3.cpp
+++ b/src/chips/dosbox_opl3.cpp
@@ -1,3 +1,23 @@
+/*
+ * Interfaces over Yamaha OPL3 (YMF262) chip emulators
+ *
+ * Copyright (C) 2017-2018 Vitaly Novichkov (Wohlstand)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include "dosbox_opl3.h"
#include "dosbox/dbopl.h"
#include <new>
diff --git a/src/chips/dosbox_opl3.h b/src/chips/dosbox_opl3.h
index 1928026..f966393 100644
--- a/src/chips/dosbox_opl3.h
+++ b/src/chips/dosbox_opl3.h
@@ -1,3 +1,23 @@
+/*
+ * Interfaces over Yamaha OPL3 (YMF262) chip emulators
+ *
+ * Copyright (C) 2017-2018 Vitaly Novichkov (Wohlstand)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#ifndef DOSBOX_OPL3_H
#define DOSBOX_OPL3_H
diff --git a/src/chips/nuked/nukedopl3.c b/src/chips/nuked/nukedopl3.c
index 87d3212..fe2313c 100644
--- a/src/chips/nuked/nukedopl3.c
+++ b/src/chips/nuked/nukedopl3.c
@@ -1,16 +1,19 @@
/*
* Copyright (C) 2013-2018 Alexey Khokholov (Nuke.YKT)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Nuked OPL3 emulator.
* Thanks:
diff --git a/src/chips/nuked/nukedopl3.h b/src/chips/nuked/nukedopl3.h
index d57cf5f..8d3318a 100644
--- a/src/chips/nuked/nukedopl3.h
+++ b/src/chips/nuked/nukedopl3.h
@@ -1,16 +1,19 @@
/*
* Copyright (C) 2013-2018 Alexey Khokholov (Nuke.YKT)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
+ * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Nuked OPL3 emulator.
* Thanks:
diff --git a/src/chips/nuked_opl3.cpp b/src/chips/nuked_opl3.cpp
index 48e5c17..e4f9764 100644
--- a/src/chips/nuked_opl3.cpp
+++ b/src/chips/nuked_opl3.cpp
@@ -1,3 +1,23 @@
+/*
+ * Interfaces over Yamaha OPL3 (YMF262) chip emulators
+ *
+ * Copyright (C) 2017-2018 Vitaly Novichkov (Wohlstand)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include "nuked_opl3.h"
#include "nuked/nukedopl3.h"
#include <cstring>
diff --git a/src/chips/nuked_opl3.h b/src/chips/nuked_opl3.h
index 1b34e9a..4b14b8b 100644
--- a/src/chips/nuked_opl3.h
+++ b/src/chips/nuked_opl3.h
@@ -1,3 +1,23 @@
+/*
+ * Interfaces over Yamaha OPL3 (YMF262) chip emulators
+ *
+ * Copyright (C) 2017-2018 Vitaly Novichkov (Wohlstand)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#ifndef NUKED_OPL3_H
#define NUKED_OPL3_H
diff --git a/src/chips/nuked_opl3_v174.cpp b/src/chips/nuked_opl3_v174.cpp
index e24b2e7..793af93 100644
--- a/src/chips/nuked_opl3_v174.cpp
+++ b/src/chips/nuked_opl3_v174.cpp
@@ -1,3 +1,23 @@
+/*
+ * Interfaces over Yamaha OPL3 (YMF262) chip emulators
+ *
+ * Copyright (C) 2017-2018 Vitaly Novichkov (Wohlstand)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include "nuked_opl3_v174.h"
#include "nuked/nukedopl3_174.h"
#include <cstring>
diff --git a/src/chips/nuked_opl3_v174.h b/src/chips/nuked_opl3_v174.h
index f14221f..9463a02 100644
--- a/src/chips/nuked_opl3_v174.h
+++ b/src/chips/nuked_opl3_v174.h
@@ -1,3 +1,23 @@
+/*
+ * Interfaces over Yamaha OPL3 (YMF262) chip emulators
+ *
+ * Copyright (C) 2017-2018 Vitaly Novichkov (Wohlstand)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#ifndef NUKED_OPL3174_H
#define NUKED_OPL3174_H
diff --git a/src/chips/opl_chip_base.h b/src/chips/opl_chip_base.h
index 879d6da..8025d03 100644
--- a/src/chips/opl_chip_base.h
+++ b/src/chips/opl_chip_base.h
@@ -1,3 +1,21 @@
+/*
+ * Copyright (C) 2017-2018 Vitaly Novichkov (Wohlstand)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#ifndef ONP_CHIP_BASE_H
#define ONP_CHIP_BASE_H