From 9a2b312caa3df990faa49bb7a8afd16cfd814a6b Mon Sep 17 00:00:00 2001 From: 987123879113 <63495610+987123879113@users.noreply.github.com> Date: Sat, 12 Oct 2024 19:35:32 +0900 Subject: [PATCH] Add preliminary patches to allow for building for DDR classic mini --- makefile | 15 +++++++++++++++ scripts/genie.lua | 11 +++++++++++ scripts/src/osd/sdl.lua | 12 +++++++----- scripts/src/osd/sdl_cfg.lua | 2 +- src/osd/modules/font/font_sdl.cpp | 2 +- src/osd/modules/lib/osdobj_common.cpp | 2 +- src/osd/sdl/sdlmain.cpp | 6 +++--- src/osd/sdl/sdlprefix.h | 4 ++++ 8 files changed, 43 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index ddf809310a0bf..90abae1201df7 100644 --- a/makefile +++ b/makefile @@ -130,6 +130,21 @@ endif ########################################################################### +ifdef IS_DDRMINI +PARAMS += --IS_DDRMINI='$(IS_DDRMINI)' +USE_LIBSDL=1 +USE_OPENGL=0 +USE_QTDEBUG=0 +NO_USE_PORTAUDIO=1 +NO_USE_PULSEAUDIO=1 +NO_USE_MIDI=1 +NO_X11=1 +NO_USE_XINPUT=1 +NO_USE_XINPUT_WII_LIGHTGUN_HACK=1 +NO_OPENGL=1 +endif + + ifndef MAKETYPE MAKETYPE := gmake endif diff --git a/scripts/genie.lua b/scripts/genie.lua index ddd2d8e0c6d67..58e46fbff7236 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -427,6 +427,11 @@ newoption { description = "Select projects to be built. Will look into project folder for files.", } +newoption { + trigger = "IS_DDRMINI", + description = "Is building for a DDR classic mini environment.", +} + dofile ("extlib.lua") if _OPTIONS["SHLIB"]=="1" then @@ -570,6 +575,12 @@ configuration { "gmake or ninja" } dofile ("toolchain.lua") +if _OPTIONS["IS_DDRMINI"]=="1" then + defines { + "__DDRMINI__", + } +end + if _OPTIONS["targetos"]=="windows" then configuration { "x64" } defines { diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index cc31fa52008b1..ac28a979f1016 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -30,10 +30,12 @@ function maintargetosdoptions(_target,_subtarget) "Xinerama", } else - if _OPTIONS["targetos"]=="linux" or _OPTIONS["targetos"]=="netbsd" or _OPTIONS["targetos"]=="openbsd" then - links { - "EGL", - } + if _OPTIONS["IS_DDRMINI"]~="1" then + if _OPTIONS["targetos"]=="linux" or _OPTIONS["targetos"]=="netbsd" or _OPTIONS["targetos"]=="openbsd" then + links { + "EGL", + } + end end end @@ -50,7 +52,7 @@ function maintargetosdoptions(_target,_subtarget) } end - if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" and _OPTIONS["targetos"]~="android" and _OPTIONS["targetos"]~="asmjs" then + if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" and _OPTIONS["targetos"]~="android" and _OPTIONS["targetos"]~="asmjs" and _OPTIONS["IS_DDRMINI"]~="1" then links { "SDL2_ttf", } diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index 10dde2d511e03..8636de40ac213 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -126,7 +126,7 @@ if BASE_TARGETOS=="unix" then buildoptions { backtick(sdlconfigcmd() .. " --cflags"), } - if _OPTIONS["targetos"]~="asmjs" then + if _OPTIONS["targetos"]~="asmjs" and _OPTIONS["IS_DDRMINI"]~="1" then buildoptions { backtick(pkgconfigcmd() .. " --cflags fontconfig"), } diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 1938c97a44d7f..d56b0bc05dc9e 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -7,7 +7,7 @@ #include "font_module.h" -#if defined(SDLMAME_UNIX) && !defined(SDLMAME_MACOSX) && !defined(SDLMAME_HAIKU) && !defined(SDLMAME_ANDROID) +#if defined(SDLMAME_UNIX) && !defined(SDLMAME_MACOSX) && !defined(SDLMAME_HAIKU) && !defined(SDLMAME_ANDROID) && !defined(SDLMAME_DDRMINI) #include "corestr.h" #include "emucore.h" diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index ca166c3dbd94c..0a44ab32fc6ef 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -250,7 +250,7 @@ void osd_common_t::register_options() #endif REGISTER_MODULE(m_mod_man, RENDERER_GDI); // GDI ahead of OpenGL as there's a chance Windows has no OpenGL REGISTER_MODULE(m_mod_man, RENDERER_OPENGL); -#if !defined(OSD_WINDOWS) && !defined(SDLMAME_WIN32) +#if !defined(OSD_WINDOWS) && !defined(SDLMAME_WIN32) && !defined(SDLMAME_DDRMINI) REGISTER_MODULE(m_mod_man, RENDERER_BGFX); // try BGFX after OpenGL on other operating systems for now #endif REGISTER_MODULE(m_mod_man, RENDERER_SDL2); diff --git a/src/osd/sdl/sdlmain.cpp b/src/osd/sdl/sdlmain.cpp index 1933bde1de6fe..0a77ddf2debc3 100644 --- a/src/osd/sdl/sdlmain.cpp +++ b/src/osd/sdl/sdlmain.cpp @@ -30,7 +30,7 @@ #include #ifdef SDLMAME_UNIX -#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_EMSCRIPTEN)) && (!defined(SDLMAME_ANDROID)) +#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_EMSCRIPTEN)) && (!defined(SDLMAME_ANDROID)) && (!defined(SDLMAME_DDRMINI)) #ifndef SDLMAME_HAIKU #include #endif @@ -88,7 +88,7 @@ int main(int argc, char** argv) #ifdef SDLMAME_UNIX sdl_entered_debugger = 0; -#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) && (!defined(SDLMAME_ANDROID)) +#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) && (!defined(SDLMAME_ANDROID)) && (!defined(SDLMAME_DDRMINI)) FcInit(); #endif #endif @@ -101,7 +101,7 @@ int main(int argc, char** argv) } #ifdef SDLMAME_UNIX -#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) && (!defined(SDLMAME_ANDROID)) +#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN)) && (!defined(SDLMAME_ANDROID)) && (!defined(SDLMAME_DDRMINI)) if (!sdl_entered_debugger) { FcFini(); diff --git a/src/osd/sdl/sdlprefix.h b/src/osd/sdl/sdlprefix.h index 0678b3ddba5c1..f40b42e876193 100644 --- a/src/osd/sdl/sdlprefix.h +++ b/src/osd/sdl/sdlprefix.h @@ -73,6 +73,10 @@ struct _IO_FILE {}; //_IO_FILE is an opaque type in the emscripten libc which m #define SDLMAME_ANDROID 1 #endif +#if defined(__DDRMINI__) +#define SDLMAME_DDRMINI 1 +#endif + // fix for Ubuntu 8.10 #ifdef _FORTIFY_SOURCE #undef _FORTIFY_SOURCE