Skip to content

Commit

Permalink
Add preliminary patches to allow for building for DDR classic mini
Browse files Browse the repository at this point in the history
  • Loading branch information
987123879113 committed Oct 12, 2024
1 parent 1f8d516 commit 9a2b312
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 11 deletions.
15 changes: 15 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions scripts/genie.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
12 changes: 7 additions & 5 deletions scripts/src/osd/sdl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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",
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/src/osd/sdl_cfg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
Expand Down
2 changes: 1 addition & 1 deletion src/osd/modules/font/font_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/osd/modules/lib/osdobj_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/osd/sdl/sdlmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <functional>

#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 <fontconfig/fontconfig.h>
#endif
Expand Down Expand Up @@ -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
Expand All @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions src/osd/sdl/sdlprefix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a2b312

Please sign in to comment.