From b3a9884eb1aeee65324772aa28f5e5661e73bfe1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 23 Sep 2019 09:26:37 +0200 Subject: [PATCH] - gave libopen the same treatment and made it its own subproject --- CMakeLists.txt | 2 ++ libraries/opnmidi/CMakeLists.txt | 30 +++++++++++++++++++ .../opnmidi/chips/gens/Ym2612_Emu.cpp | 0 .../opnmidi/chips/gens/Ym2612_Emu.h | 0 .../opnmidi/chips/gens_opn2.cpp | 0 .../opnmidi/chips/gens_opn2.h | 0 .../opnmidi/chips/mame/mame_ym2612fm.c | 0 .../opnmidi/chips/mame/mame_ym2612fm.h | 0 .../opnmidi/chips/mame/mamedef.h | 0 .../opnmidi/chips/mame_opn2.cpp | 0 .../opnmidi/chips/mame_opn2.h | 0 .../opnmidi/chips/nuked/ym3438.c | 0 .../opnmidi/chips/nuked/ym3438.h | 0 .../opnmidi/chips/nuked_opn2.cpp | 0 .../opnmidi/chips/nuked_opn2.h | 0 .../opnmidi/chips/opn_chip_base.h | 0 .../opnmidi/chips/opn_chip_base.tcc | 0 .../opnmidi/file_reader.hpp | 0 {src/sound => libraries}/opnmidi/opnbank.h | 0 {src/sound => libraries}/opnmidi/opnmidi.cpp | 0 {src/sound => libraries}/opnmidi/opnmidi.h | 0 .../opnmidi/opnmidi_bankmap.h | 0 .../opnmidi/opnmidi_bankmap.tcc | 0 .../opnmidi/opnmidi_cvt.hpp | 0 .../opnmidi/opnmidi_load.cpp | 0 .../opnmidi/opnmidi_midiplay.cpp | 0 .../opnmidi/opnmidi_opn2.cpp | 0 .../opnmidi/opnmidi_private.cpp | 0 .../opnmidi/opnmidi_private.hpp | 0 .../opnmidi/opnmidi_ptr.hpp | 0 .../opnmidi/wopn/wopn_file.c | 0 .../opnmidi/wopn/wopn_file.h | 0 src/CMakeLists.txt | 27 ++--------------- .../mididevices/music_opnmidi_mididevice.cpp | 2 +- 34 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 libraries/opnmidi/CMakeLists.txt rename {src/sound => libraries}/opnmidi/chips/gens/Ym2612_Emu.cpp (100%) rename {src/sound => libraries}/opnmidi/chips/gens/Ym2612_Emu.h (100%) rename {src/sound => libraries}/opnmidi/chips/gens_opn2.cpp (100%) rename {src/sound => libraries}/opnmidi/chips/gens_opn2.h (100%) rename {src/sound => libraries}/opnmidi/chips/mame/mame_ym2612fm.c (100%) rename {src/sound => libraries}/opnmidi/chips/mame/mame_ym2612fm.h (100%) rename {src/sound => libraries}/opnmidi/chips/mame/mamedef.h (100%) rename {src/sound => libraries}/opnmidi/chips/mame_opn2.cpp (100%) rename {src/sound => libraries}/opnmidi/chips/mame_opn2.h (100%) rename {src/sound => libraries}/opnmidi/chips/nuked/ym3438.c (100%) rename {src/sound => libraries}/opnmidi/chips/nuked/ym3438.h (100%) rename {src/sound => libraries}/opnmidi/chips/nuked_opn2.cpp (100%) rename {src/sound => libraries}/opnmidi/chips/nuked_opn2.h (100%) rename {src/sound => libraries}/opnmidi/chips/opn_chip_base.h (100%) rename {src/sound => libraries}/opnmidi/chips/opn_chip_base.tcc (100%) rename {src/sound => libraries}/opnmidi/file_reader.hpp (100%) rename {src/sound => libraries}/opnmidi/opnbank.h (100%) rename {src/sound => libraries}/opnmidi/opnmidi.cpp (100%) rename {src/sound => libraries}/opnmidi/opnmidi.h (100%) rename {src/sound => libraries}/opnmidi/opnmidi_bankmap.h (100%) rename {src/sound => libraries}/opnmidi/opnmidi_bankmap.tcc (100%) rename {src/sound => libraries}/opnmidi/opnmidi_cvt.hpp (100%) rename {src/sound => libraries}/opnmidi/opnmidi_load.cpp (100%) rename {src/sound => libraries}/opnmidi/opnmidi_midiplay.cpp (100%) rename {src/sound => libraries}/opnmidi/opnmidi_opn2.cpp (100%) rename {src/sound => libraries}/opnmidi/opnmidi_private.cpp (100%) rename {src/sound => libraries}/opnmidi/opnmidi_private.hpp (100%) rename {src/sound => libraries}/opnmidi/opnmidi_ptr.hpp (100%) rename {src/sound => libraries}/opnmidi/wopn/wopn_file.c (100%) rename {src/sound => libraries}/opnmidi/wopn/wopn_file.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf41bbb6c..6dc631d68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -384,6 +384,7 @@ endif() set( LZMA_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/lzma/C" ) set( ADL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/adlmidi" ) +set( OPN_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/opnmidi" ) if( NOT CMAKE_CROSSCOMPILING ) if( NOT CROSS_EXPORTS ) @@ -406,6 +407,7 @@ add_subdirectory( tools ) add_subdirectory( libraries/dumb ) add_subdirectory( libraries/gdtoa ) add_subdirectory( libraries/adlmidi ) +add_subdirectory( libraries/opnmidi ) add_subdirectory( wadsrc ) add_subdirectory( wadsrc_bm ) add_subdirectory( wadsrc_lights ) diff --git a/libraries/opnmidi/CMakeLists.txt b/libraries/opnmidi/CMakeLists.txt new file mode 100644 index 000000000..d9101922d --- /dev/null +++ b/libraries/opnmidi/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required( VERSION 2.8.7 ) + +make_release_only() + +# we play with out own sequencer +add_definitions(-DOPNMIDI_DISABLE_MIDI_SEQUENCER) + +# Disable OPNMIDI's experimental yet emulator (using of it has some issues and missing notes in playback) +add_definitions(-DOPNMIDI_DISABLE_GX_EMULATOR) + +if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" ) +endif() + +set (CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${ZD_FASTMATH_FLAG}) + +add_library( opn STATIC + chips/gens_opn2.cpp + chips/gens/Ym2612_Emu.cpp + chips/mame/mame_ym2612fm.c + chips/mame_opn2.cpp + chips/nuked_opn2.cpp + chips/nuked/ym3438.c + opnmidi.cpp + opnmidi_load.cpp + opnmidi_midiplay.cpp + opnmidi_opn2.cpp + opnmidi_private.cpp + wopn/wopn_file.c ) +target_link_libraries( opn ) diff --git a/src/sound/opnmidi/chips/gens/Ym2612_Emu.cpp b/libraries/opnmidi/chips/gens/Ym2612_Emu.cpp similarity index 100% rename from src/sound/opnmidi/chips/gens/Ym2612_Emu.cpp rename to libraries/opnmidi/chips/gens/Ym2612_Emu.cpp diff --git a/src/sound/opnmidi/chips/gens/Ym2612_Emu.h b/libraries/opnmidi/chips/gens/Ym2612_Emu.h similarity index 100% rename from src/sound/opnmidi/chips/gens/Ym2612_Emu.h rename to libraries/opnmidi/chips/gens/Ym2612_Emu.h diff --git a/src/sound/opnmidi/chips/gens_opn2.cpp b/libraries/opnmidi/chips/gens_opn2.cpp similarity index 100% rename from src/sound/opnmidi/chips/gens_opn2.cpp rename to libraries/opnmidi/chips/gens_opn2.cpp diff --git a/src/sound/opnmidi/chips/gens_opn2.h b/libraries/opnmidi/chips/gens_opn2.h similarity index 100% rename from src/sound/opnmidi/chips/gens_opn2.h rename to libraries/opnmidi/chips/gens_opn2.h diff --git a/src/sound/opnmidi/chips/mame/mame_ym2612fm.c b/libraries/opnmidi/chips/mame/mame_ym2612fm.c similarity index 100% rename from src/sound/opnmidi/chips/mame/mame_ym2612fm.c rename to libraries/opnmidi/chips/mame/mame_ym2612fm.c diff --git a/src/sound/opnmidi/chips/mame/mame_ym2612fm.h b/libraries/opnmidi/chips/mame/mame_ym2612fm.h similarity index 100% rename from src/sound/opnmidi/chips/mame/mame_ym2612fm.h rename to libraries/opnmidi/chips/mame/mame_ym2612fm.h diff --git a/src/sound/opnmidi/chips/mame/mamedef.h b/libraries/opnmidi/chips/mame/mamedef.h similarity index 100% rename from src/sound/opnmidi/chips/mame/mamedef.h rename to libraries/opnmidi/chips/mame/mamedef.h diff --git a/src/sound/opnmidi/chips/mame_opn2.cpp b/libraries/opnmidi/chips/mame_opn2.cpp similarity index 100% rename from src/sound/opnmidi/chips/mame_opn2.cpp rename to libraries/opnmidi/chips/mame_opn2.cpp diff --git a/src/sound/opnmidi/chips/mame_opn2.h b/libraries/opnmidi/chips/mame_opn2.h similarity index 100% rename from src/sound/opnmidi/chips/mame_opn2.h rename to libraries/opnmidi/chips/mame_opn2.h diff --git a/src/sound/opnmidi/chips/nuked/ym3438.c b/libraries/opnmidi/chips/nuked/ym3438.c similarity index 100% rename from src/sound/opnmidi/chips/nuked/ym3438.c rename to libraries/opnmidi/chips/nuked/ym3438.c diff --git a/src/sound/opnmidi/chips/nuked/ym3438.h b/libraries/opnmidi/chips/nuked/ym3438.h similarity index 100% rename from src/sound/opnmidi/chips/nuked/ym3438.h rename to libraries/opnmidi/chips/nuked/ym3438.h diff --git a/src/sound/opnmidi/chips/nuked_opn2.cpp b/libraries/opnmidi/chips/nuked_opn2.cpp similarity index 100% rename from src/sound/opnmidi/chips/nuked_opn2.cpp rename to libraries/opnmidi/chips/nuked_opn2.cpp diff --git a/src/sound/opnmidi/chips/nuked_opn2.h b/libraries/opnmidi/chips/nuked_opn2.h similarity index 100% rename from src/sound/opnmidi/chips/nuked_opn2.h rename to libraries/opnmidi/chips/nuked_opn2.h diff --git a/src/sound/opnmidi/chips/opn_chip_base.h b/libraries/opnmidi/chips/opn_chip_base.h similarity index 100% rename from src/sound/opnmidi/chips/opn_chip_base.h rename to libraries/opnmidi/chips/opn_chip_base.h diff --git a/src/sound/opnmidi/chips/opn_chip_base.tcc b/libraries/opnmidi/chips/opn_chip_base.tcc similarity index 100% rename from src/sound/opnmidi/chips/opn_chip_base.tcc rename to libraries/opnmidi/chips/opn_chip_base.tcc diff --git a/src/sound/opnmidi/file_reader.hpp b/libraries/opnmidi/file_reader.hpp similarity index 100% rename from src/sound/opnmidi/file_reader.hpp rename to libraries/opnmidi/file_reader.hpp diff --git a/src/sound/opnmidi/opnbank.h b/libraries/opnmidi/opnbank.h similarity index 100% rename from src/sound/opnmidi/opnbank.h rename to libraries/opnmidi/opnbank.h diff --git a/src/sound/opnmidi/opnmidi.cpp b/libraries/opnmidi/opnmidi.cpp similarity index 100% rename from src/sound/opnmidi/opnmidi.cpp rename to libraries/opnmidi/opnmidi.cpp diff --git a/src/sound/opnmidi/opnmidi.h b/libraries/opnmidi/opnmidi.h similarity index 100% rename from src/sound/opnmidi/opnmidi.h rename to libraries/opnmidi/opnmidi.h diff --git a/src/sound/opnmidi/opnmidi_bankmap.h b/libraries/opnmidi/opnmidi_bankmap.h similarity index 100% rename from src/sound/opnmidi/opnmidi_bankmap.h rename to libraries/opnmidi/opnmidi_bankmap.h diff --git a/src/sound/opnmidi/opnmidi_bankmap.tcc b/libraries/opnmidi/opnmidi_bankmap.tcc similarity index 100% rename from src/sound/opnmidi/opnmidi_bankmap.tcc rename to libraries/opnmidi/opnmidi_bankmap.tcc diff --git a/src/sound/opnmidi/opnmidi_cvt.hpp b/libraries/opnmidi/opnmidi_cvt.hpp similarity index 100% rename from src/sound/opnmidi/opnmidi_cvt.hpp rename to libraries/opnmidi/opnmidi_cvt.hpp diff --git a/src/sound/opnmidi/opnmidi_load.cpp b/libraries/opnmidi/opnmidi_load.cpp similarity index 100% rename from src/sound/opnmidi/opnmidi_load.cpp rename to libraries/opnmidi/opnmidi_load.cpp diff --git a/src/sound/opnmidi/opnmidi_midiplay.cpp b/libraries/opnmidi/opnmidi_midiplay.cpp similarity index 100% rename from src/sound/opnmidi/opnmidi_midiplay.cpp rename to libraries/opnmidi/opnmidi_midiplay.cpp diff --git a/src/sound/opnmidi/opnmidi_opn2.cpp b/libraries/opnmidi/opnmidi_opn2.cpp similarity index 100% rename from src/sound/opnmidi/opnmidi_opn2.cpp rename to libraries/opnmidi/opnmidi_opn2.cpp diff --git a/src/sound/opnmidi/opnmidi_private.cpp b/libraries/opnmidi/opnmidi_private.cpp similarity index 100% rename from src/sound/opnmidi/opnmidi_private.cpp rename to libraries/opnmidi/opnmidi_private.cpp diff --git a/src/sound/opnmidi/opnmidi_private.hpp b/libraries/opnmidi/opnmidi_private.hpp similarity index 100% rename from src/sound/opnmidi/opnmidi_private.hpp rename to libraries/opnmidi/opnmidi_private.hpp diff --git a/src/sound/opnmidi/opnmidi_ptr.hpp b/libraries/opnmidi/opnmidi_ptr.hpp similarity index 100% rename from src/sound/opnmidi/opnmidi_ptr.hpp rename to libraries/opnmidi/opnmidi_ptr.hpp diff --git a/src/sound/opnmidi/wopn/wopn_file.c b/libraries/opnmidi/wopn/wopn_file.c similarity index 100% rename from src/sound/opnmidi/wopn/wopn_file.c rename to libraries/opnmidi/wopn/wopn_file.c diff --git a/src/sound/opnmidi/wopn/wopn_file.h b/libraries/opnmidi/wopn/wopn_file.h similarity index 100% rename from src/sound/opnmidi/wopn/wopn_file.h rename to libraries/opnmidi/wopn/wopn_file.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33d7d55ba..4b7dc1951 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -468,7 +468,7 @@ set( ZDOOM_LIBS ${ZDOOM_LIBS} "${ZLIB_LIBRARIES}" "${JPEG_LIBRARIES}" "${BZIP2_L if (HAVE_VULKAN) set( ZDOOM_LIBS ${ZDOOM_LIBS} "glslang" "SPIRV" "OGLCompiler") endif() -include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" "${ADL_INCLUDE_DIR}" ) +include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIR}" "${JPEG_INCLUDE_DIR}" "${GME_INCLUDE_DIR}" "${ADL_INCLUDE_DIR}" "${OPN_INCLUDE_DIR}" ) if( ${HAVE_VM_JIT} ) add_definitions( -DHAVE_VM_JIT ) @@ -649,13 +649,6 @@ if( NOT SEND_ANON_STATS ) add_definitions( -DNO_SEND_STATS ) endif() -# Disable ADLMIDI's and OPNMIDI's MIDI Sequencer -add_definitions(-DADLMIDI_DISABLE_MIDI_SEQUENCER) -add_definitions(-DOPNMIDI_DISABLE_MIDI_SEQUENCER) - -# Disable OPNMIDI's experimental yet emulator (using of it has some issues and missing notes in playback) -add_definitions(-DOPNMIDI_DISABLE_GX_EMULATOR) - # Project files should be aware of the header files. We can GLOB these since # there's generally a new cpp for every header so this file will get changed file( GLOB HEADER_FILES @@ -679,7 +672,6 @@ file( GLOB HEADER_FILES sound/*.h sound/backend/*.h* sound/music/*.h* - sound/opnmidi/*.h* sound/oplsynth/*.h sound/oplsynth/dosbox/*.h posix/*.h @@ -884,18 +876,7 @@ set( FASTMATH_SOURCES rendering/hwrenderer/scene/hw_weapon.cpp r_data/models/models.cpp utility/matrix.cpp - sound/opnmidi/chips/gens_opn2.cpp - sound/opnmidi/chips/gens/Ym2612_Emu.cpp - sound/opnmidi/chips/mame/mame_ym2612fm.c - sound/opnmidi/chips/mame_opn2.cpp - sound/opnmidi/chips/nuked_opn2.cpp - sound/opnmidi/chips/nuked/ym3438.c - sound/opnmidi/opnmidi.cpp - sound/opnmidi/opnmidi_load.cpp - sound/opnmidi/opnmidi_midiplay.cpp - sound/opnmidi/opnmidi_opn2.cpp - sound/opnmidi/opnmidi_private.cpp - sound/opnmidi/wopn/wopn_file.c) +) #Vulkan stuff must go into a separate list later because it needs to be disabled for some platforms set (VULKAN_SOURCES @@ -1371,7 +1352,7 @@ if( UNIX ) endif() endif() -target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma adl ) +target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma adl opn ) include_directories( . g_statusbar @@ -1500,8 +1481,6 @@ install(TARGETS zdoom source_group("Audio Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/.+") source_group("Audio Files\\Backend" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/backend/.+") -source_group("Audio Files\\ADL MIDI" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/adlmidi/.+") -source_group("Audio Files\\OPN MIDI" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/opnmidi/.+") source_group("Audio Files\\OPL Synth" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/oplsynth/.+") source_group("Audio Files\\OPL Synth\\DOSBox" FILES sound/oplsynth/dosbox/opl.cpp sound/oplsynth/dosbox/opl.h) source_group("Audio Files\\Timidity" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sound/timidity/.+") diff --git a/src/sound/mididevices/music_opnmidi_mididevice.cpp b/src/sound/mididevices/music_opnmidi_mididevice.cpp index ed308554e..1a08d6c72 100644 --- a/src/sound/mididevices/music_opnmidi_mididevice.cpp +++ b/src/sound/mididevices/music_opnmidi_mididevice.cpp @@ -37,7 +37,7 @@ #include "i_musicinterns.h" #include "w_wad.h" #include "doomerrors.h" -#include "opnmidi/opnmidi.h" +#include "opnmidi.h" #include "i_soundfont.h" class OPNMIDIDevice : public SoftSynthMIDIDevice