summaryrefslogtreecommitdiffstatshomepage
path: root/scripts
diff options
context:
space:
mode:
author Aaron Giles <aaronsgiles@users.noreply.github.com>2021-05-14 18:33:49 -0700
committer GitHub <noreply@github.com>2021-05-14 18:33:49 -0700
commit3cfc5224583f219ce5539708f78816d63f21c965 (patch)
tree5e404d9014e39cbba18475d42142bae08d8d8294 /scripts
parentb16708ff756062e0f450a77baa9f38c77a4263aa (diff)
ymfm: Refactor new FM engine into a 3rdparty library (#8046)
ymfm: refactor the code into a separate 3rdparty library * Moved ymfm core implementation to 3rdparty/ymfm * Split out each family (OPM/OPN/OPL/etc) into its own source file * Added preliminary OPQ and OPZ support, still WIP * Put all 3rdparty code into its own namespace ymfm * Fixed various bugs reported in #8042 * Created interface class for communication between the 3rdparty engine and the emulator * Standardized MAME implementation of all Yamaha devices based on a template class * Created standard base class ym_generic that can be used when multiple YM chips are swapped in * Changed YM2203/2608/2610 to embed a YM2149 as a subdevice instead of deriving from ay8910_device * Also provided compile-time option to use a simplified built-in SSG rather than using MAME's at all (currently off) * Consolidated MAME header files from one-per-chip (ym2151.h, ym2203.h, etc) to one-per-family (ymopm.h, ymopn.h, etc)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genie.lua1
-rw-r--r--scripts/src/3rdparty.lua34
-rw-r--r--scripts/src/main.lua1
-rw-r--r--scripts/src/sound.lua126
-rw-r--r--scripts/target/mame/mess.lua2
-rw-r--r--scripts/target/mame/virtual.lua2
6 files changed, 68 insertions, 98 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua
index b68ae191860..d7c841b4df3 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -1437,6 +1437,7 @@ if _OPTIONS["vs"]=="clangcl" then
"-Wno-unused-local-typedef",
"-Wno-unused-private-field",
"-Wno-unused-variable",
+ "-Wno-xor-used-as-pow",
"-Wno-microsoft-cast",
}
end
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index 2056e2e95a5..01404120033 100644
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -2255,6 +2255,40 @@ project "wdlfft"
--------------------------------------------------
+-- ymfm library objects
+--------------------------------------------------
+
+project "ymfm"
+ uuid "2403a536-cb0a-4b50-b41f-10c17917689b"
+ kind "StaticLib"
+
+ configuration { }
+ defines {
+ "YMFM_MAME",
+ }
+
+ files {
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm.h",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_adpcm.cpp",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_adpcm.h",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_fm.h",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_fm.ipp",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opl.cpp",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opl.h",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opm.cpp",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opm.h",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opn.cpp",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opn.h",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opq.cpp",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opq.h",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opz.cpp",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_opz.h",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_ssg.cpp",
+ MAME_DIR .. "3rdparty/ymfm/src/ymfm_ssg.h",
+ }
+
+
+--------------------------------------------------
-- asmjit library
--------------------------------------------------
diff --git a/scripts/src/main.lua b/scripts/src/main.lua
index 256a99c690f..992f883f3c8 100644
--- a/scripts/src/main.lua
+++ b/scripts/src/main.lua
@@ -250,6 +250,7 @@ end
"softfloat",
"softfloat3",
"wdlfft",
+ "ymfm",
ext_lib("jpeg"),
"7z",
}
diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua
index 1d643268548..57d9ae8afe1 100644
--- a/scripts/src/sound.lua
+++ b/scripts/src/sound.lua
@@ -1169,124 +1169,56 @@ end
---------------------------------------------------
-- Yamaha FM synthesizers
---@src/devices/sound/ym2151.h,SOUNDS["YM2151"] = true
---@src/devices/sound/ym2203.h,SOUNDS["YM2203"] = true
---@src/devices/sound/ym2413.h,SOUNDS["YM2413"] = true
---@src/devices/sound/ym2608.h,SOUNDS["YM2608"] = true
---@src/devices/sound/ym2610.h,SOUNDS["YM2610"] = true
---@src/devices/sound/ym2612.h,SOUNDS["YM2612"] = true
---@src/devices/sound/ym3526.h,SOUNDS["YM3526"] = true
---@src/devices/sound/ym3812.h,SOUNDS["YM3812"] = true
---@src/devices/sound/ymf262.h,SOUNDS["YMF262"] = true
+--@src/devices/sound/ymopm.h,SOUNDS["YM2151"] = true
+--@src/devices/sound/ymopm.h,SOUNDS["YM2414"] = true
+--@src/devices/sound/ymopm.h,SOUNDS["YM3806"] = true
+--@src/devices/sound/ymopn.h,SOUNDS["YM2203"] = true
+--@src/devices/sound/ymopl.h,SOUNDS["YM2413"] = true
+--@src/devices/sound/ymopn.h,SOUNDS["YM2608"] = true
+--@src/devices/sound/ymopn.h,SOUNDS["YM2610"] = true
+--@src/devices/sound/ymopn.h,SOUNDS["YM2612"] = true
+--@src/devices/sound/ymopl.h,SOUNDS["YM3526"] = true
+--@src/devices/sound/ymopl.h,SOUNDS["YM3812"] = true
+--@src/devices/sound/ymopl.h,SOUNDS["YMF262"] = true
--@src/devices/sound/ymf271.h,SOUNDS["YMF271"] = true
--@src/devices/sound/ymf278b.h,SOUNDS["YMF278B"] = true
---@src/devices/sound/y8950.h,SOUNDS["Y8950"] = true
+--@src/devices/sound/ymopl.h,SOUNDS["Y8950"] = true
---------------------------------------------------
-if (SOUNDS["YM2151"]~=null) then
+if (SOUNDS["YM2151"]~=null or SOUNDS["YM2164"]~=null) then
files {
- MAME_DIR .. "src/devices/sound/ym2151.cpp",
- MAME_DIR .. "src/devices/sound/ym2151.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
+ MAME_DIR .. "src/devices/sound/ymopm.cpp",
+ MAME_DIR .. "src/devices/sound/ymopm.h",
}
end
-if (SOUNDS["YM2413"]~=null or SOUNDS["YM2423"]~=null or SOUNDS["YMF281"]~=null or SOUNDS["DS1001"]~=null) then
+if (SOUNDS["YM2414"]~=null) then
files {
- MAME_DIR .. "src/devices/sound/ym2413.cpp",
- MAME_DIR .. "src/devices/sound/ym2413.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
+ MAME_DIR .. "src/devices/sound/ymopz.cpp",
+ MAME_DIR .. "src/devices/sound/ymopz.h",
}
end
-if (SOUNDS["YM2203"]~=null or SOUNDS["YM2608"]~=null or SOUNDS["YM2610"]~=null or SOUNDS["YM2610B"]~=null or SOUNDS["YM2612"]~=null or SOUNDS["YM3438"]~=null) then
---if (SOUNDS["YM2203"]~=null) then
- files {
- MAME_DIR .. "src/devices/sound/ay8910.cpp",
- MAME_DIR .. "src/devices/sound/ay8910.h",
- MAME_DIR .. "src/devices/sound/ym2203.cpp",
- MAME_DIR .. "src/devices/sound/ym2203.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
- }
---end
-
-
---if (SOUNDS["YM2608"]~=null) then
+if (SOUNDS["YM3806"]~=null) then
files {
- MAME_DIR .. "src/devices/sound/ay8910.cpp",
- MAME_DIR .. "src/devices/sound/ay8910.h",
- MAME_DIR .. "src/devices/sound/ym2608.cpp",
- MAME_DIR .. "src/devices/sound/ym2608.h",
- MAME_DIR .. "src/devices/sound/ymadpcm.cpp",
- MAME_DIR .. "src/devices/sound/ymadpcm.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
+ MAME_DIR .. "src/devices/sound/ymopq.cpp",
+ MAME_DIR .. "src/devices/sound/ymopq.h",
}
---end
+end
---if (SOUNDS["YM2610"]~=null or SOUNDS["YM2610B"]~=null) then
+if (SOUNDS["YM2203"]~=null or SOUNDS["YM2608"]~=null or SOUNDS["YM2610"]~=null or SOUNDS["YM2610B"]~=null or SOUNDS["YM2612"]~=null or SOUNDS["YM3438"]~=null) then
files {
MAME_DIR .. "src/devices/sound/ay8910.cpp",
MAME_DIR .. "src/devices/sound/ay8910.h",
- MAME_DIR .. "src/devices/sound/ym2610.cpp",
- MAME_DIR .. "src/devices/sound/ym2610.h",
- MAME_DIR .. "src/devices/sound/ymadpcm.cpp",
- MAME_DIR .. "src/devices/sound/ymadpcm.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
- }
---end
-
---if (SOUNDS["YM2612"]~=null or SOUNDS["YM3438"]~=null) then
- files {
- MAME_DIR .. "src/devices/sound/ym2612.cpp",
- MAME_DIR .. "src/devices/sound/ym2612.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
- }
---end
-end
-
-if (SOUNDS["YM3812"]~=null or SOUNDS["YM3526"]~=null or SOUNDS["Y8950"]~=null) then
---if (SOUNDS["YM3812"]~=null) then
- files {
- MAME_DIR .. "src/devices/sound/ym3812.cpp",
- MAME_DIR .. "src/devices/sound/ym3812.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
- }
---end
-
---if (SOUNDS["YM3526"]~=null) then
- files {
- MAME_DIR .. "src/devices/sound/ym3526.cpp",
- MAME_DIR .. "src/devices/sound/ym3526.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
- }
---end
-
---if (SOUNDS["Y8950"]~=null) then
- files {
- MAME_DIR .. "src/devices/sound/y8950.cpp",
- MAME_DIR .. "src/devices/sound/y8950.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
- MAME_DIR .. "src/devices/sound/ymadpcm.cpp",
- MAME_DIR .. "src/devices/sound/ymadpcm.h",
+ MAME_DIR .. "src/devices/sound/ymopn.cpp",
+ MAME_DIR .. "src/devices/sound/ymopn.h",
}
---end
end
-if (SOUNDS["YMF262"]~=null) then
+if (SOUNDS["YM3526"]~=null or SOUNDS["Y8950"]~=null or SOUNDS["YM3812"]~=null or SOUNDS["YMF262"]~=null or SOUNDS["YM2413"]~=null or SOUNDS["YM2423"]~=null or SOUNDS["YMF281"]~=null or SOUNDS["DS1001"]~=null) then
files {
- MAME_DIR .. "src/devices/sound/ymf262.cpp",
- MAME_DIR .. "src/devices/sound/ymf262.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
+ MAME_DIR .. "src/devices/sound/ymopl.cpp",
+ MAME_DIR .. "src/devices/sound/ymopl.h",
}
end
@@ -1301,8 +1233,6 @@ if (SOUNDS["YMF278B"]~=null) then
files {
MAME_DIR .. "src/devices/sound/ymf278b.cpp",
MAME_DIR .. "src/devices/sound/ymf278b.h",
- MAME_DIR .. "src/devices/sound/ymfm.cpp",
- MAME_DIR .. "src/devices/sound/ymfm.h",
}
end
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index b69c745a60c..8f0a101f811 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -184,6 +184,8 @@ SOUNDS["BEEP"] = true
SOUNDS["DISCRETE"] = true
SOUNDS["AY8910"] = true
SOUNDS["YM2151"] = true
+SOUNDS["YM2414"] = true
+SOUNDS["YM3806"] = true
SOUNDS["YM2203"] = true
SOUNDS["YM2413"] = true
SOUNDS["YM2608"] = true
diff --git a/scripts/target/mame/virtual.lua b/scripts/target/mame/virtual.lua
index 2d1c866d51a..e3d4da3a59d 100644
--- a/scripts/target/mame/virtual.lua
+++ b/scripts/target/mame/virtual.lua
@@ -57,6 +57,8 @@ SOUNDS["WAVE"] = true
SOUNDS["X1_010"] = true
SOUNDS["Y8950"] = true
SOUNDS["YM2151"] = true
+SOUNDS["YM2414"] = true
+SOUNDS["YM3806"] = true
SOUNDS["YM2203"] = true
SOUNDS["YM2413"] = true
SOUNDS["YM2608"] = true