aboutsummaryrefslogtreecommitdiff
path: root/src/chips/mame_opl2.h
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2025-03-25 21:22:37 +0300
committerWohlstand <admin@wohlnet.ru>2025-03-25 21:22:37 +0300
commit6918066f6a73d6cff1e759b7975396220e89d4cb (patch)
treea07ce3673530279230f2c58a6ac9e9343abe0e89 /src/chips/mame_opl2.h
parent55d2eab229b563aa0e0f5f9319570876c525ccb8 (diff)
downloadlibADLMIDI-6918066f6a73d6cff1e759b7975396220e89d4cb.tar.gz
libADLMIDI-6918066f6a73d6cff1e759b7975396220e89d4cb.tar.bz2
libADLMIDI-6918066f6a73d6cff1e759b7975396220e89d4cb.zip
Added MAME OPL2 emulator
Diffstat (limited to 'src/chips/mame_opl2.h')
-rw-r--r--src/chips/mame_opl2.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/chips/mame_opl2.h b/src/chips/mame_opl2.h
new file mode 100644
index 0000000..8a5ea9c
--- /dev/null
+++ b/src/chips/mame_opl2.h
@@ -0,0 +1,46 @@
+/*
+ * Interfaces over Yamaha OPL3 (YMF262) chip emulators
+ *
+ * Copyright (c) 2017-2025 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 MAME_OPL2_H
+#define MAME_OPL2_H
+
+#include "opl_chip_base.h"
+
+class MameOPL2 final : public OPLChipBaseT<MameOPL2>
+{
+ void *m_chip;
+
+public:
+ MameOPL2();
+ ~MameOPL2() override;
+
+ bool canRunAtPcmRate() const override { return false; }
+ void setRate(uint32_t rate) override;
+ void reset() override;
+ void writeReg(uint16_t addr, uint8_t data) override;
+ void nativePreGenerate() override {}
+ void nativePostGenerate() override {}
+ void nativeGenerate(int16_t *frame) override;
+ const char *emulatorName() override;
+ ChipType chipType() override;
+ bool hasFullPanning() override;
+};
+
+#endif // MAME_OPL2_H