mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
Upstream changes needed to compile JSMESS [Justin Kerk, John Vilk, Justin de Vesine]
Out of whatsnew: there are still a few files being worked on, and the build scripts which are currently set up outside of the MAME source hierarchy. Always open to cleaner ways of doing things.
This commit is contained in:
parent
b6e5d79245
commit
cdc51864b0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8626,6 +8626,7 @@ src/osd/sdl/sdlptty_unix.c svneol=native#text/plain
|
|||||||
src/osd/sdl/sdlptty_win32.c svneol=native#text/plain
|
src/osd/sdl/sdlptty_win32.c svneol=native#text/plain
|
||||||
src/osd/sdl/sdlsocket.c svneol=native#text/plain
|
src/osd/sdl/sdlsocket.c svneol=native#text/plain
|
||||||
src/osd/sdl/sdlsync.h svneol=native#text/plain
|
src/osd/sdl/sdlsync.h svneol=native#text/plain
|
||||||
|
src/osd/sdl/sdlsync_mini.c svneol=native#text/plain
|
||||||
src/osd/sdl/sdlsync_ntc.c svneol=native#text/plain
|
src/osd/sdl/sdlsync_ntc.c svneol=native#text/plain
|
||||||
src/osd/sdl/sdlsync_os2.c svneol=native#text/plain
|
src/osd/sdl/sdlsync_os2.c svneol=native#text/plain
|
||||||
src/osd/sdl/sdlsync_sdl.c svneol=native#text/plain
|
src/osd/sdl/sdlsync_sdl.c svneol=native#text/plain
|
||||||
|
@ -95,6 +95,28 @@ static char giant_string_buffer[65536] = { 0 };
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//**************************************************************************
|
||||||
|
// JAVASCRIPT PORT-SPECIFIC
|
||||||
|
//**************************************************************************
|
||||||
|
|
||||||
|
#ifdef SDLMAME_EMSCRIPTEN
|
||||||
|
#include <emscripten.h>
|
||||||
|
|
||||||
|
static device_scheduler * scheduler;
|
||||||
|
|
||||||
|
void js_main_loop() {
|
||||||
|
attotime stoptime = scheduler->time() + attotime(0,HZ_TO_ATTOSECONDS(60));
|
||||||
|
while (scheduler->time() < stoptime) {
|
||||||
|
scheduler->timeslice();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void js_set_main_loop(device_scheduler &sched) {
|
||||||
|
scheduler = &sched;
|
||||||
|
emscripten_set_main_loop(&js_main_loop, 0, 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
// RUNNING MACHINE
|
// RUNNING MACHINE
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -381,6 +403,11 @@ int running_machine::run(bool firstrun)
|
|||||||
{
|
{
|
||||||
g_profiler.start(PROFILER_EXTRA);
|
g_profiler.start(PROFILER_EXTRA);
|
||||||
|
|
||||||
|
#ifdef SDLMAME_EMSCRIPTEN
|
||||||
|
//break out to our async javascript loop and halt
|
||||||
|
js_set_main_loop(m_scheduler);
|
||||||
|
#endif
|
||||||
|
|
||||||
// execute CPUs if not paused
|
// execute CPUs if not paused
|
||||||
if (!m_paused)
|
if (!m_paused)
|
||||||
m_scheduler.timeslice();
|
m_scheduler.timeslice();
|
||||||
|
@ -594,7 +594,7 @@ static int drawogl_window_create(sdl_window_info *window, int width, int height)
|
|||||||
sdl->extra_flags |= SDL_OPENGL | SDL_DOUBLEBUF;
|
sdl->extra_flags |= SDL_OPENGL | SDL_DOUBLEBUF;
|
||||||
|
|
||||||
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
|
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
|
||||||
#if (SDL_VERSION_ATLEAST(1,2,10))
|
#if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
|
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -41,6 +41,12 @@
|
|||||||
#undef DELETE
|
#undef DELETE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Emscripten requires the SDL2 API for keyboard inputs, but nothing else
|
||||||
|
#ifdef SDLMAME_EMSCRIPTEN
|
||||||
|
#undef SDLMAME_SDL2
|
||||||
|
#define SDLMAME_SDL2 1
|
||||||
|
#endif
|
||||||
|
|
||||||
//============================================================
|
//============================================================
|
||||||
// PARAMETERS
|
// PARAMETERS
|
||||||
//============================================================
|
//============================================================
|
||||||
@ -496,6 +502,13 @@ static kt_table sdl_key_trans_table[] =
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(SDLMAME_EMSCRIPTEN)
|
||||||
|
#undef GET_WINDOW
|
||||||
|
#undef GET_FOCUS_WINDOW
|
||||||
|
#define GET_WINDOW(ev) sdl_window_list
|
||||||
|
#define GET_FOCUS_WINDOW(ev) sdl_window_list
|
||||||
|
#endif
|
||||||
|
|
||||||
struct key_lookup_table
|
struct key_lookup_table
|
||||||
{
|
{
|
||||||
int code;
|
int code;
|
||||||
@ -722,7 +735,7 @@ static void sdlinput_register_joysticks(running_machine &machine)
|
|||||||
{
|
{
|
||||||
char *joy_name;
|
char *joy_name;
|
||||||
|
|
||||||
#if (SDLMAME_SDL2)
|
#if (SDLMAME_SDL2) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
joy = SDL_JoystickOpen(physical_stick);
|
joy = SDL_JoystickOpen(physical_stick);
|
||||||
joy_name = remove_spaces(machine, SDL_JoystickName(joy));
|
joy_name = remove_spaces(machine, SDL_JoystickName(joy));
|
||||||
SDL_JoystickClose(joy);
|
SDL_JoystickClose(joy);
|
||||||
@ -1533,7 +1546,7 @@ INT32 normalize_absolute_axis(INT32 raw, INT32 rawmin, INT32 rawmax)
|
|||||||
// sdlinput_poll
|
// sdlinput_poll
|
||||||
//============================================================
|
//============================================================
|
||||||
|
|
||||||
#if (SDLMAME_SDL2)
|
#if (SDLMAME_SDL2) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
INLINE sdl_window_info * window_from_id(Uint32 windowID)
|
INLINE sdl_window_info * window_from_id(Uint32 windowID)
|
||||||
{
|
{
|
||||||
sdl_window_info *w;
|
sdl_window_info *w;
|
||||||
@ -1923,7 +1936,7 @@ void sdlinput_poll(running_machine &machine)
|
|||||||
devinfo->joystick.balls[event.jball.ball * 2] = event.jball.xrel * INPUT_RELATIVE_PER_PIXEL;
|
devinfo->joystick.balls[event.jball.ball * 2] = event.jball.xrel * INPUT_RELATIVE_PER_PIXEL;
|
||||||
devinfo->joystick.balls[event.jball.ball * 2 + 1] = event.jball.yrel * INPUT_RELATIVE_PER_PIXEL;
|
devinfo->joystick.balls[event.jball.ball * 2 + 1] = event.jball.yrel * INPUT_RELATIVE_PER_PIXEL;
|
||||||
break;
|
break;
|
||||||
#if (!SDLMAME_SDL2)
|
#if (!SDLMAME_SDL2) || defined(SDLMAME_EMSCRIPTEN)
|
||||||
case SDL_APPMOUSEFOCUS:
|
case SDL_APPMOUSEFOCUS:
|
||||||
app_has_mouse_focus = event.active.gain;
|
app_has_mouse_focus = event.active.gain;
|
||||||
if (!event.active.gain)
|
if (!event.active.gain)
|
||||||
@ -2000,7 +2013,7 @@ void sdlinput_poll(running_machine &machine)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if (SDLMAME_SDL2)
|
#if (SDLMAME_SDL2) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
resize_all_windows();
|
resize_all_windows();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -337,6 +337,12 @@ NO_USE_QTDEBUG = 1
|
|||||||
NO_OPENGL = 1
|
NO_OPENGL = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(TARGETOS),emscripten)
|
||||||
|
DEFS += -DSDLMAME_EMSCRIPTEN
|
||||||
|
BASE_TARGETOS = unix
|
||||||
|
SYNC_IMPLEMENTATION = mini
|
||||||
|
endif
|
||||||
|
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
# Sanity checks
|
# Sanity checks
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
@ -409,9 +415,12 @@ INCPATH += -Isrc/debug
|
|||||||
MOCINCPATH := $(INCPATH)
|
MOCINCPATH := $(INCPATH)
|
||||||
|
|
||||||
# add the prefix file
|
# add the prefix file
|
||||||
|
# Don't pull in the system includes if we are compiling for Emscripten, which has its own headers
|
||||||
|
ifneq ($(TARGETOS),emscripten)
|
||||||
INCPATH += -include $(SDLSRC)/sdlprefix.h
|
INCPATH += -include $(SDLSRC)/sdlprefix.h
|
||||||
INCPATH += -I/work/src/m/sdl
|
INCPATH += -I/work/src/m/sdl
|
||||||
MOCINCPATH += -I/work/src/m/sdl
|
MOCINCPATH += -I/work/src/m/sdl
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
@ -530,7 +539,9 @@ ifeq ($(NO_X11),1)
|
|||||||
NO_DEBUGGER = 1
|
NO_DEBUGGER = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(TARGETOS),emscripten)
|
||||||
INCPATH += `$(SDL_CONFIG) --cflags | sed -e 's:/SDL[2]*::' -e 's:\(-D[^ ]*\)::g'`
|
INCPATH += `$(SDL_CONFIG) --cflags | sed -e 's:/SDL[2]*::' -e 's:\(-D[^ ]*\)::g'`
|
||||||
|
endif
|
||||||
CCOMFLAGS += `$(SDL_CONFIG) --cflags | sed -e 's:/SDL[2]*::' -e 's:\(-I[^ ]*\)::g'`
|
CCOMFLAGS += `$(SDL_CONFIG) --cflags | sed -e 's:/SDL[2]*::' -e 's:\(-I[^ ]*\)::g'`
|
||||||
|
|
||||||
LIBS += `$(SDL_CONFIG) --libs`
|
LIBS += `$(SDL_CONFIG) --libs`
|
||||||
@ -542,7 +553,9 @@ INCPATH += -I$(SDL_INSTALL_ROOT)/include/directfb
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(TARGETOS),emscripten)
|
||||||
INCPATH += `pkg-config --cflags fontconfig`
|
INCPATH += `pkg-config --cflags fontconfig`
|
||||||
|
endif
|
||||||
LIBS += `pkg-config --libs fontconfig`
|
LIBS += `pkg-config --libs fontconfig`
|
||||||
|
|
||||||
ifeq ($(SDL_LIBVER),sdl2)
|
ifeq ($(SDL_LIBVER),sdl2)
|
||||||
@ -597,7 +610,9 @@ ifeq ($(BASE_TARGETOS),win32)
|
|||||||
OSDCOREOBJS += $(SDLMAIN)
|
OSDCOREOBJS += $(SDLMAIN)
|
||||||
|
|
||||||
ifdef SDL_INSTALL_ROOT
|
ifdef SDL_INSTALL_ROOT
|
||||||
|
ifneq ($(TARGETOS),emscripten)
|
||||||
INCPATH += -I$(SDL_INSTALL_ROOT)/include
|
INCPATH += -I$(SDL_INSTALL_ROOT)/include
|
||||||
|
endif
|
||||||
LIBS += -L$(SDL_INSTALL_ROOT)/lib
|
LIBS += -L$(SDL_INSTALL_ROOT)/lib
|
||||||
#-Wl,-rpath,$(SDL_INSTALL_ROOT)/lib
|
#-Wl,-rpath,$(SDL_INSTALL_ROOT)/lib
|
||||||
endif
|
endif
|
||||||
@ -714,6 +729,11 @@ LIBS += -L/usr/X11/lib -L/usr/X11R6/lib -L/usr/openwin/lib
|
|||||||
INCPATH += -I/usr/X11/include -I/usr/X11R6/include -I/usr/openwin/include
|
INCPATH += -I/usr/X11/include -I/usr/X11R6/include -I/usr/openwin/include
|
||||||
endif # NO_X11
|
endif # NO_X11
|
||||||
|
|
||||||
|
# can't use native libs with emscripten
|
||||||
|
ifeq ($(TARGETOS),emscripten)
|
||||||
|
LIBS =
|
||||||
|
endif
|
||||||
|
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
# XInput
|
# XInput
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#define INVPATHSEPCH '\\'
|
#define INVPATHSEPCH '\\'
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
|
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU) || defined(SDLMAME_EMSCRIPTEN)
|
||||||
typedef struct dirent sdl_dirent;
|
typedef struct dirent sdl_dirent;
|
||||||
typedef struct stat sdl_stat;
|
typedef struct stat sdl_stat;
|
||||||
#define sdl_readdir readdir
|
#define sdl_readdir readdir
|
||||||
|
@ -103,7 +103,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64
|
|||||||
UINT32 access;
|
UINT32 access;
|
||||||
const char *src;
|
const char *src;
|
||||||
char *dst;
|
char *dst;
|
||||||
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
|
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU) || defined(SDLMAME_EMSCRIPTEN)
|
||||||
struct stat st;
|
struct stat st;
|
||||||
#else
|
#else
|
||||||
struct stat64 st;
|
struct stat64 st;
|
||||||
@ -203,7 +203,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// attempt to open the file
|
// attempt to open the file
|
||||||
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
|
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU) || defined(SDLMAME_EMSCRIPTEN)
|
||||||
(*file)->handle = open(tmpstr, access, 0666);
|
(*file)->handle = open(tmpstr, access, 0666);
|
||||||
#else
|
#else
|
||||||
(*file)->handle = open64(tmpstr, access, 0666);
|
(*file)->handle = open64(tmpstr, access, 0666);
|
||||||
@ -226,7 +226,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64
|
|||||||
// attempt to reopen the file
|
// attempt to reopen the file
|
||||||
if (error == NO_ERROR)
|
if (error == NO_ERROR)
|
||||||
{
|
{
|
||||||
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
|
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU) || defined(SDLMAME_EMSCRIPTEN)
|
||||||
(*file)->handle = open(tmpstr, access, 0666);
|
(*file)->handle = open(tmpstr, access, 0666);
|
||||||
#else
|
#else
|
||||||
(*file)->handle = open64(tmpstr, access, 0666);
|
(*file)->handle = open64(tmpstr, access, 0666);
|
||||||
@ -246,6 +246,21 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get the file size
|
// get the file size
|
||||||
|
#ifdef SDLMAME_EMSCRIPTEN
|
||||||
|
//the fstat approach does not work on emscripten, work around for now
|
||||||
|
FILE *fileptr;
|
||||||
|
fileptr = fdopen((*file)->handle,"rb");
|
||||||
|
if (fileptr == NULL)
|
||||||
|
{
|
||||||
|
*filesize = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fseek(fileptr, 0, SEEK_END);
|
||||||
|
*filesize = ftell(fileptr);
|
||||||
|
fseek(fileptr, 0, SEEK_SET);
|
||||||
|
}
|
||||||
|
#else
|
||||||
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
|
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2) || defined(SDLMAME_HAIKU)
|
||||||
fstat((*file)->handle, &st);
|
fstat((*file)->handle, &st);
|
||||||
#else
|
#else
|
||||||
@ -253,6 +268,7 @@ file_error osd_open(const char *path, UINT32 openflags, osd_file **file, UINT64
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
*filesize = (UINT64)st.st_size;
|
*filesize = (UINT64)st.st_size;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@ -279,7 +295,7 @@ file_error osd_read(osd_file *file, void *buffer, UINT64 offset, UINT32 count, U
|
|||||||
switch (file->type)
|
switch (file->type)
|
||||||
{
|
{
|
||||||
case SDLFILE_FILE:
|
case SDLFILE_FILE:
|
||||||
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD)
|
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD) || defined(SDLMAME_EMSCRIPTEN)
|
||||||
result = pread(file->handle, buffer, count, offset);
|
result = pread(file->handle, buffer, count, offset);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
#elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
|
#elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
|
||||||
@ -325,7 +341,7 @@ file_error osd_write(osd_file *file, const void *buffer, UINT64 offset, UINT32 c
|
|||||||
switch (file->type)
|
switch (file->type)
|
||||||
{
|
{
|
||||||
case SDLFILE_FILE:
|
case SDLFILE_FILE:
|
||||||
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD)
|
#if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD) || defined(SDLMAME_EMSCRIPTEN)
|
||||||
result = pwrite(file->handle, buffer, count, offset);
|
result = pwrite(file->handle, buffer, count, offset);
|
||||||
if (!result)
|
if (!result)
|
||||||
#elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
|
#elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifdef SDLMAME_UNIX
|
#ifdef SDLMAME_UNIX
|
||||||
#ifndef SDLMAME_MACOSX
|
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
#if (SDLMAME_SDL2)
|
#if (SDLMAME_SDL2)
|
||||||
//#include <SDL2/SDL_ttf.h>
|
//#include <SDL2/SDL_ttf.h>
|
||||||
#else
|
#else
|
||||||
@ -337,7 +337,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#ifdef SDLMAME_UNIX
|
#ifdef SDLMAME_UNIX
|
||||||
sdl_entered_debugger = 0;
|
sdl_entered_debugger = 0;
|
||||||
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU))
|
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
#if !(SDLMAME_SDL2)
|
#if !(SDLMAME_SDL2)
|
||||||
if (TTF_Init() == -1)
|
if (TTF_Init() == -1)
|
||||||
{
|
{
|
||||||
@ -391,7 +391,7 @@ int main(int argc, char *argv[])
|
|||||||
//SDL_Quit();
|
//SDL_Quit();
|
||||||
|
|
||||||
#ifdef SDLMAME_UNIX
|
#ifdef SDLMAME_UNIX
|
||||||
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU))
|
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_HAIKU)) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
#if !(SDLMAME_SDL2)
|
#if !(SDLMAME_SDL2)
|
||||||
TTF_Quit();
|
TTF_Quit();
|
||||||
#endif
|
#endif
|
||||||
@ -720,7 +720,7 @@ void sdl_osd_interface::init(running_machine &machine)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SDLMAME_UNIX
|
#if defined(SDLMAME_UNIX) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
#define POINT_SIZE 144.0
|
#define POINT_SIZE 144.0
|
||||||
|
|
||||||
#ifdef SDLMAME_MACOSX
|
#ifdef SDLMAME_MACOSX
|
||||||
|
@ -64,6 +64,10 @@
|
|||||||
#define SDLMAME_NO64BITIO 1
|
#define SDLMAME_NO64BITIO 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(EMSCRIPTEN)
|
||||||
|
#define SDLMAME_NO64BITIO 1
|
||||||
|
#endif
|
||||||
|
|
||||||
// fix for Ubuntu 8.10
|
// fix for Ubuntu 8.10
|
||||||
#ifdef _FORTIFY_SOURCE
|
#ifdef _FORTIFY_SOURCE
|
||||||
#undef _FORTIFY_SOURCE
|
#undef _FORTIFY_SOURCE
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#elif defined(SDLMAME_OPENBSD)
|
#elif defined(SDLMAME_OPENBSD)
|
||||||
# include <termios.h>
|
# include <termios.h>
|
||||||
# include <util.h>
|
# include <util.h>
|
||||||
#elif defined(SDLMAME_LINUX)
|
#elif defined(SDLMAME_LINUX) || defined(SDLMAME_EMSCRIPTEN)
|
||||||
# include <pty.h>
|
# include <pty.h>
|
||||||
#elif defined(SDLMAME_HAIKU)
|
#elif defined(SDLMAME_HAIKU)
|
||||||
# include <bsd/pty.h>
|
# include <bsd/pty.h>
|
||||||
|
@ -109,7 +109,7 @@ file_error sdl_open_socket(const char *path, UINT32 openflags, osd_file **file,
|
|||||||
|
|
||||||
file_error sdl_read_socket(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
|
file_error sdl_read_socket(osd_file *file, void *buffer, UINT64 offset, UINT32 count, UINT32 *actual)
|
||||||
{
|
{
|
||||||
#ifndef SDLMAME_WIN32
|
#if (!defined(SDLMAME_WIN32)) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
ssize_t result;
|
ssize_t result;
|
||||||
char line[80];
|
char line[80];
|
||||||
struct timeval timeout;
|
struct timeval timeout;
|
||||||
|
173
src/osd/sdl/sdlsync_mini.c
Normal file
173
src/osd/sdl/sdlsync_mini.c
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
// license:BSD-3-Clause
|
||||||
|
// copyright-holders:Aaron Giles
|
||||||
|
//============================================================
|
||||||
|
//
|
||||||
|
// sdlsync_mini.c - Minimal core synchronization functions
|
||||||
|
//
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
#include "osdcore.h"
|
||||||
|
#include "sdlsync.h"
|
||||||
|
|
||||||
|
#define USE_SCALABLE_LOCKS (0)
|
||||||
|
|
||||||
|
struct _osd_event
|
||||||
|
{
|
||||||
|
void * ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _osd_thread {
|
||||||
|
void * ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_lock_alloc
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
osd_lock *osd_lock_alloc(void)
|
||||||
|
{
|
||||||
|
// the minimal implementation does not support threading
|
||||||
|
// just return a dummy value here
|
||||||
|
return (osd_lock *)1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_lock_acquire
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
void osd_lock_acquire(osd_lock *lock)
|
||||||
|
{
|
||||||
|
// the minimal implementation does not support threading
|
||||||
|
// the acquire always "succeeds"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_lock_try
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
int osd_lock_try(osd_lock *lock)
|
||||||
|
{
|
||||||
|
// the minimal implementation does not support threading
|
||||||
|
// the acquire always "succeeds"
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_lock_release
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
void osd_lock_release(osd_lock *lock)
|
||||||
|
{
|
||||||
|
// the minimal implementation does not support threading
|
||||||
|
// do nothing here
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_lock_free
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
void osd_lock_free(osd_lock *lock)
|
||||||
|
{
|
||||||
|
// the minimal implementation does not support threading
|
||||||
|
// do nothing here
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_event_alloc
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
osd_event *osd_event_alloc(int manualreset, int initialstate)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_event_free
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
void osd_event_free(osd_event *event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_event_set
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
void osd_event_set(osd_event *event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_event_reset
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
void osd_event_reset(osd_event *event)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_event_wait
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
int osd_event_wait(osd_event *event, osd_ticks_t timeout)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_thread_create
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
osd_thread *osd_thread_create(osd_thread_callback callback, void *cbparam)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_thread_adjust_priority
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
int osd_thread_adjust_priority(osd_thread *thread, int adjust)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_thread_cpu_affinity
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
int osd_thread_cpu_affinity(osd_thread *thread, UINT32 mask)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_thread_wait_free
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
void osd_thread_wait_free(osd_thread *thread)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================
|
||||||
|
// osd_process_kill
|
||||||
|
//============================================================
|
||||||
|
|
||||||
|
void osd_process_kill(void)
|
||||||
|
{
|
||||||
|
}
|
@ -88,7 +88,7 @@ static sdl_window_info **last_window_ptr;
|
|||||||
static int multithreading_enabled;
|
static int multithreading_enabled;
|
||||||
static osd_work_queue *work_queue;
|
static osd_work_queue *work_queue;
|
||||||
|
|
||||||
#if !(SDLMAME_SDL2)
|
#if !(SDLMAME_SDL2) && (!defined(SDLMAME_EMSCRIPTEN))
|
||||||
typedef int SDL_threadID;
|
typedef int SDL_threadID;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user