diff --git a/makefile b/makefile index 63ff8fd0505..a218974a994 100644 --- a/makefile +++ b/makefile @@ -313,6 +313,10 @@ ifdef USE_QTDEBUG PARAMS += --USE_QTDEBUG='$(USE_QTDEBUG)' endif +ifdef DIRECTINPUT +PARAMS += --DIRECTINPUT='$(DIRECTINPUT)' +endif + ifdef MESA_INSTALL_ROOT PARAMS += --MESA_INSTALL_ROOT='$(MESA_INSTALL_ROOT)' endif diff --git a/scripts/genie.lua b/scripts/genie.lua index 4cbce4a281d..5ebbdd18873 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -721,7 +721,6 @@ end "comctl32", "shlwapi", "wsock32", - "dinput8", "comdlg32", } @@ -743,7 +742,6 @@ configuration { "vs*" } "comctl32", "shlwapi", "wsock32", - "dinput8", "comdlg32", } diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua index 7f02118b054..03d3948dd4f 100644 --- a/scripts/src/osd/windows.lua +++ b/scripts/src/osd/windows.lua @@ -8,6 +8,16 @@ function maintargetosdoptions(_target) "-municode", } + if _OPTIONS["DIRECTINPUT"] == "8" then + links { + "dinput8", + } + else + links { + "dinput", + } + end + local rcfile = MAME_DIR .. "src/" .. _target .. "/osd/windows/" .. _target ..".rc" if os.isfile(rcfile) then @@ -22,6 +32,20 @@ function maintargetosdoptions(_target) end +newoption { + trigger = "DIRECTINPUT", + description = "Minimum DirectInput version to support", + allowed = { + { "7", "Support DirectInput 7 or later" }, + { "8", "Support DirectInput 8 or later" }, + }, +} + +if not _OPTIONS["DIRECTINPUT"] then + _OPTIONS["DIRECTINPUT"] = "8" +end + + project ("osd_" .. _OPTIONS["osd"]) uuid (os.uuid("osd_" .. _OPTIONS["osd"])) kind "StaticLib" @@ -30,10 +54,19 @@ project ("osd_" .. _OPTIONS["osd"]) osdmodulesbuild() defines { - "DIRECTINPUT_VERSION=0x0800", "DIRECT3D_VERSION=0x0900", } + if _OPTIONS["DIRECTINPUT"] == "8" then + defines { + "DIRECTINPUT_VERSION=0x0800", + } + else + defines { + "DIRECTINPUT_VERSION=0x0700", + } + end + includedirs { MAME_DIR .. "src/emu", MAME_DIR .. "src/osd",