From 63141d11132fedfd63860fc42e16de1f48312e01 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Sat, 11 May 2024 00:00:33 +0300 Subject: Initial implementation of Serial support + refactor of the MIDI play, making separated loop functions instead the mess of everything in one single loop function. --- src/adlmidi_opl3.hpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/adlmidi_opl3.hpp') diff --git a/src/adlmidi_opl3.hpp b/src/adlmidi_opl3.hpp index ca35157..abdc20d 100644 --- a/src/adlmidi_opl3.hpp +++ b/src/adlmidi_opl3.hpp @@ -74,6 +74,13 @@ private: //! Cached BD registry value (flags register: DeepTremolo, DeepVibrato, and RhythmMode) std::vector m_regBD; +#ifdef ADLMIDI_ENABLE_HW_SERIAL + bool m_serial; + std::string m_serialName; + unsigned m_serialBaud; + unsigned m_serialProtocol; +#endif + public: /** * @brief MIDI bank entry @@ -321,12 +328,12 @@ public: */ ADLMIDI_VolumeModels getVolumeScaleModel(); - #ifndef ADLMIDI_HW_OPL +#ifndef ADLMIDI_HW_OPL /** * @brief Clean up all running emulated chip instances */ void clearChips(); - #endif +#endif /** * @brief Reset chip properties and initialize them @@ -335,6 +342,18 @@ public: * @param audioTickHandler PCM-accurate clock hook */ void reset(int emulator, unsigned long PCM_RATE, void *audioTickHandler); + + void initChip(size_t chip); + +#ifdef ADLMIDI_ENABLE_HW_SERIAL + /** + * @brief Reset chip properties for hardware use + * @param emulator + * @param PCM_RATE + * @param audioTickHandler + */ + void resetSerial(const std::string &serialName, unsigned int baud, unsigned int protocol); +#endif }; /** -- cgit v1.2.3