From f317b4d5342eafbee5900ffa685673fdd17f398d Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 10:32:43 +0200 Subject: Remove pnacl remains --- scripts/genie.lua | 21 ++++-------------- scripts/src/3rdparty.lua | 12 +---------- scripts/src/main.lua | 9 -------- scripts/toolchain.lua | 56 ------------------------------------------------ 4 files changed, 5 insertions(+), 93 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index 2d53bda770b..e427c30e544 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -144,7 +144,6 @@ newoption { { "freebsd", "FreeBSD" }, { "netbsd", "NetBSD" }, { "openbsd", "OpenBSD" }, - { "pnacl", "Native Client - PNaCl" }, { "linux", "Linux" }, { "ios", "iOS" }, { "macosx", "OSX" }, @@ -785,11 +784,9 @@ local version = str_to_version(_OPTIONS["gcc_version"]) "-std=c++17", } -- this speeds it up a bit by piping between the preprocessor/compiler/assembler - if not ("pnacl" == _OPTIONS["gcc"]) then - buildoptions { - "-pipe", - } - end + buildoptions { + "-pipe", + } -- add -g if we need symbols, and ensure we have frame pointers if _OPTIONS["SYMBOLS"]~=nil and _OPTIONS["SYMBOLS"]~="0" then buildoptions { @@ -1075,7 +1072,7 @@ end local version = str_to_version(_OPTIONS["gcc_version"]) - if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "pnacl") or string.find(_OPTIONS["gcc"], "asmjs") or string.find(_OPTIONS["gcc"], "android") then + if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "asmjs") or string.find(_OPTIONS["gcc"], "android") then if (version < 60000) then print("Clang version 6.0 or later needed") os.exit(-1) @@ -1228,16 +1225,6 @@ configuration { "android-arm64" } "-Wno-asm-operand-widths", } -configuration { "pnacl" } - buildoptions { - "-std=gnu89", - "-Wno-inline-new-delete", - } - buildoptions_cpp { - "-std=c++17", - } - archivesplit_size "20" - configuration { "linux-* or rpi or ci20"} links { "dl", diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index fff3b94f0c8..c3748d688b3 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -878,16 +878,11 @@ end "LUA_COMPAT_5_1", "LUA_COMPAT_5_2", } - if not (_OPTIONS["targetos"]=="windows") and not (_OPTIONS["targetos"]=="asmjs") and not (_OPTIONS["targetos"]=="pnacl") then + if not (_OPTIONS["targetos"]=="windows") and not (_OPTIONS["targetos"]=="asmjs") then defines { "LUA_USE_POSIX", } end - if ("pnacl" == _OPTIONS["gcc"]) then - defines { - "LUA_32BITS", - } - end configuration { } @@ -953,11 +948,6 @@ project "lualibs" "/wd4130", -- warning C4130: '==': logical operation on address of string constant } - configuration { "pnacl"} - buildoptions { - "-Wno-char-subscripts", - } - configuration { } defines { "LUA_COMPAT_ALL", diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 992f883f3c8..067cd8ad27a 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -40,15 +40,6 @@ end "GLESv2", "SDL2", } - configuration { "pnacl" } - kind "ConsoleApp" - targetextension ".pexe" - links { - "ppapi", - "ppapi_gles2", - "pthread", - } - configuration { "winstore*" } kind "WindowedApp" diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 5fc886e1f48..72035a90110 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -36,7 +36,6 @@ newoption { { "openbsd", "OpenBSD" }, { "osx", "OSX (GCC compiler)" }, { "osx-clang", "OSX (Clang compiler)" }, - { "pnacl", "Native Client - PNaCl" }, { "rpi", "RaspberryPi" }, { "solaris", "Solaris" }, { "steamlink", "Steam Link" }, @@ -303,25 +302,6 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang") end - if "pnacl" == _OPTIONS["gcc"] then - - if not os.getenv("NACL_SDK_ROOT") then - print("Set NACL_SDK_ROOT enviroment variables.") - end - - naclToolchain = "$(NACL_SDK_ROOT)/toolchain/win_pnacl/bin/pnacl-" - if os.is("macosx") then - naclToolchain = "$(NACL_SDK_ROOT)/toolchain/mac_pnacl/bin/pnacl-" - elseif os.is("linux") then - naclToolchain = "$(NACL_SDK_ROOT)/toolchain/linux_pnacl/bin/pnacl-" - end - - premake.gcc.cc = naclToolchain .. "clang" - premake.gcc.cxx = naclToolchain .. "clang++" - premake.gcc.ar = naclToolchain .. "ar" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-pnacl") - end - if "rpi" == _OPTIONS["gcc"] then location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi") end @@ -1021,36 +1001,6 @@ function toolchain(_buildDir, _subDir) "-Wno-extern-c-compat", } - configuration { "pnacl" } - buildoptions { - "-U__STRICT_ANSI__", -- strcasecmp, setenv, unsetenv,... - "-fno-stack-protector", - "-fdiagnostics-show-option", - "-fdata-sections", - "-ffunction-sections", - "-Wunused-value", - } - - configuration { "pnacl" } - buildoptions { - "-Wno-tautological-undefined-compare", - "-Wno-cast-align", - } - includedirs { - "$(NACL_SDK_ROOT)/include", - "$(NACL_SDK_ROOT)/include/pnacl", - } - - configuration { "pnacl" } - targetdir (_buildDir .. "pnacl" .. "/bin") - objdir (_buildDir .. "pnacl" .. "/obj") - - configuration { "pnacl", "Debug" } - libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Debug" } - - configuration { "pnacl", "Release" } - libdirs { "$(NACL_SDK_ROOT)/lib/pnacl/Release" } - configuration { "osx*", "x32", "not arm64" } objdir (_buildDir .. "osx_clang" .. "/obj") buildoptions { @@ -1137,12 +1087,6 @@ function strip() "$(SILENT) " .. (_OPTIONS['TOOLCHAIN'] or "$(MINGW32)/bin/") .. "strip -s \"$(TARGET)\"", } - configuration { "pnacl" } - postbuildcommands { - "$(SILENT) echo Running pnacl-finalize.", - "$(SILENT) " .. naclToolchain .. "finalize \"$(TARGET)\"" - } - configuration { "asmjs" } postbuildcommands { "$(SILENT) echo Running asmjs finalize.", -- cgit v1.2.3 From 97a7d8bec86177090e8db5d0d5391d5cdf7bb875 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 10:40:30 +0200 Subject: Remove steamlink --- makefile | 24 ------------------------ scripts/genie.lua | 12 ------------ scripts/src/3rdparty.lua | 6 +----- scripts/toolchain.lua | 33 --------------------------------- 4 files changed, 1 insertion(+), 74 deletions(-) diff --git a/makefile b/makefile index 232f54efb17..0c8f5e92ebd 100644 --- a/makefile +++ b/makefile @@ -1608,30 +1608,6 @@ openbsd_x86: generate $(PROJECTDIR)/$(MAKETYPE)-openbsd/Makefile $(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-openbsd config=$(CONFIG)32 precompile $(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-openbsd config=$(CONFIG)32 -#------------------------------------------------- -# gmake-steamlink -#------------------------------------------------- - -$(PROJECTDIR)/$(MAKETYPE)-steamlink/Makefile: makefile $(SCRIPTS) $(GENIE) -ifndef MARVELL_SDK_PATH - $(error MARVELL_SDK_PATH is not set) -endif -ifndef MARVELL_ROOTFS - $(error MARVELL_ROOTFS is not set) -endif - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --gcc=steamlink --gcc_version=$(GCC_VERSION) --NO_OPENGL=1 --NO_USE_MIDI=1 --NO_X11=1 --NOASM=1 --SDL_INSTALL_ROOT=$(MARVELL_ROOTFS)/usr $(MAKETYPE) - -.PHONY: steamlink -steamlink: generate $(PROJECTDIR)/$(MAKETYPE)-steamlink/Makefile -ifndef MARVELL_SDK_PATH - $(error MARVELL_SDK_PATH is not set) -endif -ifndef MARVELL_ROOTFS - $(error MARVELL_ROOTFS is not set) -endif - $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-steamlink config=$(CONFIG) precompile - $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-steamlink config=$(CONFIG) - #------------------------------------------------- # gmake-rpi #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index e427c30e544..8886fe2d0e6 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -150,7 +150,6 @@ newoption { { "windows", "Windows" }, { "haiku", "Haiku" }, { "solaris", "Solaris SunOS" }, - { "steamlink", "Steam Link" }, { "rpi", "Raspberry Pi" }, { "ci20", "Creator-Ci20" }, }, @@ -1239,17 +1238,6 @@ configuration { "linux-* or rpi or ci20"} -configuration { "steamlink" } - links { - "dl", - "EGL", - "GLESv2", - "SDL2", - } - defines { - "EGL_API_FB", - } - configuration { "rpi" } links { "SDL2", diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index c3748d688b3..fdc4b561c09 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -1311,13 +1311,9 @@ end MAME_DIR .. "3rdparty/bx/include", MAME_DIR .. "3rdparty/bimg/include", MAME_DIR .. "3rdparty/bgfx/3rdparty/dxsdk/include", + MAME_DIR .. "3rdparty/bgfx/3rdparty/khronos", } - configuration { "not steamlink"} - includedirs { - MAME_DIR .. "3rdparty/bgfx/3rdparty/khronos", - } - configuration { "android-*"} buildoptions { "-Wno-macro-redefined", diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 72035a90110..8099f50baf2 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -38,7 +38,6 @@ newoption { { "osx-clang", "OSX (Clang compiler)" }, { "rpi", "RaspberryPi" }, { "solaris", "Solaris" }, - { "steamlink", "Steam Link" }, { "ci20", "Creator-Ci20" }, }, } @@ -222,16 +221,6 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-linux-clang") end - if "steamlink" == _OPTIONS["gcc"] then - if not os.getenv("MARVELL_SDK_PATH") then - print("Set MARVELL_SDK_PATH envrionment variable.") - end - premake.gcc.cc = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-gcc" - premake.gcc.cxx = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-g++" - premake.gcc.ar = "$(MARVELL_SDK_PATH)/toolchain/bin/armv7a-cros-linux-gnueabi-ar" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-steamlink") - end - if "rpi" == _OPTIONS["gcc"] then if not os.getenv("RASPBERRY_SDK_PATH") then print("Set RASPBERRY_SDK_PATH envrionment variable.") @@ -559,28 +548,6 @@ function toolchain(_buildDir, _subDir) configuration { "x64", "mingw64-gcc", "Debug" } targetdir (_buildDir .. "mingw-gcc" .. "/bin/x64/Debug") - configuration { "steamlink" } - objdir ( _buildDir .. "steamlink/obj") - defines { - "__STEAMLINK__=1", -- There is no special prefedined compiler symbol to detect SteamLink, faking it. - } - buildoptions { - "-marm", - "-mfloat-abi=hard", - "--sysroot=$(MARVELL_SDK_PATH)/rootfs", - } - linkoptions { - "-static-libgcc", - "-static-libstdc++", - "--sysroot=$(MARVELL_SDK_PATH)/rootfs", - } - - configuration { "steamlink", "Release" } - targetdir (_buildDir .. "steamlink/bin/Release") - - configuration { "steamlink", "Debug" } - targetdir (_buildDir .. "steamlink/bin/Debug") - configuration { "rpi" } objdir ( _buildDir .. "rpi/obj") libdirs { -- cgit v1.2.3 From 7d75eee51e0e8d675b0e41e86d64620cf53e562c Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 10:42:34 +0200 Subject: Remove CI20 --- makefile | 24 ----------------- scripts/genie.lua | 13 +--------- scripts/toolchain.lua | 71 --------------------------------------------------- 3 files changed, 1 insertion(+), 107 deletions(-) diff --git a/makefile b/makefile index 0c8f5e92ebd..5d85764e29a 100644 --- a/makefile +++ b/makefile @@ -1632,30 +1632,6 @@ endif $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi config=$(CONFIG) precompile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi config=$(CONFIG) -#------------------------------------------------- -# gmake-ci20 -#------------------------------------------------- - -$(PROJECTDIR_SDL)/$(MAKETYPE)-ci20/Makefile: makefile $(SCRIPTS) $(GENIE) -ifndef MIPS_LINUXGNU_ROOT - $(error MIPS_LINUXGNU_ROOT is not set) -endif -ifndef CI20_SYSROOT - $(error CI20_SYSROOT is not set) -endif - $(SILENT) $(GENIE) $(PARAMS) --gcc=ci20 --gcc_version=4.9.2 --osd=sdl --targetos=ci20 --targetos=ci20 --NO_USE_MIDI=1 --PLATFORM=arm --NOASM=1 --USE_QTDEBUG=0 --SDL_INSTALL_ROOT=$(RASPBERRY_SYSROOT)/usr $(MAKETYPE) - -.PHONY: ci20 -ci20: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20/Makefile -ifndef MIPS_LINUXGNU_ROOT - $(error MIPS_LINUXGNU_ROOT is not set) -endif -ifndef CI20_SYSROOT - $(error CI20_SYSROOT is not set) -endif - $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20 config=$(CONFIG) precompile - $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-ci20 config=$(CONFIG) - #------------------------------------------------- # cmake #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index 8886fe2d0e6..e76a2c1c3d1 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -151,7 +151,6 @@ newoption { { "haiku", "Haiku" }, { "solaris", "Solaris SunOS" }, { "rpi", "Raspberry Pi" }, - { "ci20", "Creator-Ci20" }, }, } @@ -1224,7 +1223,7 @@ configuration { "android-arm64" } "-Wno-asm-operand-widths", } -configuration { "linux-* or rpi or ci20"} +configuration { "linux-* or rpi"} links { "dl", "rt", @@ -1252,16 +1251,6 @@ configuration { "rpi" } } -configuration { "ci20" } - links { - "SDL2", - "asound", - "fontconfig", - "freetype", - "pthread", - } - - configuration { "osx* or xcode4" } links { "pthread", diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 8099f50baf2..faf0ea24664 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -38,7 +38,6 @@ newoption { { "osx-clang", "OSX (Clang compiler)" }, { "rpi", "RaspberryPi" }, { "solaris", "Solaris" }, - { "ci20", "Creator-Ci20" }, }, } @@ -231,16 +230,6 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi") end - if "ci20" == _OPTIONS["gcc"] then - if not os.getenv("MIPS_LINUXGNU_ROOT") then - print("Set MIPS_LINUXGNU_ROOT envrionment variable.") - end - premake.gcc.cc = "$(MIPS_LINUXGNU_ROOT)/bin/mips-mti-linux-gnu-gcc" - premake.gcc.cxx = "$(MIPS_LINUXGNU_ROOT)/bin/mips-mti-linux-gnu-g++" - premake.gcc.ar = "$(MIPS_LINUXGNU_ROOT)/bin/mips-mti-linux-gnu-ar" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-ci20") - end - if "mingw32-gcc" == _OPTIONS["gcc"] then if not os.getenv("MINGW32") then print("Set MINGW32 envrionment variable.") @@ -294,10 +283,6 @@ function toolchain(_buildDir, _subDir) if "rpi" == _OPTIONS["gcc"] then location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi") end - - if "ci20" == _OPTIONS["gcc"] then - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-ci20") - end elseif _ACTION == "vs2015" or _ACTION == "vs2015-fastbuild" then if (_ACTION .. "-clang") == _OPTIONS["vs"] then @@ -579,62 +564,6 @@ function toolchain(_buildDir, _subDir) configuration { "rpi", "Debug" } targetdir (_buildDir .. "rpi/bin/Debug") - configuration { "ci20" } - objdir ( _buildDir .. "ci20/obj") - includedirs { - "$(CI20_SYSROOT)/mipsel-r2-hard/usr/include/c++/4.9", - "$(CI20_SYSROOT)/mipsel-r2-hard/usr/include/mipsel-linux-gnu/c++/4.9", - "$(CI20_SYSROOT)/mipsel-r2-hard/usr/include/c++/4.9/backward", - "$(CI20_SYSROOT)/mipsel-r2-hard/usr/lib/gcc/mipsel-linux-gnu/4.9/include", - "$(CI20_SYSROOT)/mipsel-r2-hard/usr/local/include", - "$(CI20_SYSROOT)/mipsel-r2-hard/usr/lib/gcc/mipsel-linux-gnu/4.9/include-fixed", - "$(CI20_SYSROOT)/mipsel-r2-hard/usr/include/mipsel-linux-gnu", - "$(CI20_SYSROOT)/mipsel-r2-hard/usr/include", - } - links { - "c", - "dl", - "m", - "gcc", - "stdc++", - "gcc_s", - } - - buildoptions { - "--sysroot=$(CI20_SYSROOT)", - "-Wno-pragmas", - "-Wno-undef", - "-EL", - "-mel", - "-march=mips32r2", - "-mllsc", - "-mabi=32", - } - linkoptions { - "--sysroot=$(CI20_SYSROOT)", - "-Wl,-rpath=$(CI20_SYSROOT)/mipsel-r2-hard/usr/lib/mipsel-linux-gnu/", - "-Wl,-rpath=$(CI20_SYSROOT)/mipsel-r2-hard/lib/mipsel-linux-gnu/", - "-nostdlib", - "-EL", - "-mel", - "-march=mips32r2", - "-mllsc", - "-mabi=32", - "$(MIPS_LINUXGNU_ROOT)/lib/gcc/mips-mti-linux-gnu/4.9.2/mipsel-r2-hard/lib/crtbegin.o", - "$(MIPS_LINUXGNU_ROOT)/lib/gcc/mips-mti-linux-gnu/4.9.2/mipsel-r2-hard/lib/crtend.o", - "-L$(CI20_SYSROOT)/mipsel-r2-hard/usr/lib/gcc/mipsel-linux-gnu/4.9", - "-L$(CI20_SYSROOT)/mipsel-r2-hard/usr/lib/mipsel-linux-gnu", - "-L$(CI20_SYSROOT)/mipsel-r2-hard/usr/lib", - "-L$(CI20_SYSROOT)/mipsel-r2-hard/lib/mipsel-linux-gnu", - "-L$(CI20_SYSROOT)/mipsel-r2-hard/lib", - } - - configuration { "ci20", "Release" } - targetdir (_buildDir .. "ci20/bin/Release") - - configuration { "ci20", "Debug" } - targetdir (_buildDir .. "ci20/bin/Debug") - configuration { "mingw-clang" } buildoptions { "-femulated-tls", -- cgit v1.2.3 From 60aed0ed6b8f5fcca97b5f99232c0d900284bb23 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 10:45:16 +0200 Subject: cmake target was not very useful --- makefile | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/makefile b/makefile index 5d85764e29a..c2b1c12fe26 100644 --- a/makefile +++ b/makefile @@ -1632,21 +1632,6 @@ endif $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi config=$(CONFIG) precompile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi config=$(CONFIG) -#------------------------------------------------- -# cmake -#------------------------------------------------- - -.PHONY: cmake -cmake: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) cmake -ifneq (posix,$(SHELLTYPE)) - $(SILENT)echo cmake_minimum_required(VERSION 2.8.4) > CMakeLists.txt - $(SILENT)echo add_subdirectory($(PROJECTDIR)/cmake) >> CMakeLists.txt -else - $(SILENT)echo "cmake_minimum_required(VERSION 2.8.4)" > CMakeLists.txt - $(SILENT)echo "add_subdirectory($(PROJECTDIR)/cmake)" >> CMakeLists.txt -endif - #------------------------------------------------- # Clean/bootstrap #------------------------------------------------- -- cgit v1.2.3 From 1a79bb82b120f1710ef326546b1046edd5a44c6a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 10:50:09 +0200 Subject: rpi target was not used, but regular linux one anyway --- makefile | 24 ---------------------- scripts/genie.lua | 17 +--------------- scripts/src/3rdparty.lua | 8 -------- scripts/src/main.lua | 3 --- scripts/src/tests.lua | 4 ---- scripts/toolchain.lua | 52 +----------------------------------------------- 6 files changed, 2 insertions(+), 106 deletions(-) diff --git a/makefile b/makefile index c2b1c12fe26..9907204149a 100644 --- a/makefile +++ b/makefile @@ -1608,30 +1608,6 @@ openbsd_x86: generate $(PROJECTDIR)/$(MAKETYPE)-openbsd/Makefile $(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-openbsd config=$(CONFIG)32 precompile $(SILENT) $(MAKE) -C $(PROJECTDIR)/$(MAKETYPE)-openbsd config=$(CONFIG)32 -#------------------------------------------------- -# gmake-rpi -#------------------------------------------------- - -$(PROJECTDIR_SDL)/$(MAKETYPE)-rpi/Makefile: makefile $(SCRIPTS) $(GENIE) -ifndef RASPBERRY_SDK_PATH - $(error RASPBERRY_SDK_PATH is not set) -endif -ifndef RASPBERRY_SYSROOT - $(error RASPBERRY_SYSROOT is not set) -endif - $(SILENT) $(GENIE) $(PARAMS) --gcc=rpi --gcc_version=4.9.2 --osd=sdl --targetos=rpi --targetos=rpi --NO_USE_MIDI=1 --PLATFORM=arm --NOASM=1 --USE_QTDEBUG=0 --SDL_INSTALL_ROOT=$(RASPBERRY_SYSROOT)/usr $(MAKETYPE) - -.PHONY: rpi -rpi: generate $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi/Makefile -ifndef RASPBERRY_SDK_PATH - $(error RASPBERRY_SDK_PATH is not set) -endif -ifndef RASPBERRY_SYSROOT - $(error RASPBERRY_SYSROOT is not set) -endif - $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi config=$(CONFIG) precompile - $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/$(MAKETYPE)-rpi config=$(CONFIG) - #------------------------------------------------- # Clean/bootstrap #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index e76a2c1c3d1..d1d7cebb883 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -150,7 +150,6 @@ newoption { { "windows", "Windows" }, { "haiku", "Haiku" }, { "solaris", "Solaris SunOS" }, - { "rpi", "Raspberry Pi" }, }, } @@ -1223,7 +1222,7 @@ configuration { "android-arm64" } "-Wno-asm-operand-widths", } -configuration { "linux-* or rpi"} +configuration { "linux-*"} links { "dl", "rt", @@ -1237,20 +1236,6 @@ configuration { "linux-* or rpi"} -configuration { "rpi" } - links { - "SDL2", - "fontconfig", - "X11", - "GLESv2", - "EGL", - "bcm_host", - "vcos", - "vchiq_arm", - "pthread", - } - - configuration { "osx* or xcode4" } links { "pthread", diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index fdc4b561c09..73d7f4d4332 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -1350,14 +1350,6 @@ end "-Wno-unused-function", "-Wno-unused-variable", } - configuration { "rpi" } - buildoptions { - "-Wno-unused-but-set-variable", - "-Wno-unused-variable", - } - defines { - "__STDC_VERSION__=199901L", - } configuration { } diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 067cd8ad27a..e09282d28c0 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -104,9 +104,6 @@ end configuration { "mingw*" or "vs20*" } targetextension ".exe" - configuration { "rpi" } - targetextension "" - configuration { "asmjs" } targetextension ".bc" if os.getenv("EMSCRIPTEN") then diff --git a/scripts/src/tests.lua b/scripts/src/tests.lua index 89c8c976c39..b0164f6946a 100644 --- a/scripts/src/tests.lua +++ b/scripts/src/tests.lua @@ -36,10 +36,6 @@ project("mametests") configuration { "mingw*" or "vs*" } targetextension ".exe" - configuration { "rpi" } - targetextension "" - - configuration { } links { diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index faf0ea24664..54703ccfc3a 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -36,7 +36,6 @@ newoption { { "openbsd", "OpenBSD" }, { "osx", "OSX (GCC compiler)" }, { "osx-clang", "OSX (Clang compiler)" }, - { "rpi", "RaspberryPi" }, { "solaris", "Solaris" }, }, } @@ -220,16 +219,6 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-linux-clang") end - if "rpi" == _OPTIONS["gcc"] then - if not os.getenv("RASPBERRY_SDK_PATH") then - print("Set RASPBERRY_SDK_PATH envrionment variable.") - end - premake.gcc.cc = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-gcc" - premake.gcc.cxx = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-g++" - premake.gcc.ar = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-ar" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi") - end - if "mingw32-gcc" == _OPTIONS["gcc"] then if not os.getenv("MINGW32") then print("Set MINGW32 envrionment variable.") @@ -279,10 +268,6 @@ function toolchain(_buildDir, _subDir) premake.gcc.ar = toolchainPrefix .. "ar" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang") end - - if "rpi" == _OPTIONS["gcc"] then - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi") - end elseif _ACTION == "vs2015" or _ACTION == "vs2015-fastbuild" then if (_ACTION .. "-clang") == _OPTIONS["vs"] then @@ -533,37 +518,6 @@ function toolchain(_buildDir, _subDir) configuration { "x64", "mingw64-gcc", "Debug" } targetdir (_buildDir .. "mingw-gcc" .. "/bin/x64/Debug") - configuration { "rpi" } - objdir ( _buildDir .. "rpi/obj") - libdirs { - "$(RASPBERRY_SYSROOT)/opt/vc/lib", - } - includedirs { - "$(RASPBERRY_SYSROOT)/opt/vc/include", - "$(RASPBERRY_SYSROOT)/opt/vc/include/interface/vcos/pthreads", - "$(RASPBERRY_SYSROOT)/opt/vc/include/interface/vmcs_host/linux", - } - defines { - "__VCCOREVER__=0x04000000", -- There is no special prefedined compiler symbol to detect RaspberryPi, faking it. - } - linkoptions { - "-Wl,--gc-sections", - } - buildoptions { - "--sysroot=$(RASPBERRY_SYSROOT)", - } - linkoptions { - "-static-libgcc", - "-static-libstdc++", - "--sysroot=$(RASPBERRY_SYSROOT)", - } - - configuration { "rpi", "Release" } - targetdir (_buildDir .. "rpi/bin/Release") - - configuration { "rpi", "Debug" } - targetdir (_buildDir .. "rpi/bin/Debug") - configuration { "mingw-clang" } buildoptions { "-femulated-tls", @@ -940,10 +894,6 @@ function toolchain(_buildDir, _subDir) targetdir (_buildDir .. "ios-simulator" .. "/bin") objdir (_buildDir .. "ios-simulator" .. "/obj") - configuration { "rpi" } - targetdir (_buildDir .. "rpi" .. "/bin") - objdir (_buildDir .. "rpi" .. "/obj") - configuration {} -- reset configuration return true @@ -966,7 +916,7 @@ function strip() "$(SILENT) " .. toolchainPrefix .. "strip -s \"$(TARGET)\"" } - configuration { "linux-* or rpi" } + configuration { "linux-*" } postbuildcommands { "$(SILENT) echo Stripping symbols.", "$(SILENT) strip -s \"$(TARGET)\"" -- cgit v1.2.3 From 9dce821cbb1a7016d418f6b650152fab4f32a418 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 10:52:26 +0200 Subject: mips platform is not supported for Android for some time --- scripts/src/3rdparty.lua | 6 ------ scripts/src/main.lua | 6 ------ scripts/toolchain.lua | 4 ---- 3 files changed, 16 deletions(-) diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 73d7f4d4332..b8555883e54 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -1664,12 +1664,6 @@ if _OPTIONS["targetos"]=="android" then if _OPTIONS["PLATFORM"]=="arm64" then targetdir(MAME_DIR .. "android-project/app/src/main/libs/arm64-v8a") end - if _OPTIONS["PLATFORM"]=="mips" then - targetdir(MAME_DIR .. "android-project/app/src/main/libs/mips") - end - if _OPTIONS["PLATFORM"]=="mips64" then - targetdir(MAME_DIR .. "android-project/app/src/main/libs/mips64") - end if _OPTIONS["PLATFORM"]=="x86" then targetdir(MAME_DIR .. "android-project/app/src/main/libs/x86") end diff --git a/scripts/src/main.lua b/scripts/src/main.lua index e09282d28c0..bbd352b2ab4 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -180,12 +180,6 @@ end if _OPTIONS["PLATFORM"]=="arm64" then targetdir(MAME_DIR .. "android-project/app/src/main/libs/arm64-v8a") end - if _OPTIONS["PLATFORM"]=="mips" then - targetdir(MAME_DIR .. "android-project/app/src/main/libs/mips") - end - if _OPTIONS["PLATFORM"]=="mips64" then - targetdir(MAME_DIR .. "android-project/app/src/main/libs/mips64") - end if _OPTIONS["PLATFORM"]=="x86" then targetdir(MAME_DIR .. "android-project/app/src/main/libs/x86") end diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 54703ccfc3a..758862c96f0 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -17,8 +17,6 @@ newoption { allowed = { { "android-arm", "Android - ARM" }, { "android-arm64", "Android - ARM64" }, - { "android-mips", "Android - MIPS" }, - { "android-mips64","Android - MIPS64" }, { "android-x86", "Android - x86" }, { "android-x64", "Android - x64" }, { "asmjs", "Emscripten/asm.js" }, @@ -134,8 +132,6 @@ function toolchain(_buildDir, _subDir) local platformToolchainMap = { ['arm'] = "arm-linux-androideabi", ['arm64'] = "aarch64-linux-android", - ['mips64'] = "mips64el-linux-android", - ['mips'] = "mipsel-linux-android", ['x86'] = "i686-linux-android", ['x64'] = "x86_64-linux-android", } -- cgit v1.2.3 From 22d5ba05dc6db119be9f7c07d69ff9ab7781af9e Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 10:59:28 +0200 Subject: xcode4 and ios removal --- makefile | 8 ------- scripts/genie.lua | 24 ++++++--------------- scripts/src/3rdparty.lua | 6 +++--- scripts/toolchain.lua | 56 ------------------------------------------------ 4 files changed, 10 insertions(+), 84 deletions(-) diff --git a/makefile b/makefile index 9907204149a..465dc2f56de 100644 --- a/makefile +++ b/makefile @@ -1464,14 +1464,6 @@ macosx_x86_clang: generate $(PROJECTDIR)/$(MAKETYPE)-osx-clang/Makefile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx-clang config=$(CONFIG)32 precompile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-osx-clang config=$(CONFIG)32 -.PHONY: xcode4 -xcode4: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --targetos=macosx --xcode=osx xcode4 - -.PHONY: xcode4-ios -xcode4-ios: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --targetos=macosx --xcode=ios xcode4 - #------------------------------------------------- # gmake-solaris #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index d1d7cebb883..607789ee82e 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -14,8 +14,6 @@ newoption { premake.check_paths = true premake.make.override = { "TARGET" } -premake.xcode.parameters = { 'CLANG_CXX_LANGUAGE_STANDARD = "c++17"', 'CLANG_CXX_LIBRARY = "libc++"' } - MAME_DIR = (path.getabsolute("..") .. "/") --MAME_DIR = string.gsub(MAME_DIR, "(%s)", "\\%1") local MAME_BUILD_DIR = (MAME_DIR .. _OPTIONS["build-dir"] .. "/") @@ -74,8 +72,7 @@ end function precompiledheaders() if _OPTIONS["precompile"]==nil or (_OPTIONS["precompile"]~=nil and _OPTIONS["precompile"]=="1") then - configuration { "not xcode4" } - pchheader("emu.h") + pchheader("emu.h") configuration { } end end @@ -145,7 +142,6 @@ newoption { { "netbsd", "NetBSD" }, { "openbsd", "OpenBSD" }, { "linux", "Linux" }, - { "ios", "iOS" }, { "macosx", "OSX" }, { "windows", "Windows" }, { "haiku", "Haiku" }, @@ -470,17 +466,11 @@ configurations { "Release", } -if _ACTION == "xcode4" then - platforms { - "x64", - } -else - platforms { - "x32", - "x64", - "Native", -- for targets where bitness is not specified - } -end +platforms { + "x32", + "x64", + "Native", -- for targets where bitness is not specified +} language "C++" @@ -1236,7 +1226,7 @@ configuration { "linux-*"} -configuration { "osx* or xcode4" } +configuration { "osx*" } links { "pthread", } diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index b8555883e54..a44db5ba54a 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -1150,7 +1150,7 @@ project "bx" MAME_DIR .. "3rdparty/bx/include/compat/mingw", } - configuration { "osx* or xcode4" } + configuration { "osx*" } includedirs { MAME_DIR .. "3rdparty/bx/include/compat/osx", } @@ -1218,7 +1218,7 @@ project "bimg" MAME_DIR .. "3rdparty/bx/include/compat/mingw", } - configuration { "osx* or xcode4" } + configuration { "osx*" } includedirs { MAME_DIR .. "3rdparty/bx/include/compat/osx", } @@ -1328,7 +1328,7 @@ end MAME_DIR .. "3rdparty/bx/include/compat/mingw", } - configuration { "osx* or xcode4" } + configuration { "osx*" } includedirs { MAME_DIR .. "3rdparty/bx/include/compat/osx", } diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 758862c96f0..4aba7c8963c 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -24,8 +24,6 @@ newoption { { "freebsd-clang", "FreeBSD (clang compiler)"}, { "linux-gcc", "Linux (GCC compiler)" }, { "linux-clang", "Linux (Clang compiler)" }, - { "ios-arm", "iOS - ARM" }, - { "ios-simulator", "iOS - Simulator" }, { "mingw32-gcc", "MinGW32" }, { "mingw64-gcc", "MinGW64" }, { "mingw-clang", "MinGW (clang compiler)" }, @@ -57,28 +55,12 @@ newoption { }, } -newoption { - trigger = "xcode", - value = "xcode_target", - description = "Choose XCode target", - allowed = { - { "osx", "OSX" }, - { "ios", "iOS" }, - } -} - newoption { trigger = "with-android", value = "#", description = "Set Android platform version (default: android-21).", } -newoption { - trigger = "with-ios", - value = "#", - description = "Set iOS target version (default: 8.0).", -} - newoption { trigger = "with-windows", value = "#", @@ -96,11 +78,6 @@ function toolchain(_buildDir, _subDir) androidPlatform = "android-24" end - local iosPlatform = "" - if _OPTIONS["with-ios"] then - iosPlatform = _OPTIONS["with-ios"] - end - local windowsPlatform = "10.0.10240.0" if _OPTIONS["with-windows"] then windowsPlatform = _OPTIONS["with-windows"] @@ -179,20 +156,6 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-openbsd") end - if "ios-arm" == _OPTIONS["gcc"] then - premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" - premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" - premake.gcc.ar = "ar" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-ios-arm") - end - - if "ios-simulator" == _OPTIONS["gcc"] then - premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" - premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" - premake.gcc.ar = "ar" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-ios-simulator") - end - if "linux-gcc" == _OPTIONS["gcc"] then -- Force gcc-4.2 on ubuntu-intrepid if _OPTIONS["distro"]=="ubuntu-intrepid" then @@ -401,17 +364,6 @@ function toolchain(_buildDir, _subDir) premake.vstudio.toolset = "Intel C++ Compiler XE 15.0" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel") end - elseif _ACTION == "xcode4" then - - - if "osx" == _OPTIONS["xcode"] then - premake.xcode.toolset = "macosx" - location (path.join(_buildDir, "projects", _ACTION .. "-osx")) - - elseif "ios" == _OPTIONS["xcode"] then - premake.xcode.toolset = "iphoneos" - location (path.join(_buildDir, "projects", _ACTION .. "-ios")) - end end if (_OPTIONS["CC"] ~= nil) then @@ -882,14 +834,6 @@ function toolchain(_buildDir, _subDir) configuration { "osx*", "arm64", "Debug" } targetdir (_buildDir .. "osx_clang" .. "/bin/x64/Debug") - configuration { "ios-arm" } - targetdir (_buildDir .. "ios-arm" .. "/bin") - objdir (_buildDir .. "ios-arm" .. "/obj") - - configuration { "ios-simulator" } - targetdir (_buildDir .. "ios-simulator" .. "/bin") - objdir (_buildDir .. "ios-simulator" .. "/obj") - configuration {} -- reset configuration return true -- cgit v1.2.3 From 34d4c26e40c942a045fd807dbf6dcefa083a5e72 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:07:34 +0200 Subject: Remove old VisualStudio --- makefile | 78 ---------------------------------- scripts/genie.lua | 2 +- scripts/toolchain.lua | 115 -------------------------------------------------- 3 files changed, 1 insertion(+), 194 deletions(-) diff --git a/makefile b/makefile index 465dc2f56de..c996542e0bd 100644 --- a/makefile +++ b/makefile @@ -1163,84 +1163,6 @@ windows_x86_clang: generate $(PROJECTDIR)/$(MAKETYPE)-mingw-clang/Makefile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw-clang config=$(CONFIG)32 WINDRES=$(WINDRES) precompile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/$(MAKETYPE)-mingw-clang config=$(CONFIG)32 WINDRES=$(WINDRES) -#------------------------------------------------- -# Visual Studio 2015 -#------------------------------------------------- - -.PHONY: vs2015 -vs2015: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2015 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2015/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - -.PHONY: vs2015_intel -vs2015_intel: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=intel-15 vs2015 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2015-intel/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - -.PHONY: vs2015_xp -vs2015_xp: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=vs2015-xp vs2015 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2015-xp/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - -.PHONY: vs2015_uwp -vs2015_uwp: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=winstore82 --osd=uwp --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_USE_PORTAUDIO=1 --MODERN_WIN_API=1 vs2015 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2015-winstore82/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - -.PHONY: vs2015_fastbuild -vs2015_fastbuild: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2015-fastbuild -ifdef FASTBUILD - $(SILENT) fbuild.exe -config $(PROJECTDIR_WIN)/vs2015-fastbuild/ftbuild.bff $(FASTBUILD_PARAMS) -endif - -#------------------------------------------------- -# Visual Studio 2017 -#------------------------------------------------- - -.PHONY: vs2017 -vs2017: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2017 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2017/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - -.PHONY: vs2017_intel -vs2017_intel: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=intel-15 vs2017 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2017-intel/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - -.PHONY: vs2017_xp -vs2017_xp: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=vs2017-xp vs2017 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2017-xp/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - -.PHONY: vs2017_uwp -vs2017_uwp: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=winstore82 --osd=uwp --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_USE_PORTAUDIO=1 --MODERN_WIN_API=1 vs2017 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2017-winstore82/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - -.PHONY: vs2017_fastbuild -vs2017_fastbuild: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2017-fastbuild -ifdef FASTBUILD - $(SILENT) fbuild.exe -config $(PROJECTDIR_WIN)/vs2017-fastbuild/ftbuild.bff $(FASTBUILD_PARAMS) -endif - #------------------------------------------------- # Visual Studio 2019 #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index 607789ee82e..5d318e2d68a 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -542,7 +542,7 @@ configuration { "Release", "vsllvm" } "NoIncrementalLink", } --- Force VS2015/17 targets to use bundled SDL2 +-- Force Visual Studio targets to use bundled SDL2 if string.sub(_ACTION,1,4) == "vs20" and _OPTIONS["osd"]=="sdl" then if _OPTIONS["with-bundled-sdl2"]==nil then _OPTIONS["with-bundled-sdl2"] = "1" diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 4aba7c8963c..df21f41c176 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -41,12 +41,7 @@ newoption { value = "toolset", description = "Choose VS toolset", allowed = { - { "intel-14", "Intel C++ Compiler XE 14.0" }, { "intel-15", "Intel C++ Compiler XE 15.0" }, - { "vs2015-clang", "Clang 3.6" }, - { "vs2015-xp", "Visual Studio 2015 targeting XP" }, - { "vs2017-clang", "Clang 3.6" }, - { "vs2017-xp", "Visual Studio 2017 targeting XP" }, { "clangcl", "Visual Studio 2019 using Clang/LLVM" }, { "winphone8", "Windows Phone 8.0" }, { "winphone81", "Windows Phone 8.1" }, @@ -227,116 +222,6 @@ function toolchain(_buildDir, _subDir) premake.gcc.ar = toolchainPrefix .. "ar" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang") end - elseif _ACTION == "vs2015" or _ACTION == "vs2015-fastbuild" then - - if (_ACTION .. "-clang") == _OPTIONS["vs"] then - premake.vstudio.toolset = ("LLVM-" .. _ACTION) - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-clang") - end - - if "winphone8" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v110_wp80" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winphone8") - end - - if "winphone81" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v120_wp81" - platforms { "ARM" } - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winphone81") - end - - if "winstore81" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v120" - premake.vstudio.storeapp = "8.1" - platforms { "ARM" } - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winstore81") - end - - if "winstore82" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v140" - premake.vstudio.storeapp = "8.2" - - -- If needed, depending on GENie version, enable file-level configuration - if enablefilelevelconfig ~= nil then - enablefilelevelconfig() - end - - local action = premake.action.current() - action.vstudio.windowsTargetPlatformVersion = windowsPlatform - - platforms { "ARM" } - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winstore82") - end - - if "intel-14" == _OPTIONS["vs"] then - premake.vstudio.toolset = "Intel C++ Compiler XE 14.0" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel") - end - - if "intel-15" == _OPTIONS["vs"] then - premake.vstudio.toolset = "Intel C++ Compiler XE 15.0" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel") - end - - if ("vs2015-xp") == _OPTIONS["vs"] then - premake.vstudio.toolset = ("v140_xp") - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-xp") - end - elseif _ACTION == "vs2017" or _ACTION == "vs2017-fastbuild" then - - if (_ACTION .. "-clang") == _OPTIONS["vs"] then - premake.vstudio.toolset = ("LLVM-" .. _ACTION) - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-clang") - end - - if "winphone8" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v110_wp80" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winphone8") - end - - if "winphone81" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v120_wp81" - platforms { "ARM" } - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winphone81") - end - - if "winstore81" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v120" - premake.vstudio.storeapp = "8.1" - platforms { "ARM" } - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winstore81") - end - - if "winstore82" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v141" - premake.vstudio.storeapp = "8.2" - - -- If needed, depending on GENie version, enable file-level configuration - if enablefilelevelconfig ~= nil then - enablefilelevelconfig() - end - - local action = premake.action.current() - action.vstudio.windowsTargetPlatformVersion = windowsPlatform - - platforms { "ARM" } - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winstore82") - end - - if "intel-14" == _OPTIONS["vs"] then - premake.vstudio.toolset = "Intel C++ Compiler XE 14.0" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel") - end - - if "intel-15" == _OPTIONS["vs"] then - premake.vstudio.toolset = "Intel C++ Compiler XE 15.0" - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel") - end - - if ("vs2017-xp") == _OPTIONS["vs"] then - premake.vstudio.toolset = ("v141_xp") - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-xp") - end elseif _ACTION == "vs2019" or _ACTION == "vs2019-fastbuild" then if "clangcl" == _OPTIONS["vs"] then -- cgit v1.2.3 From 8a6482eba6548d79e3b88ad76208dfed02bda8f0 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:08:41 +0200 Subject: fastbuild removal --- makefile | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/makefile b/makefile index c996542e0bd..f80254b483d 100644 --- a/makefile +++ b/makefile @@ -1021,19 +1021,6 @@ ifeq (posix,$(SHELLTYPE)) MSBUILD_PARAMS := $(subst /,-,$(MSBUILD_PARAMS)) endif endif -ifdef FASTBUILD -FASTBUILD_PARAMS := -j$(NUMBER_OF_PROCESSORS) -ifeq ($(CONFIG),debug) -FASTBUILD_TARGET := all-Debug -else -FASTBUILD_TARGET := all-Release -endif -ifeq ($(ARCHITECTURE),_x64) -FASTBUILD_PARAMS += $(FASTBUILD_TARGET)-x64 -else -FASTBUILD_PARAMS += $(FASTBUILD_TARGET)-x32 -endif -endif else ifdef OVERRIDE_CC GCC_VERSION := $(shell $(TOOLCHAIN)$(subst @,,$(OVERRIDE_CC)) -dumpversion 2> /dev/null) @@ -1195,13 +1182,6 @@ ifdef MSBUILD $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2019-winstore82/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) endif -.PHONY: vs2019_fastbuild -vs2019_fastbuild: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vs2019-fastbuild -ifdef FASTBUILD - $(SILENT) fbuild.exe -config $(PROJECTDIR_WIN)/vs2019-fastbuild/ftbuild.bff $(FASTBUILD_PARAMS) -endif - #------------------------------------------------- # Visual Studio LLVM #------------------------------------------------- -- cgit v1.2.3 From 63f907ee3223b81cd500bcc62a64f6e787bc4afa Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:11:35 +0200 Subject: vs2019_clang target is now used instead of vsllvm --- makefile | 11 -------- scripts/genie.lua | 70 ------------------------------------------------ scripts/src/3rdparty.lua | 27 ------------------- scripts/src/main.lua | 7 ----- 4 files changed, 115 deletions(-) diff --git a/makefile b/makefile index f80254b483d..ce9ff44754c 100644 --- a/makefile +++ b/makefile @@ -1182,17 +1182,6 @@ ifdef MSBUILD $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2019-winstore82/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) endif -#------------------------------------------------- -# Visual Studio LLVM -#------------------------------------------------- - -.PHONY: vsllvm -vsllvm: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) vsllvm -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vsllvm/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - #------------------------------------------------- # android-ndk #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index 5d318e2d68a..7ed354bd2e9 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -514,34 +514,6 @@ configuration { "Release", "vs20*" } } end -configuration { "vsllvm" } - buildoptions { - "/bigobj", - } - flags { - "NoPCH", - "ExtraWarnings", - } - if not _OPTIONS["NOWERROR"] then - flags{ - "FatalWarnings", - } - end - - -configuration { "Debug", "vsllvm" } - flags { - "Symbols", - "NoMultiProcessorCompilation", - } - -configuration { "Release", "vsllvm" } - flags { - "Optimize", - "NoEditAndContinue", - "NoIncrementalLink", - } - -- Force Visual Studio targets to use bundled SDL2 if string.sub(_ACTION,1,4) == "vs20" and _OPTIONS["osd"]=="sdl" then if _OPTIONS["with-bundled-sdl2"]==nil then @@ -1257,19 +1229,6 @@ configuration { "mingw*" } "userenv", } -configuration { "vsllvm" } - defines { - "XML_STATIC", - "WIN32", - "_WIN32", - "_CRT_NONSTDC_NO_DEPRECATE", - "_CRT_SECURE_NO_DEPRECATE", - "_CRT_STDIO_LEGACY_WIDE_SPECIFIERS", - } - includedirs { - MAME_DIR .. "3rdparty/dxsdk/Include" - } - configuration { "vs20*" } defines { "XML_STATIC", @@ -1404,35 +1363,6 @@ configuration { "winphone8* or winstore8*" } linkoptions { "/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata } -configuration { "vsllvm" } - buildoptions { - "-Wno-tautological-constant-out-of-range-compare", - "-Wno-ignored-qualifiers", - "-Wno-missing-field-initializers", - "-Wno-ignored-pragma-optimize", - "-Wno-unknown-warning-option", - "-Wno-unused-function", - "-Wno-unused-label", - "-Wno-unused-local-typedef", - "-Wno-unused-const-variable", - "-Wno-unused-parameter", - "-Wno-unneeded-internal-declaration", - "-Wno-unused-private-field", - "-Wno-missing-braces", - "-Wno-unused-variable", - "-Wno-tautological-pointer-compare", - "-Wno-nonportable-include-path", - "-Wno-enum-conversion", - "-Wno-pragma-pack", - "-Wno-new-returns-null", - "-Wno-sign-compare", - "-Wno-switch", - "-Wno-tautological-undefined-compare", - "-Wno-deprecated-declarations", - "-Wno-macro-redefined", - "-Wno-narrowing", - } - configuration { } diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index a44db5ba54a..fe2d94d53d9 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -667,12 +667,6 @@ end "-include stdint.h" } - configuration { "vsllvm" } - buildoptions { - "-Wno-enum-conversion", - "-Wno-unused-function", - } - configuration { } defines { "WORDS_BIGENDIAN=0", @@ -1021,12 +1015,6 @@ end "SQLITE_OS_WINRT", } - configuration { "vsllvm" } - buildoptions { - "-Wno-deprecated-declarations", - "-Wno-unused-variable", - } - configuration { } files { @@ -1290,12 +1278,6 @@ project "bgfx" "/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used } - configuration { "vsllvm" } - buildoptions { - "-Wno-unneeded-internal-declaration", - "-Wno-unused-const-variable", - } - if _OPTIONS["vs"]=="intel-15" then buildoptions { "/Qwd906", -- message #906: effect of this "#pragma pack" directive is local to function "xxx" @@ -1490,15 +1472,6 @@ project "portaudio" } end - configuration { "vsllvm" } - buildoptions { - "-Wno-deprecated-declarations", - "-Wno-missing-braces", - "-Wno-switch", - "-Wno-unused-function", - "-Wno-unused-variable", - } - configuration { "gmake or ninja" } buildoptions_c { "-Wno-bad-function-cast", diff --git a/scripts/src/main.lua b/scripts/src/main.lua index bbd352b2ab4..b6b983ca51b 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -401,13 +401,6 @@ if (STANDALONE~=true) then "@echo Emitting ".. rctarget .. "vers.rc...", PYTHON .. " \"" .. path.translate(MAME_DIR .. "scripts/build/verinfo.py","\\") .. "\" -r -b " .. rctarget .. " \"" .. path.translate(GEN_DIR .. "version.cpp","\\") .. "\" > \"" .. path.translate(GEN_DIR .. "resource/" .. rctarget .. "vers.rc", "\\") .. "\"" , } - - configuration { "vsllvm" } - prebuildcommands { - "mkdir \"" .. path.translate(GEN_DIR .. "resource/","\\") .. "\" 2>NUL", - "@echo Emitting ".. rctarget .. "vers.rc...", - PYTHON .. " \"" .. path.translate(MAME_DIR .. "scripts/build/verinfo.py","\\") .. "\" -r -b " .. rctarget .. " \"" .. path.translate(GEN_DIR .. "version.cpp","\\") .. "\" > \"" .. path.translate(GEN_DIR .. "resource/" .. rctarget .. "vers.rc", "\\") .. "\"" , - } end configuration { } -- cgit v1.2.3 From 9e7455b0578033442ee76b360b2b2c3fc577c81f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:18:31 +0200 Subject: Remove of winstore/winphone --- makefile | 7 ------- scripts/genie.lua | 7 ------- scripts/src/3rdparty.lua | 24 ------------------------ scripts/src/main.lua | 32 -------------------------------- scripts/toolchain.lua | 31 +------------------------------ 5 files changed, 1 insertion(+), 100 deletions(-) diff --git a/makefile b/makefile index ce9ff44754c..62b70d056e4 100644 --- a/makefile +++ b/makefile @@ -1175,13 +1175,6 @@ ifdef MSBUILD $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2019-intel/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) endif -.PHONY: vs2019_uwp -vs2019_uwp: generate - $(SILENT) $(GENIE) $(PARAMS) $(TARGET_PARAMS) --vs=winstore82 --osd=uwp --NO_USE_MIDI=1 --NO_OPENGL=1 --USE_QTDEBUG=0 --NO_USE_PORTAUDIO=1 --MODERN_WIN_API=1 vs2019 -ifdef MSBUILD - $(SILENT) msbuild.exe $(PROJECTDIR_WIN)/vs2019-winstore82/$(PROJECT_NAME).sln $(MSBUILD_PARAMS) -endif - #------------------------------------------------- # android-ndk #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index 7ed354bd2e9..b2d3d475533 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1239,8 +1239,6 @@ configuration { "vs20*" } "_CRT_STDIO_LEGACY_WIDE_SPECIFIERS", } --- Windows Store/Phone projects already link against the available libraries. -if _OPTIONS["vs"]==nil or not (string.startswith(_OPTIONS["vs"], "winstore8") or string.startswith(_OPTIONS["vs"], "winphone8")) then links { "user32", "winmm", @@ -1253,7 +1251,6 @@ if _OPTIONS["vs"]==nil or not (string.startswith(_OPTIONS["vs"], "winstore8") or "shell32", "userenv", } -end buildoptions { "/WX", -- Treats all compiler warnings as errors. @@ -1359,10 +1356,6 @@ end includedirs { MAME_DIR .. "3rdparty/dxsdk/Include" } -configuration { "winphone8* or winstore8*" } - linkoptions { - "/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata - } configuration { } diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index fe2d94d53d9..f2dcf55d39b 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -573,11 +573,6 @@ if _OPTIONS["vs"]=="intel-15" then } end - configuration { "winstore*" } - defines { - "NO_GETENV" - } - configuration { } files { @@ -768,11 +763,6 @@ if _OPTIONS["vs"]=="intel-15" then "/Qwd869", -- remark #869: parameter "xxx" was never referenced } end - configuration { "winstore*" } - forcedincludes { - MAME_DIR .. "src/osd/uwp/uwpcompat.h" - } - configuration { } defines { "_7ZIP_PPMD_SUPPPORT", @@ -861,11 +851,6 @@ if _OPTIONS["vs"]=="intel-15" then } end - configuration { "winstore*" } - forcedincludes { - MAME_DIR .. "src/osd/uwp/uwpcompat.h", - } - configuration { } defines { "LUA_COMPAT_ALL", @@ -961,11 +946,6 @@ end ext_includedir("sqlite3"), } - configuration { "winstore*" } - forcedincludes { - MAME_DIR .. "src/osd/uwp/uwpcompat.h" - } - configuration {} files { @@ -1010,10 +990,6 @@ if _OPTIONS["vs"]=="clangcl" then "-Wno-implicit-int-float-conversion", } end - configuration { "winstore*" } - defines { - "SQLITE_OS_WINRT", - } configuration { } diff --git a/scripts/src/main.lua b/scripts/src/main.lua index b6b983ca51b..5ad6aa77d7f 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -40,8 +40,6 @@ end "GLESv2", "SDL2", } - configuration { "winstore*" } - kind "WindowedApp" configuration { } @@ -59,36 +57,6 @@ end } end - configuration { "winstore*" } - -- Windows Required Files - files { - -- Manifest file - MAME_DIR .. "scripts/resources/uwp/Package.appxmanifest", - } - - configuration { "winstore*" } - files { - MAME_DIR .. "scripts/resources/uwp/assets/*.png" - } - configuration "**/scripts/resources/uwp/assets/*.png" - flags { "DeploymentContent" } - - -- Effects and Shaders - configuration { "winstore*" } - files { - MAME_DIR .. "artwork/*", - MAME_DIR .. "artwork/**/*", - MAME_DIR .. "bgfx/*", - MAME_DIR .. "bgfx/**/*", - MAME_DIR .. "hash/*", - MAME_DIR .. "language/*", - MAME_DIR .. "language/**/*", - MAME_DIR .. "plugins/*", - MAME_DIR .. "plugins/**/*", - } - configuration "**/*" - flags { "DeploymentContent" } - configuration { "Release" } targetsuffix "" if _OPTIONS["PROFILE"] then diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index df21f41c176..79aa3aec835 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -43,10 +43,6 @@ newoption { allowed = { { "intel-15", "Intel C++ Compiler XE 15.0" }, { "clangcl", "Visual Studio 2019 using Clang/LLVM" }, - { "winphone8", "Windows Phone 8.0" }, - { "winphone81", "Windows Phone 8.1" }, - { "winstore81", "Windows Store 8.1" }, - { "winstore82", "Universal Windows App" } }, } @@ -222,29 +218,13 @@ function toolchain(_buildDir, _subDir) premake.gcc.ar = toolchainPrefix .. "ar" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-osx-clang") end - elseif _ACTION == "vs2019" or _ACTION == "vs2019-fastbuild" then + elseif _ACTION == "vs2019" then if "clangcl" == _OPTIONS["vs"] then premake.vstudio.toolset = ("ClangCL") location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-clang") end - if "winstore82" == _OPTIONS["vs"] then - premake.vstudio.toolset = "v142" - premake.vstudio.storeapp = "10.0" - - -- If needed, depending on GENie version, enable file-level configuration - if enablefilelevelconfig ~= nil then - enablefilelevelconfig() - end - - local action = premake.action.current() - action.vstudio.windowsTargetPlatformVersion = windowsPlatform - - platforms { "ARM" } - location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-winstore82") - end - if "intel-15" == _OPTIONS["vs"] then premake.vstudio.toolset = "Intel C++ Compiler XE 15.0" location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-intel") @@ -319,15 +299,6 @@ function toolchain(_buildDir, _subDir) "-Qunused-arguments", } - configuration { "winphone8* or winstore8*" } - removeflags { - "StaticRuntime", - "NoExceptions", - } - flags { - "WinMain" - } - configuration { "mingw*" } defines { "WIN32" } -- cgit v1.2.3 From 9d61cf33d156aab6ad7c003cafecaa3303444bc4 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:24:03 +0200 Subject: Remove uwp from build system --- scripts/resources/uwp/Package.appxmanifest | 36 ------ .../uwp/assets/LockScreenLogo.scale-200.png | Bin 4544 -> 0 bytes .../uwp/assets/SplashScreen.scale-200.png | Bin 249008 -> 0 bytes .../uwp/assets/Square150x150Logo.scale-200.png | Bin 27658 -> 0 bytes .../uwp/assets/Square44x44Logo.scale-200.png | Bin 6817 -> 0 bytes ...are44x44Logo.targetsize-24_altform-unplated.png | Bin 3589 -> 0 bytes scripts/resources/uwp/assets/StoreLogo.png | Bin 4705 -> 0 bytes .../uwp/assets/Wide310x150Logo.scale-200.png | Bin 97655 -> 0 bytes scripts/resources/uwp/mame_TemporaryKey.pfx | Bin 2454 -> 0 bytes scripts/src/3rdparty.lua | 15 +-- scripts/src/main.lua | 4 - scripts/src/osd/uwp.lua | 122 --------------------- scripts/src/osd/uwp_cfg.lua | 20 ---- 13 files changed, 1 insertion(+), 196 deletions(-) delete mode 100644 scripts/resources/uwp/Package.appxmanifest delete mode 100644 scripts/resources/uwp/assets/LockScreenLogo.scale-200.png delete mode 100644 scripts/resources/uwp/assets/SplashScreen.scale-200.png delete mode 100644 scripts/resources/uwp/assets/Square150x150Logo.scale-200.png delete mode 100644 scripts/resources/uwp/assets/Square44x44Logo.scale-200.png delete mode 100644 scripts/resources/uwp/assets/Square44x44Logo.targetsize-24_altform-unplated.png delete mode 100644 scripts/resources/uwp/assets/StoreLogo.png delete mode 100644 scripts/resources/uwp/assets/Wide310x150Logo.scale-200.png delete mode 100644 scripts/resources/uwp/mame_TemporaryKey.pfx delete mode 100644 scripts/src/osd/uwp.lua delete mode 100644 scripts/src/osd/uwp_cfg.lua diff --git a/scripts/resources/uwp/Package.appxmanifest b/scripts/resources/uwp/Package.appxmanifest deleted file mode 100644 index 60092db9fed..00000000000 --- a/scripts/resources/uwp/Package.appxmanifest +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - MAME - MAME Team - scripts\resources\uwp\assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/scripts/resources/uwp/assets/LockScreenLogo.scale-200.png b/scripts/resources/uwp/assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 989319d4ec3..00000000000 Binary files a/scripts/resources/uwp/assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/scripts/resources/uwp/assets/SplashScreen.scale-200.png b/scripts/resources/uwp/assets/SplashScreen.scale-200.png deleted file mode 100644 index 538a6ad95a9..00000000000 Binary files a/scripts/resources/uwp/assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/scripts/resources/uwp/assets/Square150x150Logo.scale-200.png b/scripts/resources/uwp/assets/Square150x150Logo.scale-200.png deleted file mode 100644 index 15b8043caa8..00000000000 Binary files a/scripts/resources/uwp/assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/scripts/resources/uwp/assets/Square44x44Logo.scale-200.png b/scripts/resources/uwp/assets/Square44x44Logo.scale-200.png deleted file mode 100644 index 420dc54bf73..00000000000 Binary files a/scripts/resources/uwp/assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/scripts/resources/uwp/assets/Square44x44Logo.targetsize-24_altform-unplated.png b/scripts/resources/uwp/assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index ba31e4f883f..00000000000 Binary files a/scripts/resources/uwp/assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/scripts/resources/uwp/assets/StoreLogo.png b/scripts/resources/uwp/assets/StoreLogo.png deleted file mode 100644 index a16e59dcee9..00000000000 Binary files a/scripts/resources/uwp/assets/StoreLogo.png and /dev/null differ diff --git a/scripts/resources/uwp/assets/Wide310x150Logo.scale-200.png b/scripts/resources/uwp/assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index b6fd1f57bca..00000000000 Binary files a/scripts/resources/uwp/assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/scripts/resources/uwp/mame_TemporaryKey.pfx b/scripts/resources/uwp/mame_TemporaryKey.pfx deleted file mode 100644 index de6ef5c5f88..00000000000 Binary files a/scripts/resources/uwp/mame_TemporaryKey.pfx and /dev/null differ diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index f2dcf55d39b..436a54a3e43 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -934,12 +934,9 @@ project "lualibs" includedirs { MAME_DIR .. "3rdparty", - } -if (_OPTIONS["osd"] ~= "uwp") then - includedirs { MAME_DIR .. "3rdparty/linenoise", } -end + includedirs { ext_includedir("lua"), ext_includedir("zlib"), @@ -952,16 +949,8 @@ end MAME_DIR .. "3rdparty/lsqlite3/lsqlite3.c", MAME_DIR .. "3rdparty/lua-zlib/lua_zlib.c", MAME_DIR .. "3rdparty/luafilesystem/src/lfs.c", - } -if (_OPTIONS["osd"] == "uwp") then - files { - MAME_DIR .. "3rdparty/lua-linenoise/linenoise_none.c", - } -else - files { MAME_DIR .. "3rdparty/lua-linenoise/linenoise.c", } -end -------------------------------------------------- -- SQLite3 library objects @@ -2095,7 +2084,6 @@ end -- linenoise library -------------------------------------------------- -if (_OPTIONS["osd"] ~= "uwp") then project "linenoise" uuid "7320ffc8-2748-4add-8864-ae29b72a8511" kind (LIBTYPE) @@ -2117,7 +2105,6 @@ project "linenoise" MAME_DIR .. "3rdparty/linenoise/utf8.c", MAME_DIR .. "3rdparty/linenoise/linenoise.c", } -end -------------------------------------------------- diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 5ad6aa77d7f..04cccabc0c0 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -213,12 +213,8 @@ if (STANDALONE~=true) then links { ext_lib("lua"), "lualibs", - } -if (_OPTIONS["osd"] ~= "uwp") then - links { "linenoise", } -end end links { ext_lib("zlib"), diff --git a/scripts/src/osd/uwp.lua b/scripts/src/osd/uwp.lua deleted file mode 100644 index 1cb0eef5c75..00000000000 --- a/scripts/src/osd/uwp.lua +++ /dev/null @@ -1,122 +0,0 @@ --- 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/osdfile.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/scripts/src/osd/uwp_cfg.lua b/scripts/src/osd/uwp_cfg.lua deleted file mode 100644 index 28892656728..00000000000 --- a/scripts/src/osd/uwp_cfg.lua +++ /dev/null @@ -1,20 +0,0 @@ --- 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", -} -- cgit v1.2.3 From 67389f4cbdd00e1b139590325d5fbae47d0e62d0 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:28:11 +0200 Subject: Remove uwp specific sources --- scripts/src/osd/modules.lua | 1 - src/osd/modules/input/input_uwp.cpp | 652 -------------------- src/osd/modules/lib/osdlib_uwp.cpp | 207 ------- src/osd/modules/lib/osdobj_common.cpp | 2 - src/osd/uwp/uwpcompat.cpp | 103 ---- src/osd/uwp/uwpcompat.h | 139 ----- src/osd/uwp/video.cpp | 209 ------- src/osd/uwp/video.h | 19 - src/osd/uwp/window.cpp | 1076 --------------------------------- src/osd/uwp/window.h | 151 ----- 10 files changed, 2559 deletions(-) delete mode 100644 src/osd/modules/input/input_uwp.cpp delete mode 100644 src/osd/modules/lib/osdlib_uwp.cpp delete mode 100644 src/osd/uwp/uwpcompat.cpp delete mode 100644 src/osd/uwp/uwpcompat.h delete mode 100644 src/osd/uwp/video.cpp delete mode 100644 src/osd/uwp/video.h delete mode 100644 src/osd/uwp/window.cpp delete mode 100644 src/osd/uwp/window.h diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index 7ee20732784..48f83e126cd 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -104,7 +104,6 @@ function osdmodulesbuild() 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/input/input_mac.cpp", MAME_DIR .. "src/osd/modules/output/output_module.h", MAME_DIR .. "src/osd/modules/output/none.cpp", diff --git a/src/osd/modules/input/input_uwp.cpp b/src/osd/modules/input/input_uwp.cpp deleted file mode 100644 index 111ff0e0784..00000000000 --- a/src/osd/modules/input/input_uwp.cpp +++ /dev/null @@ -1,652 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Brad Hughes -//============================================================ -// -// input_uwp.cpp - UWP input implementation -// -//============================================================ - -#include "input_module.h" -#include "modules/osdmodule.h" - -#if defined(OSD_UWP) - -#include -#include -#include -#undef interface - -// MAME headers -#include "emu.h" -#include "uiinput.h" -#include "strconv.h" - -// MAMEOS headers -#include "winmain.h" -#include "input_common.h" -#include "input_windows.h" - - -namespace { - -#define UWP_BUTTON_COUNT 32 - -using namespace concurrency; -using namespace Windows::UI::Core; -using namespace Windows::Foundation; -using namespace Windows::Foundation::Collections; -using namespace Windows::Gaming::Input; - -//============================================================ -// UWP Base device/module implementation -//============================================================ - -//============================================================ -// UwpInputDevice - base class for implementing an input -// device in C++/CX. To be used with uwp_input_device -//============================================================ - -private ref class UwpInputDevice -{ -private: - running_machine & m_machine; - std::string m_name; - std::string m_id; - input_device_class m_devclass; - input_module & m_module; - input_device *m_inputdevice; - -internal: - UwpInputDevice(running_machine &machine, std::string &&name, std::string &&id, input_device_class deviceclass, input_module &module) : - m_machine(machine), - m_name(std::move(name)), - m_id(std::move(id)), - m_devclass(deviceclass), - m_module(module), - m_inputdevice(nullptr) - { - } - - property running_machine & Machine - { - running_machine & get() { return m_machine; } - } - - property const std::string & Name - { - const std::string & get() { return m_name; } - } - - property const std::string & Id - { - const std::string & get() { return m_id; } - } - - property input_device_class DeviceClass - { - input_device_class get() { return m_devclass; } - } - - property input_module & Module - { - input_module & get() { return m_module; } - } - - property input_device* InputDevice - { - input_device* get() { return m_inputdevice; } - void set(input_device* value) { m_inputdevice = value; } - } - - virtual void Poll() - { - } - - virtual void Reset() - { - } -}; - -//============================================================ -// uwp_input_device - a device that can be used to wrap a -// C++/CX ref class for an input device implementation -//============================================================ - -class uwp_input_device : public device_info -{ -private: - UwpInputDevice ^m_wrapped_device; - -public: - uwp_input_device(UwpInputDevice ^device) : - device_info(device->Machine, std::string(device->Name), std::string(device->Id), device->DeviceClass, device->Module), - m_wrapped_device(device) - { - } - - void poll() override - { - m_wrapped_device->Poll(); - } - - void reset() override - { - m_wrapped_device->Reset(); - } -}; - -//============================================================ -// UwpInputModule - a base class that can be used to -// implement an input module with a C++/CX class. -// normally used with uwp_wininput_module -//============================================================ - -class uwp_input_module; - -private ref class UwpInputModule -{ -private: - const std::string m_type; - const std::string m_name; - uwp_input_module *m_module; - -internal: - UwpInputModule(std::string &&type, std::string &&name) : - m_type(std::move(type)), - m_name(std::move(name)), - m_module(nullptr) - { - } - - property const std::string & Type - { - const std::string & get() { return m_type; } - } - - property const std::string & Name - { - const std::string & get() { return m_name; } - } - - property uwp_input_module * NativeModule - { - uwp_input_module * get() { return m_module; } - void set(uwp_input_module * value) { m_module = value; } - } - - virtual void input_init(running_machine &machine) - { - } -}; - -//============================================================ -// uwp_input_module - an input module that can be -// used to create an input module with a C++/CX ref class -//============================================================ - -class uwp_input_module : public wininput_module -{ -private: - UwpInputModule^ m_refmodule; - -public: - uwp_input_module(UwpInputModule^ refmodule) : - wininput_module(refmodule->Type.c_str(), refmodule->Name.c_str()), - m_refmodule(refmodule) - { - refmodule->NativeModule = this; - } - - void input_init(running_machine &machine) override - { - m_refmodule->input_init(machine); - } -}; - -//============================================================ -// UWP Keyboard Implementation -//============================================================ - -//============================================================ -// UwpKeyboardDevice -//============================================================ - -private ref class UwpKeyboardDevice : public UwpInputDevice -{ -private: - keyboard_state keyboard; - Platform::Agile m_coreWindow; - std::mutex m_state_lock; - -internal: - UwpKeyboardDevice(Platform::Agile coreWindow, running_machine& machine, std::string &&name, std::string &&id, input_module &module) : - UwpInputDevice(machine, std::move(name), std::move(id), DEVICE_CLASS_KEYBOARD, module), - keyboard({{0}}), - m_coreWindow(coreWindow) - { - coreWindow->Dispatcher->AcceleratorKeyActivated += ref new TypedEventHandler(this, &UwpKeyboardDevice::OnAcceleratorKeyActivated); - coreWindow->KeyDown += ref new TypedEventHandler(this, &UwpKeyboardDevice::OnKeyDown); - coreWindow->KeyUp += ref new TypedEventHandler(this, &UwpKeyboardDevice::OnKeyUp); - coreWindow->CharacterReceived += ref new TypedEventHandler(this, &UwpKeyboardDevice::OnCharacterReceived); - } - - void Reset() override - { - std::lock_guard scope_lock(m_state_lock); - memset(&keyboard, 0, sizeof(keyboard)); - } - - void Configure() - { - keyboard_trans_table &table = keyboard_trans_table::instance(); - - // populate it indexed by the scancode - for (int keynum = KEY_UNKNOWN + 1; keynum < MAX_KEYS; keynum++) - { - input_item_id itemid = table.map_di_scancode_to_itemid(keynum); - const char *keyname = table.ui_label_for_mame_key(itemid); - - char temp[256]; - if (!keyname) - { - snprintf(temp, std::size(temp), "Scan%03d", keynum); - keyname = temp; - } - - // add the item to the device - this->InputDevice->add_item(keyname, itemid, generic_button_get_state, &keyboard.state[keynum]); - } - } - - void OnKeyDown(CoreWindow^ win, KeyEventArgs^ args) - { - std::lock_guard scope_lock(m_state_lock); - CorePhysicalKeyStatus status = args->KeyStatus; - int discancode = (status.ScanCode & 0x7f) | (status.IsExtendedKey ? 0x80 : 0x00); - keyboard.state[discancode] = 0x80; - } - - void OnKeyUp(CoreWindow^ win, KeyEventArgs^ args) - { - std::lock_guard scope_lock(m_state_lock); - CorePhysicalKeyStatus status = args->KeyStatus; - int discancode = (status.ScanCode & 0x7f) | (status.IsExtendedKey ? 0x80 : 0x00); - keyboard.state[discancode] = 0; - } - - void OnCharacterReceived(CoreWindow ^sender, CharacterReceivedEventArgs ^args) - { - this->Machine.ui_input().push_char_event(osd_common_t::s_window_list.front()->target(), args->KeyCode); - } - - void OnAcceleratorKeyActivated(CoreDispatcher ^sender, AcceleratorKeyEventArgs ^args) - { - std::lock_guard scope_lock(m_state_lock); - auto eventType = args->EventType; - if (eventType == CoreAcceleratorKeyEventType::SystemKeyDown || - eventType == CoreAcceleratorKeyEventType::SystemKeyUp) - { - CorePhysicalKeyStatus status = args->KeyStatus; - int discancode = (status.ScanCode & 0x7f) | (status.IsExtendedKey ? 0x80 : 0x00); - keyboard.state[discancode] = - eventType == CoreAcceleratorKeyEventType::SystemKeyDown ? 0x80 : 0; - } - } -}; - -//============================================================ -// UwpKeyboardModule -//============================================================ - -private ref class UwpKeyboardModule : public UwpInputModule -{ -private: - running_machine *m_machine; - -internal: - UwpKeyboardModule() : UwpInputModule(OSD_KEYBOARDINPUT_PROVIDER, "uwp") - { - } - - void input_init(running_machine &machine) override - { - auto first_window = std::static_pointer_cast(osd_common_t::s_window_list.front()); - auto coreWindow = first_window->platform_window(); - - // allocate the UWP implementation of the device object - UwpKeyboardDevice ^refdevice = ref new UwpKeyboardDevice(coreWindow, machine, "UWP Keyboard 1", "UWP Keyboard 1", *this->NativeModule); - - // Allocate the wrapper and add it to the list - auto created_devinfo = std::make_unique(refdevice); - uwp_input_device &devinfo = NativeModule->devicelist()->add_device(machine, std::move(created_devinfo)); - - // Give the UWP implementation a handle to the input_device - refdevice->InputDevice = devinfo.device(); - - // Configure the device - refdevice->Configure(); - } -}; - -//============================================================ -// uwp_keyboard_module -//============================================================ - -class uwp_keyboard_module : public uwp_input_module -{ -public: - uwp_keyboard_module() - : uwp_input_module(ref new UwpKeyboardModule()) - { - } -}; - -// default axis names -static const char *const uwp_axis_name[] = -{ - "LSX", - "LSY", - "RSX", - "RSY" -}; - -static const input_item_id uwp_axis_ids[] = -{ - ITEM_ID_XAXIS, - ITEM_ID_YAXIS, - ITEM_ID_RXAXIS, - ITEM_ID_RYAXIS -}; - -struct gamepad_state -{ - BYTE buttons[UWP_BUTTON_COUNT]; - LONG left_trigger; - LONG right_trigger; - LONG left_thumb_x; - LONG left_thumb_y; - LONG right_thumb_x; - LONG right_thumb_y; -}; - -// Maps different UWP GameControllerButtonLabels to a halfway-sane input_item_id in many cases -static input_item_id buttonlabel_to_itemid[] = -{ - input_item_id::ITEM_ID_INVALID, // GameControllerButtonLabel::None - input_item_id::ITEM_ID_SELECT, // GameControllerButtonLabel::XboxBack - input_item_id::ITEM_ID_START, // GameControllerButtonLabel::XboxStart - input_item_id::ITEM_ID_START, // GameControllerButtonLabel::XboxMenu - input_item_id::ITEM_ID_SELECT, // GameControllerButtonLabel::XboxView - input_item_id::ITEM_ID_HAT1UP, // GameControllerButtonLabel::XboxUp - input_item_id::ITEM_ID_HAT1DOWN, // GameControllerButtonLabel::XboxDown - input_item_id::ITEM_ID_HAT1LEFT, // GameControllerButtonLabel::XboxLeft - input_item_id::ITEM_ID_HAT1RIGHT, // GameControllerButtonLabel::XboxRight - input_item_id::ITEM_ID_BUTTON1, // GameControllerButtonLabel::XboxA - input_item_id::ITEM_ID_BUTTON2, // GameControllerButtonLabel::XboxB - input_item_id::ITEM_ID_BUTTON3, // GameControllerButtonLabel::XboxX - input_item_id::ITEM_ID_BUTTON4, // GameControllerButtonLabel::XboxY - input_item_id::ITEM_ID_BUTTON5, // GameControllerButtonLabel::XboxLeftBumper - input_item_id::ITEM_ID_ZAXIS, // GameControllerButtonLabel::XboxLeftTrigger - input_item_id::ITEM_ID_BUTTON7, // GameControllerButtonLabel::XboxLeftStickButton - input_item_id::ITEM_ID_BUTTON6, // GameControllerButtonLabel::XboxRightBumper - input_item_id::ITEM_ID_RZAXIS, // GameControllerButtonLabel::XboxRightTrigger - input_item_id::ITEM_ID_BUTTON8, // GameControllerButtonLabel::XboxRightStickButton - input_item_id::ITEM_ID_BUTTON9, // GameControllerButtonLabel::XboxPaddle1 - input_item_id::ITEM_ID_BUTTON10, // GameControllerButtonLabel::XboxPaddle2 - input_item_id::ITEM_ID_BUTTON11, // GameControllerButtonLabel::XboxPaddle3 - input_item_id::ITEM_ID_BUTTON12, // GameControllerButtonLabel::XboxPaddle4 - input_item_id::ITEM_ID_INVALID, // GameControllerButtonLabel_Mode - input_item_id::ITEM_ID_SELECT, // GameControllerButtonLabel_Select - input_item_id::ITEM_ID_START, // GameControllerButtonLabel_Menu - input_item_id::ITEM_ID_SELECT, // GameControllerButtonLabel_View - input_item_id::ITEM_ID_SELECT, // GameControllerButtonLabel_Back - input_item_id::ITEM_ID_START, // GameControllerButtonLabel_Start - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Options - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Share - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Up - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Down - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Left - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Right - input_item_id::ITEM_ID_BUTTON1, // GameControllerButtonLabel_LetterA - input_item_id::ITEM_ID_BUTTON2, // GameControllerButtonLabel_LetterB - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_LetterC - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_LetterL - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_LetterR - input_item_id::ITEM_ID_BUTTON3, // GameControllerButtonLabel_LetterX - input_item_id::ITEM_ID_BUTTON4, // GameControllerButtonLabel_LetterY - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_LetterZ - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Cross - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Circle - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Square - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Triangle - input_item_id::ITEM_ID_BUTTON5, // GameControllerButtonLabel_LeftBumper - input_item_id::ITEM_ID_ZAXIS, // GameControllerButtonLabel_LeftTrigger - input_item_id::ITEM_ID_BUTTON7, // GameControllerButtonLabel_LeftStickButton - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Left1 - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Left2 - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Left3 - input_item_id::ITEM_ID_BUTTON6, // GameControllerButtonLabel_RightBumper - input_item_id::ITEM_ID_RZAXIS, // GameControllerButtonLabel_RightTrigger - input_item_id::ITEM_ID_BUTTON8, // GameControllerButtonLabel_RightStickButton - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Right1 - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Right2 - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Right3 - input_item_id::ITEM_ID_BUTTON9, // GameControllerButtonLabel_Paddle1 - input_item_id::ITEM_ID_BUTTON10, // GameControllerButtonLabel_Paddle2 - input_item_id::ITEM_ID_BUTTON11, // GameControllerButtonLabel_Paddle3 - input_item_id::ITEM_ID_BUTTON12, // GameControllerButtonLabel_Paddle4 - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Plus - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Minus - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_DownLeftArrow - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_DialLeft - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_DialRight - input_item_id::ITEM_ID_OTHER_SWITCH, // GameControllerButtonLabel_Suspension -}; - -//============================================================ -// UwpJoystickDevice -//============================================================ - -private ref class UwpJoystickDevice : public UwpInputDevice -{ -private: - Gamepad ^m_pad; - bool m_configured; - gamepad_state state; - -internal: - UwpJoystickDevice(Gamepad^ pad, running_machine &machine, const char *name, const char *id, input_module &module) - : UwpInputDevice(machine, name, id, DEVICE_CLASS_JOYSTICK, module), - m_pad(pad), - m_configured(false), - state({0}) - {} - - void Poll() override - { - // If the device hasn't been configured, don't poll - if (!m_configured) - return; - - GamepadReading reading = m_pad->GetCurrentReading(); - - for (int butnum = 0; butnum < UWP_BUTTON_COUNT; butnum++) - { - GamepadButtons currentButton = GamepadButtons(1 << butnum); - state.buttons[butnum] = (reading.Buttons & currentButton) != GamepadButtons::None ? 0xFF : 0; - } - - // Now grab the axis values - // Each of the thumbstick axis members is a signed value between -32768 and 32767 describing the position of the thumbstick - // However, the Y axis values are inverted from what MAME expects, so negate the value - state.left_thumb_x = normalize_absolute_axis(reading.LeftThumbstickX, -1, 1); - state.left_thumb_y = -normalize_absolute_axis(reading.LeftThumbstickY, -1, 1); - state.right_thumb_x = normalize_absolute_axis(reading.RightThumbstickX, -1, 1); - state.right_thumb_y = -normalize_absolute_axis(reading.RightThumbstickY, -1, 1); - - // Get the trigger values - state.left_trigger = normalize_absolute_axis(reading.LeftTrigger, 0.0, 1.0); - state.right_trigger = normalize_absolute_axis(reading.RightTrigger, 0.0, 1.0); - - // For the UI, triggering UI_CONFIGURE is odd. It requires a EVENT_CHAR first - static constexpr int menuhotkey = (int)(GamepadButtons::View | GamepadButtons::X); - if (((int)reading.Buttons & menuhotkey) == menuhotkey) - { - ui_event uiev; - memset(&uiev, 0, sizeof(uiev)); - uiev.event_type = ui_event::IME_CHAR; - this->Machine.ui_input().push_event(uiev); - } - } - - void Reset() override - { - memset(&state, 0, sizeof(state)); - } - - void Configure() - { - // If the device has already been configured, don't do it again - if (m_configured) - return; - - GamepadReading r = m_pad->GetCurrentReading(); - - // Add the axes - for (int axisnum = 0; axisnum < 4; axisnum++) - { - this->InputDevice->add_item( - uwp_axis_name[axisnum], - uwp_axis_ids[axisnum], - generic_axis_get_state, - &state.left_thumb_x + axisnum); - } - - // populate the buttons - for (int butnum = 0; butnum < UWP_BUTTON_COUNT; butnum++) - { - GamepadButtons button = GamepadButtons(1 << butnum); - auto label = m_pad->GetButtonLabel(button); - if (label != GameControllerButtonLabel::None) - { - std::string desc = osd::text::from_wstring(label.ToString()->Data()); - this->InputDevice->add_item( - desc.c_str(), - buttonlabel_to_itemid[static_cast(label)], - generic_button_get_state, - &state.buttons[butnum]); - } - } - - this->InputDevice->add_item( - "Left Trigger", - ITEM_ID_ZAXIS, - generic_axis_get_state, - &state.left_trigger); - - this->InputDevice->add_item( - "Right Trigger", - ITEM_ID_RZAXIS, - generic_axis_get_state, - &state.right_trigger); - - m_configured = true; - } -}; - -//============================================================ -// UwpJoystickModule -//============================================================ - -private ref class UwpJoystickModule : public UwpInputModule -{ -private: - boolean m_joysticks_discovered; - -internal: - UwpJoystickModule() - : UwpInputModule(OSD_JOYSTICKINPUT_PROVIDER, "uwp"), - m_joysticks_discovered(false) - { - } - - void input_init(running_machine &machine) override - { - PerformGamepadDiscovery(); - - auto pads = Gamepad::Gamepads; - - int padindex = 0; - std::for_each(begin(pads), end(pads), [&](Gamepad^ pad) - { - std::ostringstream namestream; - namestream << "UWP Gamepad " << (padindex + 1); - - auto name = namestream.str(); - - // allocate the UWP implementation of the device object - UwpJoystickDevice ^refdevice = ref new UwpJoystickDevice(pad, machine, name.c_str(), name.c_str(), *this->NativeModule); - - // Allocate the wrapper and add it to the list - auto created_devinfo = std::make_unique(refdevice); - auto &devinfo = NativeModule->devicelist()->add_device(machine, std::move(created_devinfo)); - - // Give the UWP implementation a handle to the input_device - refdevice->InputDevice = devinfo->device(); - - // Configure the device - refdevice->Configure(); - - padindex++; - }); - } - -private: - void PerformGamepadDiscovery() - { - Gamepad::GamepadAdded += ref new EventHandler(this, &UwpJoystickModule::OnGamepadAdded); - auto start = std::chrono::system_clock::now(); - - // We need to pause a bit and pump events so gamepads get discovered - while (std::chrono::system_clock::now() - start < std::chrono::milliseconds(1000)) - CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); - - m_joysticks_discovered = true; - } - - void OnGamepadAdded(Platform::Object ^sender, Gamepad ^pad) - { - if (m_joysticks_discovered) - { - osd_printf_error("Input: UWP Compatible %s gamepad plugged in AFTER discovery complete!\n", pad->IsWireless ? "Wireless" : "Wired"); - } - else - { - osd_printf_verbose("Input: UWP Compatible %s gamepad discovered.\n", pad->IsWireless ? "Wireless" : "Wired"); - } - } -}; - -//============================================================ -// uwp_joystick_module -//============================================================ - -class uwp_joystick_module : public uwp_input_module -{ -public: - uwp_joystick_module() : uwp_input_module(ref new UwpJoystickModule()) - { - } -}; - -} // anonymous namespace - -#else // defined(OSD_UWP) - -MODULE_NOT_SUPPORTED(uwp_keyboard_module, OSD_KEYBOARDINPUT_PROVIDER, "uwp") -MODULE_NOT_SUPPORTED(uwp_joystick_module, OSD_JOYSTICKINPUT_PROVIDER, "uwp") - -#endif // defined(OSD_UWP) - -MODULE_DEFINITION(KEYBOARDINPUT_UWP, uwp_keyboard_module) -MODULE_DEFINITION(JOYSTICKINPUT_UWP, uwp_joystick_module) diff --git a/src/osd/modules/lib/osdlib_uwp.cpp b/src/osd/modules/lib/osdlib_uwp.cpp deleted file mode 100644 index 87035e9db97..00000000000 --- a/src/osd/modules/lib/osdlib_uwp.cpp +++ /dev/null @@ -1,207 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert, R. Belmont, Brad Hughes -//============================================================ -// -// sdlos_*.c - OS specific low level code -// -// SDLMAME by Olivier Galibert and R. Belmont -// -//============================================================ - -// MAME headers -#include "osdlib.h" -#include "osdcomm.h" -#include "osdcore.h" -#include "strconv.h" - -#include -#include -#include -#include - -#include -#include - -#include - - -using namespace Platform; -using namespace Windows::ApplicationModel::DataTransfer; -using namespace Windows::Foundation; - - -//============================================================ -// GLOBAL VARIABLES -//============================================================ - -std::map> g_runtime_environment; - -//============================================================ -// osd_getenv -//============================================================ - -const char *osd_getenv(const char *name) -{ - for (auto iter = g_runtime_environment.begin(); iter != g_runtime_environment.end(); iter++) - { - if (stricmp(iter->first, name) == 0) - { - osd_printf_debug("ENVIRONMENT: Get %s = value: '%s'", name, iter->second.get()); - return iter->second.get(); - } - } - - return nullptr; -} - - -//============================================================ -// osd_setenv -//============================================================ - -int osd_setenv(const char *name, const char *value, int overwrite) -{ - if (!overwrite) - { - if (osd_getenv(name) != nullptr) - return 0; - } - - auto buf = std::make_unique(strlen(name) + strlen(value) + 2); - sprintf(buf.get(), "%s=%s", name, value); - - g_runtime_environment[name] = std::move(buf); - osd_printf_debug("ENVIRONMENT: Set %s to value: '%s'", name, buf.get()); - - return 0; -} - -//============================================================ -// osd_process_kill -//============================================================ - -void osd_process_kill() -{ - TerminateProcess(GetCurrentProcess(), -1); -} - -//============================================================ -// osd_break_into_debugger -//============================================================ - -void osd_break_into_debugger(const char *message) -{ - if (IsDebuggerPresent()) - { - OutputDebugStringA(message); - __debugbreak(); - } -} - -//============================================================ -// get_clipboard_text_by_format -//============================================================ - -static bool get_clipboard_text_by_format(std::string &result_text, UINT format, std::string (*convert)(LPCVOID data)) -{ - DataPackageView^ dataPackageView; - IAsyncOperation^ getTextOp; - String^ clipboardText; - - dataPackageView = Clipboard::GetContent(); - getTextOp = dataPackageView->GetTextAsync(); - clipboardText = getTextOp->GetResults(); - - result_text = convert(clipboardText->Data()); - return !result_text.empty(); -} - -//============================================================ -// convert_wide -//============================================================ - -static std::string convert_wide(LPCVOID data) -{ - return osd::text::from_wstring((LPCWSTR) data); -} - -//============================================================ -// convert_ansi -//============================================================ - -static std::string convert_ansi(LPCVOID data) -{ - return osd::text::from_astring((LPCSTR) data); -} - -//============================================================ -// osd_get_clipboard_text -//============================================================ - -std::string osd_get_clipboard_text() -{ - std::string result; - - // try to access unicode text - if (!get_clipboard_text_by_format(result, CF_UNICODETEXT, convert_wide)) - { - // try to access ANSI text - get_clipboard_text_by_format(result, CF_TEXT, convert_ansi); - } - - return result; -} - -//============================================================ -// osd_getpid -//============================================================ - -int osd_getpid() -{ - return GetCurrentProcessId(); -} - - -namespace osd { - -bool invalidate_instruction_cache(void const *start, std::size_t size) -{ - return FlushInstructionCache(GetCurrentProcess(), start, size) != 0; -} - - -void *virtual_memory_allocation::do_alloc(std::initializer_list blocks, unsigned intent, std::size_t &size, std::size_t &page_size) -{ - SYSTEM_INFO info; - GetSystemInfo(&info); - SIZE_T s(0); - for (std::size_t b : blocks) - s += (b + info.dwPageSize - 1) / info.dwPageSize; - s *= info.dwPageSize; - if (!s) - return nullptr; - LPVOID const result(VirtualAllocFromApp(nullptr, s, MEM_COMMIT, PAGE_NOACCESS)); - if (result) - { - size = s; - page_size = info.dwPageSize; - } - return result; -} - -void virtual_memory_allocation::do_free(void *start, std::size_t size) -{ - VirtualFree(start, 0, MEM_RELEASE); -} - -bool virtual_memory_allocation::do_set_access(void *start, std::size_t size, unsigned access) -{ - ULONG p, o; - if (access & EXECUTE) - p = (access & WRITE) ? PAGE_EXECUTE_READWRITE : (access & READ) ? PAGE_EXECUTE_READ : PAGE_EXECUTE; - else - p = (access & WRITE) ? PAGE_READWRITE : (access & READ) ? PAGE_READONLY : PAGE_NOACCESS; - return VirtualProtectFromApp(start, size, p, &o) != 0; -} - -} // namespace osd diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index a8ed943f18b..be06da29767 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -260,7 +260,6 @@ void osd_common_t::register_options() REGISTER_MODULE(m_mod_man, KEYBOARDINPUT_RAWINPUT); REGISTER_MODULE(m_mod_man, KEYBOARDINPUT_DINPUT); REGISTER_MODULE(m_mod_man, KEYBOARDINPUT_WIN32); - REGISTER_MODULE(m_mod_man, KEYBOARDINPUT_UWP); REGISTER_MODULE(m_mod_man, KEYBOARD_NONE); REGISTER_MODULE(m_mod_man, MOUSEINPUT_SDL); @@ -278,7 +277,6 @@ void osd_common_t::register_options() REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_WINHYBRID); REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_DINPUT); REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_XINPUT); - REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_UWP); REGISTER_MODULE(m_mod_man, JOYSTICK_NONE); REGISTER_MODULE(m_mod_man, OUTPUT_NONE); diff --git a/src/osd/uwp/uwpcompat.cpp b/src/osd/uwp/uwpcompat.cpp deleted file mode 100644 index e4e1149f72c..00000000000 --- a/src/osd/uwp/uwpcompat.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Brad Hughes, Miodrag Milanovic -//============================================================ -// -// uwpcompat.h - Universal Windows Platform compat forced includes -// -//============================================================ - -#include "uwpcompat.h" - -#include -#include - -#undef interface - -#include "emu.h" - -extern "C" { - - BOOL WINAPI GetVersionEx( - _Inout_ LPOSVERSIONINFO lpVersionInfo - ) - { - lpVersionInfo->dwMajorVersion = 10; - return TRUE; - } - - HANDLE - WINAPI - CreateFileW( - _In_ LPCWSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile - ) - { - // TODO: Handle other arguments that go into last param (pCreateExParams) - return CreateFile2((wchar_t*)lpFileName, dwDesiredAccess, dwShareMode, dwCreationDisposition, NULL); - } - - HANDLE - WINAPI - CreateFileA( - _In_ LPCSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile - ) - { - wchar_t filepath[MAX_PATH + 1]; - if (MultiByteToWideChar(CP_ACP, 0, lpFileName, strlen(lpFileName), filepath, MAX_PATH)) - return CreateFileW(filepath, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); - - SetLastError(E_FAIL); - return INVALID_HANDLE_VALUE; - } - - DWORD WINAPI GetTickCount(void) - { - return osd_ticks(); - } - - // This is only in here so callers get an error - HMODULE WINAPI LoadLibraryExA( - _In_ LPCSTR lpLibFileName, - _Reserved_ HANDLE hFile, - _In_ DWORD dwFlags - ) - { - SetLastError(ERROR_FILE_NOT_FOUND); - return nullptr; - } - - HMODULE WINAPI LoadLibraryExW( - _In_ LPCWSTR lpLibFileName, - _Reserved_ HANDLE hFile, - _In_ DWORD dwFlags - ) - { - SetLastError(ERROR_FILE_NOT_FOUND); - return nullptr; - } - - DWORD WINAPI GetFileSize( - _In_ HANDLE hFile, - _Out_opt_ LPDWORD lpFileSizeHigh - ) - { - FILE_STANDARD_INFO file_info; - GetFileInformationByHandleEx(hFile, FileStandardInfo, &file_info, sizeof(file_info)); - if(lpFileSizeHigh!=nullptr) - { - *lpFileSizeHigh = file_info.EndOfFile.HighPart; - } - return file_info.EndOfFile.LowPart; - } -} diff --git a/src/osd/uwp/uwpcompat.h b/src/osd/uwp/uwpcompat.h deleted file mode 100644 index 5d0dbb07dcb..00000000000 --- a/src/osd/uwp/uwpcompat.h +++ /dev/null @@ -1,139 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Brad Hughes, Miodrag Milanovic -//============================================================ -// -// uwpcompat.h - Universal Windows Platform compat forced includes -// -//============================================================ - -#ifndef __UWPCOMPAT_H__ -#define __UWPCOMPAT_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef NOGDI -#define NOGDI -#endif -#include -#include - -int system(const char *command); - -const char *getenv(const char *varname); - -HANDLE -WINAPI -CreateFileA( - _In_ LPCSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile - ); - -HANDLE -WINAPI -CreateFileW( - _In_ LPCWSTR lpFileName, - _In_ DWORD dwDesiredAccess, - _In_ DWORD dwShareMode, - _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, - _In_ DWORD dwCreationDisposition, - _In_ DWORD dwFlagsAndAttributes, - _In_opt_ HANDLE hTemplateFile - ); - -#ifdef UNICODE -#define CreateFile CreateFileW -#else -#define CreateFile CreateFileA -#endif // !UNICODE - -BOOL WINAPI GetVersionEx( - _Inout_ LPOSVERSIONINFO lpVersionInfo -); - -DWORD WINAPI GetTickCount(void); - -FILE *_popen( - const char *command, - const char *mode - ); - -int _pclose( - FILE *stream); - -_Ret_maybenull_ -HMODULE WINAPI LoadLibraryA( - _In_ LPCSTR lpFileName -); - -_Ret_maybenull_ -HMODULE WINAPI LoadLibraryW( - _In_ LPCWSTR lpFileName -); - -#ifdef UNICODE -#define LoadLibrary LoadLibraryW -#else -#define LoadLibrary LoadLibraryA -#endif // !UNICODE - -_Ret_maybenull_ -HMODULE WINAPI GetModuleHandleA( - _In_ LPCSTR lpModuleName -); - -_Ret_maybenull_ -HMODULE WINAPI GetModuleHandleW( - _In_ LPCWSTR lpModuleName -); - -#ifdef UNICODE -#define GetModuleHandle GetModuleHandleW -#else -#define GetModuleHandle GetModuleHandleA -#endif // !UNICODE - -_Ret_maybenull_ -HMODULE -WINAPI -LoadLibraryExA( - _In_ LPCSTR lpLibFileName, - _Reserved_ HANDLE hFile, - _In_ DWORD dwFlags -); - -_Ret_maybenull_ -HMODULE -WINAPI -LoadLibraryExW( - _In_ LPCWSTR lpLibFileName, - _Reserved_ HANDLE hFile, - _In_ DWORD dwFlags -); - -#ifdef UNICODE -#define LoadLibraryEx LoadLibraryExW -#else -#define LoadLibraryEx LoadLibraryExA -#endif // !UNICODE - -DWORD -WINAPI -GetFileSize( - _In_ HANDLE hFile, - _Out_opt_ LPDWORD lpFileSizeHigh -); - -#ifdef __cplusplus -} -#endif - -#endif // __UWPCOMPAT_H__ - - diff --git a/src/osd/uwp/video.cpp b/src/osd/uwp/video.cpp deleted file mode 100644 index 8ca19c75af0..00000000000 --- a/src/osd/uwp/video.cpp +++ /dev/null @@ -1,209 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Brad Hughes, Aaron Giles -//============================================================ -// -// video.c - UWP video handling -// -//============================================================ - -#include - -// standard windows headers -#include -#include -#include -#undef interface - -// MAME headers -#include "emu.h" -#include "emuopts.h" -#include "render.h" -#include "uiinput.h" - -// MAMEOS headers -#include "winmain.h" -#include "video.h" -#include "window.h" -#include "strconv.h" - -#include "modules/osdwindow.h" - -using namespace Platform; -using namespace Microsoft::WRL; -using namespace Windows::UI::Core; - -//============================================================ -// GLOBAL VARIABLES -//============================================================ - -osd_video_config video_config; - - -//============================================================ -// PROTOTYPES -//============================================================ - -static void get_resolution(const char *defdata, const char *data, osd_window_config *config, int report_error); - - -//============================================================ -// video_init -//============================================================ - -// FIXME: Temporary workaround -static osd_window_config windows[MAX_VIDEO_WINDOWS]; // configuration data per-window - -bool windows_osd_interface::video_init() -{ - // extract data from the options - extract_video_config(); - - // initialize the window system so we can make windows - window_init(); - - // create the windows - windows_options &options = downcast(machine().options()); - for (int index = 0; index < video_config.numscreens; index++) - { - uwp_window_info::create(machine(), index, m_monitor_module->pick_monitor(options, index), &windows[index]); - } - - if (video_config.mode != VIDEO_MODE_NONE) - { - auto win = std::static_pointer_cast(osd_common_t::s_window_list.front()); - win->platform_window()->Activate(); - } - - return true; -} - -//============================================================ -// video_exit -//============================================================ - -void windows_osd_interface::video_exit() -{ - window_exit(); -} - -//============================================================ -// update -//============================================================ - -void windows_osd_interface::update(bool skip_redraw) -{ - osd_common_t::update(skip_redraw); - - // if we're not skipping this redraw, update all windows - if (!skip_redraw) - { -// profiler_mark(PROFILER_BLIT); - for (auto window : osd_common_t::s_window_list) - window->update(); -// profiler_mark(PROFILER_END); - } - - // if we're running, disable some parts of the debugger - if ((machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0) - debugger_update(); -} - -//============================================================ -// input_update -//============================================================ - -void windows_osd_interface::input_update() -{ - // poll the joystick values here - winwindow_process_events(machine(), true, false); - poll_input(machine()); - check_osd_inputs(); -} - -//============================================================ -// check_osd_inputs -//============================================================ - -void windows_osd_interface::check_osd_inputs() -{ -} - - - -//============================================================ -// extract_video_config -//============================================================ - -void windows_osd_interface::extract_video_config() -{ - const char *stemp; - - // global options: extract the data - video_config.windowed = options().window(); - video_config.prescale = options().prescale(); - video_config.filter = options().filter(); - video_config.numscreens = options().numscreens(); - - // if we are in debug mode, never go full screen - if (machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) - video_config.windowed = TRUE; - - // per-window options: extract the data - const char *default_resolution = options().resolution(); - get_resolution(default_resolution, options().resolution(0), &windows[0], TRUE); - get_resolution(default_resolution, options().resolution(1), &windows[1], TRUE); - get_resolution(default_resolution, options().resolution(2), &windows[2], TRUE); - get_resolution(default_resolution, options().resolution(3), &windows[3], TRUE); - - // video options: extract the data - stemp = options().video(); - if (strcmp(stemp, "auto") == 0) - video_config.mode = VIDEO_MODE_BGFX; - else if (strcmp(stemp, "bgfx") == 0) - video_config.mode = VIDEO_MODE_BGFX; - else if (strcmp(stemp, "none") == 0) - { - video_config.mode = VIDEO_MODE_NONE; - if (!emulator_info::standalone() && options().seconds_to_run() == 0) - osd_printf_warning("Warning: -video none doesn't make much sense without -seconds_to_run\n"); - } - else - { - osd_printf_warning("Invalid video value %s; reverting to gdi\n", stemp); - video_config.mode = VIDEO_MODE_GDI; - } - video_config.waitvsync = options().wait_vsync(); - video_config.syncrefresh = options().sync_refresh(); - video_config.triplebuf = options().triple_buffer(); - video_config.switchres = options().switch_res(); - - if (video_config.prescale < 1 || video_config.prescale > 8) - { - osd_printf_warning("Invalid prescale option, reverting to '1'\n"); - video_config.prescale = 1; - } -} - - -//============================================================ -// get_resolution -//============================================================ - -static void get_resolution(const char *defdata, const char *data, osd_window_config *config, int report_error) -{ - config->width = config->height = config->depth = config->refresh = 0; - if (strcmp(data, OSDOPTVAL_AUTO) == 0) - { - if (strcmp(defdata, OSDOPTVAL_AUTO) == 0) - return; - data = defdata; - } - - if (sscanf(data, "%dx%dx%d", &config->width, &config->height, &config->depth) < 2 && report_error) - osd_printf_error("Illegal resolution value = %s\n", data); - - const char * at_pos = strchr(data, '@'); - if (at_pos) - if (sscanf(at_pos + 1, "%d", &config->refresh) < 1 && report_error) - osd_printf_error("Illegal refresh rate in resolution value = %s\n", data); -} diff --git a/src/osd/uwp/video.h b/src/osd/uwp/video.h deleted file mode 100644 index 5725a2bb0d4..00000000000 --- a/src/osd/uwp/video.h +++ /dev/null @@ -1,19 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// video.h - UWP implementation of MAME video routines -// -//============================================================ - -#ifndef __UWP_VIDEO__ -#define __UWP_VIDEO__ - -#include "modules/osdhelper.h" - -inline osd_rect RECT_to_osd_rect(const RECT &r) -{ - return osd_rect(r.left, r.top, r.right - r.left, r.bottom - r.top); -} - -#endif diff --git a/src/osd/uwp/window.cpp b/src/osd/uwp/window.cpp deleted file mode 100644 index ae89ac7cac8..00000000000 --- a/src/osd/uwp/window.cpp +++ /dev/null @@ -1,1076 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// window.c - Win32 window handling -// -//============================================================ - -#define LOG_TEMP_PAUSE 0 - -// Needed for RAW Input -#define WM_INPUT 0x00FF - -// standard C headers -#include - -#include -#include -#include -#include - -// MAME headers -#include "emu.h" -#include "uiinput.h" -#include "ui/uimain.h" - -// MAMEOS headers -#include "winmain.h" -#include "window.h" -#include "video.h" -#include "winutf8.h" - -#include "winutil.h" - -#include "modules/monitor/monitor_common.h" - -#include -using namespace Windows::UI::Core; - -#include "modules/render/drawbgfx.h" -#include "modules/render/drawnone.h" - -#define NOT_ALREADY_DOWN(x) (x & 0x40000000) == 0 -#define SCAN_CODE(x) ((x >> 16) & 0xff) -#define IS_EXTENDED(x) (0x01000000 & x) -#define MAKE_DI_SCAN(scan, isextended) (scan & 0x7f) | (isextended ? 0x80 : 0x00) -#define WINOSD(machine) downcast(&machine.osd()) - -//============================================================ -// PARAMETERS -//============================================================ - -// window styles -#define WINDOW_STYLE WS_OVERLAPPEDWINDOW -#define WINDOW_STYLE_EX 0 - -// debugger window styles -#define DEBUG_WINDOW_STYLE WS_OVERLAPPED -#define DEBUG_WINDOW_STYLE_EX 0 - -// full screen window styles -#define FULLSCREEN_STYLE WS_POPUP -#define FULLSCREEN_STYLE_EX WS_EX_TOPMOST - -// minimum window dimension -#define MIN_WINDOW_DIM 200 - -// custom window messages -#define WM_USER_REDRAW (WM_USER + 2) -#define WM_USER_SET_FULLSCREEN (WM_USER + 3) -#define WM_USER_SET_MAXSIZE (WM_USER + 4) -#define WM_USER_SET_MINSIZE (WM_USER + 5) - - - -//============================================================ -// GLOBAL VARIABLES -//============================================================ - -static DWORD main_threadid; - -// actual physical resolution -static int win_physical_width; -static int win_physical_height; - - - -//============================================================ -// LOCAL VARIABLES -//============================================================ - -// event handling -static std::chrono::system_clock::time_point last_event_check; - -// debugger -static int in_background; - -static int ui_temp_pause; -static int ui_temp_was_paused; - -static HANDLE window_thread; -static DWORD window_threadid; - -static std::chrono::time_point last_update_time; - -static HANDLE ui_pause_event; - -//============================================================ -// window_init -// (main thread) -//============================================================ - -bool windows_osd_interface::window_init() -{ - // get the main thread ID before anything else - main_threadid = GetCurrentThreadId(); - - // create an event to signal UI pausing - ui_pause_event = CreateEvent(nullptr, TRUE, FALSE, nullptr); - if (!ui_pause_event) - fatalerror("Failed to create pause event\n"); - - window_thread = GetCurrentThread(); - window_threadid = main_threadid; - - const int fallbacks[VIDEO_MODE_COUNT] = { - -1, // NONE -> no fallback - VIDEO_MODE_NONE, // GDI -> NONE - -1 // No SOFT on Windows OSD - }; - - int current_mode = video_config.mode; - while (current_mode != VIDEO_MODE_NONE) - { - bool error = false; - switch(current_mode) - { - case VIDEO_MODE_NONE: - error = renderer_none::init(machine()); - break; - case VIDEO_MODE_BGFX: - error = renderer_bgfx::init(machine()); - break; - default: - fatalerror("Unknown video mode."); - break; - } - if (error) - { - current_mode = fallbacks[current_mode]; - } - else - { - break; - } - } - video_config.mode = current_mode; - - return true; -} - -void windows_osd_interface::update_slider_list() -{ - for (auto window : osd_common_t::s_window_list) - { - // check if any window has dirty sliders - if (window->has_renderer() && window->renderer().sliders_dirty()) - { - build_slider_list(); - return; - } - } -} - -int windows_osd_interface::window_count() -{ - return osd_common_t::s_window_list.size(); -} - -void windows_osd_interface::build_slider_list() -{ - m_sliders.clear(); - - for (auto window : osd_common_t::s_window_list) - { - if (window->has_renderer()) - { - // take the sliders of the first window - std::vector window_sliders = window->renderer().get_slider_list(); - m_sliders.insert(m_sliders.end(), window_sliders.begin(), window_sliders.end()); - } - } -} - -void windows_osd_interface::add_audio_to_recording(const int16_t *buffer, int samples_this_frame) -{ - auto window = osd_common_t::s_window_list.front(); // We only record on the first window - if (window != nullptr) - { - window->renderer().add_audio_to_recording(buffer, samples_this_frame); - } -} - -//============================================================ -// winwindow_exit -// (main thread) -//============================================================ - -void windows_osd_interface::window_exit() -{ - assert(GetCurrentThreadId() == main_threadid); - - // if we hid the cursor during the emulation, show it - if (!osd_common_t::s_window_list.empty()) - osd_common_t::s_window_list.front()->show_pointer(); - - // free all the windows - while (!osd_common_t::s_window_list.empty()) - { - auto window = osd_common_t::s_window_list.front(); - - // Destroy removes it from the list also - window->destroy(); - } - - switch(video_config.mode) - { - case VIDEO_MODE_NONE: - renderer_none::exit(); - break; - case VIDEO_MODE_BGFX: - renderer_bgfx::exit(); - break; - default: - break; - } - - // kill the UI pause event - if (ui_pause_event) - CloseHandle(ui_pause_event); -} - -uwp_window_info::uwp_window_info( - running_machine &machine, - int index, - std::shared_ptr monitor, - const osd_window_config *config) : osd_window_t(machine, index, std::move(monitor), *config), - m_init_state(0), - m_startmaximized(0), - m_isminimized(0), - m_ismaximized(0), - m_fullscreen_safe(0), - m_aspect(0), - m_targetview(0), - m_targetorient(0), - m_targetvismask(0), - m_lastclicktime(std::chrono::system_clock::time_point::min()), - m_lastclickx(0), - m_lastclicky(0) -{ - m_non_fullscreen_bounds.left = 0; - m_non_fullscreen_bounds.top = 0; - m_non_fullscreen_bounds.right = 0; - m_non_fullscreen_bounds.bottom = 0; - - m_fullscreen = !video_config.windowed; - m_prescale = video_config.prescale; -} - -POINT uwp_window_info::s_saved_cursor_pos = { -1, -1 }; - -CoreCursor^ uwp_window_info::s_cursor = nullptr; - -void uwp_window_info::capture_pointer() -{ - platform_window()->SetPointerCapture(); -} - -void uwp_window_info::release_pointer() -{ - platform_window()->ReleasePointerCapture(); -} - -void uwp_window_info::hide_pointer() -{ - auto window = platform_window(); - uwp_window_info::s_cursor = window->PointerCursor; - window->PointerCursor = nullptr; -} - -void uwp_window_info::show_pointer() -{ - auto window = platform_window(); - window->PointerCursor = uwp_window_info::s_cursor; -} - -//============================================================ -// winwindow_process_events_periodic -// (main thread) -//============================================================ - -void winwindow_process_events_periodic(running_machine &machine) -{ - auto currticks = std::chrono::system_clock::now(); - - assert(GetCurrentThreadId() == main_threadid); - - // update once every 1/8th of a second - if (currticks - last_event_check < std::chrono::milliseconds(1000 / 8)) - return; - winwindow_process_events(machine, true, false); -} - -//============================================================ -// winwindow_has_focus -// (main or window thread) -//============================================================ - -bool winwindow_has_focus(void) -{ - // For now always act like we have focus - return true; -} - -//============================================================ -// winwindow_process_events -// (main thread) -//============================================================ - -void winwindow_process_events(running_machine &machine, bool ingame, bool nodispatch) -{ -// MSG message; - - assert(GetCurrentThreadId() == main_threadid); - - // remember the last time we did this - last_event_check = std::chrono::system_clock::now(); - - try - { - CoreWindow^ window = CoreWindow::GetForCurrentThread(); - window->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); - } - catch (Platform::DisconnectedException^) - { - // This can get thrown when the window is being destroyed - } -} - - -//============================================================ -// winwindow_video_window_create -// (main thread) -//============================================================ - -void uwp_window_info::create(running_machine &machine, int index, std::shared_ptr monitor, const osd_window_config *config) -{ - assert(GetCurrentThreadId() == main_threadid); - - // allocate a new window object - auto window = std::make_shared(machine, index, monitor, config); - - // set main window - if (window->index() > 0) - { - for (auto w : osd_common_t::s_window_list) - { - if (w->index() == 0) - { - window->set_main_window(std::static_pointer_cast(w)); - break; - } - } - } - else - { - // We must be the main window - window->set_main_window(window); - } - - // see if we are safe for fullscreen - window->m_fullscreen_safe = TRUE; - for (auto win : osd_common_t::s_window_list) - if (win->monitor() == monitor.get()) - window->m_fullscreen_safe = FALSE; - - window->create_target(); - - // remember the current values in case they change - window->m_targetview = window->target()->view(); - window->m_targetorient = window->target()->orientation(); - window->m_targetlayerconfig = window->target()->layer_config(); - window->m_targetvismask = window->target()->visibility_mask(); - - // set the initial maximized state - window->m_startmaximized = downcast(machine.options()).maximize(); - - window->m_init_state = window->complete_create() ? -1 : 1; - - // handle error conditions - if (window->m_init_state == -1) - fatalerror("Unable to complete window creation\n"); -} - -//============================================================ -// winwindow_video_window_destroy -// (main thread) -//============================================================ - -void uwp_window_info::complete_destroy() -{ - assert(GetCurrentThreadId() == main_threadid); - - // destroy the window -// if (platform_window() != nullptr) - // DestroyWindow(platform_window()); -} - - - -//============================================================ -// winwindow_video_window_update -// (main thread) -//============================================================ - -void uwp_window_info::update() -{ - assert(GetCurrentThreadId() == main_threadid); - - // see if the target has changed significantly in window mode - unsigned const targetview = target()->view(); - int const targetorient = target()->orientation(); - render_layer_config const targetlayerconfig = target()->layer_config(); - u32 const targetvismask = target()->visibility_mask(); - if (targetview != m_targetview || targetorient != m_targetorient || targetlayerconfig != m_targetlayerconfig || targetvismask != m_targetvismask) - { - m_targetview = targetview; - m_targetorient = targetorient; - m_targetlayerconfig = targetlayerconfig; - m_targetvismask = targetvismask; - - // in window mode, reminimize/maximize - if (!fullscreen()) - { - //if (m_isminimized) - //SendMessage(platform_window(), WM_USER_SET_MINSIZE, 0, 0); - //if (m_ismaximized) -// SendMessage(platform_window(), WM_USER_SET_MAXSIZE, 0, 0); - } - } - - // if we're visible and running and not in the middle of a resize, draw - if (platform_window() != nullptr && target() != nullptr && has_renderer()) - { - bool got_lock = true; - auto clock = std::chrono::high_resolution_clock(); - - // only block if we're throttled - if (machine().video().throttled() || clock.now() - last_update_time > std::chrono::milliseconds(250)) - m_render_lock.lock(); - else - got_lock = m_render_lock.try_lock(); - - // only render if we were able to get the lock - if (got_lock) - { - render_primitive_list *primlist; - - // don't hold the lock; we just used it to see if rendering was still happening - m_render_lock.unlock(); - - // ensure the target bounds are up-to-date, and then get the primitives - primlist = renderer().get_primitives(); - - // post a redraw request with the primitive list as a parameter - last_update_time = clock.now(); - - // Actually perform the redraw - m_primlist = primlist; - draw_video_contents(false); - } - } -} - -//============================================================ -// draw_video_contents -// (window thread) -//============================================================ - -void uwp_window_info::draw_video_contents(bool update) -{ - assert(GetCurrentThreadId() == window_threadid); - - std::lock_guard lock(m_render_lock); - - // if we're iconic, don't bother - if (platform_window() != nullptr) - { - // if no bitmap, just fill - if (m_primlist == nullptr) - { - // For now do nothing, eventually we need to clear the window - } - - // otherwise, render with our drawing system - else - { - renderer().draw(update); - } - } -} - - -//============================================================ -// winwindow_ui_pause -// (main thread) -//============================================================ - -void winwindow_ui_pause(running_machine &machine, int pause) -{ - int old_temp_pause = ui_temp_pause; - - assert(GetCurrentThreadId() == main_threadid); - - // if we're pausing, increment the pause counter - if (pause) - { - // if we're the first to pause, we have to actually initiate it - if (ui_temp_pause++ == 0) - { - // only call mame_pause if we weren't already paused due to some external reason - ui_temp_was_paused = machine.paused(); - if (!ui_temp_was_paused) - machine.pause(); - - SetEvent(ui_pause_event); - } - } - - // if we're resuming, decrement the pause counter - else - { - // if we're the last to resume, unpause MAME - if (--ui_temp_pause == 0) - { - // but only do it if we were the ones who initiated it - if (!ui_temp_was_paused) - machine.resume(); - - ResetEvent(ui_pause_event); - } - } - - if (LOG_TEMP_PAUSE) - osd_printf_verbose("winwindow_ui_pause(): %d --> %d\n", old_temp_pause, ui_temp_pause); -} - - - -//============================================================ -// winwindow_ui_is_paused -//============================================================ - -int winwindow_ui_is_paused(running_machine &machine) -{ - return machine.paused() && ui_temp_was_paused; -} - - - -//============================================================ -// wnd_extra_width -// (window thread) -//============================================================ - -int uwp_window_info::wnd_extra_width() -{ - RECT temprect = { 100, 100, 200, 200 }; - if (fullscreen()) - return 0; - //AdjustWindowRectEx(&temprect, WINDOW_STYLE, win_has_menu(), WINDOW_STYLE_EX); - return rect_width(&temprect) - 100; -} - - - -//============================================================ -// wnd_extra_height -// (window thread) -//============================================================ - -int uwp_window_info::wnd_extra_height() -{ - RECT temprect = { 100, 100, 200, 200 }; - if (fullscreen()) - return 0; - //AdjustWindowRectEx(&temprect, WINDOW_STYLE, win_has_menu(), WINDOW_STYLE_EX); - return rect_height(&temprect) - 100; -} - - -//============================================================ -// complete_create -// (window thread) -//============================================================ - -int uwp_window_info::complete_create() -{ - int tempwidth, tempheight; - - assert(GetCurrentThreadId() == window_threadid); - - // get the monitor bounds - osd_rect monitorbounds = monitor()->position_size(); - - auto coreWindow = Platform::Agile(CoreWindow::GetForCurrentThread()); - set_platform_window(coreWindow); - - // skip the positioning stuff for -video none */ - if (video_config.mode == VIDEO_MODE_NONE) - { - set_renderer(osd_renderer::make_for_type(video_config.mode, shared_from_this())); - renderer().create(); - return 0; - } - - // adjust the window position to the initial width/height - tempwidth = (m_win_config.width != 0) ? m_win_config.width : 640; - tempheight = (m_win_config.height != 0) ? m_win_config.height : 480; - - // maximum or minimize as appropriate - if (m_startmaximized) - maximize_window(); - else - minimize_window(); - adjust_window_position_after_major_change(); - - // show the window - if (!fullscreen() || m_fullscreen_safe) - { - set_renderer(osd_renderer::make_for_type(video_config.mode, shared_from_this())); - if (renderer().create()) - return 1; - - } - - return 0; -} - - -//============================================================ -// constrain_to_aspect_ratio -// (window thread) -//============================================================ - -osd_rect uwp_window_info::constrain_to_aspect_ratio(const osd_rect &rect, int adjustment) -{ - assert(GetCurrentThreadId() == window_threadid); - - int32_t extrawidth = wnd_extra_width(); - int32_t extraheight = wnd_extra_height(); - int32_t propwidth, propheight; - int32_t minwidth, minheight; - int32_t maxwidth, maxheight; - int32_t viswidth, visheight; - int32_t adjwidth, adjheight; - float pixel_aspect; - - auto monitor = monitor_from_rect(&rect); - - // Sometimes this gets called when monitors have already been torn down - // In that the case, just return the unmodified rect - if (monitor == nullptr) - return rect; - - // do not constrain aspect ratio for integer scaled views - if (target()->scale_mode() != SCALE_FRACTIONAL) - return rect; - - // get the pixel aspect ratio for the target monitor - pixel_aspect = monitor->pixel_aspect(); - - // determine the proposed width/height - propwidth = rect.width() - extrawidth; - propheight = rect.height() - extraheight; - - // based on which edge we are adjusting, take either the width, height, or both as gospel - // and scale to fit using that as our parameter - switch (adjustment) - { - case WMSZ_BOTTOM: - case WMSZ_TOP: - target()->compute_visible_area(10000, propheight, pixel_aspect, target()->orientation(), propwidth, propheight); - break; - - case WMSZ_LEFT: - case WMSZ_RIGHT: - target()->compute_visible_area(propwidth, 10000, pixel_aspect, target()->orientation(), propwidth, propheight); - break; - - default: - target()->compute_visible_area(propwidth, propheight, pixel_aspect, target()->orientation(), propwidth, propheight); - break; - } - - // get the minimum width/height for the current layout - target()->compute_minimum_size(minwidth, minheight); - - // clamp against the absolute minimum - propwidth = std::max(propwidth, MIN_WINDOW_DIM); - propheight = std::max(propheight, MIN_WINDOW_DIM); - - // clamp against the minimum width and height - propwidth = std::max(propwidth, minwidth); - propheight = std::max(propheight, minheight); - - // clamp against the maximum (fit on one screen for full screen mode) - if (fullscreen()) - { - maxwidth = monitor->position_size().width() - extrawidth; - maxheight = monitor->position_size().height() - extraheight; - } - else - { - maxwidth = monitor->usuable_position_size().width() - extrawidth; - maxheight = monitor->usuable_position_size().height() - extraheight; - - // further clamp to the maximum width/height in the window - if (m_win_config.width != 0) - maxwidth = std::min(maxwidth, m_win_config.width + extrawidth); - if (m_win_config.height != 0) - maxheight = std::min(maxheight, m_win_config.height + extraheight); - } - - // clamp to the maximum - propwidth = std::min(propwidth, maxwidth); - propheight = std::min(propheight, maxheight); - - // compute the visible area based on the proposed rectangle - target()->compute_visible_area(propwidth, propheight, pixel_aspect, target()->orientation(), viswidth, visheight); - - // compute the adjustments we need to make - adjwidth = (viswidth + extrawidth) - rect.width(); - adjheight = (visheight + extraheight) - rect.height(); - - // based on which corner we're adjusting, constrain in different ways - osd_rect ret(rect); - - switch (adjustment) - { - case WMSZ_BOTTOM: - case WMSZ_BOTTOMRIGHT: - case WMSZ_RIGHT: - ret = rect.resize(rect.width() + adjwidth, rect.height() + adjheight); - break; - - case WMSZ_BOTTOMLEFT: - ret = rect.move_by(-adjwidth, 0).resize(rect.width() + adjwidth, rect.height() + adjheight); - break; - - case WMSZ_LEFT: - case WMSZ_TOPLEFT: - case WMSZ_TOP: - ret = rect.move_by(-adjwidth, -adjheight).resize(rect.width() + adjwidth, rect.height() + adjheight); - break; - - case WMSZ_TOPRIGHT: - ret = rect.move_by(0, -adjheight).resize(rect.width() + adjwidth, rect.height() + adjheight); - break; - } - return ret; -} - - - -//============================================================ -// get_min_bounds -// (window thread) -//============================================================ - -osd_dim uwp_window_info::get_min_bounds(int constrain) -{ - int32_t minwidth, minheight; - - //assert(GetCurrentThreadId() == window_threadid); - - // get the minimum target size - target()->compute_minimum_size(minwidth, minheight); - - // expand to our minimum dimensions - if (minwidth < MIN_WINDOW_DIM) - minwidth = MIN_WINDOW_DIM; - if (minheight < MIN_WINDOW_DIM) - minheight = MIN_WINDOW_DIM; - - // account for extra window stuff - minwidth += wnd_extra_width(); - minheight += wnd_extra_height(); - - // if we want it constrained, figure out which one is larger - if (constrain && target()->scale_mode() == SCALE_FRACTIONAL) - { - // first constrain with no height limit - osd_rect test1(0,0,minwidth,10000); - test1 = constrain_to_aspect_ratio(test1, WMSZ_BOTTOMRIGHT); - - // then constrain with no width limit - osd_rect test2(0,0,10000,minheight); - test2 = constrain_to_aspect_ratio(test2, WMSZ_BOTTOMRIGHT); - - // pick the larger - if (test1.width() > test2.width()) - { - minwidth = test1.width(); - minheight = test1.height(); - } - else - { - minwidth = test2.width(); - minheight = test2.height(); - } - } - - return osd_dim(minwidth, minheight); -} - - - -//============================================================ -// get_max_bounds -// (window thread) -//============================================================ - -osd_dim uwp_window_info::get_max_bounds(int constrain) -{ - //assert(GetCurrentThreadId() == window_threadid); - - // compute the maximum client area - //monitor()->refresh(); - osd_rect maximum = monitor()->usuable_position_size(); - - // clamp to the window's max - int tempw = maximum.width(); - int temph = maximum.height(); - if (m_win_config.width != 0) - { - int temp = m_win_config.width + wnd_extra_width(); - if (temp < maximum.width()) - tempw = temp; - } - if (m_win_config.height != 0) - { - int temp = m_win_config.height + wnd_extra_height(); - if (temp < maximum.height()) - temph = temp; - } - - maximum = maximum.resize(tempw, temph); - - // constrain to fit - if (constrain && target()->scale_mode() == SCALE_FRACTIONAL) - maximum = constrain_to_aspect_ratio(maximum, WMSZ_BOTTOMRIGHT); - - return maximum.dim(); -} - - - -//============================================================ -// update_minmax_state -// (window thread) -//============================================================ - -void uwp_window_info::update_minmax_state() -{ - assert(GetCurrentThreadId() == window_threadid); - - if (!fullscreen()) - { - RECT bounds; - - // compare the maximum bounds versus the current bounds - const bool keep_aspect = keepaspect(); - osd_dim minbounds = get_min_bounds(keep_aspect); - osd_dim maxbounds = get_max_bounds(keep_aspect); - //GetWindowRect(platform_window(), &bounds); - - // if either the width or height matches, we were maximized - m_isminimized = (rect_width(&bounds) == minbounds.width()) || - (rect_height(&bounds) == minbounds.height()); - m_ismaximized = (rect_width(&bounds) == maxbounds.width()) || - (rect_height(&bounds) == maxbounds.height()); - } - else - { - m_isminimized = FALSE; - m_ismaximized = TRUE; - } -} - - - -//============================================================ -// minimize_window -// (window thread) -//============================================================ - -void uwp_window_info::minimize_window() -{ - assert(GetCurrentThreadId() == window_threadid); - - osd_dim newsize = get_min_bounds(keepaspect()); - - // get the window rect - //RECT bounds; - //GetWindowRect(platform_window(), &bounds); - - //osd_rect newrect(bounds.left, bounds.top, newsize ); - - - //SetWindowPos(platform_window(), nullptr, newrect.left(), newrect.top(), newrect.width(), newrect.height(), SWP_NOZORDER); -} - -//============================================================ -// maximize_window -// (window thread) -//============================================================ - -void uwp_window_info::maximize_window() -{ - assert(GetCurrentThreadId() == window_threadid); - - osd_dim newsize = get_max_bounds(keepaspect()); - - // center within the work area - osd_rect work = monitor()->usuable_position_size(); - osd_rect newrect = osd_rect(work.left() + (work.width() - newsize.width()) / 2, - work.top() + (work.height() - newsize.height()) / 2, - newsize); - - //SetWindowPos(platform_window(), nullptr, newrect.left(), newrect.top(), newrect.width(), newrect.height(), SWP_NOZORDER); -} - - - -//============================================================ -// adjust_window_position_after_major_change -// (window thread) -//============================================================ - -void uwp_window_info::adjust_window_position_after_major_change() -{ - RECT oldrect; - - assert(GetCurrentThreadId() == window_threadid); - - // get the current size - //GetWindowRect(platform_window(), &oldrect); - osd_rect newrect = RECT_to_osd_rect(oldrect); - - // adjust the window size so the client area is what we want - if (!fullscreen()) - { - // constrain the existing size to the aspect ratio - if (keepaspect()) - newrect = constrain_to_aspect_ratio(newrect, WMSZ_BOTTOMRIGHT); - } - - // in full screen, make sure it covers the primary display - else - { - std::shared_ptr monitor = monitor_from_rect(nullptr); - newrect = monitor->position_size(); - } - - // adjust the position if different - if (oldrect.left != newrect.left() || oldrect.top != newrect.top() || - oldrect.right != newrect.right() || oldrect.bottom != newrect.bottom()) - //SetWindowPos(platform_window(), fullscreen() ? HWND_TOPMOST : HWND_TOP, - // newrect.left(), newrect.top(), - //newrect.width(), newrect.height(), 0); - - // take note of physical window size (used for lightgun coordinate calculation) - if (index() == 0) - { - win_physical_width = newrect.width(); - win_physical_height = newrect.height(); - osd_printf_verbose("Physical width %d, height %d\n",win_physical_width,win_physical_height); - } -} - - -//============================================================ -// set_fullscreen -// (window thread) -//============================================================ - -void uwp_window_info::set_fullscreen(int fullscreen) -{ - assert(GetCurrentThreadId() == window_threadid); - - // if we're in the right state, punt - if (this->fullscreen() == fullscreen) - return; - m_fullscreen = fullscreen; - - // reset UI to main menu - machine().ui().menu_reset(); - - // kill off the drawers - renderer_reset(); - - // hide ourself - //ShowWindow(platform_window(), SW_HIDE); - - // configure the window if non-fullscreen - if (!fullscreen) - { - // adjust the style - //SetWindowLong(platform_window(), GWL_STYLE, WINDOW_STYLE); - //SetWindowLong(platform_window(), GWL_EXSTYLE, WINDOW_STYLE_EX); - //SetWindowPos(platform_window(), nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); - - // force to the bottom, then back on top - //SetWindowPos(platform_window(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - //SetWindowPos(platform_window(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - - //// if we have previous non-fullscreen bounds, use those - //if (m_non_fullscreen_bounds.right != m_non_fullscreen_bounds.left) - //{ - // SetWindowPos(platform_window(), HWND_TOP, m_non_fullscreen_bounds.left, m_non_fullscreen_bounds.top, - // rect_width(&m_non_fullscreen_bounds), rect_height(&m_non_fullscreen_bounds), - // SWP_NOZORDER); - //} - // - //// otherwise, set a small size and maximize from there - //else - //{ - // SetWindowPos(platform_window(), HWND_TOP, 0, 0, MIN_WINDOW_DIM, MIN_WINDOW_DIM, SWP_NOZORDER); - // maximize_window(); - //} - } - - // configure the window if fullscreen - else - { - // save the bounds - //GetWindowRect(platform_window(), &m_non_fullscreen_bounds); - // - //// adjust the style - //SetWindowLong(platform_window(), GWL_STYLE, FULLSCREEN_STYLE); - //SetWindowLong(platform_window(), GWL_EXSTYLE, FULLSCREEN_STYLE_EX); - //SetWindowPos(platform_window(), nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); - // - //// set topmost - //SetWindowPos(platform_window(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - } - - // adjust the window to compensate for the change - adjust_window_position_after_major_change(); - - // show ourself - if (!this->fullscreen() || m_fullscreen_safe) - { - //if (video_config.mode != VIDEO_MODE_NONE) - //ShowWindow(platform_window(), SW_SHOW); - - set_renderer(osd_renderer::make_for_type(video_config.mode, shared_from_this())); - if (renderer().create()) - exit(1); - } - - // ensure we're still adjusted correctly - adjust_window_position_after_major_change(); -} - diff --git a/src/osd/uwp/window.h b/src/osd/uwp/window.h deleted file mode 100644 index e581ec71246..00000000000 --- a/src/osd/uwp/window.h +++ /dev/null @@ -1,151 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles, Brad Hughes -//============================================================ -// -// window.h - UWP window handling -// -//============================================================ - -#ifndef __UWP_WINDOW__ -#define __UWP_WINDOW__ - -// standard windows headers -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "render.h" - -#include "modules/osdwindow.h" - -//============================================================ -// PARAMETERS -//============================================================ - - -//============================================================ -// CONSTANTS -//============================================================ - -#define RESIZE_STATE_NORMAL 0 -#define RESIZE_STATE_RESIZING 1 -#define RESIZE_STATE_PENDING 2 - - - -//============================================================ -// TYPE DEFINITIONS -//============================================================ - -class uwp_window_info : public osd_window_t> -{ -public: - uwp_window_info(running_machine &machine, int index, std::shared_ptr monitor, const osd_window_config *config); - - void update() override; - - virtual osd_dim get_size() override - { - auto bounds = platform_window()->Bounds; - return osd_dim(bounds.Width, bounds.Height); - } - - bool win_has_menu() override - { - return false; - } - - void capture_pointer() override; - void release_pointer() override; - void show_pointer() override; - void hide_pointer() override; - - void complete_destroy() override; - - // static - - static void create(running_machine &machine, int index, std::shared_ptr monitor, const osd_window_config *config); - - // member variables - - volatile int m_init_state; - - // window handle and info - RECT m_non_fullscreen_bounds; - int m_startmaximized; - int m_isminimized; - int m_ismaximized; - - // monitor info - int m_fullscreen_safe; - float m_aspect; - - // rendering info - std::mutex m_render_lock; - unsigned m_targetview; - int m_targetorient; - render_layer_config m_targetlayerconfig; - u32 m_targetvismask; - - // input info - std::chrono::system_clock::time_point m_lastclicktime; - int m_lastclickx; - int m_lastclicky; - -private: - int complete_create(); - void draw_video_contents(bool update); - int wnd_extra_width(); - int wnd_extra_height(); - osd_rect constrain_to_aspect_ratio(const osd_rect &rect, int adjustment); - osd_dim get_min_bounds(int constrain); - osd_dim get_max_bounds(int constrain); - void update_minmax_state(); - void minimize_window(); - void maximize_window(); - void adjust_window_position_after_major_change(); - void set_fullscreen(int fullscreen); - - static POINT s_saved_cursor_pos; - - static Windows::UI::Core::CoreCursor^ s_cursor; -}; - -struct osd_draw_callbacks -{ - osd_renderer *(*create)(osd_window *window); - void (*exit)(void); -}; - - -//============================================================ -// PROTOTYPES -//============================================================ - -bool winwindow_has_focus(void); -void winwindow_process_events(running_machine &machine, bool ingame, bool nodispatch); -void winwindow_process_events_periodic(running_machine &machine); - -//============================================================ -// rect_width / rect_height -//============================================================ - -static inline int rect_width(const RECT *rect) -{ - return rect->right - rect->left; -} - - -static inline int rect_height(const RECT *rect) -{ - return rect->bottom - rect->top; -} - -#endif -- cgit v1.2.3 From 8aa5c5a29c5af282c8c89a489f91617f59a97706 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:45:04 +0200 Subject: Remove OSD_UWP from rest of code --- scripts/src/osd/sdl.lua | 6 - scripts/src/osd/windows.lua | 1 - src/osd/modules/diagnostics/diagnostics_win32.cpp | 3 - src/osd/modules/diagnostics/none.cpp | 5 - src/osd/modules/font/font_dwrite.cpp | 6 +- src/osd/modules/input/input_common.cpp | 27 +--- src/osd/modules/input/input_common.h | 6 - src/osd/modules/input/input_windows.cpp | 16 +-- src/osd/modules/input/input_xinput.cpp | 4 - src/osd/modules/lib/osdlib.h | 11 -- src/osd/modules/lib/osdlib_win32.cpp | 5 - src/osd/modules/monitor/monitor_dxgi.cpp | 18 +-- src/osd/modules/osdwindow.cpp | 2 +- src/osd/modules/osdwindow.h | 2 +- src/osd/modules/render/drawbgfx.cpp | 25 +--- src/osd/modules/render/drawnone.cpp | 8 -- src/osd/modules/sound/xaudio2_sound.cpp | 2 +- src/osd/strconv.cpp | 4 +- src/osd/windows/main.cpp | 34 ----- src/osd/windows/window.cpp | 36 ----- src/osd/windows/window.h | 12 -- src/osd/windows/winmain.cpp | 154 ---------------------- src/osd/windows/winmain.h | 30 ----- src/osd/windows/winutf8.cpp | 42 ++---- 24 files changed, 20 insertions(+), 439 deletions(-) delete mode 100644 src/osd/windows/main.cpp diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index fc8fab036d4..25ef22fd3a5 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -381,12 +381,6 @@ project ("osd_" .. _OPTIONS["osd"]) 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", diff --git a/scripts/src/osd/windows.lua b/scripts/src/osd/windows.lua index 2f77844d17a..2d5ca91cca6 100644 --- a/scripts/src/osd/windows.lua +++ b/scripts/src/osd/windows.lua @@ -217,7 +217,6 @@ project ("ocore_" .. _OPTIONS["osd"]) 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", diff --git a/src/osd/modules/diagnostics/diagnostics_win32.cpp b/src/osd/modules/diagnostics/diagnostics_win32.cpp index 27d9c96307d..b80bbdfcdba 100644 --- a/src/osd/modules/diagnostics/diagnostics_win32.cpp +++ b/src/osd/modules/diagnostics/diagnostics_win32.cpp @@ -16,7 +16,6 @@ // standard windows headers #include -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #include #include @@ -1098,6 +1097,4 @@ diagnostics_module * diagnostics_module::get_instance() return &s_instance; } -#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - #endif diff --git a/src/osd/modules/diagnostics/none.cpp b/src/osd/modules/diagnostics/none.cpp index 8a731fe9009..4663e8aa4d8 100644 --- a/src/osd/modules/diagnostics/none.cpp +++ b/src/osd/modules/diagnostics/none.cpp @@ -35,13 +35,8 @@ public: // Determine if diagnostics_none should be used based on OSD #if defined(OSD_WINDOWS) || defined(SDLMAME_WIN32) -#include -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #define USE_DIAG_NONE 0 // Desktop Windows #else -#define USE_DIAG_NONE 1 // Universal Windows -#endif -#else #define USE_DIAG_NONE 1 // SDL and others #endif diff --git a/src/osd/modules/font/font_dwrite.cpp b/src/osd/modules/font/font_dwrite.cpp index b8a60aee200..a1e63c2d870 100644 --- a/src/osd/modules/font/font_dwrite.cpp +++ b/src/osd/modules/font/font_dwrite.cpp @@ -9,7 +9,7 @@ #include "modules/osdmodule.h" #include "modules/lib/osdlib.h" -#if defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(OSD_WINDOWS) #include @@ -353,11 +353,7 @@ public: // accept qualifiers from the name std::string name(_name); if (name.compare("default") == 0) -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - name = "Tahoma"; -#else name = "Segoe UI"; -#endif bool bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0); bool italic = (strreplace(name, "[I]", "") + strreplace(name, "[i]", "") > 0); diff --git a/src/osd/modules/input/input_common.cpp b/src/osd/modules/input/input_common.cpp index 344d7f02f51..a04c46b6477 100644 --- a/src/osd/modules/input/input_common.cpp +++ b/src/osd/modules/input/input_common.cpp @@ -32,16 +32,13 @@ #include #define KEY_TRANS_ENTRY0(mame, sdlsc, sdlkey, disc, virtual, uwp, ascii, UI) { ITEM_ID_##mame, SDL_SCANCODE_ ## sdlsc, ascii, "ITEM_ID_"#mame, (char *) UI } #define KEY_TRANS_ENTRY1(mame, sdlsc, sdlkey, disc, virtual, uwp, ascii) { ITEM_ID_##mame, SDL_SCANCODE_ ## sdlsc, ascii, "ITEM_ID_"#mame, (char*) #mame } -#elif defined(OSD_UWP) -#define KEY_TRANS_ENTRY0(mame, sdlsc, sdlkey, disc, virtual, uwp, ascii, UI) { ITEM_ID_##mame, KEY_ ## disc, Windows::System::VirtualKey:: ## uwp, ascii, "ITEM_ID_"#mame, (char *) UI } -#define KEY_TRANS_ENTRY1(mame, sdlsc, sdlkey, disc, virtual, uwp, ascii) { ITEM_ID_##mame, KEY_ ## disc, Windows::System::VirtualKey:: ## uwp, ascii, "ITEM_ID_"#mame, (char*) #mame } #else // osd mini #endif // FIXME: sdl_key can be removed from the table below. It is no longer used. -#if defined(OSD_WINDOWS) || defined(OSD_SDL) || defined(OSD_UWP) +#if defined(OSD_WINDOWS) || defined(OSD_SDL) key_trans_entry keyboard_trans_table::s_default_table[] = { // MAME key sdl scancode sdl key di scancode virtual key uwp vkey ascii ui @@ -227,7 +224,7 @@ input_item_id keyboard_trans_table::lookup_mame_code(const char *scode) const } // Windows specific lookup methods -#if defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(OSD_WINDOWS) input_item_id keyboard_trans_table::map_di_scancode_to_itemid(int scancode) const { @@ -242,10 +239,6 @@ input_item_id keyboard_trans_table::map_di_scancode_to_itemid(int scancode) cons return ITEM_ID_OTHER_SWITCH; } -#endif - -#if defined(OSD_WINDOWS) - //============================================================ // wininput_vkey_for_mame_code //============================================================ @@ -268,22 +261,6 @@ int keyboard_trans_table::vkey_for_mame_code(input_code code) const #endif -#if defined(OSD_UWP) - -const char* keyboard_trans_table::ui_label_for_mame_key(input_item_id itemid) const -{ - // scan the table for a match - for (int tablenum = 0; tablenum < m_table_size; tablenum++) - if (m_table[tablenum].mame_key == itemid) - return m_table[tablenum].ui_name; - - // We didn't find one - return nullptr; -} - -#endif - - int input_module_base::init(const osd_options &options) { m_options = &options; diff --git a/src/osd/modules/input/input_common.h b/src/osd/modules/input/input_common.h index bddcf9b6384..49c4e768dcf 100644 --- a/src/osd/modules/input/input_common.h +++ b/src/osd/modules/input/input_common.h @@ -360,9 +360,6 @@ struct key_trans_entry { #elif defined(OSD_WINDOWS) int scan_code; unsigned char virtual_key; -#elif defined(OSD_UWP) - int scan_code; - Windows::System::VirtualKey virtual_key; #endif char ascii_key; @@ -396,9 +393,6 @@ public: #if defined(OSD_WINDOWS) input_item_id map_di_scancode_to_itemid(int di_scancode) const; int vkey_for_mame_code(input_code code) const; -#elif defined(OSD_UWP) - input_item_id map_di_scancode_to_itemid(int di_scancode) const; - const char* ui_label_for_mame_key(input_item_id code) const; #endif static keyboard_trans_table& instance() diff --git a/src/osd/modules/input/input_windows.cpp b/src/osd/modules/input/input_windows.cpp index 9432aab83a7..b00d5570ca2 100644 --- a/src/osd/modules/input/input_windows.cpp +++ b/src/osd/modules/input/input_windows.cpp @@ -8,7 +8,7 @@ #include "input_module.h" -#if defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(OSD_WINDOWS) // MAME headers #include "emu.h" @@ -81,23 +81,11 @@ void windows_osd_interface::customize_input_type_list(std::vector UI_CONFIGURE (Menu) - case IPT_UI_CONFIGURE: - entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::or_code, JOYCODE_SELECT, JOYCODE_BUTTON3); - break; - - // UWP: Hotkey Select + Start => CANCEL - case IPT_UI_CANCEL: - entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ESC, input_seq::or_code, JOYCODE_SELECT, JOYCODE_START); - break; -#endif // configurable UI mode switch case IPT_UI_TOGGLE_UI: uimode = options().ui_mode_key(); @@ -163,4 +151,4 @@ void windows_osd_interface::customize_input_type_list(std::vectorbind(#fname) #define OSD_DYNAMIC_CALL(fname, ...) (*m_##fname##_pfn) ( __VA_ARGS__ ) #define OSD_DYNAMIC_API_TEST(fname) (m_##fname##_pfn != nullptr) -#else - -#define OSD_DYNAMIC_API(apiname, ...) -#define OSD_DYNAMIC_API_FN(apiname, ret, conv, fname, ...) -#define OSD_DYNAMIC_CALL(fname, ...) fname( __VA_ARGS__ ) -#define OSD_DYNAMIC_API_TEST(fname) (true) - -#endif - #endif /* __OSDLIB__ */ diff --git a/src/osd/modules/lib/osdlib_win32.cpp b/src/osd/modules/lib/osdlib_win32.cpp index b75500deee9..174dc769760 100644 --- a/src/osd/modules/lib/osdlib_win32.cpp +++ b/src/osd/modules/lib/osdlib_win32.cpp @@ -195,13 +195,8 @@ int osd_getpid() // osd_dynamic_bind //============================================================ -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) // for classic desktop applications #define load_library(filename) LoadLibrary(filename) -#else -// for Windows Store universal applications -#define load_library(filename) LoadPackagedLibrary(filename, 0) -#endif namespace osd { diff --git a/src/osd/modules/monitor/monitor_dxgi.cpp b/src/osd/modules/monitor/monitor_dxgi.cpp index 054afea1eb0..8c2c3cb334a 100644 --- a/src/osd/modules/monitor/monitor_dxgi.cpp +++ b/src/osd/modules/monitor/monitor_dxgi.cpp @@ -9,7 +9,7 @@ #include "modules/osdmodule.h" #include "monitor_module.h" -#if defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(OSD_WINDOWS) // standard windows headers #include @@ -79,7 +79,6 @@ public: if (!m_initialized) return nullptr; -#if defined(OSD_WINDOWS) RECT p; p.top = rect.top(); p.left = rect.left(); @@ -89,13 +88,6 @@ public: auto nearest = monitor_from_handle(reinterpret_cast(MonitorFromRect(&p, MONITOR_DEFAULTTONEAREST))); assert(nearest != nullptr); return nearest; -#elif defined(OSD_UWP) - if (list().size() == 0) - return nullptr; - - // For now just return first monitor - return list()[0]; -#endif } // Currently this method implementation is duplicated from the win32 module @@ -105,17 +97,9 @@ public: if (!m_initialized) return nullptr; -#if defined(OSD_WINDOWS) auto nearest = monitor_from_handle(reinterpret_cast(MonitorFromWindow(static_cast(window).platform_window(), MONITOR_DEFAULTTONEAREST))); assert(nearest != nullptr); return nearest; -#elif defined(OSD_UWP) - if (list().size() == 0) - return nullptr; - - // For now just return first monitor - return list()[0]; -#endif } protected: diff --git a/src/osd/modules/osdwindow.cpp b/src/osd/modules/osdwindow.cpp index 610b7a0929a..797148382bf 100644 --- a/src/osd/modules/osdwindow.cpp +++ b/src/osd/modules/osdwindow.cpp @@ -61,7 +61,7 @@ std::unique_ptr osd_renderer::make_for_type(int mode, std::shared_ { switch(mode) { -#if defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(OSD_WINDOWS) case VIDEO_MODE_NONE: return std::make_unique(window); #endif diff --git a/src/osd/modules/osdwindow.h b/src/osd/modules/osdwindow.h index 4b74d504a1c..730e8a67894 100644 --- a/src/osd/modules/osdwindow.h +++ b/src/osd/modules/osdwindow.h @@ -127,7 +127,7 @@ public: virtual void update() = 0; virtual void complete_destroy() = 0; -#if defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(OSD_WINDOWS) virtual bool win_has_menu() = 0; #endif diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp index 1e34cb1ee7e..29cb8deda00 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp @@ -8,7 +8,7 @@ #include #include -#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) // standard windows headers #include #if defined(SDLMAME_WIN32) @@ -208,22 +208,6 @@ inline bool sdlSetWindow(SDL_Window* _window) return true; } -#elif defined(OSD_UWP) -inline void winrtSetWindow(::IUnknown* _window) -{ - bgfx::PlatformData pd; - pd.ndt = NULL; - pd.nwh = _window; - pd.context = NULL; - pd.backBuffer = NULL; - pd.backBufferDS = NULL; - bgfx::setPlatformData(pd); -} - -IInspectable* AsInspectable(Platform::Agile win) -{ - return reinterpret_cast(win.Get()); -} #endif int renderer_bgfx::create() @@ -249,9 +233,6 @@ int renderer_bgfx::create() } #ifdef OSD_WINDOWS winSetHwnd(std::static_pointer_cast(win)->platform_window()); -#elif defined(OSD_UWP) - - winrtSetWindow(AsInspectable(std::static_pointer_cast(win)->platform_window())); #elif defined(OSD_MAC) macSetWindow(std::static_pointer_cast(win)->platform_window()); #else @@ -316,8 +297,6 @@ int renderer_bgfx::create() { #ifdef OSD_WINDOWS m_framebuffer = m_targets->create_backbuffer(std::static_pointer_cast(win)->platform_window(), m_width[win->index()], m_height[win->index()]); -#elif defined(OSD_UWP) - m_framebuffer = m_targets->create_backbuffer(AsInspectable(std::static_pointer_cast(win)->platform_window()), m_width[win->index()], m_height[win->index()]); #elif defined(OSD_MAC) m_framebuffer = m_targets->create_backbuffer(GetOSWindow(std::static_pointer_cast(win)->platform_window()), m_width[win->index()], m_height[win->index()]); #else @@ -1001,8 +980,6 @@ bool renderer_bgfx::update_dimensions() delete m_framebuffer; #ifdef OSD_WINDOWS m_framebuffer = m_targets->create_backbuffer(std::static_pointer_cast(win)->platform_window(), width, height); -#elif defined(OSD_UWP) - m_framebuffer = m_targets->create_backbuffer(AsInspectable(std::static_pointer_cast(win)->platform_window()), width, height); #elif defined(OSD_MAC) m_framebuffer = m_targets->create_backbuffer(GetOSWindow(std::static_pointer_cast(win)->platform_window()), width, height); #else diff --git a/src/osd/modules/render/drawnone.cpp b/src/osd/modules/render/drawnone.cpp index e8bbfa15432..6d9d433ecca 100644 --- a/src/osd/modules/render/drawnone.cpp +++ b/src/osd/modules/render/drawnone.cpp @@ -25,15 +25,7 @@ render_primitive_list *renderer_none::get_primitives() return nullptr; RECT client; -#if defined(OSD_WINDOWS) GetClientRect(std::static_pointer_cast(win)->platform_window(), &client); -#elif defined(OSD_UWP) - auto bounds = std::static_pointer_cast(win)->platform_window()->Bounds; - client.left = bounds.Left; - client.right = bounds.Right; - client.top = bounds.Top; - client.bottom = bounds.Bottom; -#endif if ((rect_width(&client) == 0) || (rect_height(&client) == 0)) return nullptr; win->target()->set_bounds(rect_width(&client), rect_height(&client), win->pixel_aspect()); diff --git a/src/osd/modules/sound/xaudio2_sound.cpp b/src/osd/modules/sound/xaudio2_sound.cpp index 40697ac9aaf..2ec81fde836 100644 --- a/src/osd/modules/sound/xaudio2_sound.cpp +++ b/src/osd/modules/sound/xaudio2_sound.cpp @@ -9,7 +9,7 @@ #include "sound_module.h" #include "modules/osdmodule.h" -#if defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(OSD_WINDOWS) // standard windows headers #include diff --git a/src/osd/strconv.cpp b/src/osd/strconv.cpp index b798161006c..4dafeddd398 100644 --- a/src/osd/strconv.cpp +++ b/src/osd/strconv.cpp @@ -5,7 +5,7 @@ // strconv.cpp - Win32 string conversion // //============================================================ -#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) #include #endif #include @@ -13,7 +13,7 @@ // MAMEOS headers #include "strconv.h" -#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) || defined(OSD_UWP) +#if defined(SDLMAME_WIN32) || defined(OSD_WINDOWS) namespace osd::text { diff --git a/src/osd/windows/main.cpp b/src/osd/windows/main.cpp deleted file mode 100644 index cfadf9ffe0b..00000000000 --- a/src/osd/windows/main.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// main.cpp - Win32 main program -// -//============================================================ - -// standard windows headers -#ifdef OSD_SDL -#define _WIN32_WINNT 0x0501 -#endif -#include -#include -#include -#include -#include - -#include "strconv.h" - -#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - -#include "winmain.h" - -// The main function is only used to initialize our IFrameworkView class. -[Platform::MTAThread] -int main(Platform::Array^) -{ - auto app_source = ref new MameViewSource(); - Windows::ApplicationModel::Core::CoreApplication::Run(app_source); - return 0; -} - -#endif diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index 0f03f34ff90..e6a15729350 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -34,11 +34,6 @@ #include "modules/monitor/monitor_common.h" -#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -#include -using namespace Windows::UI::Core; -#endif - #include "modules/render/drawbgfx.h" #include "modules/render/drawnone.h" #include "modules/render/drawd3d.h" @@ -325,8 +320,6 @@ win_window_info::win_window_info( POINT win_window_info::s_saved_cursor_pos = { -1, -1 }; -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - void win_window_info::capture_pointer() { RECT bounds; @@ -361,35 +354,6 @@ void win_window_info::show_pointer() ShowCursor(FALSE); } -#else - -CoreCursor^ win_window_info::s_cursor = nullptr; - -void win_window_info::capture_pointer() -{ - platform_window>()->SetPointerCapture(); -} - -void win_window_info::release_pointer() -{ - platform_window>()->ReleasePointerCapture(); -} - -void win_window_info::hide_pointer() -{ - auto window = platform_window>(); - win_window_info::s_cursor = window->PointerCursor; - window->PointerCursor = nullptr; -} - -void win_window_info::show_pointer() -{ - auto window = platform_window>(); - window->PointerCursor = win_window_info::s_cursor; -} - -#endif - //============================================================ // winwindow_process_events_periodic // (main thread) diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h index 71bd519ab3a..8db6fc394b2 100644 --- a/src/osd/windows/window.h +++ b/src/osd/windows/window.h @@ -62,22 +62,14 @@ public: virtual bool win_has_menu() override { -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) return GetMenu(platform_window()) ? true : false; -#else - return false; -#endif } virtual osd_dim get_size() override { -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) RECT client; GetClientRect(platform_window(), &client); return osd_dim(client.right - client.left, client.bottom - client.top); -#else - throw ref new Platform::NotImplementedException(); -#endif } void capture_pointer() override; @@ -137,10 +129,6 @@ private: static POINT s_saved_cursor_pos; -#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - static Windows::UI::Core::CoreCursor^ s_cursor; -#endif - bool m_attached_mode; }; diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp index f9d5f4964c2..09315e5ca84 100644 --- a/src/osd/windows/winmain.cpp +++ b/src/osd/windows/winmain.cpp @@ -33,15 +33,6 @@ #include #include -#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) -#include -using namespace Windows::Storage; -using namespace Platform; -using namespace Windows::ApplicationModel; -using namespace Windows::ApplicationModel::Core; -using namespace Windows::UI::Popups; -#endif - #define DEBUG_SLOW_LOCKS 0 //************************************************************************** @@ -58,8 +49,6 @@ using namespace Windows::UI::Popups; // TYPE DEFINITIONS //************************************************************************** -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - //============================================================ // winui_output_error //============================================================ @@ -84,45 +73,6 @@ public: } }; -#else - -//============================================================ -// winuniversal_output_error -//============================================================ - -class winuniversal_output_error : public osd_output -{ -public: - virtual void output_callback(osd_output_channel channel, const char *msg, va_list args) override - { - char buffer[2048]; - if (channel == OSD_OUTPUT_CHANNEL_ERROR) - { - vsnprintf(buffer, std::size(buffer), msg, args); - - std::wstring wcbuffer(osd::text::to_wstring(buffer)); - std::wstring wcappname(osd::text::to_wstring(emulator_info::get_appname())); - - auto dlg = ref new MessageDialog(ref new Platform::String(wcbuffer.data()), ref new Platform::String(wcbuffer.data())); - dlg->ShowAsync(); - } - else if (channel == OSD_OUTPUT_CHANNEL_VERBOSE) - { - vsnprintf(buffer, std::size(buffer), msg, args); - std::wstring wcbuffer = osd::text::to_wstring(buffer); - OutputDebugString(wcbuffer.c_str()); - - // Chain to next anyway - chain_output(channel, msg, args); - } - else - chain_output(channel, msg, args); - } -}; - -#endif - - //************************************************************************** // GLOBAL VARIABLES //************************************************************************** @@ -134,10 +84,8 @@ int _CRT_glob = 0; // LOCAL VARIABLES //************************************************************************** -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) static int timeresult = !TIMERR_NOERROR; static TIMECAPS timecaps; -#endif static running_machine *g_current_machine; @@ -279,8 +227,6 @@ const options_entry windows_options::s_option_entries[] = // MAIN ENTRY POINT //************************************************************************** -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - //============================================================ // main //============================================================ @@ -365,83 +311,6 @@ static BOOL WINAPI control_handler(DWORD type) return TRUE; } -#else - -// The main function is only used to initialize our IFrameworkView class. -[Platform::MTAThread] -int main(Platform::Array^ args) -{ - auto direct3DApplicationSource = ref new MameViewSource(); - CoreApplication::Run(direct3DApplicationSource); - return 0; -} - -MameMainApp::MameMainApp() -{ - // Turn off application view scaling so XBOX gets full screen - Windows::UI::ViewManagement::ApplicationViewScaling::TrySetDisableLayoutScaling(true); -} - -void MameMainApp::Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView) -{ - // Register event handlers for app lifecycle. -} - -// Called when the CoreWindow object is created (or re-created). -void MameMainApp::SetWindow(Windows::UI::Core::CoreWindow^ window) -{ - // Attach event handlers on the window for input, etc. -} - -// Initializes scene resources, or loads a previously saved app state. -void MameMainApp::Load(Platform::String^ entryPoint) -{ -} - -void MameMainApp::Run() -{ - // use small output buffers on non-TTYs (i.e. pipes) - if (!isatty(fileno(stdout))) - setvbuf(stdout, (char *) nullptr, _IOFBF, 64); - if (!isatty(fileno(stderr))) - setvbuf(stderr, (char *) nullptr, _IOFBF, 64); - - // parse config and cmdline options - m_options = std::make_unique(); - m_osd = std::make_unique(*m_options.get()); - - // Since we're a GUI app, out errors to message boxes - // Initialize this after the osd interface so that we are first in the - // output order - winuniversal_output_error winerror; - osd_output::push(&winerror); - - m_osd->register_options(); - - // To satisfy the latter things, pass in the module path name - char exe_path[MAX_PATH]; - GetModuleFileNameA(nullptr, exe_path, MAX_PATH); - char* args[3] = { exe_path, (char*)"-verbose", (char*)"-mouse" }; - - DWORD result = emulator_info::start_frontend(*m_options.get(), *m_osd.get(), std::size(args), args); - osd_output::pop(&winerror); -} - -// Required for IFrameworkView. -void MameMainApp::Uninitialize() -{ - // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView - // class is torn down while the app is in the foreground. -} - -IFrameworkView^ MameViewSource::CreateView() -{ - return ref new MameMainApp(); -} - -#endif - - //============================================================ // windows_options //============================================================ @@ -450,21 +319,6 @@ windows_options::windows_options() : osd_options() { add_entries(s_option_entries); -#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - String^ path = ApplicationData::Current->LocalFolder->Path + L"\\"; - set_default_value(OPTION_INIPATH, osd::text::from_wstring((LPCWSTR)path->Data()) + ";" + ini_path()); - set_default_value(OPTION_CFG_DIRECTORY, osd::text::from_wstring((LPCWSTR)path->Data()) + cfg_directory()); - set_default_value(OPTION_NVRAM_DIRECTORY, osd::text::from_wstring((LPCWSTR)path->Data()) + nvram_directory()); - set_default_value(OPTION_INPUT_DIRECTORY, osd::text::from_wstring((LPCWSTR)path->Data()) + input_directory()); - set_default_value(OPTION_STATE_DIRECTORY, osd::text::from_wstring((LPCWSTR)path->Data()) + state_directory()); - set_default_value(OPTION_SNAPSHOT_DIRECTORY, osd::text::from_wstring((LPCWSTR)path->Data()) + snapshot_directory()); - set_default_value(OPTION_DIFF_DIRECTORY, osd::text::from_wstring((LPCWSTR)path->Data()) + diff_directory()); - set_default_value(OPTION_COMMENT_DIRECTORY, osd::text::from_wstring((LPCWSTR)path->Data()) + comment_directory()); - set_default_value(OPTION_SHARE_DIRECTORY, osd::text::from_wstring((LPCWSTR)path->Data()) + share_directory()); - - set_default_value(OPTION_HOMEPATH, osd::text::from_wstring((LPCWSTR)path->Data())); - set_default_value(OPTION_MEDIAPATH, osd::text::from_wstring((LPCWSTR)path->Data()) + media_path()); -#endif } @@ -579,13 +433,11 @@ void windows_osd_interface::init(running_machine &machine) if (options.oslog()) machine.add_logerror_callback(&windows_osd_interface::output_oslog); -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) // crank up the multimedia timer resolution to its max // this gives the system much finer timeslices timeresult = timeGetDevCaps(&timecaps, sizeof(timecaps)); if (timeresult == TIMERR_NOERROR) timeBeginPeriod(timecaps.wPeriodMin); -#endif // create and start the profiler if (profile > 0) @@ -619,11 +471,9 @@ void windows_osd_interface::osd_exit() diagnostics_module::get_instance()->stop_profiler(); diagnostics_module::get_instance()->print_profiler_results(); -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) // restore the timer resolution if (timeresult == TIMERR_NOERROR) timeEndPeriod(timecaps.wPeriodMin); -#endif // one last pass at events winwindow_process_events(machine(), false, false); @@ -641,8 +491,6 @@ void osd_setup_osd_specific_emu_options(emu_options &opts) } -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - //============================================================ // check_for_double_click_start //============================================================ @@ -657,5 +505,3 @@ static int is_double_click_start(int argc) // try to determine if MAME was simply double-clicked return (argc <= 1 && startup_info.dwFlags && !(startup_info.dwFlags & STARTF_USESTDHANDLES)); } - -#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h index faca28e5bca..ef1cd1aff4f 100644 --- a/src/osd/windows/winmain.h +++ b/src/osd/windows/winmain.h @@ -9,7 +9,6 @@ #ifndef __WINDOWS_WINMAIN_H__ #define __WINDOWS_WINMAIN_H__ -#include #include "osdepend.h" #include "modules/lib/osdobj_common.h" @@ -267,10 +266,8 @@ struct _EXCEPTION_POINTERS; class windows_osd_interface : public osd_common_t { -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) // Access to exception filter static method friend int main(int argc, char *argv[]); -#endif public: // construction/destruction @@ -322,33 +319,6 @@ private: static const int DEFAULT_FONT_HEIGHT = 200; }; -#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - -ref class MameMainApp sealed : public Windows::ApplicationModel::Core::IFrameworkView -{ -private: - std::unique_ptr m_options; - std::unique_ptr m_osd; - -public: - MameMainApp(); - - // IFrameworkView Methods. - virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView); - virtual void SetWindow(Windows::UI::Core::CoreWindow^ window); - virtual void Load(Platform::String^ entryPoint); - virtual void Run(); - virtual void Uninitialize(); -}; - -ref class MameViewSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource -{ -public: - virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView(); -}; - -#endif - //============================================================ // GLOBAL VARIABLES //============================================================ diff --git a/src/osd/windows/winutf8.cpp b/src/osd/windows/winutf8.cpp index cb6ab1a3dbc..cdb0e87a86b 100644 --- a/src/osd/windows/winutf8.cpp +++ b/src/osd/windows/winutf8.cpp @@ -27,8 +27,6 @@ void win_output_debug_string_utf8(const char *string) } -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - //============================================================ // win_message_box_utf8 //============================================================ @@ -55,9 +53,6 @@ int win_message_box_utf8(HWND window, const char *text, const char *caption, UIN return MessageBox(window, t_text, t_caption, type); } -#endif - - //============================================================ // win_set_window_text_utf8 @@ -75,13 +70,7 @@ BOOL win_set_window_text_utf8(HWND window, const char *text) t_text = ts_text.c_str(); } -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) result = SetWindowText(window, t_text); -#else - Windows::UI::ViewManagement::ApplicationView::GetForCurrentView()->Title = ref new Platform::String(t_text); - result = TRUE; -#endif - return result; } @@ -93,30 +82,17 @@ BOOL win_set_window_text_utf8(HWND window, const char *text) std::string win_get_window_text_utf8(HWND window) { -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - { - // invoke the core Win32 API - int length = GetWindowTextLength(window); - if (length <= 0) - return std::string(); - - auto *buffer = (TCHAR *) alloca((length + 1) * sizeof(TCHAR)); - GetWindowText(window, buffer, length + 1); - return osd::text::from_tstring(buffer); - } -#else - { - TCHAR t_buffer[256]; - auto title = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView()->Title; - wcsncpy(t_buffer, title->Data(), std::size(t_buffer)); - return osd::text::from_tstring(t_buffer); - } -#endif + // invoke the core Win32 API + int length = GetWindowTextLength(window); + if (length <= 0) + return std::string(); + + auto *buffer = (TCHAR *) alloca((length + 1) * sizeof(TCHAR)); + GetWindowText(window, buffer, length + 1); + return osd::text::from_tstring(buffer); } -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) - //============================================================ // win_create_window_ex_utf8 //============================================================ @@ -138,5 +114,3 @@ HWND win_create_window_ex_utf8(DWORD exstyle, const char* classname, const char* return CreateWindowEx(exstyle, ts_classname.c_str(), t_windowname, style, x, y, width, height, parent, menu, instance, param); } - -#endif -- cgit v1.2.3 From 86de4740405386439848883046b52851a687dc58 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:48:29 +0200 Subject: remove uwp column --- src/osd/modules/input/input_common.cpp | 268 ++++++++++++++++----------------- 1 file changed, 134 insertions(+), 134 deletions(-) diff --git a/src/osd/modules/input/input_common.cpp b/src/osd/modules/input/input_common.cpp index a04c46b6477..bb596295ea9 100644 --- a/src/osd/modules/input/input_common.cpp +++ b/src/osd/modules/input/input_common.cpp @@ -25,13 +25,13 @@ #if defined(OSD_WINDOWS) #include -#define KEY_TRANS_ENTRY0(mame, sdlsc, sdlkey, disc, virtual, uwp, ascii, UI) { ITEM_ID_##mame, KEY_ ## disc, virtual, ascii, "ITEM_ID_"#mame, (char *) UI } -#define KEY_TRANS_ENTRY1(mame, sdlsc, sdlkey, disc, virtual, uwp, ascii) { ITEM_ID_##mame, KEY_ ## disc, virtual, ascii, "ITEM_ID_"#mame, (char*) #mame } +#define KEY_TRANS_ENTRY0(mame, sdlsc, sdlkey, disc, virtual, ascii, UI) { ITEM_ID_##mame, KEY_ ## disc, virtual, ascii, "ITEM_ID_"#mame, (char *) UI } +#define KEY_TRANS_ENTRY1(mame, sdlsc, sdlkey, disc, virtual, ascii) { ITEM_ID_##mame, KEY_ ## disc, virtual, ascii, "ITEM_ID_"#mame, (char*) #mame } #elif defined(OSD_SDL) // SDL include #include -#define KEY_TRANS_ENTRY0(mame, sdlsc, sdlkey, disc, virtual, uwp, ascii, UI) { ITEM_ID_##mame, SDL_SCANCODE_ ## sdlsc, ascii, "ITEM_ID_"#mame, (char *) UI } -#define KEY_TRANS_ENTRY1(mame, sdlsc, sdlkey, disc, virtual, uwp, ascii) { ITEM_ID_##mame, SDL_SCANCODE_ ## sdlsc, ascii, "ITEM_ID_"#mame, (char*) #mame } +#define KEY_TRANS_ENTRY0(mame, sdlsc, sdlkey, disc, virtual, ascii, UI) { ITEM_ID_##mame, SDL_SCANCODE_ ## sdlsc, ascii, "ITEM_ID_"#mame, (char *) UI } +#define KEY_TRANS_ENTRY1(mame, sdlsc, sdlkey, disc, virtual, ascii) { ITEM_ID_##mame, SDL_SCANCODE_ ## sdlsc, ascii, "ITEM_ID_"#mame, (char*) #mame } #else // osd mini #endif @@ -41,124 +41,124 @@ #if defined(OSD_WINDOWS) || defined(OSD_SDL) key_trans_entry keyboard_trans_table::s_default_table[] = { - // MAME key sdl scancode sdl key di scancode virtual key uwp vkey ascii ui - KEY_TRANS_ENTRY0(ESC, ESCAPE, ESCAPE, ESCAPE, VK_ESCAPE, Escape, 27, "ESCAPE"), - KEY_TRANS_ENTRY1(1, 1, 1, 1, '1', Number1, '1'), - KEY_TRANS_ENTRY1(2, 2, 2, 2, '2', Number2, '2'), - KEY_TRANS_ENTRY1(3, 3, 3, 3, '3', Number3, '3'), - KEY_TRANS_ENTRY1(4, 4, 4, 4, '4', Number4, '4'), - KEY_TRANS_ENTRY1(5, 5, 5, 5, '5', Number5, '5'), - KEY_TRANS_ENTRY1(6, 6, 6, 6, '6', Number6, '6'), - KEY_TRANS_ENTRY1(7, 7, 7, 7, '7', Number7, '7'), - KEY_TRANS_ENTRY1(8, 8, 8, 8, '8', Number8, '8'), - KEY_TRANS_ENTRY1(9, 9, 9, 9, '9', Number9, '9'), - KEY_TRANS_ENTRY1(0, 0, 0, 0, '0', Number0, '0'), - KEY_TRANS_ENTRY1(MINUS, MINUS, MINUS, MINUS, VK_OEM_MINUS, None, '-'), - KEY_TRANS_ENTRY1(EQUALS, EQUALS, EQUALS, EQUALS, VK_OEM_PLUS, None, '='), - KEY_TRANS_ENTRY1(BACKSPACE, BACKSPACE, BACKSPACE, BACK, VK_BACK, Back, 8), - KEY_TRANS_ENTRY1(TAB, TAB, TAB, TAB, VK_TAB, Tab, 9), - KEY_TRANS_ENTRY1(Q, Q, q, Q, 'Q', Q, 'Q'), - KEY_TRANS_ENTRY1(W, W, w, W, 'W', W, 'W'), - KEY_TRANS_ENTRY1(E, E, e, E, 'E', E, 'E'), - KEY_TRANS_ENTRY1(R, R, r, R, 'R', R, 'R'), - KEY_TRANS_ENTRY1(T, T, t, T, 'T', T, 'T'), - KEY_TRANS_ENTRY1(Y, Y, y, Y, 'Y', Y, 'Y'), - KEY_TRANS_ENTRY1(U, U, u, U, 'U', U, 'U'), - KEY_TRANS_ENTRY1(I, I, i, I, 'I', I, 'I'), - KEY_TRANS_ENTRY1(O, O, o, O, 'O', O, 'O'), - KEY_TRANS_ENTRY1(P, P, p, P, 'P', P, 'P'), - KEY_TRANS_ENTRY1(OPENBRACE, LEFTBRACKET, LEFTBRACKET, LBRACKET, VK_OEM_4, None, '['), - KEY_TRANS_ENTRY1(CLOSEBRACE, RIGHTBRACKET, RIGHTBRACKET, RBRACKET, VK_OEM_6, None, ']'), - KEY_TRANS_ENTRY0(ENTER, RETURN, RETURN, RETURN, VK_RETURN, Enter, 13, "RETURN"), - KEY_TRANS_ENTRY1(LCONTROL, LCTRL, LCTRL, LCONTROL, VK_LCONTROL, LeftControl, 0), - KEY_TRANS_ENTRY1(A, A, a, A, 'A', A, 'A'), - KEY_TRANS_ENTRY1(S, S, s, S, 'S', S, 'S'), - KEY_TRANS_ENTRY1(D, D, d, D, 'D', D, 'D'), - KEY_TRANS_ENTRY1(F, F, f, F, 'F', F, 'F'), - KEY_TRANS_ENTRY1(G, G, g, G, 'G', G, 'G'), - KEY_TRANS_ENTRY1(H, H, h, H, 'H', H, 'H'), - KEY_TRANS_ENTRY1(J, J, j, J, 'J', J, 'J'), - KEY_TRANS_ENTRY1(K, K, k, K, 'K', K, 'K'), - KEY_TRANS_ENTRY1(L, L, l, L, 'L', L, 'L'), - KEY_TRANS_ENTRY1(COLON, SEMICOLON, SEMICOLON, SEMICOLON, VK_OEM_1, None, ';'), - KEY_TRANS_ENTRY1(QUOTE, APOSTROPHE, QUOTE, APOSTROPHE, VK_OEM_7, None, '\''), - KEY_TRANS_ENTRY1(TILDE, GRAVE, BACKQUOTE, GRAVE, VK_OEM_3, None, '`'), - KEY_TRANS_ENTRY1(LSHIFT, LSHIFT, LSHIFT, LSHIFT, VK_LSHIFT, LeftShift, 0), - KEY_TRANS_ENTRY1(BACKSLASH, BACKSLASH, BACKSLASH, BACKSLASH, VK_OEM_5, None, '\\'), -// KEY_TRANS_ENTRY1(BACKSLASH2, NONUSHASH, UNKNOWN, OEM_102, VK_OEM_102, None, '<'), + // MAME key sdl scancode sdl key di scancode virtual key ascii ui + KEY_TRANS_ENTRY0(ESC, ESCAPE, ESCAPE, ESCAPE, VK_ESCAPE, 27, "ESCAPE"), + KEY_TRANS_ENTRY1(1, 1, 1, 1, '1', '1'), + KEY_TRANS_ENTRY1(2, 2, 2, 2, '2', '2'), + KEY_TRANS_ENTRY1(3, 3, 3, 3, '3', '3'), + KEY_TRANS_ENTRY1(4, 4, 4, 4, '4', '4'), + KEY_TRANS_ENTRY1(5, 5, 5, 5, '5', '5'), + KEY_TRANS_ENTRY1(6, 6, 6, 6, '6', '6'), + KEY_TRANS_ENTRY1(7, 7, 7, 7, '7', '7'), + KEY_TRANS_ENTRY1(8, 8, 8, 8, '8', '8'), + KEY_TRANS_ENTRY1(9, 9, 9, 9, '9', '9'), + KEY_TRANS_ENTRY1(0, 0, 0, 0, '0', '0'), + KEY_TRANS_ENTRY1(MINUS, MINUS, MINUS, MINUS, VK_OEM_MINUS, '-'), + KEY_TRANS_ENTRY1(EQUALS, EQUALS, EQUALS, EQUALS, VK_OEM_PLUS, '='), + KEY_TRANS_ENTRY1(BACKSPACE, BACKSPACE, BACKSPACE, BACK, VK_BACK, 8), + KEY_TRANS_ENTRY1(TAB, TAB, TAB, TAB, VK_TAB, 9), + KEY_TRANS_ENTRY1(Q, Q, q, Q, 'Q', 'Q'), + KEY_TRANS_ENTRY1(W, W, w, W, 'W', 'W'), + KEY_TRANS_ENTRY1(E, E, e, E, 'E', 'E'), + KEY_TRANS_ENTRY1(R, R, r, R, 'R', 'R'), + KEY_TRANS_ENTRY1(T, T, t, T, 'T', 'T'), + KEY_TRANS_ENTRY1(Y, Y, y, Y, 'Y', 'Y'), + KEY_TRANS_ENTRY1(U, U, u, U, 'U', 'U'), + KEY_TRANS_ENTRY1(I, I, i, I, 'I', 'I'), + KEY_TRANS_ENTRY1(O, O, o, O, 'O', 'O'), + KEY_TRANS_ENTRY1(P, P, p, P, 'P', 'P'), + KEY_TRANS_ENTRY1(OPENBRACE, LEFTBRACKET, LEFTBRACKET, LBRACKET, VK_OEM_4, '['), + KEY_TRANS_ENTRY1(CLOSEBRACE, RIGHTBRACKET, RIGHTBRACKET, RBRACKET, VK_OEM_6, ']'), + KEY_TRANS_ENTRY0(ENTER, RETURN, RETURN, RETURN, VK_RETURN, 13, "RETURN"), + KEY_TRANS_ENTRY1(LCONTROL, LCTRL, LCTRL, LCONTROL, VK_LCONTROL, 0), + KEY_TRANS_ENTRY1(A, A, a, A, 'A', 'A'), + KEY_TRANS_ENTRY1(S, S, s, S, 'S', 'S'), + KEY_TRANS_ENTRY1(D, D, d, D, 'D', 'D'), + KEY_TRANS_ENTRY1(F, F, f, F, 'F', 'F'), + KEY_TRANS_ENTRY1(G, G, g, G, 'G', 'G'), + KEY_TRANS_ENTRY1(H, H, h, H, 'H', 'H'), + KEY_TRANS_ENTRY1(J, J, j, J, 'J', 'J'), + KEY_TRANS_ENTRY1(K, K, k, K, 'K', 'K'), + KEY_TRANS_ENTRY1(L, L, l, L, 'L', 'L'), + KEY_TRANS_ENTRY1(COLON, SEMICOLON, SEMICOLON, SEMICOLON, VK_OEM_1, ';'), + KEY_TRANS_ENTRY1(QUOTE, APOSTROPHE, QUOTE, APOSTROPHE, VK_OEM_7, '\''), + KEY_TRANS_ENTRY1(TILDE, GRAVE, BACKQUOTE, GRAVE, VK_OEM_3, '`'), + KEY_TRANS_ENTRY1(LSHIFT, LSHIFT, LSHIFT, LSHIFT, VK_LSHIFT, 0), + KEY_TRANS_ENTRY1(BACKSLASH, BACKSLASH, BACKSLASH, BACKSLASH, VK_OEM_5, '\\'), +// KEY_TRANS_ENTRY1(BACKSLASH2, NONUSHASH, UNKNOWN, OEM_102, VK_OEM_102, '<'), // This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. - KEY_TRANS_ENTRY1(BACKSLASH2, NONUSBACKSLASH, UNKNOWN, OEM_102, VK_OEM_102, None, '<'), - KEY_TRANS_ENTRY1(Z, Z, z, Z, 'Z', Z, 'Z'), - KEY_TRANS_ENTRY1(X, X, x, X, 'X', X, 'X'), - KEY_TRANS_ENTRY1(C, C, c, C, 'C', C, 'C'), - KEY_TRANS_ENTRY1(V, V, v, V, 'V', V, 'V'), - KEY_TRANS_ENTRY1(B, B, b, B, 'B', B, 'B'), - KEY_TRANS_ENTRY1(N, N, n, N, 'N', N, 'N'), - KEY_TRANS_ENTRY1(M, M, m, M, 'M', M, 'M'), - KEY_TRANS_ENTRY1(COMMA, COMMA, COMMA, COMMA, VK_OEM_COMMA, None, ','), - KEY_TRANS_ENTRY1(STOP, PERIOD, PERIOD, PERIOD, VK_OEM_PERIOD, None, '.'), - KEY_TRANS_ENTRY1(SLASH, SLASH, SLASH, SLASH, VK_OEM_2, None, '/'), - KEY_TRANS_ENTRY1(RSHIFT, RSHIFT, RSHIFT, RSHIFT, VK_RSHIFT, RightShift, 0), - KEY_TRANS_ENTRY1(ASTERISK, KP_MULTIPLY, KP_MULTIPLY, MULTIPLY, VK_MULTIPLY, Multiply, '*'), - KEY_TRANS_ENTRY1(LALT, LALT, LALT, LMENU, VK_LMENU, LeftMenu, 0), - KEY_TRANS_ENTRY1(SPACE, SPACE, SPACE, SPACE, VK_SPACE, Space, ' '), - KEY_TRANS_ENTRY1(CAPSLOCK, CAPSLOCK, CAPSLOCK, CAPITAL, VK_CAPITAL, CapitalLock, 0), - KEY_TRANS_ENTRY1(F1, F1, F1, F1, VK_F1, F1, 0), - KEY_TRANS_ENTRY1(F2, F2, F2, F2, VK_F2, F2, 0), - KEY_TRANS_ENTRY1(F3, F3, F3, F3, VK_F3, F3, 0), - KEY_TRANS_ENTRY1(F4, F4, F4, F4, VK_F4, F4, 0), - KEY_TRANS_ENTRY1(F5, F5, F5, F5, VK_F5, F5, 0), - KEY_TRANS_ENTRY1(F6, F6, F6, F6, VK_F6, F6, 0), - KEY_TRANS_ENTRY1(F7, F7, F7, F7, VK_F7, F7, 0), - KEY_TRANS_ENTRY1(F8, F8, F8, F8, VK_F8, F8, 0), - KEY_TRANS_ENTRY1(F9, F9, F9, F9, VK_F9, F9, 0), - KEY_TRANS_ENTRY1(F10, F10, F10, F10, VK_F10, F10, 0), - KEY_TRANS_ENTRY1(NUMLOCK, NUMLOCKCLEAR, NUMLOCKCLEAR, NUMLOCK, VK_NUMLOCK, NumberKeyLock, 0), - KEY_TRANS_ENTRY1(SCRLOCK, SCROLLLOCK, SCROLLLOCK, SCROLL, VK_SCROLL, Scroll, 0), - KEY_TRANS_ENTRY1(7_PAD, KP_7, KP_7, NUMPAD7, VK_NUMPAD7, NumberPad7, 0), - KEY_TRANS_ENTRY1(8_PAD, KP_8, KP_8, NUMPAD8, VK_NUMPAD8, NumberPad8, 0), - KEY_TRANS_ENTRY1(9_PAD, KP_9, KP_9, NUMPAD9, VK_NUMPAD9, NumberPad9, 0), - KEY_TRANS_ENTRY1(MINUS_PAD, KP_MINUS, KP_MINUS, SUBTRACT, VK_SUBTRACT, Subtract, 0), - KEY_TRANS_ENTRY1(4_PAD, KP_4, KP_4, NUMPAD4, VK_NUMPAD4, NumberPad4, 0), - KEY_TRANS_ENTRY1(5_PAD, KP_5, KP_5, NUMPAD5, VK_NUMPAD5, NumberPad5, 0), - KEY_TRANS_ENTRY1(6_PAD, KP_6, KP_6, NUMPAD6, VK_NUMPAD6, NumberPad6, 0), - KEY_TRANS_ENTRY1(PLUS_PAD, KP_PLUS, KP_PLUS, ADD, VK_ADD, Add, 0), - KEY_TRANS_ENTRY1(1_PAD, KP_1, KP_1, NUMPAD1, VK_NUMPAD1, NumberPad1, 0), - KEY_TRANS_ENTRY1(2_PAD, KP_2, KP_2, NUMPAD2, VK_NUMPAD2, NumberPad2, 0), - KEY_TRANS_ENTRY1(3_PAD, KP_3, KP_3, NUMPAD3, VK_NUMPAD3, NumberPad3, 0), - KEY_TRANS_ENTRY1(0_PAD, KP_0, KP_0, NUMPAD0, VK_NUMPAD0, NumberPad0, 0), - KEY_TRANS_ENTRY1(DEL_PAD, KP_PERIOD, KP_PERIOD, DECIMAL, VK_DECIMAL, Decimal, 0), - KEY_TRANS_ENTRY1(F11, F11, F11, F11, VK_F11, F11, 0), - KEY_TRANS_ENTRY1(F12, F12, F12, F12, VK_F12, F12, 0), - KEY_TRANS_ENTRY1(F13, F13, F13, F13, VK_F13, F13, 0), - KEY_TRANS_ENTRY1(F14, F14, F14, F14, VK_F14, F14, 0), - KEY_TRANS_ENTRY1(F15, F15, F15, F15, VK_F15, F15, 0), - KEY_TRANS_ENTRY1(ENTER_PAD, KP_ENTER, KP_ENTER, NUMPADENTER, VK_RETURN, None, 0), - KEY_TRANS_ENTRY1(RCONTROL, RCTRL, RCTRL, RCONTROL, VK_RCONTROL, RightControl, 0), - KEY_TRANS_ENTRY1(SLASH_PAD, KP_DIVIDE, KP_DIVIDE, DIVIDE, VK_DIVIDE, Divide, 0), - KEY_TRANS_ENTRY1(PRTSCR, PRINTSCREEN, PRINTSCREEN, SYSRQ, 0, Print, 0), - KEY_TRANS_ENTRY1(RALT, RALT, RALT, RMENU, VK_RMENU, RightMenu, 0), - KEY_TRANS_ENTRY1(HOME, HOME, HOME, HOME, VK_HOME, Home, 0), - KEY_TRANS_ENTRY1(UP, UP, UP, UP, VK_UP, Up, 0), - KEY_TRANS_ENTRY1(PGUP, PAGEUP, PAGEUP, PRIOR, VK_PRIOR, PageUp, 0), - KEY_TRANS_ENTRY1(LEFT, LEFT, LEFT, LEFT, VK_LEFT, Left, 0), - KEY_TRANS_ENTRY1(RIGHT, RIGHT, RIGHT, RIGHT, VK_RIGHT, Right, 0), - KEY_TRANS_ENTRY1(END, END, END, END, VK_END, End, 0), - KEY_TRANS_ENTRY1(DOWN, DOWN, DOWN, DOWN, VK_DOWN, Down, 0), - KEY_TRANS_ENTRY1(PGDN, PAGEDOWN, PAGEDOWN, NEXT, VK_NEXT, PageDown, 0), - KEY_TRANS_ENTRY1(INSERT, INSERT, INSERT, INSERT, VK_INSERT, Insert, 0), - KEY_TRANS_ENTRY0(DEL, DELETE, DELETE, DELETE, VK_DELETE, Delete, 0, "DELETE"), - KEY_TRANS_ENTRY1(LWIN, LGUI, LGUI, LWIN, VK_LWIN, LeftWindows, 0), - KEY_TRANS_ENTRY1(RWIN, RGUI, RGUI, RWIN, VK_RWIN, RightWindows, 0), - KEY_TRANS_ENTRY1(MENU, MENU, MENU, APPS, VK_APPS, Menu, 0), - KEY_TRANS_ENTRY1(PAUSE, PAUSE, PAUSE, PAUSE, VK_PAUSE, Pause, 0), - KEY_TRANS_ENTRY0(CANCEL, CANCEL, CANCEL, UNKNOWN, 0, Cancel, 0, "CANCEL"), - KEY_TRANS_ENTRY1(BS_PAD, KP_BACKSPACE, KP_BACKSPACE, UNKNOWN, 0, None, 0), - KEY_TRANS_ENTRY1(TAB_PAD, KP_TAB, KP_TAB, UNKNOWN, 0, None, 0), - KEY_TRANS_ENTRY1(00_PAD, KP_00, KP_00, UNKNOWN, 0, None, 0), - KEY_TRANS_ENTRY1(000_PAD, KP_000, KP_000, UNKNOWN, 0, None, 0), - KEY_TRANS_ENTRY1(COMMA_PAD, KP_COMMA, KP_COMMA, NUMPADCOMMA, 0, None, 0), - KEY_TRANS_ENTRY1(EQUALS_PAD, KP_EQUALS, KP_EQUALS, NUMPADEQUALS, 0, None, 0), + KEY_TRANS_ENTRY1(BACKSLASH2, NONUSBACKSLASH, UNKNOWN, OEM_102, VK_OEM_102, '<'), + KEY_TRANS_ENTRY1(Z, Z, z, Z, 'Z', 'Z'), + KEY_TRANS_ENTRY1(X, X, x, X, 'X', 'X'), + KEY_TRANS_ENTRY1(C, C, c, C, 'C', 'C'), + KEY_TRANS_ENTRY1(V, V, v, V, 'V', 'V'), + KEY_TRANS_ENTRY1(B, B, b, B, 'B', 'B'), + KEY_TRANS_ENTRY1(N, N, n, N, 'N', 'N'), + KEY_TRANS_ENTRY1(M, M, m, M, 'M', 'M'), + KEY_TRANS_ENTRY1(COMMA, COMMA, COMMA, COMMA, VK_OEM_COMMA, ','), + KEY_TRANS_ENTRY1(STOP, PERIOD, PERIOD, PERIOD, VK_OEM_PERIOD, '.'), + KEY_TRANS_ENTRY1(SLASH, SLASH, SLASH, SLASH, VK_OEM_2, '/'), + KEY_TRANS_ENTRY1(RSHIFT, RSHIFT, RSHIFT, RSHIFT, VK_RSHIFT, 0), + KEY_TRANS_ENTRY1(ASTERISK, KP_MULTIPLY, KP_MULTIPLY, MULTIPLY, VK_MULTIPLY, '*'), + KEY_TRANS_ENTRY1(LALT, LALT, LALT, LMENU, VK_LMENU, 0), + KEY_TRANS_ENTRY1(SPACE, SPACE, SPACE, SPACE, VK_SPACE, ' '), + KEY_TRANS_ENTRY1(CAPSLOCK, CAPSLOCK, CAPSLOCK, CAPITAL, VK_CAPITAL, 0), + KEY_TRANS_ENTRY1(F1, F1, F1, F1, VK_F1, 0), + KEY_TRANS_ENTRY1(F2, F2, F2, F2, VK_F2, 0), + KEY_TRANS_ENTRY1(F3, F3, F3, F3, VK_F3, 0), + KEY_TRANS_ENTRY1(F4, F4, F4, F4, VK_F4, 0), + KEY_TRANS_ENTRY1(F5, F5, F5, F5, VK_F5, 0), + KEY_TRANS_ENTRY1(F6, F6, F6, F6, VK_F6, 0), + KEY_TRANS_ENTRY1(F7, F7, F7, F7, VK_F7, 0), + KEY_TRANS_ENTRY1(F8, F8, F8, F8, VK_F8, 0), + KEY_TRANS_ENTRY1(F9, F9, F9, F9, VK_F9, 0), + KEY_TRANS_ENTRY1(F10, F10, F10, F10, VK_F10, 0), + KEY_TRANS_ENTRY1(NUMLOCK, NUMLOCKCLEAR, NUMLOCKCLEAR, NUMLOCK, VK_NUMLOCK, 0), + KEY_TRANS_ENTRY1(SCRLOCK, SCROLLLOCK, SCROLLLOCK, SCROLL, VK_SCROLL, 0), + KEY_TRANS_ENTRY1(7_PAD, KP_7, KP_7, NUMPAD7, VK_NUMPAD7, 0), + KEY_TRANS_ENTRY1(8_PAD, KP_8, KP_8, NUMPAD8, VK_NUMPAD8, 0), + KEY_TRANS_ENTRY1(9_PAD, KP_9, KP_9, NUMPAD9, VK_NUMPAD9, 0), + KEY_TRANS_ENTRY1(MINUS_PAD, KP_MINUS, KP_MINUS, SUBTRACT, VK_SUBTRACT, 0), + KEY_TRANS_ENTRY1(4_PAD, KP_4, KP_4, NUMPAD4, VK_NUMPAD4, 0), + KEY_TRANS_ENTRY1(5_PAD, KP_5, KP_5, NUMPAD5, VK_NUMPAD5, 0), + KEY_TRANS_ENTRY1(6_PAD, KP_6, KP_6, NUMPAD6, VK_NUMPAD6, 0), + KEY_TRANS_ENTRY1(PLUS_PAD, KP_PLUS, KP_PLUS, ADD, VK_ADD, 0), + KEY_TRANS_ENTRY1(1_PAD, KP_1, KP_1, NUMPAD1, VK_NUMPAD1, 0), + KEY_TRANS_ENTRY1(2_PAD, KP_2, KP_2, NUMPAD2, VK_NUMPAD2, 0), + KEY_TRANS_ENTRY1(3_PAD, KP_3, KP_3, NUMPAD3, VK_NUMPAD3, 0), + KEY_TRANS_ENTRY1(0_PAD, KP_0, KP_0, NUMPAD0, VK_NUMPAD0, 0), + KEY_TRANS_ENTRY1(DEL_PAD, KP_PERIOD, KP_PERIOD, DECIMAL, VK_DECIMAL, 0), + KEY_TRANS_ENTRY1(F11, F11, F11, F11, VK_F11, 0), + KEY_TRANS_ENTRY1(F12, F12, F12, F12, VK_F12, 0), + KEY_TRANS_ENTRY1(F13, F13, F13, F13, VK_F13, 0), + KEY_TRANS_ENTRY1(F14, F14, F14, F14, VK_F14, 0), + KEY_TRANS_ENTRY1(F15, F15, F15, F15, VK_F15, 0), + KEY_TRANS_ENTRY1(ENTER_PAD, KP_ENTER, KP_ENTER, NUMPADENTER, VK_RETURN, 0), + KEY_TRANS_ENTRY1(RCONTROL, RCTRL, RCTRL, RCONTROL, VK_RCONTROL, 0), + KEY_TRANS_ENTRY1(SLASH_PAD, KP_DIVIDE, KP_DIVIDE, DIVIDE, VK_DIVIDE, 0), + KEY_TRANS_ENTRY1(PRTSCR, PRINTSCREEN, PRINTSCREEN, SYSRQ, 0, 0), + KEY_TRANS_ENTRY1(RALT, RALT, RALT, RMENU, VK_RMENU, 0), + KEY_TRANS_ENTRY1(HOME, HOME, HOME, HOME, VK_HOME, 0), + KEY_TRANS_ENTRY1(UP, UP, UP, UP, VK_UP, 0), + KEY_TRANS_ENTRY1(PGUP, PAGEUP, PAGEUP, PRIOR, VK_PRIOR, 0), + KEY_TRANS_ENTRY1(LEFT, LEFT, LEFT, LEFT, VK_LEFT, 0), + KEY_TRANS_ENTRY1(RIGHT, RIGHT, RIGHT, RIGHT, VK_RIGHT, 0), + KEY_TRANS_ENTRY1(END, END, END, END, VK_END, 0), + KEY_TRANS_ENTRY1(DOWN, DOWN, DOWN, DOWN, VK_DOWN, 0), + KEY_TRANS_ENTRY1(PGDN, PAGEDOWN, PAGEDOWN, NEXT, VK_NEXT, 0), + KEY_TRANS_ENTRY1(INSERT, INSERT, INSERT, INSERT, VK_INSERT, 0), + KEY_TRANS_ENTRY0(DEL, DELETE, DELETE, DELETE, VK_DELETE, 0, "DELETE"), + KEY_TRANS_ENTRY1(LWIN, LGUI, LGUI, LWIN, VK_LWIN, 0), + KEY_TRANS_ENTRY1(RWIN, RGUI, RGUI, RWIN, VK_RWIN, 0), + KEY_TRANS_ENTRY1(MENU, MENU, MENU, APPS, VK_APPS, 0), + KEY_TRANS_ENTRY1(PAUSE, PAUSE, PAUSE, PAUSE, VK_PAUSE, 0), + KEY_TRANS_ENTRY0(CANCEL, CANCEL, CANCEL, UNKNOWN, 0, 0, "CANCEL"), + KEY_TRANS_ENTRY1(BS_PAD, KP_BACKSPACE, KP_BACKSPACE, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(TAB_PAD, KP_TAB, KP_TAB, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(00_PAD, KP_00, KP_00, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(000_PAD, KP_000, KP_000, UNKNOWN, 0, 0), + KEY_TRANS_ENTRY1(COMMA_PAD, KP_COMMA, KP_COMMA, NUMPADCOMMA, 0, 0), + KEY_TRANS_ENTRY1(EQUALS_PAD, KP_EQUALS, KP_EQUALS, NUMPADEQUALS, 0, 0), // New keys introduced in Windows 2000. These have no MAME codes to // preserve compatibility with old config files that may refer to them @@ -167,19 +167,19 @@ key_trans_entry keyboard_trans_table::s_default_table[] = // GetAsyncKeyState polling is used (as happens currently when MAME is // paused). Some codes are missing because the mapping to vkey codes // isn't clear, and MapVirtualKey is no help. - KEY_TRANS_ENTRY1(OTHER_SWITCH, MUTE, MUTE, MUTE, VK_VOLUME_MUTE, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, VOLUMEDOWN, VOLUMEDOWN, VOLUMEDOWN, VK_VOLUME_DOWN, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, VOLUMEUP, VOLUMEUP, VOLUMEUP, VK_VOLUME_UP, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_HOME, AC_HOME, WEBHOME, VK_BROWSER_HOME, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_SEARCH, AC_SEARCH, WEBSEARCH, VK_BROWSER_SEARCH, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_BOOKMARKS, AC_BOOKMARKS, WEBFAVORITES, VK_BROWSER_FAVORITES, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_REFRESH, AC_REFRESH, WEBREFRESH, VK_BROWSER_REFRESH, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_STOP, AC_STOP, WEBSTOP, VK_BROWSER_STOP, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_FORWARD, AC_FORWARD, WEBFORWARD, VK_BROWSER_FORWARD, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_BACK, AC_BACK, WEBBACK, VK_BROWSER_BACK, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, MAIL, MAIL, MAIL, VK_LAUNCH_MAIL, None, 0), - KEY_TRANS_ENTRY1(OTHER_SWITCH, MEDIASELECT, MEDIASELECT, MEDIASELECT, VK_LAUNCH_MEDIA_SELECT, None, 0), - KEY_TRANS_ENTRY0(INVALID, UNKNOWN, UNKNOWN, ESCAPE, 0, None, 0, "INVALID") + KEY_TRANS_ENTRY1(OTHER_SWITCH, MUTE, MUTE, MUTE, VK_VOLUME_MUTE, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, VOLUMEDOWN, VOLUMEDOWN, VOLUMEDOWN, VK_VOLUME_DOWN, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, VOLUMEUP, VOLUMEUP, VOLUMEUP, VK_VOLUME_UP, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_HOME, AC_HOME, WEBHOME, VK_BROWSER_HOME, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_SEARCH, AC_SEARCH, WEBSEARCH, VK_BROWSER_SEARCH, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_BOOKMARKS, AC_BOOKMARKS, WEBFAVORITES, VK_BROWSER_FAVORITES, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_REFRESH, AC_REFRESH, WEBREFRESH, VK_BROWSER_REFRESH, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_STOP, AC_STOP, WEBSTOP, VK_BROWSER_STOP, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_FORWARD, AC_FORWARD, WEBFORWARD, VK_BROWSER_FORWARD, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, AC_BACK, AC_BACK, WEBBACK, VK_BROWSER_BACK, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, MAIL, MAIL, MAIL, VK_LAUNCH_MAIL, 0), + KEY_TRANS_ENTRY1(OTHER_SWITCH, MEDIASELECT, MEDIASELECT, MEDIASELECT, VK_LAUNCH_MEDIA_SELECT, 0), + KEY_TRANS_ENTRY0(INVALID, UNKNOWN, UNKNOWN, ESCAPE, 0, 0, "INVALID") }; // The private constructor to create the default instance -- cgit v1.2.3 From 951303452116588727a5127917dfccd36bc4ff1f Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Tue, 26 Oct 2021 11:53:27 +0200 Subject: Few more leftovers removed --- scripts/toolchain.lua | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 79aa3aec835..4a3eac02546 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -52,12 +52,6 @@ newoption { description = "Set Android platform version (default: android-21).", } -newoption { - trigger = "with-windows", - value = "#", - description = "Set the Windows target platform version (default: 10.0.10240.0).", -} - function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION) @@ -69,11 +63,6 @@ function toolchain(_buildDir, _subDir) androidPlatform = "android-24" end - local windowsPlatform = "10.0.10240.0" - if _OPTIONS["with-windows"] then - windowsPlatform = _OPTIONS["with-windows"] - end - if _ACTION == "gmake" or _ACTION == "ninja" then if nil == _OPTIONS["gcc"] or nil == _OPTIONS["gcc_version"] then @@ -266,16 +255,6 @@ function toolchain(_buildDir, _subDir) configuration { "x64", "vs*", "Debug" } targetdir (_buildDir .. _ACTION .. "/bin/x64/Debug") - configuration { "ARM", "vs*" } - targetdir (_buildDir .. _ACTION .. "/bin/ARM") - objdir (_buildDir .. _ACTION .. "/obj") - - configuration { "ARM", "vs*", "Release" } - targetdir (_buildDir .. _ACTION .. "/bin/ARM/Release") - - configuration { "ARM", "vs*", "Debug" } - targetdir (_buildDir .. _ACTION .. "/bin/ARM/Debug") - configuration { "x32", "vs*-clang" } objdir (_buildDir .. _ACTION .. "-clang/obj") -- cgit v1.2.3