mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
Bring back USE_SDL, CYGWIN_BUILD and malloc debugging for Windows OSD
This commit is contained in:
parent
7b19a9d10b
commit
4cd434246d
10
makefile
10
makefile
@ -28,6 +28,7 @@
|
|||||||
# NO_OPENGL = 1
|
# NO_OPENGL = 1
|
||||||
# USE_DISPATCH_GL = 0
|
# USE_DISPATCH_GL = 0
|
||||||
# DIRECTINPUT = 7
|
# DIRECTINPUT = 7
|
||||||
|
# USE_SDL = 1
|
||||||
# SDL2_MULTIAPI = 1
|
# SDL2_MULTIAPI = 1
|
||||||
# NO_USE_MIDI = 1
|
# NO_USE_MIDI = 1
|
||||||
# DONT_USE_NETWORK = 1
|
# DONT_USE_NETWORK = 1
|
||||||
@ -57,6 +58,7 @@
|
|||||||
# SDL_FRAMEWORK_PATH = $(HOME)/Library/Frameworks
|
# SDL_FRAMEWORK_PATH = $(HOME)/Library/Frameworks
|
||||||
# SDL_LIBVER = sdl
|
# SDL_LIBVER = sdl
|
||||||
# MACOSX_USE_LIBSDL = 1
|
# MACOSX_USE_LIBSDL = 1
|
||||||
|
# CYGWIN_BUILD = 1
|
||||||
|
|
||||||
# TARGETOS = windows
|
# TARGETOS = windows
|
||||||
# CROSS_BUILD = 1
|
# CROSS_BUILD = 1
|
||||||
@ -406,6 +408,14 @@ ifdef DIRECTINPUT
|
|||||||
PARAMS += --DIRECTINPUT='$(DIRECTINPUT)'
|
PARAMS += --DIRECTINPUT='$(DIRECTINPUT)'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef USE_SDL
|
||||||
|
PARAMS += --USE_SDL='$(USE_SDL)'
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef CYGWIN_BUILD
|
||||||
|
PARAMS += --CYGWIN_BUILD='$(CYGWIN_BUILD)'
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef MESA_INSTALL_ROOT
|
ifdef MESA_INSTALL_ROOT
|
||||||
PARAMS += --MESA_INSTALL_ROOT='$(MESA_INSTALL_ROOT)'
|
PARAMS += --MESA_INSTALL_ROOT='$(MESA_INSTALL_ROOT)'
|
||||||
endif
|
endif
|
||||||
|
@ -21,6 +21,13 @@ function maintargetosdoptions(_target)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if _OPTIONS["USE_SDL"] == "1" then
|
||||||
|
links {
|
||||||
|
"SDL.dll",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
local rcfile = MAME_DIR .. "src/" .. _target .. "/osd/windows/" .. _target ..".rc"
|
local rcfile = MAME_DIR .. "src/" .. _target .. "/osd/windows/" .. _target ..".rc"
|
||||||
|
|
||||||
if os.isfile(rcfile) then
|
if os.isfile(rcfile) then
|
||||||
@ -40,7 +47,7 @@ newoption {
|
|||||||
description = "Minimum DirectInput version to support",
|
description = "Minimum DirectInput version to support",
|
||||||
allowed = {
|
allowed = {
|
||||||
{ "7", "Support DirectInput 7 or later" },
|
{ "7", "Support DirectInput 7 or later" },
|
||||||
{ "8", "Support DirectInput 8 or later" },
|
{ "8", "Support DirectInput 8 or later" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +55,42 @@ if not _OPTIONS["DIRECTINPUT"] then
|
|||||||
_OPTIONS["DIRECTINPUT"] = "8"
|
_OPTIONS["DIRECTINPUT"] = "8"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
newoption {
|
||||||
|
trigger = "USE_SDL",
|
||||||
|
description = "Enable SDL sound output",
|
||||||
|
allowed = {
|
||||||
|
{ "0", "Disable SDL sound output" },
|
||||||
|
{ "1", "Enable SDL sound output" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if not _OPTIONS["USE_SDL"] then
|
||||||
|
_OPTIONS["USE_SDL"] = "0"
|
||||||
|
end
|
||||||
|
|
||||||
|
newoption {
|
||||||
|
trigger = "CYGWIN_BUILD",
|
||||||
|
description = "Build with Cygwin tools",
|
||||||
|
allowed = {
|
||||||
|
{ "0", "Build with MinGW tools" },
|
||||||
|
{ "1", "Build with Cygwin tools" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if not _OPTIONS["CYGWIN_BUILD"] then
|
||||||
|
_OPTIONS["CYGWIN_BUILD"] = "0"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if _OPTIONS["CYGWIN_BUILD"] == "1" then
|
||||||
|
buildoptions {
|
||||||
|
"-mmo-cygwin",
|
||||||
|
}
|
||||||
|
linkoptions {
|
||||||
|
"-mno-cygwin",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
project ("osd_" .. _OPTIONS["osd"])
|
project ("osd_" .. _OPTIONS["osd"])
|
||||||
uuid (os.uuid("osd_" .. _OPTIONS["osd"]))
|
uuid (os.uuid("osd_" .. _OPTIONS["osd"]))
|
||||||
@ -157,7 +200,7 @@ project ("ocore_" .. _OPTIONS["osd"])
|
|||||||
MAME_DIR .. "src/osd/modules/lib/osdlib_win32.c",
|
MAME_DIR .. "src/osd/modules/lib/osdlib_win32.c",
|
||||||
}
|
}
|
||||||
|
|
||||||
if _OPTIONS["NOASM"]=="1" then
|
if _OPTIONS["NOASM"] == "1" then
|
||||||
files {
|
files {
|
||||||
MAME_DIR .. "src/osd/modules/sync/work_mini.c",
|
MAME_DIR .. "src/osd/modules/sync/work_mini.c",
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,15 @@ defines {
|
|||||||
"UNICODE",
|
"UNICODE",
|
||||||
"_UNICODE",
|
"_UNICODE",
|
||||||
"OSD_WINDOWS",
|
"OSD_WINDOWS",
|
||||||
"USE_SDL=0",
|
|
||||||
"main=utf8_main",
|
"main=utf8_main",
|
||||||
"_WIN32_WINNT=0x0501",
|
"_WIN32_WINNT=0x0501",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configuration { "Debug" }
|
||||||
|
defines {
|
||||||
|
"MALLOC_DEBUG",
|
||||||
|
}
|
||||||
|
|
||||||
configuration { "vs*" }
|
configuration { "vs*" }
|
||||||
flags {
|
flags {
|
||||||
"Unicode",
|
"Unicode",
|
||||||
@ -20,3 +24,16 @@ if not _OPTIONS["DONT_USE_NETWORK"] then
|
|||||||
"OSD_NET_USE_PCAP",
|
"OSD_NET_USE_PCAP",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if _OPTIONS["USE_SDL"]=="1" then
|
||||||
|
defines {
|
||||||
|
"SDLMAME_SDL2=0",
|
||||||
|
"USE_XINPUT=0",
|
||||||
|
"USE_SDL=1",
|
||||||
|
"USE_SDL_SOUND",
|
||||||
|
}
|
||||||
|
else
|
||||||
|
defines {
|
||||||
|
"USE_SDL=0",
|
||||||
|
}
|
||||||
|
end
|
||||||
|
@ -32,8 +32,8 @@
|
|||||||
#include "modules/lib/osdlib.h"
|
#include "modules/lib/osdlib.h"
|
||||||
#include "modules/lib/osdobj_common.h"
|
#include "modules/lib/osdobj_common.h"
|
||||||
|
|
||||||
#ifdef OSD_WINDOWS
|
#if defined(OSD_WINDOWS) && !defined(SDLMAME_SDL2)
|
||||||
#define SDLMAME_SDL2 1
|
#define SDLMAME_SDL2 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// OpenGL headers
|
// OpenGL headers
|
||||||
@ -189,9 +189,8 @@ enum
|
|||||||
// TYPES
|
// TYPES
|
||||||
//============================================================
|
//============================================================
|
||||||
|
|
||||||
#if (SDLMAME_SDL2)
|
#if defined(OSD_WINDOWS)
|
||||||
|
|
||||||
#ifdef OSD_WINDOWS
|
|
||||||
class win_gl_context : public osd_gl_context
|
class win_gl_context : public osd_gl_context
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -347,7 +346,8 @@ private:
|
|||||||
HMODULE win_gl_context::m_module;
|
HMODULE win_gl_context::m_module;
|
||||||
|
|
||||||
|
|
||||||
#else
|
#elif SDLMAME_SDL2
|
||||||
|
|
||||||
class sdl_gl_context : public osd_gl_context
|
class sdl_gl_context : public osd_gl_context
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -396,7 +396,7 @@ private:
|
|||||||
SDL_Window *m_window;
|
SDL_Window *m_window;
|
||||||
char m_error[256];
|
char m_error[256];
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
// SDL 1.2
|
// SDL 1.2
|
||||||
class sdl12_gl_context : public osd_gl_context
|
class sdl12_gl_context : public osd_gl_context
|
||||||
@ -442,7 +442,6 @@ private:
|
|||||||
char m_error[256];
|
char m_error[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
@ -763,12 +762,13 @@ int drawogl_init(running_machine &machine, osd_draw_callbacks *callbacks)
|
|||||||
dll_loaded = 0;
|
dll_loaded = 0;
|
||||||
|
|
||||||
load_gl_lib(machine);
|
load_gl_lib(machine);
|
||||||
if (SDLMAME_SDL2)
|
#if defined(OSD_WINDOWS)
|
||||||
{
|
osd_printf_verbose("Using Windows OpenGL driver\n");
|
||||||
osd_printf_verbose("Using SDL multi-window OpenGL driver (SDL 2.0+)\n");
|
#elif SDLMAME_SDL2
|
||||||
}
|
osd_printf_verbose("Using SDL multi-window OpenGL driver (SDL 2.0+)\n");
|
||||||
else
|
#else
|
||||||
osd_printf_verbose("Using SDL single-window OpenGL driver (SDL 1.2)\n");
|
osd_printf_verbose("Using SDL single-window OpenGL driver (SDL 1.2)\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1030,13 +1030,11 @@ void sdl_info_ogl::initialize_gl()
|
|||||||
|
|
||||||
int sdl_info_ogl::create()
|
int sdl_info_ogl::create()
|
||||||
{
|
{
|
||||||
#if (SDLMAME_SDL2)
|
|
||||||
// create renderer
|
// create renderer
|
||||||
#ifdef OSD_WINDOWS
|
#if defined(OSD_WINDOWS)
|
||||||
m_gl_context = global_alloc(win_gl_context(window().m_hwnd));
|
m_gl_context = global_alloc(win_gl_context(window().m_hwnd));
|
||||||
#else
|
#elif SDLMAME_SDL2
|
||||||
m_gl_context = global_alloc(sdl_gl_context(window().sdl_window()));
|
m_gl_context = global_alloc(sdl_gl_context(window().sdl_window()));
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
m_gl_context = global_alloc(sdl12_gl_context(window().sdl_surface()));
|
m_gl_context = global_alloc(sdl12_gl_context(window().sdl_surface()));
|
||||||
#endif
|
#endif
|
||||||
@ -1530,7 +1528,7 @@ int sdl_info_ogl::draw(const int update)
|
|||||||
if (m_init_context)
|
if (m_init_context)
|
||||||
{
|
{
|
||||||
// do some one-time OpenGL setup
|
// do some one-time OpenGL setup
|
||||||
#if (SDLMAME_SDL2)
|
#if SDLMAME_SDL2
|
||||||
// FIXME: SRGB conversion is working on SDL2, may be of use
|
// FIXME: SRGB conversion is working on SDL2, may be of use
|
||||||
// when we eventually target gamma and monitor profiles.
|
// when we eventually target gamma and monitor profiles.
|
||||||
//glEnable(GL_FRAMEBUFFER_SRGB);
|
//glEnable(GL_FRAMEBUFFER_SRGB);
|
||||||
@ -1560,7 +1558,7 @@ int sdl_info_ogl::draw(const int update)
|
|||||||
loadGLExtensions();
|
loadGLExtensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (!SDLMAME_SDL2)
|
#if !defined(OSD_WINDOWS) && !SDLMAME_SDL2
|
||||||
// force all textures to be regenerated
|
// force all textures to be regenerated
|
||||||
destroy_all_textures();
|
destroy_all_textures();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user