summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/lib
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2021-10-26 11:28:11 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2021-10-26 11:28:11 +0200
commit67389f4cbdd00e1b139590325d5fbae47d0e62d0 (patch)
treea2b67645237774e133a5c785d9d7a2d7a72e55b9 /src/osd/modules/lib
parent9d61cf33d156aab6ad7c003cafecaa3303444bc4 (diff)
Remove uwp specific sources
Diffstat (limited to 'src/osd/modules/lib')
-rw-r--r--src/osd/modules/lib/osdlib_uwp.cpp207
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp2
2 files changed, 0 insertions, 209 deletions
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 <cstdio>
-#include <cstdlib>
-#include <map>
-#include <memory>
-
-#include <windows.h>
-#include <memoryapi.h>
-
-#include <wrl\client.h>
-
-
-using namespace Platform;
-using namespace Windows::ApplicationModel::DataTransfer;
-using namespace Windows::Foundation;
-
-
-//============================================================
-// GLOBAL VARIABLES
-//============================================================
-
-std::map<const char *, std::unique_ptr<char>> 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<char>(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<String^>^ 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<std::size_t> 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);