diff options
Diffstat (limited to 'docs/release/scripts/src/osd')
-rw-r--r-- | docs/release/scripts/src/osd/modules.lua | 556 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/newui.lua | 273 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/osdmini.lua | 130 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/osdmini_cfg.lua | 12 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/sdl.lua | 506 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/sdl_cfg.lua | 165 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/uwp.lua | 121 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/uwp_cfg.lua | 20 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/windows.lua | 291 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/windows_cfg.lua | 59 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/winui.lua | 320 | ||||
-rw-r--r-- | docs/release/scripts/src/osd/winui_cfg.lua | 26 |
12 files changed, 2479 insertions, 0 deletions
diff --git a/docs/release/scripts/src/osd/modules.lua b/docs/release/scripts/src/osd/modules.lua new file mode 100644 index 00000000000..1376be2b1d5 --- /dev/null +++ b/docs/release/scripts/src/osd/modules.lua @@ -0,0 +1,556 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +--------------------------------------------------------------------------- +-- +-- modules.lua +-- +-- Rules for the building of modules +-- +--------------------------------------------------------------------------- + +function string.starts(String,Start) + return string.sub(String,1,string.len(Start))==Start +end + +function addlibfromstring(str) + if (str==nil) then return end + for w in str:gmatch("%S+") do + if string.starts(w,"-l")==true then + links { + string.sub(w,3) + } + end + end +end + +function addoptionsfromstring(str) + if (str==nil) then return end + for w in str:gmatch("%S+") do + if string.starts(w,"-l")==false then + linkoptions { + w + } + end + end +end + +function pkgconfigcmd() + local pkgconfig = os.getenv("PKG_CONFIG") + if pkgconfig == nil then + return "pkg-config" + end + return pkgconfig +end + +function osdmodulesbuild() + + removeflags { + "SingleOutputDir", + } + + files { + MAME_DIR .. "src/osd/osdnet.cpp", + MAME_DIR .. "src/osd/osdnet.h", + MAME_DIR .. "src/osd/watchdog.cpp", + MAME_DIR .. "src/osd/watchdog.h", + MAME_DIR .. "src/osd/modules/debugger/debug_module.h", + MAME_DIR .. "src/osd/modules/font/font_module.h", + MAME_DIR .. "src/osd/modules/midi/midi_module.h", + MAME_DIR .. "src/osd/modules/netdev/netdev_module.h", + MAME_DIR .. "src/osd/modules/sound/sound_module.h", + MAME_DIR .. "src/osd/modules/diagnostics/diagnostics_module.h", + MAME_DIR .. "src/osd/modules/monitor/monitor_module.h", + MAME_DIR .. "src/osd/modules/lib/osdobj_common.cpp", + MAME_DIR .. "src/osd/modules/lib/osdobj_common.h", + MAME_DIR .. "src/osd/modules/diagnostics/none.cpp", + MAME_DIR .. "src/osd/modules/diagnostics/diagnostics_win32.cpp", + MAME_DIR .. "src/osd/modules/debugger/none.cpp", + MAME_DIR .. "src/osd/modules/debugger/debugwin.cpp", + MAME_DIR .. "src/osd/modules/debugger/debugimgui.cpp", + MAME_DIR .. "src/osd/modules/font/font_sdl.cpp", + MAME_DIR .. "src/osd/modules/font/font_windows.cpp", + MAME_DIR .. "src/osd/modules/font/font_dwrite.cpp", + MAME_DIR .. "src/osd/modules/font/font_osx.cpp", + MAME_DIR .. "src/osd/modules/font/font_none.cpp", + MAME_DIR .. "src/osd/modules/netdev/taptun.cpp", + MAME_DIR .. "src/osd/modules/netdev/pcap.cpp", + MAME_DIR .. "src/osd/modules/netdev/none.cpp", + MAME_DIR .. "src/osd/modules/midi/portmidi.cpp", + MAME_DIR .. "src/osd/modules/midi/none.cpp", + MAME_DIR .. "src/osd/modules/sound/js_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/direct_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/pa_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/coreaudio_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/sdl_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/xaudio2_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/none.cpp", + MAME_DIR .. "src/osd/modules/input/input_module.h", + MAME_DIR .. "src/osd/modules/input/input_common.cpp", + MAME_DIR .. "src/osd/modules/input/input_common.h", + MAME_DIR .. "src/osd/modules/input/input_dinput.cpp", + MAME_DIR .. "src/osd/modules/input/input_dinput.h", + MAME_DIR .. "src/osd/modules/input/input_none.cpp", + MAME_DIR .. "src/osd/modules/input/input_rawinput.cpp", + MAME_DIR .. "src/osd/modules/input/input_win32.cpp", + MAME_DIR .. "src/osd/modules/input/input_sdl.cpp", + MAME_DIR .. "src/osd/modules/input/input_sdlcommon.cpp", + MAME_DIR .. "src/osd/modules/input/input_sdlcommon.h", + MAME_DIR .. "src/osd/modules/input/input_x11.cpp", + MAME_DIR .. "src/osd/modules/input/input_windows.cpp", + MAME_DIR .. "src/osd/modules/input/input_windows.h", + MAME_DIR .. "src/osd/modules/input/input_xinput.cpp", + MAME_DIR .. "src/osd/modules/input/input_xinput.h", + MAME_DIR .. "src/osd/modules/input/input_winhybrid.cpp", + MAME_DIR .. "src/osd/modules/input/input_uwp.cpp", + MAME_DIR .. "src/osd/modules/output/output_module.h", + MAME_DIR .. "src/osd/modules/output/none.cpp", + MAME_DIR .. "src/osd/modules/output/console.cpp", + MAME_DIR .. "src/osd/modules/output/network.cpp", + MAME_DIR .. "src/osd/modules/output/win32_output.cpp", + MAME_DIR .. "src/osd/modules/output/win32_output.h", + MAME_DIR .. "src/osd/modules/monitor/monitor_common.h", + MAME_DIR .. "src/osd/modules/monitor/monitor_common.cpp", + MAME_DIR .. "src/osd/modules/monitor/monitor_win32.cpp", + MAME_DIR .. "src/osd/modules/monitor/monitor_dxgi.cpp", + MAME_DIR .. "src/osd/modules/monitor/monitor_sdl.cpp", + } + includedirs { + ext_includedir("asio"), + } + + if _OPTIONS["targetos"]=="windows" then + includedirs { + MAME_DIR .. "3rdparty/winpcap/Include", + MAME_DIR .. "3rdparty/compat/mingw", + MAME_DIR .. "3rdparty/portaudio/include", + } + + includedirs { + MAME_DIR .. "3rdparty/compat/winsdk-override", + } + end + + if _OPTIONS["NO_OPENGL"]=="1" then + defines { + "USE_OPENGL=0", + } + else + files { + MAME_DIR .. "src/osd/modules/render/drawogl.cpp", + MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.cpp", + MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.cpp", + MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.h", + MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.h", + MAME_DIR .. "src/osd/modules/opengl/osd_opengl.h", + } + defines { + "USE_OPENGL=1", + } + if _OPTIONS["USE_DISPATCH_GL"]=="1" then + defines { + "USE_DISPATCH_GL=1", + } + end + end + + defines { + "__STDC_LIMIT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_CONSTANT_MACROS", + "IMGUI_DISABLE_OBSOLETE_FUNCTIONS", + } + + files { + MAME_DIR .. "src/osd/modules/render/drawbgfx.cpp", + MAME_DIR .. "src/osd/modules/render/aviwrite.cpp", + MAME_DIR .. "src/osd/modules/render/aviwrite.h", + MAME_DIR .. "src/osd/modules/render/bgfxutil.cpp", + MAME_DIR .. "src/osd/modules/render/bgfxutil.h", + MAME_DIR .. "src/osd/modules/render/binpacker.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/blendreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/chain.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/chainentry.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/chainentryreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/chainmanager.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/chainreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/clear.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/clear.h", + MAME_DIR .. "src/osd/modules/render/bgfx/clearreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/clearreader.h", + MAME_DIR .. "src/osd/modules/render/bgfx/cullreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/depthreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/effect.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/effectmanager.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/effectreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/entryuniformreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/inputpair.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/frameparameter.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/timeparameter.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/paramreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/paramuniform.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/paramuniformreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/shadermanager.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/slider.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/sliderreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/slideruniform.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/slideruniformreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/statereader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/suppressor.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/suppressorreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/target.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/targetreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/targetmanager.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/texture.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/texturemanager.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/uniform.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/uniformreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/valueuniform.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/valueuniformreader.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/view.cpp", + MAME_DIR .. "src/osd/modules/render/bgfx/writereader.cpp", + } + includedirs { + MAME_DIR .. "3rdparty/bgfx/examples/common", + MAME_DIR .. "3rdparty/bgfx/include", + MAME_DIR .. "3rdparty/bgfx/3rdparty", + MAME_DIR .. "3rdparty/bx/include", + ext_includedir("rapidjson") + } + + if _OPTIONS["NO_USE_PORTAUDIO"]=="1" then + defines { + "NO_USE_PORTAUDIO", + } + else + includedirs { + ext_includedir("portaudio"), + } + end + + if _OPTIONS["NO_USE_MIDI"]=="1" then + defines { + "NO_USE_MIDI", + } + else + includedirs { + ext_includedir("portmidi"), + } + end + + if _OPTIONS["USE_QTDEBUG"]=="1" then + defines { + "USE_QTDEBUG=1", + } + else + defines { + "USE_QTDEBUG=0", + } + end + +end + + +function qtdebuggerbuild() + + removeflags { + "SingleOutputDir", + } + local version = str_to_version(_OPTIONS["gcc_version"]) + if _OPTIONS["gcc"]~=nil and (string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "asmjs")) then + configuration { "gmake or ninja" } + if (version >= 30600) then + buildoptions { + "-Wno-inconsistent-missing-override", + } + end + configuration { } + end + + files { + MAME_DIR .. "src/osd/modules/debugger/debugqt.cpp", + } + + if _OPTIONS["USE_QTDEBUG"]=="1" then + files { + MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.h", + MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.h", + MAME_DIR .. "src/osd/modules/debugger/qt/logwindow.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/logwindow.h", + MAME_DIR .. "src/osd/modules/debugger/qt/dasmwindow.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/dasmwindow.h", + MAME_DIR .. "src/osd/modules/debugger/qt/mainwindow.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/mainwindow.h", + MAME_DIR .. "src/osd/modules/debugger/qt/memorywindow.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/memorywindow.h", + MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.h", + MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.cpp", + MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.h", + MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.h", + GEN_DIR .. "osd/modules/debugger/qt/debuggerview.moc.cpp", + GEN_DIR .. "osd/modules/debugger/qt/windowqt.moc.cpp", + GEN_DIR .. "osd/modules/debugger/qt/logwindow.moc.cpp", + GEN_DIR .. "osd/modules/debugger/qt/dasmwindow.moc.cpp", + GEN_DIR .. "osd/modules/debugger/qt/mainwindow.moc.cpp", + GEN_DIR .. "osd/modules/debugger/qt/memorywindow.moc.cpp", + GEN_DIR .. "osd/modules/debugger/qt/breakpointswindow.moc.cpp", + GEN_DIR .. "osd/modules/debugger/qt/deviceswindow.moc.cpp", + GEN_DIR .. "osd/modules/debugger/qt/deviceinformationwindow.moc.cpp", + } + defines { + "USE_QTDEBUG=1", + } + + local MOC = "" + if (os.is("windows")) then + MOC = "moc" + else + if _OPTIONS["QT_HOME"]~=nil then + QMAKETST = backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake --version 2>/dev/null") + if (QMAKETST=='') then + print("Qt's Meta Object Compiler (moc) wasn't found!") + os.exit(1) + end + MOC = _OPTIONS["QT_HOME"] .. "/bin/moc" + else + MOCTST = backtick("which moc-qt5 2>/dev/null") + if (MOCTST=='') then + MOCTST = backtick("which moc 2>/dev/null") + end + if (MOCTST=='') then + print("Qt's Meta Object Compiler (moc) wasn't found!") + os.exit(1) + end + MOC = MOCTST + end + end + + + custombuildtask { + { MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.h", GEN_DIR .. "osd/modules/debugger/qt/debuggerview.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + { MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.h", GEN_DIR .. "osd/modules/debugger/qt/windowqt.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + { MAME_DIR .. "src/osd/modules/debugger/qt/logwindow.h", GEN_DIR .. "osd/modules/debugger/qt/logwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + { MAME_DIR .. "src/osd/modules/debugger/qt/dasmwindow.h", GEN_DIR .. "osd/modules/debugger/qt/dasmwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + { MAME_DIR .. "src/osd/modules/debugger/qt/mainwindow.h", GEN_DIR .. "osd/modules/debugger/qt/mainwindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + { MAME_DIR .. "src/osd/modules/debugger/qt/memorywindow.h", GEN_DIR .. "osd/modules/debugger/qt/memorywindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + { MAME_DIR .. "src/osd/modules/debugger/qt/breakpointswindow.h", GEN_DIR .. "osd/modules/debugger/qt/breakpointswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + { MAME_DIR .. "src/osd/modules/debugger/qt/deviceswindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceswindow.moc.cpp", { }, { MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + { MAME_DIR .. "src/osd/modules/debugger/qt/deviceinformationwindow.h", GEN_DIR .. "osd/modules/debugger/qt/deviceinformationwindow.moc.cpp", { },{ MOC .. "$(MOCINCPATH) -b emu.h $(<) -o $(@)" }}, + + } + + if _OPTIONS["targetos"]=="windows" then + configuration { "mingw*" } + buildoptions { + "-I$(shell qmake -query QT_INSTALL_HEADERS)", + } + configuration { } + elseif _OPTIONS["targetos"]=="macosx" then + buildoptions { + "-F" .. backtick("qmake -query QT_INSTALL_LIBS"), + } + else + if _OPTIONS["QT_HOME"]~=nil then + buildoptions { + "-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_HEADERS"), + } + else + buildoptions { + backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + } + end + end + else + defines { + "USE_QTDEBUG=0", + } + end + +end + + +function osdmodulestargetconf() + + if _OPTIONS["NO_OPENGL"]~="1" then + if _OPTIONS["targetos"]=="macosx" then + links { + "OpenGL.framework", + } + elseif _OPTIONS["USE_DISPATCH_GL"]~="1" then + if _OPTIONS["targetos"]=="windows" then + links { + "opengl32", + } + else + links { + "GL", + } + end + end + end + + if _OPTIONS["NO_USE_MIDI"]~="1" then + if _OPTIONS["targetos"]=="linux" then + local str = backtick(pkgconfigcmd() .. " --libs alsa") + addlibfromstring(str) + addoptionsfromstring(str) + elseif _OPTIONS["targetos"]=="macosx" then + links { + "CoreMIDI.framework", + } + end + end + + if _OPTIONS["USE_QTDEBUG"]=="1" then + if _OPTIONS["targetos"]=="windows" then + linkoptions { + "-L$(shell qmake -query QT_INSTALL_LIBS)", + } + links { + "Qt5Core.dll", + "Qt5Gui.dll", + "Qt5Widgets.dll", + } + elseif _OPTIONS["targetos"]=="macosx" then + linkoptions { + "-F" .. backtick("qmake -query QT_INSTALL_LIBS"), + } + links { + "Qt5Core.framework", + "Qt5Gui.framework", + "Qt5Widgets.framework", + } + else + if _OPTIONS["QT_HOME"]~=nil then + linkoptions { + "-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"), + } + links { + "Qt5Core", + "Qt5Gui", + "Qt5Widgets", + } + else + local str = backtick(pkgconfigcmd() .. " --libs Qt5Widgets") + addlibfromstring(str) + addoptionsfromstring(str) + end + end + end + + if _OPTIONS["targetos"]=="windows" then + links { + "gdi32", + "dsound", + "dxguid", + "oleaut32", + "winmm", + } + elseif _OPTIONS["targetos"]=="macosx" then + links { + "AudioUnit.framework", + "AudioToolbox.framework", + "CoreAudio.framework", + "CoreServices.framework", + } + end + +end + + +newoption { + trigger = "DONT_USE_NETWORK", + description = "Disable network access", +} + +newoption { + trigger = "NO_OPENGL", + description = "Disable use of OpenGL", + allowed = { + { "0", "Enable OpenGL" }, + { "1", "Disable OpenGL" }, + }, +} + +newoption { + trigger = "USE_DISPATCH_GL", + description = "Use GL-dispatching", + allowed = { + { "0", "Link to OpenGL library" }, + { "1", "Use GL-dispatching" }, + }, +} + +if not _OPTIONS["USE_DISPATCH_GL"] then + _OPTIONS["USE_DISPATCH_GL"] = "0" +end + +newoption { + trigger = "NO_USE_MIDI", + description = "Disable MIDI I/O", + allowed = { + { "0", "Enable MIDI" }, + { "1", "Disable MIDI" }, + }, +} + +if not _OPTIONS["NO_USE_MIDI"] then + if _OPTIONS["targetos"]=="freebsd" or _OPTIONS["targetos"]=="openbsd" or _OPTIONS["targetos"]=="netbsd" or _OPTIONS["targetos"]=="solaris" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"] == "asmjs" then + _OPTIONS["NO_USE_MIDI"] = "1" + else + _OPTIONS["NO_USE_MIDI"] = "0" + end +end + +newoption { + trigger = "NO_USE_PORTAUDIO", + description = "Disable PortAudio interface", + allowed = { + { "0", "Enable PortAudio" }, + { "1", "Disable PortAudio" }, + }, +} + +if not _OPTIONS["NO_USE_PORTAUDIO"] then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="linux" or _OPTIONS["targetos"]=="macosx" then + _OPTIONS["NO_USE_PORTAUDIO"] = "0" + else + _OPTIONS["NO_USE_PORTAUDIO"] = "1" + end +end + +newoption { + trigger = "MODERN_WIN_API", + description = "Use Modern Windows APIs", + allowed = { + { "0", "Use classic Windows APIs - allows support for XP and later" }, + { "1", "Use Modern Windows APIs - support for Windows 8.1 and later" }, + }, +} + +newoption { + trigger = "USE_QTDEBUG", + description = "Use QT debugger", + allowed = { + { "0", "Don't use Qt debugger" }, + { "1", "Use Qt debugger" }, + }, +} + +newoption { + trigger = "QT_HOME", + description = "QT lib location", +} + + +if not _OPTIONS["USE_QTDEBUG"] then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="solaris" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"] == "asmjs" then + _OPTIONS["USE_QTDEBUG"] = "0" + else + _OPTIONS["USE_QTDEBUG"] = "1" + end +end diff --git a/docs/release/scripts/src/osd/newui.lua b/docs/release/scripts/src/osd/newui.lua new file mode 100644 index 00000000000..425eb50ba12 --- /dev/null +++ b/docs/release/scripts/src/osd/newui.lua @@ -0,0 +1,273 @@ +-- license:BSD-3-Clause +-- copyright-holders:Robbbert + +--------------------------------------------------------------------------- +-- +-- newui.lua +-- +-- Rules for the building for Windows +-- +--------------------------------------------------------------------------- + +dofile("modules.lua") + +premake.make.linkoptions_after = false; + +function maintargetosdoptions(_target,_subtarget) + osdmodulestargetconf() + + configuration { "mingw*" } + links { + "mingw32", + } + + configuration { } + + if _OPTIONS["DIRECTINPUT"] == "8" then + links { + "dinput8", + } + else + links { + "dinput", + } + end + + links { + "comctl32", + "comdlg32", + "psapi", + "ole32", + } + +-- needs same resources as messui, because dropdown menus are in mameui.rc + override_resources = true; + rctarget = _subtarget; + local rcfile = MAME_DIR .. "src/osd/winui/" .. _subtarget .. ".rc" + local uifile = MAME_DIR .. "src/osd/winui/mameui.rc" + + if not os.isfile(rcfile) then + print(string.format("***** %s not found *****",rcfile)) + os.exit(); + end + + if not os.isfile(uifile) then + print(string.format("***** %s not found *****",uifile)) + os.exit(); + end + + files { + rcfile, + } + dependency { + { "$(OBJDIR)/".._subtarget..".res" , GEN_DIR .. "/resource/".._subtarget.."vers.rc", true }, + } +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 ("qtdbg_" .. _OPTIONS["osd"]) + uuid (os.uuid("qtdbg_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("windows_cfg.lua") + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + qtdebuggerbuild() + +project ("osd_" .. _OPTIONS["osd"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind "StaticLib" + + dofile("winui_cfg.lua") + osdmodulesbuild() + + defines { + "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/devices", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/frontend/mame", + MAME_DIR .. "src/osd/windows", + } + + files { + MAME_DIR .. "src/osd/modules/render/d3d/d3dintf.h", + MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.cpp", + MAME_DIR .. "src/osd/modules/render/d3d/d3dcomm.h", + MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.h", + MAME_DIR .. "src/osd/modules/render/drawd3d.cpp", + MAME_DIR .. "src/osd/modules/render/drawd3d.h", + MAME_DIR .. "src/osd/modules/render/drawgdi.cpp", + MAME_DIR .. "src/osd/modules/render/drawgdi.h", + MAME_DIR .. "src/osd/modules/render/drawnone.cpp", + MAME_DIR .. "src/osd/modules/render/drawnone.h", + MAME_DIR .. "src/osd/windows/video.cpp", + MAME_DIR .. "src/osd/windows/video.h", + MAME_DIR .. "src/osd/windows/window.cpp", + MAME_DIR .. "src/osd/windows/window.h", + MAME_DIR .. "src/osd/modules/osdwindow.cpp", + MAME_DIR .. "src/osd/modules/osdwindow.h", + MAME_DIR .. "src/osd/windows/winmain.cpp", + MAME_DIR .. "src/osd/windows/winmain.h", + MAME_DIR .. "src/osd/osdepend.h", + MAME_DIR .. "src/osd/winui/newui.cpp", + MAME_DIR .. "src/osd/windows/winmain.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/consolewininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/consolewininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugbaseinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugbaseinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmbasewininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmbasewininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/editwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/editwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/logviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/logviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/logwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/logwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/memoryviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/memoryviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/memorywininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/memorywininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/pointswininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/pointswininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/uimetrics.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/uimetrics.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugwin.h", + } + + +project ("ocore_" .. _OPTIONS["osd"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind "StaticLib" + + options { + "ForceCPP", + } + removeflags { + "SingleOutputDir", + } + + dofile("windows_cfg.lua") + + includedirs { + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + } + + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" + SYNC_IMPLEMENTATION = "windows" + + includedirs { + MAME_DIR .. "src/osd/windows", + MAME_DIR .. "src/lib/winpcap", + } + + files { + MAME_DIR .. "src/osd/eigccppc.h", + MAME_DIR .. "src/osd/eigccx86.h", + MAME_DIR .. "src/osd/eivc.h", + MAME_DIR .. "src/osd/eivcx86.h", + MAME_DIR .. "src/osd/eminline.h", + MAME_DIR .. "src/osd/osdcomm.h", + MAME_DIR .. "src/osd/osdcore.cpp", + MAME_DIR .. "src/osd/osdcore.h", + MAME_DIR .. "src/osd/strconv.cpp", + MAME_DIR .. "src/osd/strconv.h", + MAME_DIR .. "src/osd/windows/main.cpp", + MAME_DIR .. "src/osd/osdsync.cpp", + MAME_DIR .. "src/osd/osdsync.h", + MAME_DIR .. "src/osd/windows/winutf8.cpp", + MAME_DIR .. "src/osd/windows/winutf8.h", + MAME_DIR .. "src/osd/windows/winutil.cpp", + MAME_DIR .. "src/osd/windows/winutil.h", + MAME_DIR .. "src/osd/modules/osdmodule.cpp", + MAME_DIR .. "src/osd/modules/osdmodule.h", + MAME_DIR .. "src/osd/modules/file/windir.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.h", + MAME_DIR .. "src/osd/modules/file/winptty.cpp", + MAME_DIR .. "src/osd/modules/file/winsocket.cpp", + MAME_DIR .. "src/osd/modules/lib/osdlib_win32.cpp", + } + + + +-------------------------------------------------- +-- ledutil +-------------------------------------------------- + +if _OPTIONS["with-tools"] then + project("ledutil") + uuid ("061293ca-7290-44ac-b2b5-5913ae8dc9c0") + kind "ConsoleApp" + + options { + "ForceCPP", + } + + targetdir(MAME_DIR) + + links { + "ocore_" .. _OPTIONS["osd"], + } + + includedirs { + MAME_DIR .. "src/osd", + } + + files { + MAME_DIR .. "src/osd/windows/ledutil.cpp", + } +end diff --git a/docs/release/scripts/src/osd/osdmini.lua b/docs/release/scripts/src/osd/osdmini.lua new file mode 100644 index 00000000000..b05839e7873 --- /dev/null +++ b/docs/release/scripts/src/osd/osdmini.lua @@ -0,0 +1,130 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +--------------------------------------------------------------------------- +-- +-- osdmini.lua +-- +-- Rules for the building of osdmini +-- +--------------------------------------------------------------------------- + +function maintargetosdoptions(_target,_subtarget) +end + +project ("qtdbg_" .. _OPTIONS["osd"]) + uuid (os.uuid("qtdbg_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("osdmini_cfg.lua") + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + removeflags { + "SingleOutputDir", + } + + files { + MAME_DIR .. "src/osd/modules/debugger/debugqt.cpp", + } + +project ("osd_" .. _OPTIONS["osd"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + removeflags { + "SingleOutputDir", + } + + dofile("osdmini_cfg.lua") + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/sdl", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + MAME_DIR .. "3rdparty/winpcap/Include", + MAME_DIR .. "3rdparty/bgfx/include", + MAME_DIR .. "3rdparty/bx/include", + } + + files { + MAME_DIR .. "src/osd/osdnet.cpp", + MAME_DIR .. "src/osd/osdnet.h", + MAME_DIR .. "src/osd/osdmini/minimain.cpp", + MAME_DIR .. "src/osd/osdmini/osdmini.h", + MAME_DIR .. "src/osd/osdepend.h", + MAME_DIR .. "src/osd/modules/lib/osdobj_common.cpp", + MAME_DIR .. "src/osd/modules/lib/osdobj_common.h", + MAME_DIR .. "src/osd/modules/font/font_sdl.cpp", + MAME_DIR .. "src/osd/modules/font/font_windows.cpp", + MAME_DIR .. "src/osd/modules/font/font_osx.cpp", + MAME_DIR .. "src/osd/modules/font/font_none.cpp", + MAME_DIR .. "src/osd/modules/netdev/taptun.cpp", + MAME_DIR .. "src/osd/modules/netdev/pcap.cpp", + MAME_DIR .. "src/osd/modules/netdev/none.cpp", + MAME_DIR .. "src/osd/modules/midi/portmidi.cpp", + MAME_DIR .. "src/osd/modules/midi/none.cpp", + MAME_DIR .. "src/osd/modules/sound/js_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/direct_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/coreaudio_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/sdl_sound.cpp", + MAME_DIR .. "src/osd/modules/sound/none.cpp", + MAME_DIR .. "src/osd/modules/sound/xaudio2_sound.cpp", + } + +project ("ocore_" .. _OPTIONS["osd"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + removeflags { + "SingleOutputDir", + } + + dofile("osdmini_cfg.lua") + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + } + + if _OPTIONS["targetos"]=="linux" then + BASE_TARGETOS = "unix" + SDLOS_TARGETOS = "unix" + SYNC_IMPLEMENTATION = "tc" + end + + if _OPTIONS["targetos"]=="windows" then + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" + SYNC_IMPLEMENTATION = "windows" + end + + if _OPTIONS["targetos"]=="macosx" then + BASE_TARGETOS = "unix" + SDLOS_TARGETOS = "macosx" + SYNC_IMPLEMENTATION = "ntc" + end + + files { + MAME_DIR .. "src/osd/osdcore.cpp", + MAME_DIR .. "src/osd/osdcore.h", + MAME_DIR .. "src/osd/modules/osdmodule.cpp", + MAME_DIR .. "src/osd/modules/osdmodule.h", + MAME_DIR .. "src/osd/osdmini/minidir.cpp", + MAME_DIR .. "src/osd/osdmini/minifile.cpp", + MAME_DIR .. "src/osd/osdmini/minimisc.cpp", + MAME_DIR .. "src/osd/osdmini/minitime.cpp", + MAME_DIR .. "src/osd/modules/sync/work_mini.cpp", + } diff --git a/docs/release/scripts/src/osd/osdmini_cfg.lua b/docs/release/scripts/src/osd/osdmini_cfg.lua new file mode 100644 index 00000000000..586075d3cac --- /dev/null +++ b/docs/release/scripts/src/osd/osdmini_cfg.lua @@ -0,0 +1,12 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +defines { + "OSD_MINI", + "USE_QTDEBUG=0", + "USE_SDL", + "SDLMAME_NOASM=1", + "USE_OPENGL=0", + "NO_USE_MIDI=1", + "USE_XAUDIO2=0", +} diff --git a/docs/release/scripts/src/osd/sdl.lua b/docs/release/scripts/src/osd/sdl.lua new file mode 100644 index 00000000000..9485fcc553c --- /dev/null +++ b/docs/release/scripts/src/osd/sdl.lua @@ -0,0 +1,506 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +--------------------------------------------------------------------------- +-- +-- sdl.lua +-- +-- Rules for the building with SDL +-- +--------------------------------------------------------------------------- + +dofile("modules.lua") + + +function maintargetosdoptions(_target,_subtarget) + osdmodulestargetconf() + + if _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS["MESA_INSTALL_ROOT"] then + libdirs { + path.join(_OPTIONS["MESA_INSTALL_ROOT"],"lib"), + } + linkoptions { + "-Wl,-rpath=" .. path.join(_OPTIONS["MESA_INSTALL_ROOT"],"lib"), + } + end + + if _OPTIONS["NO_X11"]~="1" then + links { + "X11", + "Xinerama", + } + end + + if _OPTIONS["NO_USE_XINPUT"]~="1" then + links { + "Xext", + "Xi", + } + end + + if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" and _OPTIONS["targetos"]~="android" then + links { + "SDL2_ttf", + } + local str = backtick(pkgconfigcmd() .. " --libs fontconfig") + addlibfromstring(str) + addoptionsfromstring(str) + end + + if _OPTIONS["targetos"]=="windows" then + if _OPTIONS["with-bundled-sdl2"]~=nil then + configuration { "mingw*"} + links { + "SDL2", + "imm32", + "version", + "ole32", + "oleaut32", + } + configuration { "vs*" } + links { + "SDL2", + "imm32", + "version", + } + configuration { } + else + if _OPTIONS["USE_LIBSDL"]~="1" then + configuration { "mingw*"} + links { + "SDL2main", + "SDL2", + } + configuration { "vs*" } + links { + "SDL2", + "imm32", + "version", + } + configuration { } + else + local str = backtick(sdlconfigcmd() .. " --libs | sed 's/ -lSDLmain//'") + addlibfromstring(str) + addoptionsfromstring(str) + end + configuration { "x32", "vs*" } + libdirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x86") + } + configuration { "x64", "vs*" } + libdirs { + path.join(_OPTIONS["SDL_INSTALL_ROOT"],"lib","x64") + } + configuration { } + end + links { + "psapi", + } + elseif _OPTIONS["targetos"]=="haiku" then + links { + "network", + "bsd", + } + end + + configuration { "mingw*" or "vs*" } + targetprefix "sdl" + links { + "psapi", + "ole32", + } + configuration { } + + if _OPTIONS["targetos"]=="macosx" then + if _OPTIONS["with-bundled-sdl2"]~=nil then + links { + "SDL2", + } + end + end + +end + + +function sdlconfigcmd() + if _OPTIONS["targetos"]=="asmjs" then + return "sdl2-config" + elseif not _OPTIONS["SDL_INSTALL_ROOT"] then + return pkgconfigcmd() .. " sdl2" + else + return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin","sdl2") .. "-config" + end +end + + +newoption { + trigger = "MESA_INSTALL_ROOT", + description = "link against specific GL-Library - also adds rpath to executable (overridden by USE_DISPATCH_GL)", +} + +newoption { + trigger = "SDL_INI_PATH", + description = "Default search path for .ini files", +} + +newoption { + trigger = "NO_X11", + description = "Disable use of X11", + allowed = { + { "0", "Enable X11" }, + { "1", "Disable X11" }, + }, +} + +if not _OPTIONS["NO_X11"] then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" then + _OPTIONS["NO_X11"] = "1" + else + _OPTIONS["NO_X11"] = "0" + end +end + +newoption { + trigger = "NO_USE_XINPUT", + description = "Disable use of Xinput", + allowed = { + { "0", "Enable Xinput" }, + { "1", "Disable Xinput" }, + }, +} + +if not _OPTIONS["NO_USE_XINPUT"] then + if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="asmjs" then + _OPTIONS["NO_USE_XINPUT"] = "1" + else + _OPTIONS["NO_USE_XINPUT"] = "0" + end +end + +newoption { + trigger = "NO_USE_XINPUT_WII_LIGHTGUN_HACK", + description = "Disable use of Xinput Wii Lightgun Hack", + allowed = { + { "0", "Enable Xinput Wii Lightgun Hack" }, + { "1", "Disable Xinput Wii Lightgun Hack" }, + }, +} + +if not _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"] then + _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"] = "1" +end + +newoption { + trigger = "SDL2_MULTIAPI", + description = "Use couriersud's multi-keyboard patch for SDL 2.1? (this API was removed prior to the 2.0 release)", + allowed = { + { "0", "Use single-keyboard API" }, + { "1", "Use multi-keyboard API" }, + }, +} + +if not _OPTIONS["SDL2_MULTIAPI"] then + _OPTIONS["SDL2_MULTIAPI"] = "0" +end + +newoption { + trigger = "SDL_INSTALL_ROOT", + description = "Equivalent to the ./configure --prefix=<path>", +} + +newoption { + trigger = "SDL_FRAMEWORK_PATH", + description = "Location of SDL framework for custom OS X installations", +} + +if not _OPTIONS["SDL_FRAMEWORK_PATH"] then + _OPTIONS["SDL_FRAMEWORK_PATH"] = "/Library/Frameworks/" +end + +newoption { + trigger = "USE_LIBSDL", + description = "Use SDL library on OS (rather than framework/dll)", + allowed = { + { "0", "Use framework/dll" }, + { "1", "Use library" }, + }, +} + +if not _OPTIONS["USE_LIBSDL"] then + _OPTIONS["USE_LIBSDL"] = "0" +end + + +BASE_TARGETOS = "unix" +SDLOS_TARGETOS = "unix" +SDL_NETWORK = "" +if _OPTIONS["targetos"]=="linux" then + SDL_NETWORK = "taptun" +elseif _OPTIONS["targetos"]=="openbsd" then +elseif _OPTIONS["targetos"]=="netbsd" then + SDL_NETWORK = "pcap" +elseif _OPTIONS["targetos"]=="haiku" then +elseif _OPTIONS["targetos"]=="asmjs" then +elseif _OPTIONS["targetos"]=="windows" then + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" + SDL_NETWORK = "pcap" +elseif _OPTIONS["targetos"]=="macosx" then + SDLOS_TARGETOS = "macosx" + SDL_NETWORK = "pcap" +end + +if _OPTIONS["with-bundled-sdl2"]~=nil then + includedirs { + GEN_DIR .. "includes", + } +end +if BASE_TARGETOS=="unix" then + if _OPTIONS["targetos"]=="macosx" then + local os_version = str_to_version(backtick("sw_vers -productVersion")) + + links { + "Cocoa.framework", + } + linkoptions { + "-framework QuartzCore", + "-framework OpenGL", + } + + + if os_version>=101100 then + linkoptions { + "-weak_framework Metal", + } + end + if _OPTIONS["with-bundled-sdl2"]~=nil then + linkoptions { + "-framework AudioUnit", + "-framework CoreAudio", + "-framework Carbon", + "-framework ForceFeedback", + "-framework IOKit", + "-framework CoreVideo", + } + else + if _OPTIONS["USE_LIBSDL"]~="1" then + linkoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + links { + "SDL2.framework", + } + else + local str = backtick(sdlconfigcmd() .. " --libs --static | sed 's/-lSDLmain//'") + addlibfromstring(str) + addoptionsfromstring(str) + end + end + else + if _OPTIONS["NO_X11"]=="1" then + _OPTIONS["USE_QTDEBUG"] = "0" + else + libdirs { + "/usr/X11/lib", + "/usr/X11R6/lib", + "/usr/openwin/lib", + } + end + if _OPTIONS["with-bundled-sdl2"]~=nil then + if _OPTIONS["targetos"]~="android" then + links { + "SDL2", + } + end + else + local str = backtick(sdlconfigcmd() .. " --libs") + addlibfromstring(str) + addoptionsfromstring(str) + end + + if _OPTIONS["targetos"]~="haiku" and _OPTIONS["targetos"]~="android" then + links { + "m", + "pthread", + } + if _OPTIONS["targetos"]=="solaris" then + links { + "socket", + "nsl", + } + else + links { + "util", + } + end + end + end +end + +project ("qtdbg_" .. _OPTIONS["osd"]) + uuid (os.uuid("qtdbg_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("sdl_cfg.lua") + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + configuration { "linux-* or freebsd" } + buildoptions { + "-fPIC", + } + configuration { } + + qtdebuggerbuild() + +project ("osd_" .. _OPTIONS["osd"]) + targetsubdir(_OPTIONS["target"] .."_" .._OPTIONS["subtarget"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("sdl_cfg.lua") + osdmodulesbuild() + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/osd/sdl", + } + + if _OPTIONS["targetos"]=="windows" then + files { + MAME_DIR .. "src/osd/windows/main.cpp", + } + end + + if _OPTIONS["targetos"]=="macosx" then + files { + MAME_DIR .. "src/osd/modules/debugger/debugosx.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/breakpointsview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/breakpointsview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/consoleview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/consoleview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugcommandhistory.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/debugcommandhistory.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugconsole.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/debugconsole.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/debugview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugwindowhandler.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/debugwindowhandler.h", + MAME_DIR .. "src/osd/modules/debugger/osx/deviceinfoviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/deviceinfoviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/devicesviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/devicesviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/disassemblyview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/errorlogviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/memoryviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/pointsviewer.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/pointsviewer.h", + MAME_DIR .. "src/osd/modules/debugger/osx/registersview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/registersview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.mm", + MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.h", + MAME_DIR .. "src/osd/modules/debugger/osx/debugosx.h", + } + end + + files { + MAME_DIR .. "src/osd/sdl/osdsdl.h", + MAME_DIR .. "src/osd/sdl/sdlprefix.h", + MAME_DIR .. "src/osd/sdl/sdlmain.cpp", + MAME_DIR .. "src/osd/osdepend.h", + MAME_DIR .. "src/osd/sdl/video.cpp", + MAME_DIR .. "src/osd/sdl/window.cpp", + MAME_DIR .. "src/osd/sdl/window.h", + MAME_DIR .. "src/osd/modules/osdwindow.cpp", + MAME_DIR .. "src/osd/modules/osdwindow.h", + MAME_DIR .. "src/osd/modules/render/drawsdl.cpp", + } + files { + MAME_DIR .. "src/osd/modules/render/draw13.cpp", + MAME_DIR .. "src/osd/modules/render/blit13.h", + } + + +project ("ocore_" .. _OPTIONS["osd"]) + targetsubdir(_OPTIONS["target"] .."_" .. _OPTIONS["subtarget"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + removeflags { + "SingleOutputDir", + } + + dofile("sdl_cfg.lua") + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/sdl", + } + + files { + MAME_DIR .. "src/osd/osdcore.cpp", + MAME_DIR .. "src/osd/osdcore.h", + MAME_DIR .. "src/osd/strconv.cpp", + MAME_DIR .. "src/osd/strconv.h", + MAME_DIR .. "src/osd/osdsync.cpp", + MAME_DIR .. "src/osd/osdsync.h", + MAME_DIR .. "src/osd/modules/osdmodule.cpp", + MAME_DIR .. "src/osd/modules/osdmodule.h", + MAME_DIR .. "src/osd/modules/lib/osdlib_" .. SDLOS_TARGETOS .. ".cpp", + MAME_DIR .. "src/osd/modules/lib/osdlib.h", + } + + if BASE_TARGETOS=="unix" then + files { + MAME_DIR .. "src/osd/modules/file/posixdir.cpp", + MAME_DIR .. "src/osd/modules/file/posixdomain.cpp", + MAME_DIR .. "src/osd/modules/file/posixfile.cpp", + MAME_DIR .. "src/osd/modules/file/posixfile.h", + MAME_DIR .. "src/osd/modules/file/posixptty.cpp", + MAME_DIR .. "src/osd/modules/file/posixsocket.cpp", + } + elseif BASE_TARGETOS=="win32" then + includedirs { + MAME_DIR .. "src/osd/windows", + } + files { + MAME_DIR .. "src/osd/modules/file/windir.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.h", + MAME_DIR .. "src/osd/modules/file/winptty.cpp", + MAME_DIR .. "src/osd/modules/file/winsocket.cpp", + MAME_DIR .. "src/osd/windows/winutil.cpp", -- FIXME put the necessary functions somewhere more appropriate + } + else + files { + MAME_DIR .. "src/osd/modules/file/stdfile.cpp", + } + end + + diff --git a/docs/release/scripts/src/osd/sdl_cfg.lua b/docs/release/scripts/src/osd/sdl_cfg.lua new file mode 100644 index 00000000000..ad3750184fd --- /dev/null +++ b/docs/release/scripts/src/osd/sdl_cfg.lua @@ -0,0 +1,165 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +dofile('modules.lua') + +forcedincludes { + MAME_DIR .. "src/osd/sdl/sdlprefix.h" +} + +if SDL_NETWORK~="" and not _OPTIONS["DONT_USE_NETWORK"] then + defines { + "USE_NETWORK", + "OSD_NET_USE_" .. string.upper(SDL_NETWORK), + } +end + +if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS["MESA_INSTALL_ROOT"] then + includedirs { + path.join(_OPTIONS["MESA_INSTALL_ROOT"],"include"), + } +end + +if _OPTIONS["SDL_INI_PATH"]~=nil then + defines { + "'INI_PATH=\"" .. _OPTIONS["SDL_INI_PATH"] .. "\"'", + } +end + +if _OPTIONS["NO_X11"]=="1" then + defines { + "SDLMAME_NO_X11", + } +else + defines { + "SDLMAME_X11", + } + includedirs { + "/usr/X11/include", + "/usr/X11R6/include", + "/usr/openwin/include", + } +end + +if _OPTIONS["NO_USE_XINPUT"]=="1" then + defines { + "USE_XINPUT=0", + } +else + defines { + "USE_XINPUT=1", + "USE_XINPUT_DEBUG=0", + } +end + +if _OPTIONS["NO_USE_XINPUT_WII_LIGHTGUN_HACK"]=="1" then + defines { + "USE_XINPUT_WII_LIGHTGUN_HACK=0", + } +else + defines { + "USE_XINPUT_WII_LIGHTGUN_HACK=1", + } +end + +if _OPTIONS["NO_USE_MIDI"]~="1" and _OPTIONS["targetos"]=="linux" then + buildoptions { + backtick(pkgconfigcmd() .. " --cflags alsa"), + } +end + +defines { + "SDLMAME_SDL2=1", +} +if _OPTIONS["SDL2_MULTIAPI"]=="1" then + defines { + "SDL2_MULTIAPI", + } +end + +defines { + "OSD_SDL", +} + +if BASE_TARGETOS=="unix" then + defines { + "SDLMAME_UNIX", + } + if _OPTIONS["targetos"]=="macosx" then + if _OPTIONS["with-bundled-sdl2"]==nil then + if _OPTIONS["USE_LIBSDL"]~="1" then + buildoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + else + defines { + "MACOSX_USE_LIBSDL", + } + buildoptions { + backtick(sdlconfigcmd() .. " --cflags | sed 's:/SDL2::'"), + } + end + end + else + buildoptions { + backtick(sdlconfigcmd() .. " --cflags"), + } + if _OPTIONS["targetos"]~="asmjs" then + buildoptions { + backtick(pkgconfigcmd() .. " --cflags fontconfig"), + } + end + end +end + +if _OPTIONS["targetos"]=="windows" then + configuration { "mingw* or vs*" } + defines { + "UNICODE", + "_UNICODE", + "_WIN32_WINNT=0x0501", + "WIN32_LEAN_AND_MEAN", + "NOMINMAX", + } + + configuration { } + +elseif _OPTIONS["targetos"]=="linux" then + if _OPTIONS["QT_HOME"]~=nil then + buildoptions { + "-I" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_HEADERS"), + } + else + buildoptions { + backtick(pkgconfigcmd() .. " --cflags Qt5Widgets"), + } + end +elseif _OPTIONS["targetos"]=="macosx" then + defines { + "SDLMAME_MACOSX", + "SDLMAME_DARWIN", + } +elseif _OPTIONS["targetos"]=="freebsd" then + buildoptions { + -- /usr/local/include is not considered a system include director on FreeBSD. GL.h resides there and throws warnings + "-isystem /usr/local/include", + } +end + +configuration { "osx*" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/osx", + } + +configuration { "freebsd" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/freebsd", + } + +configuration { "netbsd" } + includedirs { + MAME_DIR .. "3rdparty/bx/include/compat/freebsd", + } + +configuration { } + diff --git a/docs/release/scripts/src/osd/uwp.lua b/docs/release/scripts/src/osd/uwp.lua new file mode 100644 index 00000000000..47e8e149e24 --- /dev/null +++ b/docs/release/scripts/src/osd/uwp.lua @@ -0,0 +1,121 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +--------------------------------------------------------------------------- +-- +-- uwp.lua +-- +-- Rules for the building of UWP OSD +-- +--------------------------------------------------------------------------- + +dofile("modules.lua") + +function maintargetosdoptions(_target,_subtarget) +end + +project ("qtdbg_" .. _OPTIONS["osd"]) + uuid (os.uuid("qtdbg_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("uwp_cfg.lua") + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + removeflags { + "SingleOutputDir", + } + + files { + MAME_DIR .. "src/osd/modules/debugger/debugqt.cpp", + } + +project ("osd_" .. _OPTIONS["osd"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + removeflags { + "SingleOutputDir", + } + + dofile("uwp_cfg.lua") + osdmodulesbuild() + + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + + includedirs { + MAME_DIR .. "src/osd/uwp", + MAME_DIR .. "src/osd/windows", + } + + files { + MAME_DIR .. "src/osd/uwp/video.cpp", + MAME_DIR .. "src/osd/uwp/video.h", + MAME_DIR .. "src/osd/uwp/window.cpp", + MAME_DIR .. "src/osd/uwp/window.h", + MAME_DIR .. "src/osd/windows/winutf8.cpp", + MAME_DIR .. "src/osd/windows/winutf8.h", + MAME_DIR .. "src/osd/modules/osdwindow.cpp", + MAME_DIR .. "src/osd/modules/osdwindow.h", + MAME_DIR .. "src/osd/windows/winmain.cpp", + MAME_DIR .. "src/osd/windows/winmain.h", + MAME_DIR .. "src/osd/modules/render/drawnone.cpp", + MAME_DIR .. "src/osd/modules/render/drawnone.h", + MAME_DIR .. "src/osd/uwp/uwpcompat.cpp", + MAME_DIR .. "src/osd/uwp/uwpcompat.h", + MAME_DIR .. "src/osd/osdepend.h", + } + +project ("ocore_" .. _OPTIONS["osd"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + removeflags { + "SingleOutputDir", + } + + dofile("uwp_cfg.lua") + + includedirs { + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + } + + files { + MAME_DIR .. "src/osd/osdcomm.h", + MAME_DIR .. "src/osd/osdcore.cpp", + MAME_DIR .. "src/osd/osdcore.h", + MAME_DIR .. "src/osd/strconv.cpp", + MAME_DIR .. "src/osd/strconv.h", + MAME_DIR .. "src/osd/osdsync.cpp", + MAME_DIR .. "src/osd/osdsync.h", + MAME_DIR .. "src/osd/windows/winutil.cpp", + MAME_DIR .. "src/osd/windows/winutil.h", + MAME_DIR .. "src/osd/modules/osdmodule.cpp", + MAME_DIR .. "src/osd/modules/osdmodule.h", + MAME_DIR .. "src/osd/modules/file/winrtdir.cpp", + MAME_DIR .. "src/osd/modules/file/winrtfile.cpp", + MAME_DIR .. "src/osd/modules/file/winrtfile.h", + MAME_DIR .. "src/osd/modules/file/winrtptty.cpp", + MAME_DIR .. "src/osd/modules/file/winrtsocket.cpp", + MAME_DIR .. "src/osd/modules/lib/osdlib_uwp.cpp", + } diff --git a/docs/release/scripts/src/osd/uwp_cfg.lua b/docs/release/scripts/src/osd/uwp_cfg.lua new file mode 100644 index 00000000000..28892656728 --- /dev/null +++ b/docs/release/scripts/src/osd/uwp_cfg.lua @@ -0,0 +1,20 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +defines { + "OSD_UWP=1", + "USE_QTDEBUG=0", + "SDLMAME_NOASM=1", + "USE_OPENGL=0", + "NO_USE_MIDI=1", + "WINVER=0x0603", + "_WIN32_WINNT=0x0603", + "NTDDI_VERSION=0x06030000", + "MODERN_WIN_API", + "WIN32_LEAN_AND_MEAN", + "NOMINMAX", +} + +flags { + "Unicode", +} diff --git a/docs/release/scripts/src/osd/windows.lua b/docs/release/scripts/src/osd/windows.lua new file mode 100644 index 00000000000..ecb3030c683 --- /dev/null +++ b/docs/release/scripts/src/osd/windows.lua @@ -0,0 +1,291 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +--------------------------------------------------------------------------- +-- +-- windows.lua +-- +-- Rules for the building for Windows +-- +--------------------------------------------------------------------------- + +dofile("modules.lua") + + +function maintargetosdoptions(_target,_subtarget) + osdmodulestargetconf() + + configuration { "mingw*" } + links { + "mingw32", + } + + configuration { } + + if _OPTIONS["DIRECTINPUT"] == "8" then + links { + "dinput8", + } + else + links { + "dinput", + } + end + + + if _OPTIONS["USE_SDL"] == "1" then + links { + "SDL.dll", + } + end + + links { + "comctl32", + "comdlg32", + "psapi", + "ole32", + "shlwapi", + } +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 + +newoption { + trigger = "USE_SDL", + description = "Enable SDL sound output", + allowed = { + { "0", "Disable SDL sound output" }, + { "1", "Enable SDL sound output" }, + }, +} + +if not _OPTIONS["USE_SDL"] then + _OPTIONS["USE_SDL"] = "0" +end + +newoption { + trigger = "CYGWIN_BUILD", + description = "Build with Cygwin tools", + allowed = { + { "0", "Build with MinGW tools" }, + { "1", "Build with Cygwin tools" }, + }, +} + +if not _OPTIONS["CYGWIN_BUILD"] then + _OPTIONS["CYGWIN_BUILD"] = "0" +end + + +if _OPTIONS["CYGWIN_BUILD"] == "1" then + buildoptions { + "-mmo-cygwin", + } + linkoptions { + "-mno-cygwin", + } +end + + +project ("qtdbg_" .. _OPTIONS["osd"]) + uuid (os.uuid("qtdbg_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("windows_cfg.lua") + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + qtdebuggerbuild() + +project ("osd_" .. _OPTIONS["osd"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("windows_cfg.lua") + osdmodulesbuild() + + defines { + "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/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + + includedirs { + MAME_DIR .. "src/osd/windows", + } + + files { + MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.cpp", + MAME_DIR .. "src/osd/modules/render/d3d/d3dcomm.h", + MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.h", + MAME_DIR .. "src/osd/modules/render/drawd3d.cpp", + MAME_DIR .. "src/osd/modules/render/drawd3d.h", + MAME_DIR .. "src/osd/modules/render/drawgdi.cpp", + MAME_DIR .. "src/osd/modules/render/drawgdi.h", + MAME_DIR .. "src/osd/modules/render/drawnone.cpp", + MAME_DIR .. "src/osd/modules/render/drawnone.h", + MAME_DIR .. "src/osd/windows/video.cpp", + MAME_DIR .. "src/osd/windows/video.h", + MAME_DIR .. "src/osd/windows/window.cpp", + MAME_DIR .. "src/osd/windows/window.h", + MAME_DIR .. "src/osd/modules/osdwindow.cpp", + MAME_DIR .. "src/osd/modules/osdwindow.h", + MAME_DIR .. "src/osd/windows/winmenu.cpp", + MAME_DIR .. "src/osd/windows/winmain.cpp", + MAME_DIR .. "src/osd/windows/winmain.h", + MAME_DIR .. "src/osd/osdepend.h", + MAME_DIR .. "src/osd/modules/debugger/win/consolewininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/consolewininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugbaseinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugbaseinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmbasewininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmbasewininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/editwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/editwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/logwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/logwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/logviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/logviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/memoryviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/memoryviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/memorywininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/memorywininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/pointswininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/pointswininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/uimetrics.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/uimetrics.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugwin.h", + } + + +project ("ocore_" .. _OPTIONS["osd"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + removeflags { + "SingleOutputDir", + } + + dofile("windows_cfg.lua") + + includedirs { + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + } + + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" + + includedirs { + MAME_DIR .. "src/osd/windows", + MAME_DIR .. "src/lib/winpcap", + } + + files { + MAME_DIR .. "src/osd/eigccppc.h", + MAME_DIR .. "src/osd/eigccx86.h", + MAME_DIR .. "src/osd/eivc.h", + MAME_DIR .. "src/osd/eivcx86.h", + MAME_DIR .. "src/osd/eminline.h", + MAME_DIR .. "src/osd/osdcomm.h", + MAME_DIR .. "src/osd/osdcore.cpp", + MAME_DIR .. "src/osd/osdcore.h", + MAME_DIR .. "src/osd/strconv.cpp", + MAME_DIR .. "src/osd/strconv.h", + MAME_DIR .. "src/osd/osdsync.cpp", + MAME_DIR .. "src/osd/osdsync.h", + MAME_DIR .. "src/osd/windows/main.cpp", + MAME_DIR .. "src/osd/windows/winutf8.cpp", + MAME_DIR .. "src/osd/windows/winutf8.h", + MAME_DIR .. "src/osd/windows/winutil.cpp", + MAME_DIR .. "src/osd/windows/winutil.h", + MAME_DIR .. "src/osd/modules/osdmodule.cpp", + MAME_DIR .. "src/osd/modules/osdmodule.h", + MAME_DIR .. "src/osd/modules/file/windir.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.h", + MAME_DIR .. "src/osd/modules/file/winptty.cpp", + MAME_DIR .. "src/osd/modules/file/winsocket.cpp", + MAME_DIR .. "src/osd/modules/lib/osdlib_win32.cpp", + } + + + +-------------------------------------------------- +-- ledutil +-------------------------------------------------- + +if _OPTIONS["with-tools"] then + project("ledutil") + uuid ("061293ca-7290-44ac-b2b5-5913ae8dc9c0") + kind "ConsoleApp" + + flags { + "Symbols", -- always include minimum symbols for executables + } + + if _OPTIONS["SEPARATE_BIN"]~="1" then + targetdir(MAME_DIR) + end + + links { + "ocore_" .. _OPTIONS["osd"], + } + + includedirs { + MAME_DIR .. "src/osd", + } + + files { + MAME_DIR .. "src/osd/windows/ledutil.cpp", + } +end diff --git a/docs/release/scripts/src/osd/windows_cfg.lua b/docs/release/scripts/src/osd/windows_cfg.lua new file mode 100644 index 00000000000..2735e4df4f0 --- /dev/null +++ b/docs/release/scripts/src/osd/windows_cfg.lua @@ -0,0 +1,59 @@ +-- license:BSD-3-Clause +-- copyright-holders:MAMEdev Team + +defines { + "OSD_WINDOWS", + "WIN32_LEAN_AND_MEAN", + "NOMINMAX", +} + +configuration { "mingw* or vs*" } + defines { + "UNICODE", + "_UNICODE" + } + +configuration { "vs*" } + flags { + "Unicode", + } + +configuration { } + +if not _OPTIONS["MODERN_WIN_API"] then + _OPTIONS["MODERN_WIN_API"] = "0" +end + +if _OPTIONS["MODERN_WIN_API"]=="1" then + defines { + "WINVER=0x0602", + "_WIN32_WINNT=0x0602", + "NTDDI_VERSION=0x06030000", + "MODERN_WIN_API", + } +else + defines { + "_WIN32_WINNT=0x0501", + } +end + +if not _OPTIONS["DONT_USE_NETWORK"] then + defines { + "USE_NETWORK", + "OSD_NET_USE_PCAP", + "OSD_NET_USE_TAPTUN", + } +end + +if _OPTIONS["USE_SDL"]=="1" then + defines { + "SDLMAME_SDL2=1", + "USE_XINPUT=0", + "USE_SDL=1", + "USE_SDL_SOUND", + } +else + defines { + "USE_SDL=0", + } +end diff --git a/docs/release/scripts/src/osd/winui.lua b/docs/release/scripts/src/osd/winui.lua new file mode 100644 index 00000000000..b9aa0b86871 --- /dev/null +++ b/docs/release/scripts/src/osd/winui.lua @@ -0,0 +1,320 @@ +-- license:BSD-3-Clause +-- copyright-holders:Robbbert + +--------------------------------------------------------------------------- +-- +-- winui.lua +-- +-- Rules for the building for Windows +-- +--------------------------------------------------------------------------- + +dofile("modules.lua") + +premake.make.linkoptions_after = false; + +function maintargetosdoptions(_target,_subtarget) + kind "WindowedApp" + + osdmodulestargetconf() + + configuration { "mingw*-gcc" } + linkoptions { + "-municode", + "-lmingw32", + "-Wl,--allow-multiple-definition", + } + + configuration { "x64", "Release" } + targetsuffix "ui64" + + configuration { "x64", "Debug" } + targetsuffix "ui64d" + + configuration { "x32", "Release" } + targetsuffix "ui" + + configuration { "x32", "Debug" } + targetsuffix "uid" + + configuration { "Native", "Release" } + targetsuffix "ui" + + configuration { "Native", "Debug" } + targetsuffix "uid" + + configuration { } + + if _OPTIONS["DIRECTINPUT"] == "8" then + links { + "dinput8", + } + else + links { + "dinput", + } + end + + links { + "comctl32", + "comdlg32", + "psapi", + "ole32", + } + +-- Local file gives correct icon in mame instance inside of mameui +-- Local file must #include mameui.rc + override_resources = true; + rctarget = _target; + local rcfile = MAME_DIR .. "src/osd/winui/" .. _target .. ".rc" + local uifile = MAME_DIR .. "src/osd/winui/hbmameui.rc" + + if not os.isfile(rcfile) then + print(string.format("***** %s not found *****",rcfile)) + os.exit(); + end + + if not os.isfile(uifile) then + print(string.format("***** %s not found *****",uifile)) + os.exit(); + end + + files { + rcfile, + } + dependency { + { "$(OBJDIR)/".._target ..".res" , GEN_DIR .. "/resource/" .. _target .. "vers.rc", true }, + } +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 ("qtdbg_" .. _OPTIONS["osd"]) + uuid (os.uuid("qtdbg_" .. _OPTIONS["osd"])) + kind (LIBTYPE) + + dofile("winui_cfg.lua") + includedirs { + MAME_DIR .. "src/emu", + MAME_DIR .. "src/devices", -- accessing imagedev from debugger + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + } + qtdebuggerbuild() + +project ("osd_" .. _OPTIONS["osd"]) + uuid (os.uuid("osd_" .. _OPTIONS["osd"])) + kind "StaticLib" + + dofile("winui_cfg.lua") + osdmodulesbuild() + + defines { + "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/devices", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/osd/modules/render", + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/frontend/mame", + MAME_DIR .. "src/osd/windows", + } + + files { + MAME_DIR .. "src/osd/modules/render/d3d/d3dintf.h", + MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.cpp", + MAME_DIR .. "src/osd/modules/render/d3d/d3dcomm.h", + MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.h", + MAME_DIR .. "src/osd/modules/render/drawd3d.cpp", + MAME_DIR .. "src/osd/modules/render/drawd3d.h", + MAME_DIR .. "src/osd/modules/render/drawgdi.cpp", + MAME_DIR .. "src/osd/modules/render/drawgdi.h", + MAME_DIR .. "src/osd/modules/render/drawnone.cpp", + MAME_DIR .. "src/osd/modules/render/drawnone.h", + MAME_DIR .. "src/osd/windows/video.cpp", + MAME_DIR .. "src/osd/windows/video.h", + MAME_DIR .. "src/osd/windows/window.cpp", + MAME_DIR .. "src/osd/windows/window.h", + MAME_DIR .. "src/osd/modules/osdwindow.cpp", + MAME_DIR .. "src/osd/modules/osdwindow.h", + MAME_DIR .. "src/osd/windows/winmain.cpp", + MAME_DIR .. "src/osd/windows/winmain.h", + MAME_DIR .. "src/osd/osdepend.h", + MAME_DIR .. "src/osd/windows/winmenu.cpp", +-- MAME_DIR .. "src/osd/winui/newui.cpp", + MAME_DIR .. "src/osd/windows/winmain.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/consolewininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/consolewininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugbaseinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugbaseinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/debugwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmbasewininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmbasewininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/disasmwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/disasmwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/editwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/editwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/logviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/logviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/logwininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/logwininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/memoryviewinfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/memoryviewinfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/memorywininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/memorywininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/pointswininfo.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/pointswininfo.h", + MAME_DIR .. "src/osd/modules/debugger/win/uimetrics.cpp", + MAME_DIR .. "src/osd/modules/debugger/win/uimetrics.h", + MAME_DIR .. "src/osd/modules/debugger/win/debugwin.h", + MAME_DIR .. "src/osd/winui/bitmask.cpp", + MAME_DIR .. "src/osd/winui/columnedit.cpp", + MAME_DIR .. "src/osd/winui/datamap.cpp", + MAME_DIR .. "src/osd/winui/dialogs.cpp", + MAME_DIR .. "src/osd/winui/dijoystick.cpp", +-- MAME_DIR .. "src/osd/winui/directdraw.cpp", + MAME_DIR .. "src/osd/winui/directinput.cpp", + MAME_DIR .. "src/osd/winui/directories.cpp", + MAME_DIR .. "src/osd/winui/dirwatch.cpp", +-- MAME_DIR .. "src/osd/winui/dxdecode.cpp", + MAME_DIR .. "src/osd/winui/help.cpp", + MAME_DIR .. "src/osd/winui/helpids.cpp", + MAME_DIR .. "src/osd/winui/history.cpp", + MAME_DIR .. "src/osd/winui/layout.cpp", + MAME_DIR .. "src/osd/winui/mui_audit.cpp", + MAME_DIR .. "src/osd/winui/mui_main.cpp", + MAME_DIR .. "src/osd/winui/mui_opts.cpp", + MAME_DIR .. "src/osd/winui/mui_util.cpp", + MAME_DIR .. "src/osd/winui/picker.cpp", + MAME_DIR .. "src/osd/winui/properties.cpp", + MAME_DIR .. "src/osd/winui/resource.h", + MAME_DIR .. "src/osd/winui/screenshot.cpp", + MAME_DIR .. "src/osd/winui/splitters.cpp", + MAME_DIR .. "src/osd/winui/tabview.cpp", + MAME_DIR .. "src/osd/winui/treeview.cpp", + MAME_DIR .. "src/osd/winui/winui.cpp", + } + +project ("ocore_" .. _OPTIONS["osd"]) + uuid (os.uuid("ocore_" .. _OPTIONS["osd"])) + kind "StaticLib" + + options { + "ForceCPP", + } + removeflags { + "SingleOutputDir", + } + + dofile("windows_cfg.lua") + + includedirs { + MAME_DIR .. "3rdparty", + MAME_DIR .. "src/emu", + MAME_DIR .. "src/osd", + MAME_DIR .. "src/osd/modules/file", + MAME_DIR .. "src/lib", + MAME_DIR .. "src/lib/util", + } + + BASE_TARGETOS = "win32" + SDLOS_TARGETOS = "win32" + SYNC_IMPLEMENTATION = "windows" + + includedirs { + MAME_DIR .. "src/osd/windows", + MAME_DIR .. "src/lib/winpcap", + } + + files { + MAME_DIR .. "src/osd/eigccppc.h", + MAME_DIR .. "src/osd/eigccx86.h", + MAME_DIR .. "src/osd/eivc.h", + MAME_DIR .. "src/osd/eivcx86.h", + MAME_DIR .. "src/osd/eminline.h", + MAME_DIR .. "src/osd/osdcomm.h", + MAME_DIR .. "src/osd/osdcore.cpp", + MAME_DIR .. "src/osd/osdcore.h", + MAME_DIR .. "src/osd/strconv.cpp", + MAME_DIR .. "src/osd/strconv.h", + MAME_DIR .. "src/osd/windows/main.cpp", + MAME_DIR .. "src/osd/osdsync.cpp", + MAME_DIR .. "src/osd/osdsync.h", + MAME_DIR .. "src/osd/windows/winutf8.cpp", + MAME_DIR .. "src/osd/windows/winutf8.h", + MAME_DIR .. "src/osd/windows/winutil.cpp", + MAME_DIR .. "src/osd/windows/winutil.h", + MAME_DIR .. "src/osd/modules/osdmodule.cpp", + MAME_DIR .. "src/osd/modules/osdmodule.h", + MAME_DIR .. "src/osd/modules/file/windir.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.cpp", + MAME_DIR .. "src/osd/modules/file/winfile.h", + MAME_DIR .. "src/osd/modules/file/winptty.cpp", + MAME_DIR .. "src/osd/modules/file/winsocket.cpp", + MAME_DIR .. "src/osd/modules/lib/osdlib_win32.cpp", + } + + +-------------------------------------------------- +-- ledutil +-------------------------------------------------- + +if _OPTIONS["with-tools"] then + project("ledutil") + uuid ("061293ca-7290-44ac-b2b5-5913ae8dc9c0") + kind "ConsoleApp" + + if _OPTIONS["SEPARATE_BIN"]~="1" then + targetdir(MAME_DIR) + end + + links { + "ocore_" .. _OPTIONS["osd"], + } + + includedirs { + MAME_DIR .. "src/osd", + } + + files { + MAME_DIR .. "src/osd/windows/ledutil.cpp", + } +end + diff --git a/docs/release/scripts/src/osd/winui_cfg.lua b/docs/release/scripts/src/osd/winui_cfg.lua new file mode 100644 index 00000000000..20c6034a2e1 --- /dev/null +++ b/docs/release/scripts/src/osd/winui_cfg.lua @@ -0,0 +1,26 @@ +defines { + "UNICODE", + "_UNICODE", + "OSD_WINDOWS", + "USE_SDL=0", + --"WIN95_MULTIMON" + "_WIN32_WINNT=0x0501", + "USE_QTDEBUG=0", + "WIN32_LEAN_AND_MEAN", + "NOMINMAX", +} + +configuration { "vs*" } + flags { + "Unicode", + } + +configuration { } + +if not _OPTIONS["DONT_USE_NETWORK"] then + defines { + "USE_NETWORK", + "OSD_NET_USE_PCAP", + } +end + |