diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/osd/modules/lib/osdlib.h | 13 | ||||
-rw-r--r-- | src/osd/modules/sync/osdsync.cpp | 14 | ||||
-rw-r--r-- | src/osd/osdcore.cpp | 9 | ||||
-rw-r--r-- | src/osd/osdmini/minidir.cpp | 44 | ||||
-rw-r--r-- | src/osd/osdmini/minimain.cpp | 179 | ||||
-rw-r--r-- | src/osd/osdmini/minimisc.cpp | 109 | ||||
-rw-r--r-- | src/osd/osdmini/minitime.cpp | 51 | ||||
-rw-r--r-- | src/osd/osdmini/osdmini.h | 57 | ||||
-rw-r--r-- | src/osd/osdsync.cpp (renamed from src/osd/modules/sync/work_osd.cpp) | 15 | ||||
-rw-r--r-- | src/osd/osdsync.h (renamed from src/osd/modules/sync/osdsync.h) | 0 | ||||
-rw-r--r-- | src/osd/sdl/watchdog.h | 2 |
11 files changed, 12 insertions, 481 deletions
diff --git a/src/osd/modules/lib/osdlib.h b/src/osd/modules/lib/osdlib.h index dcba7a6bc81..f4a632dbbd1 100644 --- a/src/osd/modules/lib/osdlib.h +++ b/src/osd/modules/lib/osdlib.h @@ -20,19 +20,6 @@ #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 Parameters: diff --git a/src/osd/modules/sync/osdsync.cpp b/src/osd/modules/sync/osdsync.cpp deleted file mode 100644 index 98690149358..00000000000 --- a/src/osd/modules/sync/osdsync.cpp +++ /dev/null @@ -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> - - diff --git a/src/osd/osdcore.cpp b/src/osd/osdcore.cpp index 3e783159a9b..badda762e16 100644 --- a/src/osd/osdcore.cpp +++ b/src/osd/osdcore.cpp @@ -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); -} diff --git a/src/osd/osdmini/minidir.cpp b/src/osd/osdmini/minidir.cpp deleted file mode 100644 index dde1448a694..00000000000 --- a/src/osd/osdmini/minidir.cpp +++ /dev/null @@ -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 -} diff --git a/src/osd/osdmini/minimain.cpp b/src/osd/osdmini/minimain.cpp deleted file mode 100644 index 18fbba1bc37..00000000000 --- a/src/osd/osdmini/minimain.cpp +++ /dev/null @@ -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; -} diff --git a/src/osd/osdmini/minimisc.cpp b/src/osd/osdmini/minimisc.cpp deleted file mode 100644 index fb4901ca461..00000000000 --- a/src/osd/osdmini/minimisc.cpp +++ /dev/null @@ -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; -} diff --git a/src/osd/osdmini/minitime.cpp b/src/osd/osdmini/minitime.cpp deleted file mode 100644 index b0d8ff17bb7..00000000000 --- a/src/osd/osdmini/minitime.cpp +++ /dev/null @@ -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 -} diff --git a/src/osd/osdmini/osdmini.h b/src/osd/osdmini/osdmini.h deleted file mode 100644 index c0519c98b12..00000000000 --- a/src/osd/osdmini/osdmini.h +++ /dev/null @@ -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(); diff --git a/src/osd/modules/sync/work_osd.cpp b/src/osd/osdsync.cpp index 3afe4e6c273..84c8bac6ccb 100644 --- a/src/osd/modules/sync/work_osd.cpp +++ b/src/osd/osdsync.cpp @@ -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 diff --git a/src/osd/modules/sync/osdsync.h b/src/osd/osdsync.h index a0eb8d36682..a0eb8d36682 100644 --- a/src/osd/modules/sync/osdsync.h +++ b/src/osd/osdsync.h diff --git a/src/osd/sdl/watchdog.h b/src/osd/sdl/watchdog.h index 9cc2ee03322..f9c06e72bb0 100644 --- a/src/osd/sdl/watchdog.h +++ b/src/osd/sdl/watchdog.h @@ -10,7 +10,7 @@ // //============================================================ -#include "modules/sync/osdsync.h" +#include "osdsync.h" #include <atomic> #include <thread> |