summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/lib/osdobj_common.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/lib/osdobj_common.cpp')
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp519
1 files changed, 248 insertions, 271 deletions
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp
index 9adf9f2e604..46a709b415f 100644
--- a/src/osd/modules/lib/osdobj_common.cpp
+++ b/src/osd/modules/lib/osdobj_common.cpp
@@ -2,21 +2,25 @@
// copyright-holders:Aaron Giles
/***************************************************************************
- osdepend.c
+ osdobj_common.h
OS-dependent code interface.
***************************************************************************/
-#include "modules/lib/osdobj_common.h"
+#include "osdobj_common.h"
+#include "modules/osdwindow.h"
+#include "modules/debugger/debug_module.h"
#include "modules/font/font_module.h"
#include "modules/input/input_module.h"
-#include "modules/sound/sound_module.h"
-#include "modules/debugger/debug_module.h"
-#include "modules/netdev/netdev_module.h"
#include "modules/midi/midi_module.h"
#include "modules/monitor/monitor_module.h"
+#include "modules/netdev/netdev_module.h"
+#include "modules/render/render_module.h"
+#include "modules/sound/sound_module.h"
+
+#include "osdnet.h"
#include "watchdog.h"
#include "emu.h"
@@ -27,151 +31,158 @@
const options_entry osd_options::s_option_entries[] =
{
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD KEYBOARD MAPPING OPTIONS" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD INPUT MAPPING OPTIONS" },
#if defined(SDLMAME_MACOSX) || defined(OSD_MAC)
- { OSDOPTION_UIMODEKEY, "DEL", core_options::option_type::STRING, "key to enable/disable MAME controls when emulated system has keyboard inputs" },
+ { OSDOPTION_UIMODEKEY, "DEL", core_options::option_type::STRING, "key to enable/disable MAME controls when emulated system has keyboard inputs" },
#else
- { OSDOPTION_UIMODEKEY, "SCRLOCK", core_options::option_type::STRING, "key to enable/disable MAME controls when emulated system has keyboard inputs" },
+ { OSDOPTION_UIMODEKEY, "auto", core_options::option_type::STRING, "key to enable/disable MAME controls when emulated system has keyboard inputs" },
#endif // SDLMAME_MACOSX
-
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD FONT OPTIONS" },
- { OSD_FONT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for UI font: " },
-
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD OUTPUT OPTIONS" },
- { OSD_OUTPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for output notifications: " },
-
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD INPUT OPTIONS" },
- { OSD_KEYBOARDINPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for keyboard input: " },
- { OSD_MOUSEINPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for mouse input: " },
- { OSD_LIGHTGUNINPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for lightgun input: " },
- { OSD_JOYSTICKINPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for joystick input: " },
-
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD CLI OPTIONS" },
- { OSDCOMMAND_LIST_MIDI_DEVICES ";mlist", "0", core_options::option_type::COMMAND, "list available MIDI I/O devices" },
- { OSDCOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0", core_options::option_type::COMMAND, "list available network adapters" },
-
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD DEBUGGING OPTIONS" },
- { OSDOPTION_DEBUGGER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "debugger used: " },
- { OSDOPTION_DEBUGGER_PORT, "23946", core_options::option_type::INTEGER, "port to use for gdbstub debugger" },
- { OSDOPTION_DEBUGGER_FONT ";dfont", OSDOPTVAL_AUTO, core_options::option_type::STRING, "font to use for debugger views" },
- { OSDOPTION_DEBUGGER_FONT_SIZE ";dfontsize", "0", core_options::option_type::FLOAT, "font size to use for debugger views" },
- { OSDOPTION_WATCHDOG ";wdog", "0", core_options::option_type::INTEGER, "force the program to terminate if no updates within specified number of seconds" },
-
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD PERFORMANCE OPTIONS" },
- { OSDOPTION_NUMPROCESSORS ";np", OSDOPTVAL_AUTO, core_options::option_type::STRING, "number of processors; this overrides the number the system reports" },
- { OSDOPTION_BENCH, "0", core_options::option_type::INTEGER, "benchmark for the given number of emulated seconds; implies -video none -sound none -nothrottle" },
-
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD VIDEO OPTIONS" },
-// OS X can be trusted to have working hardware OpenGL, so default to it on for the best user experience
- { OSDOPTION_VIDEO, OSDOPTVAL_AUTO, core_options::option_type::STRING, "video output method: " },
- { OSDOPTION_NUMSCREENS "(1-4)", "1", core_options::option_type::INTEGER, "number of output screens/windows to create; usually, you want just one" },
- { OSDOPTION_WINDOW ";w", "0", core_options::option_type::BOOLEAN, "enable window mode; otherwise, full screen mode is assumed" },
- { OSDOPTION_MAXIMIZE ";max", "1", core_options::option_type::BOOLEAN, "default to maximized windows" },
- { OSDOPTION_WAITVSYNC ";vs", "0", core_options::option_type::BOOLEAN, "enable waiting for the start of VBLANK before flipping screens (reduces tearing effects)" },
- { OSDOPTION_SYNCREFRESH ";srf", "0", core_options::option_type::BOOLEAN, "enable using the start of VBLANK for throttling instead of the game time" },
- { OSD_MONITOR_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "monitor discovery method: " },
+ { OSDOPTION_CONTROLLER_MAP_FILE ";ctrlmap", OSDOPTVAL_NONE, core_options::option_type::PATH, "game controller mapping file" },
+ { OSDOPTION_BACKGROUND_INPUT, "0", core_options::option_type::BOOLEAN, "don't ignore input when losing UI focus" },
+
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD FONT OPTIONS" },
+ { OSD_FONT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for UI font: " },
+
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD OUTPUT OPTIONS" },
+ { OSD_OUTPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for output notifications: " },
+
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD INPUT OPTIONS" },
+ { OSD_KEYBOARDINPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for keyboard input: " },
+ { OSD_MOUSEINPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for mouse input: " },
+ { OSD_LIGHTGUNINPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for lightgun input: " },
+ { OSD_JOYSTICKINPUT_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "provider for joystick input: " },
+
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD CLI OPTIONS" },
+ { OSDCOMMAND_LIST_MIDI_DEVICES ";mlist", "0", core_options::option_type::COMMAND, "list available MIDI I/O devices" },
+ { OSDCOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0", core_options::option_type::COMMAND, "list available network adapters" },
+
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD DEBUGGING OPTIONS" },
+ { OSDOPTION_DEBUGGER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "debugger used: " },
+ { OSDOPTION_DEBUGGER_PORT, "23946", core_options::option_type::INTEGER, "port to use for gdbstub debugger" },
+ { OSDOPTION_DEBUGGER_FONT ";dfont", OSDOPTVAL_AUTO, core_options::option_type::STRING, "font to use for debugger views" },
+ { OSDOPTION_DEBUGGER_FONT_SIZE ";dfontsize", "0", core_options::option_type::FLOAT, "font size to use for debugger views" },
+ { OSDOPTION_WATCHDOG ";wdog", "0", core_options::option_type::INTEGER, "force the program to terminate if no updates within specified number of seconds" },
+
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD PERFORMANCE OPTIONS" },
+ { OSDOPTION_NUMPROCESSORS ";np", OSDOPTVAL_AUTO, core_options::option_type::STRING, "number of processors; this overrides the number the system reports" },
+ { OSDOPTION_BENCH, "0", core_options::option_type::INTEGER, "benchmark for the given number of emulated seconds; implies -video none -sound none -nothrottle" },
+
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD VIDEO OPTIONS" },
+ { OSDOPTION_VIDEO, OSDOPTVAL_AUTO, core_options::option_type::STRING, "video output method: " },
+ { OSDOPTION_NUMSCREENS "(1-4)", "1", core_options::option_type::INTEGER, "number of output screens/windows to create; usually, you want just one" },
+ { OSDOPTION_WINDOW ";w", "0", core_options::option_type::BOOLEAN, "enable window mode; otherwise, full screen mode is assumed" },
+ { OSDOPTION_MAXIMIZE ";max", "1", core_options::option_type::BOOLEAN, "default to maximized windows" },
+ { OSDOPTION_WAITVSYNC ";vs", "0", core_options::option_type::BOOLEAN, "enable waiting for the start of VBLANK before flipping screens (reduces tearing effects)" },
+ { OSDOPTION_SYNCREFRESH ";srf", "0", core_options::option_type::BOOLEAN, "enable using the start of VBLANK for throttling instead of the game time" },
+ { OSD_MONITOR_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "monitor discovery method: " },
// per-window options
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD PER-WINDOW VIDEO OPTIONS" },
- { OSDOPTION_SCREEN, OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_ASPECT ";screen_aspect", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio for all screens; 'auto' here will try to make a best guess" },
- { OSDOPTION_RESOLUTION ";r", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'" },
- { OSDOPTION_VIEW, OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for all screens" },
-
- { OSDOPTION_SCREEN "0", OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_ASPECT "0", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio of the first screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_RESOLUTION "0;r0", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution of the first screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
- { OSDOPTION_VIEW "0", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for the first screen" },
-
- { OSDOPTION_SCREEN "1", OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the second screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_ASPECT "1", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio of the second screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_RESOLUTION "1;r1", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution of the second screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
- { OSDOPTION_VIEW "1", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for the second screen" },
-
- { OSDOPTION_SCREEN "2", OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the third screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_ASPECT "2", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio of the third screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_RESOLUTION "2;r2", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution of the third screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
- { OSDOPTION_VIEW "2", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for the third screen" },
-
- { OSDOPTION_SCREEN "3", OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the fourth screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_ASPECT "3", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio of the fourth screen; 'auto' here will try to make a best guess" },
- { OSDOPTION_RESOLUTION "3;r3", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution of the fourth screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
- { OSDOPTION_VIEW "3", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for the fourth screen" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD PER-WINDOW VIDEO OPTIONS" },
+ { OSDOPTION_SCREEN, OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT ";screen_aspect", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio for all screens; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION ";r", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution for all screens; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW, OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for all screens" },
+
+ { OSDOPTION_SCREEN "0", OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the first screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT "0", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio of the first screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION "0;r0", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution of the first screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW "0", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for the first screen" },
+
+ { OSDOPTION_SCREEN "1", OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the second screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT "1", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio of the second screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION "1;r1", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution of the second screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW "1", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for the second screen" },
+
+ { OSDOPTION_SCREEN "2", OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the third screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT "2", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio of the third screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION "2;r2", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution of the third screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW "2", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for the third screen" },
+
+ { OSDOPTION_SCREEN "3", OSDOPTVAL_AUTO, core_options::option_type::STRING, "explicit name of the fourth screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_ASPECT "3", OSDOPTVAL_AUTO, core_options::option_type::STRING, "aspect ratio of the fourth screen; 'auto' here will try to make a best guess" },
+ { OSDOPTION_RESOLUTION "3;r3", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred resolution of the fourth screen; format is <width>x<height>[@<refreshrate>] or 'auto'" },
+ { OSDOPTION_VIEW "3", OSDOPTVAL_AUTO, core_options::option_type::STRING, "preferred view for the fourth screen" },
// full screen options
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD FULL SCREEN OPTIONS" },
- { OSDOPTION_SWITCHRES, "0", core_options::option_type::BOOLEAN, "enable resolution switching" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD FULL SCREEN OPTIONS" },
+ { OSDOPTION_SWITCHRES, "0", core_options::option_type::BOOLEAN, "enable resolution switching" },
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD ACCELERATED VIDEO OPTIONS" },
- { OSDOPTION_FILTER ";glfilter;flt", "1", core_options::option_type::BOOLEAN, "use bilinear filtering when scaling emulated video" },
- { OSDOPTION_PRESCALE "(1-8)", "1", core_options::option_type::INTEGER, "scale emulated video by this factor before applying filters/shaders" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD ACCELERATED VIDEO OPTIONS" },
+ { OSDOPTION_FILTER ";glfilter;flt", "1", core_options::option_type::BOOLEAN, "use bilinear filtering when scaling emulated video" },
+ { OSDOPTION_PRESCALE "(1-20)", "1", core_options::option_type::INTEGER, "scale emulated video by this factor before applying filters/shaders" },
#if USE_OPENGL
- { nullptr, nullptr, core_options::option_type::HEADER, "OpenGL-SPECIFIC OPTIONS" },
- { OSDOPTION_GL_FORCEPOW2TEXTURE, "0", core_options::option_type::BOOLEAN, "force power-of-two texture sizes (default no)" },
- { OSDOPTION_GL_NOTEXTURERECT, "0", core_options::option_type::BOOLEAN, "don't use OpenGL GL_ARB_texture_rectangle (default on)" },
- { OSDOPTION_GL_VBO, "1", core_options::option_type::BOOLEAN, "enable OpenGL VBO if available (default on)" },
- { OSDOPTION_GL_PBO, "1", core_options::option_type::BOOLEAN, "enable OpenGL PBO if available (default on)" },
- { OSDOPTION_GL_GLSL, "0", core_options::option_type::BOOLEAN, "enable OpenGL GLSL if available (default off)" },
- { OSDOPTION_GLSL_FILTER, "1", core_options::option_type::STRING, "enable OpenGL GLSL filtering instead of FF filtering 0-plain, 1-bilinear (default), 2-bicubic" },
- { OSDOPTION_SHADER_MAME "0", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 0" },
- { OSDOPTION_SHADER_MAME "1", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 1" },
- { OSDOPTION_SHADER_MAME "2", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 2" },
- { OSDOPTION_SHADER_MAME "3", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 3" },
- { OSDOPTION_SHADER_MAME "4", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 4" },
- { OSDOPTION_SHADER_MAME "5", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 5" },
- { OSDOPTION_SHADER_MAME "6", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 6" },
- { OSDOPTION_SHADER_MAME "7", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 7" },
- { OSDOPTION_SHADER_MAME "8", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 8" },
- { OSDOPTION_SHADER_MAME "9", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 9" },
- { OSDOPTION_SHADER_SCREEN "0", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 0" },
- { OSDOPTION_SHADER_SCREEN "1", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 1" },
- { OSDOPTION_SHADER_SCREEN "2", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 2" },
- { OSDOPTION_SHADER_SCREEN "3", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 3" },
- { OSDOPTION_SHADER_SCREEN "4", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 4" },
- { OSDOPTION_SHADER_SCREEN "5", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 5" },
- { OSDOPTION_SHADER_SCREEN "6", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 6" },
- { OSDOPTION_SHADER_SCREEN "7", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 7" },
- { OSDOPTION_SHADER_SCREEN "8", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 8" },
- { OSDOPTION_SHADER_SCREEN "9", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 9" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "OpenGL-SPECIFIC OPTIONS" },
+ { OSDOPTION_GL_FORCEPOW2TEXTURE, "0", core_options::option_type::BOOLEAN, "force power-of-two texture sizes (default no)" },
+ { OSDOPTION_GL_NOTEXTURERECT, "0", core_options::option_type::BOOLEAN, "don't use OpenGL GL_ARB_texture_rectangle (default on)" },
+ { OSDOPTION_GL_VBO, "1", core_options::option_type::BOOLEAN, "enable OpenGL VBO if available (default on)" },
+ { OSDOPTION_GL_PBO, "1", core_options::option_type::BOOLEAN, "enable OpenGL PBO if available (default on)" },
+ { OSDOPTION_GL_GLSL, "0", core_options::option_type::BOOLEAN, "enable OpenGL GLSL if available (default off)" },
+ { OSDOPTION_GLSL_FILTER, "1", core_options::option_type::STRING, "enable OpenGL GLSL filtering instead of FF filtering 0-plain, 1-bilinear (default), 2-bicubic" },
+ { OSDOPTION_SHADER_MAME "0", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 0" },
+ { OSDOPTION_SHADER_MAME "1", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 1" },
+ { OSDOPTION_SHADER_MAME "2", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 2" },
+ { OSDOPTION_SHADER_MAME "3", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 3" },
+ { OSDOPTION_SHADER_MAME "4", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 4" },
+ { OSDOPTION_SHADER_MAME "5", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 5" },
+ { OSDOPTION_SHADER_MAME "6", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 6" },
+ { OSDOPTION_SHADER_MAME "7", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 7" },
+ { OSDOPTION_SHADER_MAME "8", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 8" },
+ { OSDOPTION_SHADER_MAME "9", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader set mame bitmap 9" },
+ { OSDOPTION_SHADER_SCREEN "0", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 0" },
+ { OSDOPTION_SHADER_SCREEN "1", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 1" },
+ { OSDOPTION_SHADER_SCREEN "2", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 2" },
+ { OSDOPTION_SHADER_SCREEN "3", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 3" },
+ { OSDOPTION_SHADER_SCREEN "4", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 4" },
+ { OSDOPTION_SHADER_SCREEN "5", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 5" },
+ { OSDOPTION_SHADER_SCREEN "6", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 6" },
+ { OSDOPTION_SHADER_SCREEN "7", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 7" },
+ { OSDOPTION_SHADER_SCREEN "8", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 8" },
+ { OSDOPTION_SHADER_SCREEN "9", OSDOPTVAL_NONE, core_options::option_type::STRING, "custom OpenGL GLSL shader screen bitmap 9" },
#endif
- { nullptr, nullptr, core_options::option_type::HEADER, "OSD SOUND OPTIONS" },
- { OSDOPTION_SOUND, OSDOPTVAL_AUTO, core_options::option_type::STRING, "sound output method: " },
- { OSDOPTION_AUDIO_LATENCY "(0-5)", "2", core_options::option_type::INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD SOUND OPTIONS" },
+ { OSDOPTION_SOUND, OSDOPTVAL_AUTO, core_options::option_type::STRING, "sound output method: " },
+ { OSDOPTION_AUDIO_LATENCY "(0-5)", "2", core_options::option_type::INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" },
#ifndef NO_USE_PORTAUDIO
- { nullptr, nullptr, core_options::option_type::HEADER, "PORTAUDIO OPTIONS" },
- { OSDOPTION_PA_API, OSDOPTVAL_NONE, core_options::option_type::STRING, "PortAudio API" },
- { OSDOPTION_PA_DEVICE, OSDOPTVAL_NONE, core_options::option_type::STRING, "PortAudio device" },
- { OSDOPTION_PA_LATENCY "(0-0.25)", "0", core_options::option_type::FLOAT, "suggested latency in seconds, 0 for default" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "PORTAUDIO OPTIONS" },
+ { OSDOPTION_PA_API, OSDOPTVAL_NONE, core_options::option_type::STRING, "PortAudio API" },
+ { OSDOPTION_PA_DEVICE, OSDOPTVAL_NONE, core_options::option_type::STRING, "PortAudio device" },
+ { OSDOPTION_PA_LATENCY "(0-0.25)", "0", core_options::option_type::FLOAT, "suggested latency in seconds, 0 for default" },
#endif
#ifdef SDLMAME_MACOSX
- { nullptr, nullptr, core_options::option_type::HEADER, "CoreAudio-SPECIFIC OPTIONS" },
- { OSDOPTION_AUDIO_OUTPUT, OSDOPTVAL_AUTO, core_options::option_type::STRING, "audio output device" },
- { OSDOPTION_AUDIO_EFFECT "0", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 0" },
- { OSDOPTION_AUDIO_EFFECT "1", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 1" },
- { OSDOPTION_AUDIO_EFFECT "2", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 2" },
- { OSDOPTION_AUDIO_EFFECT "3", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 3" },
- { OSDOPTION_AUDIO_EFFECT "4", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 4" },
- { OSDOPTION_AUDIO_EFFECT "5", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 5" },
- { OSDOPTION_AUDIO_EFFECT "6", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 6" },
- { OSDOPTION_AUDIO_EFFECT "7", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 7" },
- { OSDOPTION_AUDIO_EFFECT "8", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 8" },
- { OSDOPTION_AUDIO_EFFECT "9", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 9" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "CoreAudio-SPECIFIC OPTIONS" },
+ { OSDOPTION_AUDIO_OUTPUT, OSDOPTVAL_AUTO, core_options::option_type::STRING, "audio output device" },
+ { OSDOPTION_AUDIO_EFFECT "0", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 0" },
+ { OSDOPTION_AUDIO_EFFECT "1", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 1" },
+ { OSDOPTION_AUDIO_EFFECT "2", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 2" },
+ { OSDOPTION_AUDIO_EFFECT "3", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 3" },
+ { OSDOPTION_AUDIO_EFFECT "4", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 4" },
+ { OSDOPTION_AUDIO_EFFECT "5", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 5" },
+ { OSDOPTION_AUDIO_EFFECT "6", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 6" },
+ { OSDOPTION_AUDIO_EFFECT "7", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 7" },
+ { OSDOPTION_AUDIO_EFFECT "8", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 8" },
+ { OSDOPTION_AUDIO_EFFECT "9", OSDOPTVAL_NONE, core_options::option_type::STRING, "AudioUnit effect 9" },
#endif
- { nullptr, nullptr, core_options::option_type::HEADER, "BGFX POST-PROCESSING OPTIONS" },
- { OSDOPTION_BGFX_PATH, "bgfx", core_options::option_type::STRING, "path to BGFX-related files" },
- { OSDOPTION_BGFX_BACKEND, "auto", core_options::option_type::STRING, "BGFX backend to use (d3d9, d3d11, d3d12, metal, opengl, gles, vulkan)" },
- { OSDOPTION_BGFX_DEBUG, "0", core_options::option_type::BOOLEAN, "enable BGFX debugging statistics" },
- { OSDOPTION_BGFX_SCREEN_CHAINS, "default", core_options::option_type::STRING, "comma-delimited list of screen chain JSON names, colon-delimited per-window" },
- { OSDOPTION_BGFX_SHADOW_MASK, "slot-mask.png", core_options::option_type::STRING, "shadow mask texture name" },
- { OSDOPTION_BGFX_LUT, "lut-default.png", core_options::option_type::STRING, "LUT texture name" },
- { OSDOPTION_BGFX_AVI_NAME, OSDOPTVAL_AUTO, core_options::option_type::STRING, "filename for BGFX output logging" },
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD MIDI OPTIONS" },
+ { OSDOPTION_MIDI_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "MIDI I/O method: " },
+
+ { nullptr, nullptr, core_options::option_type::HEADER, "OSD EMULATED NETWORKING OPTIONS" },
+ { OSDOPTION_NETWORK_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "Emulated networking provider: " },
- // End of list
+ { nullptr, nullptr, core_options::option_type::HEADER, "BGFX POST-PROCESSING OPTIONS" },
+ { OSDOPTION_BGFX_PATH, "bgfx", core_options::option_type::PATH, "path to BGFX-related files" },
+ { OSDOPTION_BGFX_BACKEND, "auto", core_options::option_type::STRING, "BGFX backend to use (d3d9, d3d11, d3d12, metal, opengl, gles, vulkan)" },
+ { OSDOPTION_BGFX_DEBUG, "0", core_options::option_type::BOOLEAN, "enable BGFX debugging statistics" },
+ { OSDOPTION_BGFX_SCREEN_CHAINS, "", core_options::option_type::STRING, "comma-delimited list of screen chain JSON names, colon-delimited per-window" },
+ { OSDOPTION_BGFX_SHADOW_MASK, "slot-mask.png", core_options::option_type::STRING, "shadow mask texture name" },
+ { OSDOPTION_BGFX_LUT, "lut-default.png", core_options::option_type::STRING, "LUT texture name" },
+ { OSDOPTION_BGFX_AVI_NAME, OSDOPTVAL_AUTO, core_options::option_type::PATH, "filename for BGFX output logging" },
+
+ // End of list
{ nullptr }
};
@@ -182,7 +193,7 @@ osd_options::osd_options()
}
// Window list
-std::list<std::shared_ptr<osd_window>> osd_common_t::s_window_list;
+std::list<std::unique_ptr<osd_window> > osd_common_t::s_window_list;
//-------------------------------------------------
// osd_interface - constructor
@@ -217,7 +228,7 @@ osd_common_t::~osd_common_t()
osd_output::pop(this);
}
-#define REGISTER_MODULE(_O, _X ) { extern const module_type _X; _O . register_module( _X ); }
+#define REGISTER_MODULE(O, X) { extern const module_type X; O.register_module(X); }
void osd_common_t::register_options()
{
@@ -227,6 +238,26 @@ void osd_common_t::register_options()
REGISTER_MODULE(m_mod_man, FONT_SDL);
REGISTER_MODULE(m_mod_man, FONT_NONE);
+#if defined(SDLMAME_EMSCRIPTEN)
+ REGISTER_MODULE(m_mod_man, RENDERER_SDL1); // don't bother trying to use video acceleration in browsers
+#endif
+#if defined(OSD_WINDOWS)
+ REGISTER_MODULE(m_mod_man, RENDERER_D3D); // this is only built for OSD=windows, there's no dummy stub
+#endif
+#if defined(OSD_WINDOWS) || defined(SDLMAME_WIN32)
+ REGISTER_MODULE(m_mod_man, RENDERER_BGFX); // try BGFX before GDI on windows to get DirectX 10/11 acceleration
+#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)
+ 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);
+#if !defined(SDLMAME_EMSCRIPTEN)
+ REGISTER_MODULE(m_mod_man, RENDERER_SDL1);
+#endif
+ REGISTER_MODULE(m_mod_man, RENDERER_NONE);
+
REGISTER_MODULE(m_mod_man, SOUND_DSOUND);
REGISTER_MODULE(m_mod_man, SOUND_XAUDIO2);
REGISTER_MODULE(m_mod_man, SOUND_COREAUDIO);
@@ -277,12 +308,14 @@ void osd_common_t::register_options()
REGISTER_MODULE(m_mod_man, MOUSEINPUT_WIN32);
REGISTER_MODULE(m_mod_man, MOUSE_NONE);
+ REGISTER_MODULE(m_mod_man, LIGHTGUNINPUT_SDL);
REGISTER_MODULE(m_mod_man, LIGHTGUN_X11);
REGISTER_MODULE(m_mod_man, LIGHTGUNINPUT_RAWINPUT);
REGISTER_MODULE(m_mod_man, LIGHTGUNINPUT_WIN32);
REGISTER_MODULE(m_mod_man, LIGHTGUN_NONE);
- REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_SDL);
+ REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_SDLGAME);
+ REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_SDLJOY);
REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_WINHYBRID);
REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_DINPUT);
REGISTER_MODULE(m_mod_man, JOYSTICKINPUT_XINPUT);
@@ -295,95 +328,34 @@ void osd_common_t::register_options()
// after initialization we know which modules are supported
-
- const char *names[20];
- int num;
- std::vector<const char *> dnames;
-
- m_mod_man.get_module_names(OSD_MONITOR_PROVIDER, 20, num, names);
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_MONITOR_PROVIDER, dnames);
-
- m_mod_man.get_module_names(OSD_FONT_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_FONT_PROVIDER, dnames);
-
- m_mod_man.get_module_names(OSD_KEYBOARDINPUT_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_KEYBOARDINPUT_PROVIDER, dnames);
-
- m_mod_man.get_module_names(OSD_MOUSEINPUT_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_MOUSEINPUT_PROVIDER, dnames);
-
- m_mod_man.get_module_names(OSD_LIGHTGUNINPUT_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_LIGHTGUNINPUT_PROVIDER, dnames);
-
- m_mod_man.get_module_names(OSD_JOYSTICKINPUT_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_JOYSTICKINPUT_PROVIDER, dnames);
-
- m_mod_man.get_module_names(OSD_SOUND_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_SOUND_PROVIDER, dnames);
-
-#if 0
- // Register midi options and update options
- m_mod_man.get_module_names(OSD_MIDI_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_MIDI_PROVIDER, dnames);
-#endif
-
- // Register debugger options and update options
- m_mod_man.get_module_names(OSD_DEBUG_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_DEBUG_PROVIDER, dnames);
-
- m_mod_man.get_module_names(OSD_OUTPUT_PROVIDER, 20, num, names);
- dnames.clear();
- for (int i = 0; i < num; i++)
- dnames.push_back(names[i]);
- update_option(OSD_OUTPUT_PROVIDER, dnames);
-
- // Register video options and update options
- video_options_add("none", nullptr);
- video_register();
- update_option(OSDOPTION_VIDEO, m_video_names);
-}
-
-void osd_common_t::update_option(const std::string &key, std::vector<const char *> &values)
+ update_option(OSD_FONT_PROVIDER, m_mod_man.get_module_names(OSD_FONT_PROVIDER));
+ update_option(OSD_RENDERER_PROVIDER, m_mod_man.get_module_names(OSD_RENDERER_PROVIDER));
+ update_option(OSD_SOUND_PROVIDER, m_mod_man.get_module_names(OSD_SOUND_PROVIDER));
+ update_option(OSD_MONITOR_PROVIDER, m_mod_man.get_module_names(OSD_MONITOR_PROVIDER));
+ update_option(OSD_KEYBOARDINPUT_PROVIDER, m_mod_man.get_module_names(OSD_KEYBOARDINPUT_PROVIDER));
+ update_option(OSD_MOUSEINPUT_PROVIDER, m_mod_man.get_module_names(OSD_MOUSEINPUT_PROVIDER));
+ update_option(OSD_LIGHTGUNINPUT_PROVIDER, m_mod_man.get_module_names(OSD_LIGHTGUNINPUT_PROVIDER));
+ update_option(OSD_JOYSTICKINPUT_PROVIDER, m_mod_man.get_module_names(OSD_JOYSTICKINPUT_PROVIDER));
+ update_option(OSD_MIDI_PROVIDER, m_mod_man.get_module_names(OSD_MIDI_PROVIDER));
+ update_option(OSD_NETDEV_PROVIDER, m_mod_man.get_module_names(OSD_NETDEV_PROVIDER));
+ update_option(OSD_DEBUG_PROVIDER, m_mod_man.get_module_names(OSD_DEBUG_PROVIDER));
+ update_option(OSD_OUTPUT_PROVIDER, m_mod_man.get_module_names(OSD_OUTPUT_PROVIDER));
+}
+
+void osd_common_t::update_option(const std::string &key, std::vector<std::string_view> const &values)
{
std::string current_value(m_options.description(key.c_str()));
std::string new_option_value("");
for (unsigned int index = 0; index < values.size(); index++)
{
- std::string t(values[index]);
if (new_option_value.length() > 0)
{
- if( index != (values.size()-1))
+ if (index != (values.size() - 1))
new_option_value.append(", ");
else
new_option_value.append(" or ");
}
- new_option_value.append(t);
+ new_option_value.append(values[index]);
}
m_option_descs[key] = current_value + new_option_value;
@@ -394,7 +366,7 @@ void osd_common_t::update_option(const std::string &key, std::vector<const char
//-------------------------------------------------
// output_callback - callback for osd_printf_...
//-------------------------------------------------
-void osd_common_t::output_callback(osd_output_channel channel, const util::format_argument_pack<std::ostream> &args)
+void osd_common_t::output_callback(osd_output_channel channel, const util::format_argument_pack<char> &args)
{
switch (channel)
{
@@ -620,28 +592,50 @@ bool osd_common_t::execute_command(const char *command)
{
if (strcmp(command, OSDCOMMAND_LIST_NETWORK_ADAPTERS) == 0)
{
- osd_module *om = select_module_options(options(), OSD_NETDEV_PROVIDER);
-
- if (om->probe())
+ osd_module &om = select_module_options<osd_module>(OSD_NETDEV_PROVIDER);
+ auto const &interfaces = get_netdev_list();
+ if (interfaces.empty())
+ {
+ printf("No supported network interfaces were found\n");
+ }
+ else
{
- om->init(options());
- osd_list_network_adapters();
- om->exit();
+ printf("Available network interfaces:\n");
+ for (auto &entry : interfaces)
+ {
+ printf(" %s\n", entry->description);
+ }
}
+ om.exit();
return true;
}
else if (strcmp(command, OSDCOMMAND_LIST_MIDI_DEVICES) == 0)
{
- osd_module *om = select_module_options(options(), OSD_MIDI_PROVIDER);
- auto *pm = select_module_options<midi_module *>(options(), OSD_MIDI_PROVIDER);
-
- if (om->probe())
+ osd_module &om = select_module_options<osd_module>(OSD_MIDI_PROVIDER);
+ auto const ports = dynamic_cast<midi_module &>(om).list_midi_ports();
+ if (ports.empty())
{
- om->init(options());
- pm->list_midi_devices();
- om->exit();
+ printf("No MIDI ports were found\n");
}
+ else
+ {
+ printf("MIDI input ports:\n");
+ for (auto const &port : ports)
+ {
+ if (port.input)
+ printf(port.default_input ? "%s (default)\n" : "%s\n", port.name.c_str());
+ }
+
+ printf("\nMIDI output ports:\n");
+ for (auto const &port : ports)
+ {
+ if (port.output)
+ printf(port.default_output ? "%s (default)\n" : "%s\n", port.name.c_str());
+ }
+ }
+ om.exit();
+
return true;
}
@@ -657,10 +651,10 @@ static void output_notifier_callback(const char *outname, int32_t value, void *p
void osd_common_t::init_subsystems()
{
// monitors have to be initialized before video init
- m_monitor_module = select_module_options<monitor_module *>(options(), OSD_MONITOR_PROVIDER);
- assert(m_monitor_module != nullptr);
- m_monitor_module->init(options());
+ m_monitor_module = &select_module_options<monitor_module>(OSD_MONITOR_PROVIDER);
+ // various modules depend on having a window handle
+ m_render = &select_module_options<render_module>(OSD_RENDERER_PROVIDER);
if (!video_init())
{
video_exit();
@@ -670,32 +664,24 @@ void osd_common_t::init_subsystems()
exit(-1);
}
- m_keyboard_input = select_module_options<input_module *>(options(), OSD_KEYBOARDINPUT_PROVIDER);
- m_mouse_input = select_module_options<input_module *>(options(), OSD_MOUSEINPUT_PROVIDER);
- m_lightgun_input = select_module_options<input_module *>(options(), OSD_LIGHTGUNINPUT_PROVIDER);
- m_joystick_input = select_module_options<input_module *>(options(), OSD_JOYSTICKINPUT_PROVIDER);
+ m_keyboard_input = &select_module_options<input_module>(OSD_KEYBOARDINPUT_PROVIDER);
+ m_mouse_input = &select_module_options<input_module>(OSD_MOUSEINPUT_PROVIDER);
+ m_lightgun_input = &select_module_options<input_module>(OSD_LIGHTGUNINPUT_PROVIDER);
+ m_joystick_input = &select_module_options<input_module>(OSD_JOYSTICKINPUT_PROVIDER);
- m_font_module = select_module_options<font_module *>(options(), OSD_FONT_PROVIDER);
- m_sound = select_module_options<sound_module *>(options(), OSD_SOUND_PROVIDER);
- m_sound->m_sample_rate = options().sample_rate();
- m_sound->m_audio_latency = options().audio_latency();
+ m_font_module = &select_module_options<font_module>(OSD_FONT_PROVIDER);
+ m_sound = &select_module_options<sound_module>(OSD_SOUND_PROVIDER);
- m_debugger = select_module_options<debug_module *>(options(), OSD_DEBUG_PROVIDER);
+ m_debugger = &select_module_options<debug_module>(OSD_DEBUG_PROVIDER);
- select_module_options<netdev_module *>(options(), OSD_NETDEV_PROVIDER);
+ select_module_options<netdev_module>(OSD_NETDEV_PROVIDER);
- m_midi = select_module_options<midi_module *>(options(), OSD_MIDI_PROVIDER);
+ m_midi = &select_module_options<midi_module>(OSD_MIDI_PROVIDER);
- m_output = select_module_options<output_module *>(options(), OSD_OUTPUT_PROVIDER);
- m_output->set_machine(&machine());
+ m_output = &select_module_options<output_module>(OSD_OUTPUT_PROVIDER);
machine().output().set_global_notifier(output_notifier_callback, this);
- m_mod_man.init(options());
-
input_init();
- // we need pause callbacks
- machine().add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(&osd_common_t::input_pause, this));
- machine().add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(&osd_common_t::input_resume, this));
}
bool osd_common_t::video_init()
@@ -713,10 +699,6 @@ bool osd_common_t::no_sound()
return (strcmp(options().sound(),"none")==0) ? true : false;
}
-void osd_common_t::video_register()
-{
-}
-
bool osd_common_t::input_init()
{
m_keyboard_input->input_init(machine());
@@ -726,20 +708,12 @@ bool osd_common_t::input_init()
return true;
}
-void osd_common_t::input_pause()
-{
- m_keyboard_input->pause();
- m_mouse_input->pause();
- m_lightgun_input->pause();
- m_joystick_input->pause();
-}
-
-void osd_common_t::input_resume()
+void osd_common_t::poll_input_modules(bool relative_reset)
{
- m_keyboard_input->resume();
- m_mouse_input->resume();
- m_lightgun_input->resume();
- m_joystick_input->resume();
+ m_keyboard_input->poll_if_necessary(relative_reset);
+ m_mouse_input->poll_if_necessary(relative_reset);
+ m_lightgun_input->poll_if_necessary(relative_reset);
+ m_joystick_input->poll_if_necessary(relative_reset);
}
void osd_common_t::exit_subsystems()
@@ -757,17 +731,15 @@ void osd_common_t::window_exit()
void osd_common_t::osd_exit()
{
+ // destroy the renderers before shutting down their parent module
+ for (auto it = window_list().rbegin(); window_list().rend() != it; ++it)
+ (*it)->renderer_reset();
+
m_mod_man.exit();
exit_subsystems();
}
-void osd_common_t::video_options_add(const char *name, void *type)
-{
- //m_video_options.add(name, type, false);
- m_video_names.push_back(name);
-}
-
osd_font::ptr osd_common_t::font_alloc()
{
return m_font_module->font_alloc();
@@ -778,7 +750,12 @@ bool osd_common_t::get_font_families(std::string const &font_path, std::vector<s
return m_font_module->get_font_families(font_path, result);
}
-std::unique_ptr<osd_midi_device> osd_common_t::create_midi_device()
+std::unique_ptr<osd::midi_input_port> osd_common_t::create_midi_input(std::string_view name)
+{
+ return m_midi->create_input(name);
+}
+
+std::unique_ptr<osd::midi_output_port> osd_common_t::create_midi_output(std::string_view name)
{
- return m_midi->create_midi_device();
+ return m_midi->create_output(name);
}
span>isbx0_tdma_r, isbx0_tdma_w) AM_RANGE(0x0330, 0x033f) AM_READWRITE(isbx1_tdma_r, isbx1_tdma_w) AM_RANGE(0x0340, 0x034f) AM_READWRITE(isbx0_cs_r, isbx0_cs_w) AM_RANGE(0x0350, 0x035f) AM_READWRITE(isbx0_dack_r, isbx0_dack_w) AM_RANGE(0x0360, 0x036f) AM_READWRITE(isbx1_cs_r, isbx1_cs_w) AM_RANGE(0x0370, 0x037f) AM_READWRITE(isbx1_dack_r, isbx1_dack_w) #ifdef NOT_SUPPORTED_BY_MAME_CORE AM_RANGE(0x0300, 0x0301) /* PCS6:1 */ AM_MIRROR(0xe) AM_DEVREADWRITE8("upd7220", upd7220_device, dack_r, dack_w, 0xff00) // DMA-ACK graphics AM_RANGE(0x0310, 0x0311) /* PCS6:2 */ AM_MIRROR(0xe) AM_DEVREAD8(I8274_TAG, i8274_device, inta_r, 0x00ff) // 8274 INTERRUPT ACKNOWLEDGE AM_RANGE(0x0320, 0x0323) /* PCS6:4 */ AM_MIRROR(0xc) AM_DEVREADWRITE8(I8274_TAG, i8274_device, cd_ba_r, cd_ba_w, 0x00ff) AM_RANGE(0x0320, 0x0321) /* PCS6:5 */ AM_MIRROR(0xe) AM_READWRITE8(isbx0_tdma_r, isbx0_tdma_w, 0xff00) // DMA-TERMINATE J8 (iSBX0) AM_RANGE(0x0330, 0x0333) /* PCS6:6 */ AM_DEVREADWRITE8("upd7220", upd7220_device, read, write, 0x00ff) AM_RANGE(0x0330, 0x0331) /* PCS6:7 */ AM_MIRROR(0xe) AM_READWRITE8(isbx1_tdma_r, isbx1_tdma_w, 0xff00) // DMA-TERMINATE J9 (iSBX1) AM_RANGE(0x0340, 0x034f) /* PCS6:8 */ AM_DEVREADWRITE8(ISBX_0_TAG, isbx_slot_device, mcs0_r, mcs0_w, 0x00ff) // 8272 CS0 (8/16-bit) J8 (iSBX0) AM_RANGE(0x0340, 0x034f) /* PCS6:9 */ AM_DEVREADWRITE8(ISBX_0_TAG, isbx_slot_device, mcs1_r, mcs1_w, 0xff00) // CS1 (16-bit) J8 (iSBX0) AM_RANGE(0x0350, 0x035f) /* PCS6:10 */ AM_DEVREADWRITE8(ISBX_0_TAG, isbx_slot_device, mcs1_r, mcs1_w, 0x00ff) // CS1 (8-bit) J8 (iSBX0) AM_RANGE(0x0350, 0x035f) /* PCS6:11 */ AM_DEVREADWRITE8(ISBX_0_TAG, isbx_slot_device, mdack_r, mdack_w, 0xff00) // DMA-ACK J8 (iSBX0) AM_RANGE(0x0360, 0x036f) /* PCS6:13 */ AM_DEVREADWRITE8(ISBX_1_TAG, isbx_slot_device, mcs0_r, mcs0_w, 0x00ff) // CS0 (8/16-bit) J9 (iSBX1) AM_RANGE(0x0360, 0x036f) /* PCS6:13 */ AM_DEVREADWRITE8(ISBX_1_TAG, isbx_slot_device, mcs1_r, mcs1_w, 0xff00) // CS1 (16-bit) J9 (iSBX1) AM_RANGE(0x0370, 0x037f) /* PCS6:14 */ AM_DEVREADWRITE8(ISBX_1_TAG, isbx_slot_device, mcs1_r, mcs1_w, 0x00ff) // CS1 (8-bit) J9 (iSBX1) AM_RANGE(0x0370, 0x037f) /* PCS6:15 */ AM_DEVREADWRITE8(ISBX_1_TAG, isbx_slot_device, mdack_r, mdack_w, 0xff00) // DMA-ACK J9 (iSBX1) #endif ADDRESS_MAP_END //------------------------------------------------- // ADDRESS_MAP( upd7220_map ) //------------------------------------------------- static ADDRESS_MAP_START( upd7220_map, AS_0, 16, compis_state ) ADDRESS_MAP_GLOBAL_MASK(0x7fff) AM_RANGE(0x00000, 0x7fff) AM_RAM AM_SHARE("video_ram") ADDRESS_MAP_END //************************************************************************** // INPUT PORTS //************************************************************************** //------------------------------------------------- // INPUT_PORTS( compis ) //------------------------------------------------- static INPUT_PORTS_START( compis ) PORT_START("S1") PORT_CONFNAME( 0x01, 0x00, "S1 ROM Type") PORT_CONFSETTING( 0x00, "27128" ) PORT_CONFSETTING( 0x01, "27256" ) PORT_START("S2") PORT_CONFNAME( 0x01, 0x00, "S2 IC36/IC40") PORT_CONFSETTING( 0x00, "ROM" ) PORT_CONFSETTING( 0x01, "RAM" ) PORT_START("S3") PORT_CONFNAME( 0x03, 0x00, "S3 J4 RxC") PORT_CONFSETTING( 0x00, "DCE" ) PORT_CONFSETTING( 0x01, "Tmr3" ) PORT_CONFSETTING( 0x02, "Tmr4" ) PORT_START("S4") PORT_CONFNAME( 0x01, 0x01, "S4 iSBX0 Bus Width") PORT_CONFSETTING( 0x00, "8 Bit" ) PORT_CONFSETTING( 0x01, "16 Bit" ) PORT_START("S5") PORT_CONFNAME( 0x01, 0x01, "S5 iSBX1 Bus Width") PORT_CONFSETTING( 0x00, "8 Bit" ) PORT_CONFSETTING( 0x01, "16 Bit" ) PORT_START("S6") PORT_CONFNAME( 0x001, 0x001, "S6 INT 8274") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x001, DEF_STR( On ) ) PORT_CONFNAME( 0x002, 0x000, "S6 TxRDY 8251") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x002, DEF_STR( On ) ) PORT_CONFNAME( 0x004, 0x000, "S6 INT KB") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x004, DEF_STR( On ) ) PORT_CONFNAME( 0x008, 0x008, "S6 DELAY 80150") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x008, DEF_STR( On ) ) PORT_CONFNAME( 0x010, 0x000, "S6 INT0 iSBX1 (J9)") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x010, DEF_STR( On ) ) PORT_CONFNAME( 0x020, 0x000, "S6 INT1 iSBX1 (J9)") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x020, DEF_STR( On ) ) PORT_CONFNAME( 0x040, 0x040, "S6 ACK J7") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x040, DEF_STR( On ) ) PORT_CONFNAME( 0x080, 0x000, "S6 SYSTICK 80150") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x080, DEF_STR( On ) ) PORT_CONFNAME( 0x100, 0x100, "S6 RxRDY 8251") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x100, DEF_STR( On ) ) PORT_CONFNAME( 0x200, 0x000, "S6 INT0 iSBX0 (J8)") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x200, DEF_STR( On ) ) PORT_CONFNAME( 0x400, 0x400, "S6 INT1 iSBX0 (J8)") PORT_CONFSETTING( 0x000, DEF_STR( Off ) ) PORT_CONFSETTING( 0x400, DEF_STR( On ) ) PORT_START("S7") PORT_CONFNAME( 0x01, 0x00, "S7 ROM Type") PORT_CONFSETTING( 0x00, "27128" ) PORT_CONFSETTING( 0x01, "27256" ) PORT_START("S8") PORT_CONFNAME( 0x18, 0x00, "S8 Test Mode") PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) PORT_CONFSETTING( 0x08, "Remote Test" ) PORT_CONFSETTING( 0x10, "Standalone Test" ) PORT_CONFSETTING( 0x18, "Reserved" ) PORT_START("S9") PORT_CONFNAME( 0x03, 0x00, "S9 8274 TxCB") PORT_CONFSETTING( 0x00, "DCE-Rxc (J4-11)" ) PORT_CONFSETTING( 0x01, "DCE-Txc (J4-13)" ) PORT_CONFSETTING( 0x02, "Tmr3" ) PORT_START("S10") PORT_CONFNAME( 0x01, 0x01, "S10 8274 RxCA") PORT_CONFSETTING( 0x00, "DCE (J2-11)" ) PORT_CONFSETTING( 0x01, "Tmr5" ) PORT_START("S11") PORT_CONFNAME( 0x03, 0x01, "S11 8274 TxCA") PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) PORT_CONFSETTING( 0x01, "DCE (J2-13)" ) PORT_CONFSETTING( 0x02, "Tmr5" ) PORT_START("S12") PORT_CONFNAME( 0x01, 0x01, "S12 8274 TxDA") PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) PORT_CONFSETTING( 0x01, "V24 (J2)" ) PORT_START("S13") PORT_CONFNAME( 0x01, 0x01, "S13 8274 RxDA") PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) PORT_CONFSETTING( 0x01, "V24 (J2)" ) PORT_START("S14") PORT_CONFNAME( 0x01, 0x01, "S14 8274 TxCA") PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) PORT_CONFSETTING( 0x01, DEF_STR( On ) ) PORT_START("S15") PORT_CONFNAME( 0x01, 0x00, "S15 Network") PORT_CONFSETTING( 0x00, "Server" ) PORT_CONFSETTING( 0x01, "Client" ) INPUT_PORTS_END //************************************************************************** // DEVICE CONFIGURATION //************************************************************************** //------------------------------------------------- // UPD7220_INTERFACE( hgdc_intf ) //------------------------------------------------- UPD7220_DISPLAY_PIXELS_MEMBER( compis_state::hgdc_display_pixels ) { UINT16 i,gfx = m_video_ram[(address & 0x7fff) >> 1]; const pen_t *pen = m_palette->pens(); for(i=0; i<16; i++) bitmap.pix32(y, x + i) = pen[BIT(gfx, i)]; } //------------------------------------------------- // I80186_INTERFACE( cpu_intf ) //------------------------------------------------- READ8_MEMBER( compis_state::compis_irq_callback ) { return m_osp->inta_r(); } WRITE_LINE_MEMBER( compis_state::tmr0_w ) { m_tmr0 = state; m_cassette->output(m_tmr0 ? -1 : 1); m_maincpu->tmrin0_w(state); } WRITE_LINE_MEMBER( compis_state::tmr1_w ) { m_isbx0->mclk_w(state); m_isbx1->mclk_w(state); m_maincpu->tmrin1_w(state); } //------------------------------------------------- // I80130_INTERFACE( osp_intf ) //------------------------------------------------- WRITE_LINE_MEMBER( compis_state::tmr2_w ) { m_uart->write_rxc(state); m_uart->write_txc(state); } WRITE_LINE_MEMBER( compis_state::tmr5_w ) { m_mpsc->rxca_w(state); m_mpsc->txca_w(state); } //------------------------------------------------- // I8255A interface //------------------------------------------------- WRITE_LINE_MEMBER(compis_state::write_centronics_busy) { m_centronics_busy = state; } WRITE_LINE_MEMBER(compis_state::write_centronics_select) { m_centronics_select = state; } READ8_MEMBER( compis_state::ppi_pb_r ) { /* bit description 0 J5-4 1 J5-5 2 J6-3 Cassette read 3 J2-6 DSR / S8-4 Test 4 J4-6 DSR / S8-3 Test 5 J7-11 Centronics BUSY 6 J7-13 Centronics SELECT 7 Tmr0 */ UINT8 data = 0; /* DIP switch - Test mode */ data = m_s8->read(); // cassette data |= (m_cassette->input() > 0.0) << 2; /* Centronics busy */ data |= m_centronics_busy << 5; data |= m_centronics_select << 6; // TMR0 data |= m_tmr0 << 7; return data; } WRITE8_MEMBER( compis_state::ppi_pc_w ) { /* bit description 0 J5-1 1 J5-2 2 Select: 1=time measure, DSR from J2/J4 pin 6. 0=read cassette 3 Datex: Tristate datex output (low) 4 V2-5 Floppy motor on/off 5 J7-1 Centronics STROBE 6 V2-4 Floppy Soft reset 7 V2-3 Floppy Terminal count */ m_isbx0->opt1_w(BIT(data, 4)); m_centronics->write_strobe(BIT(data, 5)); if (BIT(data, 6)) { m_isbx0->reset(); } m_isbx0->opt0_w(BIT(data, 7)); } TIMER_DEVICE_CALLBACK_MEMBER( compis_state::tape_tick ) { m_maincpu->tmrin0_w(m_cassette->input() > 0.0); } //************************************************************************** // MACHINE INITIALIZATION //************************************************************************** //------------------------------------------------- // machine_start //------------------------------------------------- void compis_state::machine_start() { if (m_ram->size() == 256*1024) { m_maincpu->space(AS_PROGRAM).install_ram(0x20000, 0x3ffff, NULL); } } //------------------------------------------------- // machine_reset //------------------------------------------------- void compis_state::machine_reset() { m_uart->reset(); m_mpsc->reset(); m_ppi->reset(); m_isbx0->reset(); m_isbx1->reset(); } //************************************************************************** // MACHINE DRIVERS //************************************************************************** //------------------------------------------------- // MACHINE_CONFIG( compis ) //------------------------------------------------- static MACHINE_CONFIG_START( compis, compis_state ) // basic machine hardware MCFG_CPU_ADD(I80186_TAG, I80186, XTAL_16MHz) MCFG_CPU_PROGRAM_MAP(compis_mem) MCFG_CPU_IO_MAP(compis_io) MCFG_80186_IRQ_SLAVE_ACK(DEVREAD8(DEVICE_SELF, compis_state, compis_irq_callback)) MCFG_80186_TMROUT0_HANDLER(DEVWRITELINE(DEVICE_SELF, compis_state, tmr0_w)) MCFG_80186_TMROUT1_HANDLER(DEVWRITELINE(DEVICE_SELF, compis_state, tmr1_w)) // video hardware MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) MCFG_SCREEN_REFRESH_RATE(50) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate MCFG_SCREEN_SIZE(640, 400) MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1) MCFG_SCREEN_UPDATE_DEVICE("upd7220", upd7220_device, screen_update) MCFG_DEVICE_ADD("upd7220", UPD7220, XTAL_4_433619MHz/2) // unknown clock MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_map) MCFG_UPD7220_DISPLAY_PIXELS_CALLBACK_OWNER(compis_state, hgdc_display_pixels) MCFG_VIDEO_SET_SCREEN(SCREEN_TAG) MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") // devices MCFG_DEVICE_ADD(I80130_TAG, I80130, XTAL_16MHz/2) MCFG_I80130_IRQ_CALLBACK(DEVWRITELINE(I80186_TAG, i80186_cpu_device, int0_w)) //MCFG_I80130_SYSTICK_CALLBACK(DEVWRITELINE(I80130_TAG, i80130_device, ir3_w)) MCFG_I80130_DELAY_CALLBACK(DEVWRITELINE(I80130_TAG, i80130_device, ir7_w)) MCFG_I80130_BAUD_CALLBACK(WRITELINE(compis_state, tmr2_w)) MCFG_DEVICE_ADD(I8253_TAG, PIT8253, 0) MCFG_PIT8253_CLK0(XTAL_16MHz/8) MCFG_PIT8253_OUT0_HANDLER(DEVWRITELINE(I8274_TAG, i8274_device, rxtxcb_w)) MCFG_PIT8253_CLK1(XTAL_16MHz/8) MCFG_PIT8253_CLK2(XTAL_16MHz/8) MCFG_PIT8253_OUT2_HANDLER(WRITELINE(compis_state, tmr5_w)) MCFG_DEVICE_ADD(I8255_TAG, I8255, 0) MCFG_I8255_OUT_PORTA_CB(DEVWRITE8("cent_data_out", output_latch_device, write)) MCFG_I8255_IN_PORTB_CB(READ8(compis_state, ppi_pb_r)) MCFG_I8255_OUT_PORTC_CB(WRITE8(compis_state, ppi_pc_w)) MCFG_DEVICE_ADD(I8251A_TAG, I8251, 0) MCFG_I8251_TXD_HANDLER(DEVWRITELINE(COMPIS_KEYBOARD_TAG, compis_keyboard_device, si_w)) MCFG_I8251_RXRDY_HANDLER(DEVWRITELINE(I80130_TAG, i80130_device, ir2_w)) //MCFG_I8251_TXRDY_HANDLER(DEVWRITELINE(I80186_TAG, i80186_cpu_device, int1_w)) MCFG_DEVICE_ADD(COMPIS_KEYBOARD_TAG, COMPIS_KEYBOARD, 0) MCFG_COMPIS_KEYBOARD_OUT_TX_HANDLER(DEVWRITELINE(I8251A_TAG, i8251_device, write_rxd)) MCFG_I8274_ADD(I8274_TAG, XTAL_16MHz/4, 0, 0, 0, 0) MCFG_Z80DART_OUT_TXDA_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_txd)) MCFG_Z80DART_OUT_DTRA_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_dtr)) MCFG_Z80DART_OUT_RTSA_CB(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_rts)) MCFG_Z80DART_OUT_TXDB_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_txd)) MCFG_Z80DART_OUT_DTRB_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_dtr)) MCFG_Z80DART_OUT_RTSB_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_rts)) MCFG_Z80DART_OUT_INT_CB(DEVWRITELINE(I80186_TAG, i80186_cpu_device, int3_w)) MCFG_DEVICE_ADD(MM58174A_TAG, MM58274C, 0) MCFG_MM58274C_MODE24(0) // 12 hour MCFG_MM58274C_DAY1(1) // monday MCFG_CASSETTE_ADD(CASSETTE_TAG) MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", compis_state, tape_tick, attotime::from_hz(44100)) MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, rxa_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, dcda_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, ctsa_w)) MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, rxb_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, dcdb_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, ctsb_w)) MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_devices, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(compis_state, write_centronics_busy)) MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(compis_state, write_centronics_select)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) MCFG_ISBX_SLOT_ADD(ISBX_0_TAG, 0, isbx_cards, "fdc") MCFG_ISBX_SLOT_MINTR0_CALLBACK(DEVWRITELINE(I80130_TAG, i80130_device, ir1_w)) MCFG_ISBX_SLOT_MINTR1_CALLBACK(DEVWRITELINE(I80130_TAG, i80130_device, ir0_w)) MCFG_ISBX_SLOT_MDRQT_CALLBACK(DEVWRITELINE(I80186_TAG, i80186_cpu_device, drq0_w)) MCFG_ISBX_SLOT_ADD(ISBX_1_TAG, 0, isbx_cards, NULL) MCFG_ISBX_SLOT_MINTR0_CALLBACK(DEVWRITELINE(I80130_TAG, i80130_device, ir6_w)) MCFG_ISBX_SLOT_MINTR1_CALLBACK(DEVWRITELINE(I80130_TAG, i80130_device, ir5_w)) MCFG_ISBX_SLOT_MDRQT_CALLBACK(DEVWRITELINE(I80186_TAG, i80186_cpu_device, drq1_w)) // software lists MCFG_SOFTWARE_LIST_ADD("flop_list", "compis") // internal ram MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("128K") MCFG_RAM_EXTRA_OPTIONS("256K") MACHINE_CONFIG_END //------------------------------------------------- // MACHINE_CONFIG( compis2 ) //------------------------------------------------- static MACHINE_CONFIG_DERIVED( compis2, compis ) // basic machine hardware MCFG_CPU_MODIFY(I80186_TAG) MCFG_CPU_PROGRAM_MAP(compis2_mem) // TODO 8087 // devices // TODO 525hd drives // internal ram MCFG_RAM_MODIFY(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("768K") MACHINE_CONFIG_END //************************************************************************** // ROMS //************************************************************************** //------------------------------------------------- // ROM( compis ) //------------------------------------------------- ROM_START( compis ) ROM_REGION16_LE( 0x10000, I80186_TAG, 0 ) ROM_DEFAULT_BIOS( "v303" ) ROM_SYSTEM_BIOS( 0, "v20", "Compis v2.0 (1985-05-15)" ) ROMX_LOAD( "sa883003.u40", 0x0000, 0x4000, CRC(195ef6bf) SHA1(eaf8ae897e1a4b62d3038ff23777ce8741b766ef), ROM_BIOS(1) | ROM_SKIP(1) ) ROMX_LOAD( "sa883003.u36", 0x0001, 0x4000, CRC(7c918f56) SHA1(8ba33d206351c52f44f1aa76cc4d7f292dcef761), ROM_BIOS(1) | ROM_SKIP(1) ) ROMX_LOAD( "sa883003.u39", 0x8000, 0x4000, CRC(3cca66db) SHA1(cac36c9caa2f5bb42d7a6d5b84f419318628935f), ROM_BIOS(1) | ROM_SKIP(1) ) ROMX_LOAD( "sa883003.u35", 0x8001, 0x4000, CRC(43c38e76) SHA1(f32e43604107def2c2259898926d090f2ed62104), ROM_BIOS(1) | ROM_SKIP(1) ) ROM_SYSTEM_BIOS( 1, "v302", "Compis II v3.02 (1986-09-09)" ) ROMX_LOAD( "comp302.u39", 0x0000, 0x8000, CRC(16a7651e) SHA1(4cbd4ba6c6c915c04dfc913ec49f87c1dd7344e3), ROM_BIOS(2) | ROM_SKIP(1) ) ROMX_LOAD( "comp302.u35", 0x0001, 0x8000, CRC(ae546bef) SHA1(572e45030de552bb1949a7facbc885b8bf033fc6), ROM_BIOS(2) | ROM_SKIP(1) ) ROM_SYSTEM_BIOS( 2, "v303", "Compis II v3.03 (1987-03-09)" ) ROMX_LOAD( "rysa094.u39", 0x0000, 0x8000, CRC(e7302bff) SHA1(44ea20ef4008849af036c1a945bc4f27431048fb), ROM_BIOS(3) | ROM_SKIP(1) ) ROMX_LOAD( "rysa094.u35", 0x0001, 0x8000, CRC(b0694026) SHA1(eb6b2e3cb0f42fd5ffdf44f70e652ecb9714ce30), ROM_BIOS(3) | ROM_SKIP(1) ) ROM_END #define rom_compis2 rom_compis //************************************************************************** // SYSTEM DRIVERS //************************************************************************** // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS COMP(1985, compis, 0, 0, compis, compis, driver_device, 0, "Telenova", "Compis" , GAME_NOT_WORKING ) COMP(1986, compis2, compis, 0, compis2, compis, driver_device, 0, "Telenova", "Compis II" , GAME_NOT_WORKING )