mirror of
https://github.com/holub/mame
synced 2025-04-20 23:42:22 +03:00
moved osdsync to root of OSD, removed osdmini (nw)
This commit is contained in:
parent
a83a3c4497
commit
59662e6c71
21
makefile
21
makefile
@ -345,7 +345,7 @@ CXX:= $(SILENT)g++
|
||||
|
||||
ifndef OSD
|
||||
|
||||
OSD := osdmini
|
||||
OSD := sdl
|
||||
|
||||
ifeq ($(TARGETOS),windows)
|
||||
OSD := windows
|
||||
@ -874,7 +874,6 @@ else
|
||||
FULLTARGET := $(TARGET)$(SUBTARGET)
|
||||
endif
|
||||
PROJECTDIR := $(BUILDDIR)/projects/$(OSD)/$(FULLTARGET)
|
||||
PROJECTDIR_MINI := $(BUILDDIR)/projects/osdmini/$(FULLTARGET)
|
||||
PROJECTDIR_SDL := $(BUILDDIR)/projects/sdl/$(FULLTARGET)
|
||||
PROJECTDIR_WIN := $(BUILDDIR)/projects/windows/$(FULLTARGET)
|
||||
|
||||
@ -1157,24 +1156,6 @@ endif
|
||||
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-asmjs config=$(CONFIG) precompile
|
||||
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-asmjs config=$(CONFIG)
|
||||
|
||||
#-------------------------------------------------
|
||||
# PNaCl
|
||||
#-------------------------------------------------
|
||||
|
||||
$(PROJECTDIR_MINI)/gmake-pnacl/Makefile: makefile $(SCRIPTS) $(GENIE)
|
||||
ifndef NACL_SDK_ROOT
|
||||
$(error NACL_SDK_ROOT is not set)
|
||||
endif
|
||||
$(SILENT) $(GENIE) $(PARAMS) --gcc=pnacl --gcc_version=3.7.0 --osd=osdmini --targetos=pnacl --NOASM=1 --USE_LIBUV=0 gmake
|
||||
|
||||
.PHONY: pnacl
|
||||
pnacl: generate $(PROJECTDIR_MINI)/gmake-pnacl/Makefile
|
||||
ifndef NACL_SDK_ROOT
|
||||
$(error NACL_SDK_ROOT is not set)
|
||||
endif
|
||||
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_MINI)/gmake-pnacl config=$(CONFIG) precompile
|
||||
$(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_MINI)/gmake-pnacl config=$(CONFIG)
|
||||
|
||||
#-------------------------------------------------
|
||||
# gmake-linux
|
||||
#-------------------------------------------------
|
||||
|
@ -1,133 +0,0 @@
|
||||
-- license:BSD-3-Clause
|
||||
-- copyright-holders:MAMEdev Team
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
--
|
||||
-- osdmini.lua
|
||||
--
|
||||
-- Rules for the building of osdmini
|
||||
--
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
function maintargetosdoptions(_target,_subtarget)
|
||||
end
|
||||
|
||||
project ("qtdbg_" .. _OPTIONS["osd"])
|
||||
uuid (os.uuid("qtdbg_" .. _OPTIONS["osd"]))
|
||||
kind (LIBTYPE)
|
||||
|
||||
dofile("osdmini_cfg.lua")
|
||||
includedirs {
|
||||
MAME_DIR .. "src/emu",
|
||||
MAME_DIR .. "src/devices", -- accessing imagedev from debugger
|
||||
MAME_DIR .. "src/osd",
|
||||
MAME_DIR .. "src/lib",
|
||||
MAME_DIR .. "src/lib/util",
|
||||
MAME_DIR .. "src/osd/modules/render",
|
||||
MAME_DIR .. "3rdparty",
|
||||
}
|
||||
removeflags {
|
||||
"SingleOutputDir",
|
||||
}
|
||||
|
||||
files {
|
||||
MAME_DIR .. "src/osd/modules/debugger/debugqt.cpp",
|
||||
}
|
||||
|
||||
project ("osd_" .. _OPTIONS["osd"])
|
||||
uuid (os.uuid("osd_" .. _OPTIONS["osd"]))
|
||||
kind (LIBTYPE)
|
||||
|
||||
removeflags {
|
||||
"SingleOutputDir",
|
||||
}
|
||||
|
||||
dofile("osdmini_cfg.lua")
|
||||
|
||||
includedirs {
|
||||
MAME_DIR .. "src/emu",
|
||||
MAME_DIR .. "src/osd",
|
||||
MAME_DIR .. "src/lib",
|
||||
MAME_DIR .. "src/lib/util",
|
||||
MAME_DIR .. "src/osd/sdl",
|
||||
MAME_DIR .. "src/osd/modules/render",
|
||||
MAME_DIR .. "3rdparty",
|
||||
MAME_DIR .. "3rdparty/winpcap/Include",
|
||||
MAME_DIR .. "3rdparty/bgfx/include",
|
||||
MAME_DIR .. "3rdparty/bx/include",
|
||||
}
|
||||
|
||||
files {
|
||||
MAME_DIR .. "src/osd/osdmini/minimain.cpp",
|
||||
MAME_DIR .. "src/osd/osdmini/osdmini.h",
|
||||
MAME_DIR .. "src/osd/osdepend.h",
|
||||
MAME_DIR .. "src/osd/modules/lib/osdobj_common.cpp",
|
||||
MAME_DIR .. "src/osd/modules/lib/osdobj_common.h",
|
||||
MAME_DIR .. "src/osd/modules/font/font_sdl.cpp",
|
||||
MAME_DIR .. "src/osd/modules/font/font_windows.cpp",
|
||||
MAME_DIR .. "src/osd/modules/font/font_dwrite.cpp",
|
||||
MAME_DIR .. "src/osd/modules/font/font_osx.cpp",
|
||||
MAME_DIR .. "src/osd/modules/font/font_none.cpp",
|
||||
MAME_DIR .. "src/osd/modules/netdev/taptun.cpp",
|
||||
MAME_DIR .. "src/osd/modules/netdev/pcap.cpp",
|
||||
MAME_DIR .. "src/osd/modules/netdev/none.cpp",
|
||||
MAME_DIR .. "src/osd/modules/midi/portmidi.cpp",
|
||||
MAME_DIR .. "src/osd/modules/midi/none.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sound/js_sound.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sound/direct_sound.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sound/coreaudio_sound.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sound/sdl_sound.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sound/none.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sound/xaudio2_sound.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_module.h",
|
||||
MAME_DIR .. "src/osd/modules/input/input_common.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_common.h",
|
||||
MAME_DIR .. "src/osd/modules/input/input_dinput.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_none.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_rawinput.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_win32.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_sdl.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_sdlcommon.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_sdlcommon.h",
|
||||
MAME_DIR .. "src/osd/modules/input/input_x11.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_windows.cpp",
|
||||
MAME_DIR .. "src/osd/modules/input/input_windows.h",
|
||||
MAME_DIR .. "src/osd/modules/input/input_xinput.cpp",
|
||||
MAME_DIR .. "src/osd/modules/output/output_module.h",
|
||||
MAME_DIR .. "src/osd/modules/output/none.cpp",
|
||||
MAME_DIR .. "src/osd/modules/output/console.cpp",
|
||||
MAME_DIR .. "src/osd/modules/output/network.cpp",
|
||||
}
|
||||
|
||||
project ("ocore_" .. _OPTIONS["osd"])
|
||||
uuid (os.uuid("ocore_" .. _OPTIONS["osd"]))
|
||||
kind (LIBTYPE)
|
||||
|
||||
removeflags {
|
||||
"SingleOutputDir",
|
||||
}
|
||||
|
||||
dofile("osdmini_cfg.lua")
|
||||
|
||||
includedirs {
|
||||
MAME_DIR .. "src/emu",
|
||||
MAME_DIR .. "src/osd",
|
||||
MAME_DIR .. "src/lib",
|
||||
MAME_DIR .. "src/lib/util",
|
||||
}
|
||||
|
||||
files {
|
||||
MAME_DIR .. "src/osd/osdnet.cpp",
|
||||
MAME_DIR .. "src/osd/osdnet.h",
|
||||
MAME_DIR .. "src/osd/osdcore.cpp",
|
||||
MAME_DIR .. "src/osd/osdcore.h",
|
||||
MAME_DIR .. "src/osd/modules/osdmodule.cpp",
|
||||
MAME_DIR .. "src/osd/modules/osdmodule.h",
|
||||
MAME_DIR .. "src/osd/osdmini/minidir.cpp",
|
||||
MAME_DIR .. "src/osd/osdmini/minimisc.cpp",
|
||||
MAME_DIR .. "src/osd/osdmini/minitime.cpp",
|
||||
MAME_DIR .. "src/osd/modules/file/stdfile.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sync/osdsync.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sync/osdsync.h",
|
||||
MAME_DIR .. "src/osd/modules/sync/work_osd.cpp",
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
-- license:BSD-3-Clause
|
||||
-- copyright-holders:MAMEdev Team
|
||||
|
||||
defines {
|
||||
"OSD_MINI",
|
||||
"USE_QTDEBUG=0",
|
||||
"USE_SDL",
|
||||
"SDLMAME_NOASM=1",
|
||||
"USE_OPENGL=0",
|
||||
"NO_USE_MIDI=1",
|
||||
"USE_XAUDIO2=0",
|
||||
}
|
@ -459,14 +459,13 @@ project ("ocore_" .. _OPTIONS["osd"])
|
||||
MAME_DIR .. "src/osd/osdcore.h",
|
||||
MAME_DIR .. "src/osd/strconv.cpp",
|
||||
MAME_DIR .. "src/osd/strconv.h",
|
||||
MAME_DIR .. "src/osd/osdsync.cpp",
|
||||
MAME_DIR .. "src/osd/osdsync.h",
|
||||
MAME_DIR .. "src/osd/sdl/sdldir.cpp",
|
||||
MAME_DIR .. "src/osd/modules/osdmodule.cpp",
|
||||
MAME_DIR .. "src/osd/modules/osdmodule.h",
|
||||
MAME_DIR .. "src/osd/modules/lib/osdlib_" .. SDLOS_TARGETOS .. ".cpp",
|
||||
MAME_DIR .. "src/osd/modules/lib/osdlib.h",
|
||||
MAME_DIR .. "src/osd/modules/sync/osdsync.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sync/osdsync.h",
|
||||
MAME_DIR .. "src/osd/modules/sync/work_osd.cpp",
|
||||
}
|
||||
|
||||
if BASE_TARGETOS=="unix" then
|
||||
|
@ -243,10 +243,10 @@ project ("ocore_" .. _OPTIONS["osd"])
|
||||
MAME_DIR .. "src/osd/osdcore.h",
|
||||
MAME_DIR .. "src/osd/strconv.cpp",
|
||||
MAME_DIR .. "src/osd/strconv.h",
|
||||
MAME_DIR .. "src/osd/osdsync.cpp",
|
||||
MAME_DIR .. "src/osd/osdsync.h",
|
||||
MAME_DIR .. "src/osd/windows/main.cpp",
|
||||
MAME_DIR .. "src/osd/windows/windir.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sync/osdsync.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sync/osdsync.h",
|
||||
MAME_DIR .. "src/osd/windows/winutf8.cpp",
|
||||
MAME_DIR .. "src/osd/windows/winutf8.h",
|
||||
MAME_DIR .. "src/osd/windows/winutil.cpp",
|
||||
@ -258,5 +258,4 @@ project ("ocore_" .. _OPTIONS["osd"])
|
||||
MAME_DIR .. "src/osd/modules/file/winptty.cpp",
|
||||
MAME_DIR .. "src/osd/modules/file/winsocket.cpp",
|
||||
MAME_DIR .. "src/osd/modules/lib/osdlib_win32.cpp",
|
||||
MAME_DIR .. "src/osd/modules/sync/work_osd.cpp",
|
||||
}
|
||||
|
@ -19,19 +19,6 @@
|
||||
#ifndef __OSDLIB__
|
||||
#define __OSDLIB__
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
osd_num_processors: return the number of processors
|
||||
|
||||
Parameters:
|
||||
|
||||
None.
|
||||
|
||||
Return value:
|
||||
|
||||
Number of processors
|
||||
-----------------------------------------------------------------------------*/
|
||||
int osd_get_num_processors(void);
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
osd_process_kill: kill the current process
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles,Miodrag Milanovic
|
||||
//============================================================
|
||||
//
|
||||
// osdsync.cpp -OSD core synchronization functions
|
||||
//
|
||||
//============================================================
|
||||
// MAME headers
|
||||
#include "osdcore.h"
|
||||
#include "osdsync.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -195,12 +195,3 @@ void osd_sleep(osd_ticks_t duration)
|
||||
std::this_thread::sleep_for(std::chrono::high_resolution_clock::duration(duration));
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// osd_num_processors
|
||||
//============================================================
|
||||
|
||||
int osd_get_num_processors(void)
|
||||
{
|
||||
// max out at 4 for now since scaling above that seems to do poorly
|
||||
return MIN(std::thread::hardware_concurrency(), 4);
|
||||
}
|
||||
|
@ -1,44 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
//============================================================
|
||||
//
|
||||
// minidir.c - Minimal core directory access functions
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#include "osdcore.h"
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_opendir
|
||||
//============================================================
|
||||
|
||||
osd_directory *osd_opendir(const char *dirname)
|
||||
{
|
||||
// since there are no standard C library routines for walking directories,
|
||||
// we always return an error here
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_readdir
|
||||
//============================================================
|
||||
|
||||
const osd_directory_entry *osd_readdir(osd_directory *dir)
|
||||
{
|
||||
// since there are no standard C library routines for walking directories,
|
||||
// we always return an error here
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_closedir
|
||||
//============================================================
|
||||
|
||||
void osd_closedir(osd_directory *dir)
|
||||
{
|
||||
// since there are no standard C library routines for walking directories,
|
||||
// we do nothing
|
||||
}
|
@ -1,179 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
//============================================================
|
||||
//
|
||||
// minimain.c - Main function for mini OSD
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#include "emu.h"
|
||||
#include "osdepend.h"
|
||||
#include "render.h"
|
||||
#include "clifront.h"
|
||||
#include "osdmini.h"
|
||||
|
||||
|
||||
//============================================================
|
||||
// CONSTANTS
|
||||
//============================================================
|
||||
|
||||
// we fake a keyboard with the following keys
|
||||
enum
|
||||
{
|
||||
KEY_ESCAPE,
|
||||
KEY_P1_START,
|
||||
KEY_BUTTON_1,
|
||||
KEY_BUTTON_2,
|
||||
KEY_BUTTON_3,
|
||||
KEY_JOYSTICK_U,
|
||||
KEY_JOYSTICK_D,
|
||||
KEY_JOYSTICK_L,
|
||||
KEY_JOYSTICK_R,
|
||||
KEY_TOTAL
|
||||
};
|
||||
|
||||
|
||||
//============================================================
|
||||
// GLOBALS
|
||||
//============================================================
|
||||
|
||||
// a single rendering target
|
||||
static render_target *our_target;
|
||||
|
||||
// a single input device
|
||||
static input_device *keyboard_device;
|
||||
|
||||
// the state of each key
|
||||
static UINT8 keyboard_state[KEY_TOTAL];
|
||||
|
||||
|
||||
//============================================================
|
||||
// FUNCTION PROTOTYPES
|
||||
//============================================================
|
||||
|
||||
static INT32 keyboard_get_state(void *device_internal, void *item_internal);
|
||||
|
||||
|
||||
//============================================================
|
||||
// mini_osd_options
|
||||
//============================================================
|
||||
|
||||
mini_osd_options::mini_osd_options()
|
||||
: osd_options()
|
||||
{
|
||||
//add_entries(s_option_entries);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// main
|
||||
//============================================================
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// cli_frontend does the heavy lifting; if we have osd-specific options, we
|
||||
// create a derivative of cli_options and add our own
|
||||
mini_osd_options options;
|
||||
mini_osd_interface osd(options);
|
||||
osd.register_options();
|
||||
cli_frontend frontend(options, osd);
|
||||
return frontend.execute(argc, argv);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// constructor
|
||||
//============================================================
|
||||
|
||||
mini_osd_interface::mini_osd_interface(mini_osd_options &options)
|
||||
: osd_common_t(options)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// destructor
|
||||
//============================================================
|
||||
|
||||
mini_osd_interface::~mini_osd_interface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// init
|
||||
//============================================================
|
||||
|
||||
void mini_osd_interface::init(running_machine &machine)
|
||||
{
|
||||
// call our parent
|
||||
osd_common_t::init(machine);
|
||||
|
||||
// initialize the video system by allocating a rendering target
|
||||
our_target = machine.render().target_alloc();
|
||||
|
||||
// nothing yet to do to initialize sound, since we don't have any
|
||||
// sound updates are handled by update_audio_stream() below
|
||||
|
||||
// initialize the input system by adding devices
|
||||
// let's pretend like we have a keyboard device
|
||||
keyboard_device = machine.input().device_class(DEVICE_CLASS_KEYBOARD).add_device("Keyboard");
|
||||
if (keyboard_device == nullptr)
|
||||
fatalerror("Error creating keyboard device\n");
|
||||
|
||||
// our faux keyboard only has a couple of keys (corresponding to the
|
||||
// common defaults)
|
||||
keyboard_device->add_item("Esc", ITEM_ID_ESC, keyboard_get_state, &keyboard_state[KEY_ESCAPE]);
|
||||
keyboard_device->add_item("P1", ITEM_ID_1, keyboard_get_state, &keyboard_state[KEY_P1_START]);
|
||||
keyboard_device->add_item("B1", ITEM_ID_LCONTROL, keyboard_get_state, &keyboard_state[KEY_BUTTON_1]);
|
||||
keyboard_device->add_item("B2", ITEM_ID_LALT, keyboard_get_state, &keyboard_state[KEY_BUTTON_2]);
|
||||
keyboard_device->add_item("B3", ITEM_ID_SPACE, keyboard_get_state, &keyboard_state[KEY_BUTTON_3]);
|
||||
keyboard_device->add_item("JoyU", ITEM_ID_UP, keyboard_get_state, &keyboard_state[KEY_JOYSTICK_U]);
|
||||
keyboard_device->add_item("JoyD", ITEM_ID_DOWN, keyboard_get_state, &keyboard_state[KEY_JOYSTICK_D]);
|
||||
keyboard_device->add_item("JoyL", ITEM_ID_LEFT, keyboard_get_state, &keyboard_state[KEY_JOYSTICK_L]);
|
||||
keyboard_device->add_item("JoyR", ITEM_ID_RIGHT, keyboard_get_state, &keyboard_state[KEY_JOYSTICK_R]);
|
||||
|
||||
// hook up the debugger log
|
||||
// add_logerror_callback(machine, output_oslog);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_update
|
||||
//============================================================
|
||||
|
||||
void mini_osd_interface::update(bool skip_redraw)
|
||||
{
|
||||
// get the minimum width/height for the current layout
|
||||
int minwidth, minheight;
|
||||
our_target->compute_minimum_size(minwidth, minheight);
|
||||
|
||||
// make that the size of our target
|
||||
our_target->set_bounds(minwidth, minheight);
|
||||
|
||||
// get the list of primitives for the target at the current size
|
||||
render_primitive_list &primlist = our_target->get_primitives();
|
||||
|
||||
// lock them, and then render them
|
||||
primlist.acquire_lock();
|
||||
|
||||
// do the drawing here
|
||||
primlist.release_lock();
|
||||
|
||||
// after 5 seconds, exit
|
||||
if (machine().time() > attotime::from_seconds(5))
|
||||
machine().schedule_exit();
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// keyboard_get_state
|
||||
//============================================================
|
||||
|
||||
static INT32 keyboard_get_state(void *device_internal, void *item_internal)
|
||||
{
|
||||
// this function is called by the input system to get the current key
|
||||
// state; it is specified as a callback when adding items to input
|
||||
// devices
|
||||
UINT8 *keystate = (UINT8 *)item_internal;
|
||||
return *keystate;
|
||||
}
|
@ -1,109 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
//============================================================
|
||||
//
|
||||
// minimisc.c - Minimal core miscellaneous functions
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#include "osdcore.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_malloc
|
||||
//============================================================
|
||||
|
||||
void *osd_malloc(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_malloc_array
|
||||
//============================================================
|
||||
|
||||
void *osd_malloc_array(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_free
|
||||
//============================================================
|
||||
|
||||
void osd_free(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_alloc_executable
|
||||
//============================================================
|
||||
|
||||
void *osd_alloc_executable(size_t size)
|
||||
{
|
||||
// to use this version of the code, we have to assume that
|
||||
// code injected into a malloc'ed region can be safely executed
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_free_executable
|
||||
//============================================================
|
||||
|
||||
void osd_free_executable(void *ptr, size_t size)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_break_into_debugger
|
||||
//============================================================
|
||||
|
||||
void osd_break_into_debugger(const char *message)
|
||||
{
|
||||
// there is no standard way to do this, so ignore it
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_get_clipboard_text
|
||||
//============================================================
|
||||
|
||||
char *osd_get_clipboard_text(void)
|
||||
{
|
||||
// can't support clipboards generically
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// osd_getenv
|
||||
//============================================================
|
||||
|
||||
const char *osd_getenv(const char *name)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// osd_setenv
|
||||
//============================================================
|
||||
|
||||
int osd_setenv(const char *name, const char *value, int overwrite)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// osd_subst_env
|
||||
//============================================================
|
||||
void osd_subst_env(std::string &dst, const std::string &src)
|
||||
{
|
||||
dst = src;
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
//============================================================
|
||||
//
|
||||
// minitime.c - Minimal core timing functions
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#include "osdepend.h"
|
||||
#include <time.h>
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_num_processors
|
||||
//============================================================
|
||||
|
||||
int osd_get_num_processors(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// osd_ticks
|
||||
//============================================================
|
||||
|
||||
osd_ticks_t osd_ticks(void)
|
||||
{
|
||||
// use the standard library clock function
|
||||
return clock();
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_ticks_per_second
|
||||
//============================================================
|
||||
|
||||
osd_ticks_t osd_ticks_per_second(void)
|
||||
{
|
||||
return CLOCKS_PER_SEC;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_sleep
|
||||
//============================================================
|
||||
|
||||
void osd_sleep(osd_ticks_t duration)
|
||||
{
|
||||
// if there was a generic, cross-platform way to give up
|
||||
// time, this is where we would do it
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Aaron Giles
|
||||
//============================================================
|
||||
//
|
||||
// osdmini.h - Core header
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#include "options.h"
|
||||
#include "osdepend.h"
|
||||
#include "modules/lib/osdobj_common.h"
|
||||
|
||||
|
||||
class mini_osd_options : public osd_options
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
mini_osd_options();
|
||||
|
||||
};
|
||||
|
||||
//============================================================
|
||||
// TYPE DEFINITIONS
|
||||
//============================================================
|
||||
|
||||
class mini_osd_interface : public osd_common_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
mini_osd_interface(mini_osd_options &options);
|
||||
virtual ~mini_osd_interface();
|
||||
|
||||
// general overridables
|
||||
virtual void init(running_machine &machine);
|
||||
virtual void update(bool skip_redraw);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// GLOBAL VARIABLES
|
||||
//============================================================
|
||||
|
||||
extern const options_entry mame_win_options[];
|
||||
|
||||
// defined in winwork.c
|
||||
extern int osd_num_processors;
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// FUNCTION PROTOTYPES
|
||||
//============================================================
|
||||
|
||||
// use this to ping the watchdog
|
||||
void winmain_watchdog_ping(void);
|
||||
void winmain_dump_stack();
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Aaron Giles
|
||||
//============================================================
|
||||
//
|
||||
// sdlwork.c - SDL OSD core work item functions
|
||||
// osdsync.c - OSD core work item functions
|
||||
//
|
||||
//============================================================
|
||||
#if defined(OSD_WINDOWS) || defined(SDLMAME_WIN32)
|
||||
@ -24,9 +24,7 @@
|
||||
|
||||
// MAME headers
|
||||
#include "osdcore.h"
|
||||
|
||||
#include "modules/sync/osdsync.h"
|
||||
#include "modules/lib/osdlib.h"
|
||||
#include "osdsync.h"
|
||||
|
||||
#include "eminline.h"
|
||||
|
||||
@ -84,6 +82,15 @@ static void spin_while_not(const volatile _AtomType * volatile atom, const _Main
|
||||
spin_while<_AtomType, _MainType>(atom, val, timeout, 1);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// osd_num_processors
|
||||
//============================================================
|
||||
|
||||
int osd_get_num_processors(void)
|
||||
{
|
||||
// max out at 4 for now since scaling above that seems to do poorly
|
||||
return MIN(std::thread::hardware_concurrency(), 4);
|
||||
}
|
||||
|
||||
//============================================================
|
||||
// TYPE DEFINITIONS
|
@ -10,7 +10,7 @@
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#include "modules/sync/osdsync.h"
|
||||
#include "osdsync.h"
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user