diff options
| author | 2023-01-29 03:02:02 +1100 | |
|---|---|---|
| committer | 2023-01-29 03:16:14 +1100 | |
| commit | 68472d3d72ea4bbc545c0669348172b4e96c7b41 (patch) | |
| tree | e34fca0f55c977624148d1c806ecc6c44a5edd11 /src/osd/windows | |
| parent | 01fcb2e0decf670a4cdee3d37b6f7ebde9b8f02b (diff) | |
Various input and OSD refactoring:
osd: Supply OSD object to modules on initialisation. Encapsulated some
event handling in the OSD objects rather than leaving it in free
functions. Put various stuff in namespaces.
osd/modules/input: Enabled dinput, xinput and winhybrid modules for
Windows SDL builds, and enabled background input for dinput and xinput
(and by extension winhybrid) modules. Also fixed some COM and X11
resource leaks.
osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match
Windows, and exposed vertical and horizontal scroll as Z and rZ axes.
Moved SDL UI event handling out of input devices into OSD object.
osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's
correctly identified as a relative axis (it maps to the scroll wheel
equivalent).
osd: Added an option to choose the network provider module. Mostly
useful if you build with both TUN/TAP and pcap support included, or if
you want to disable emulated networking completely.
emu/input.cpp: Use a better strategy for assembling input code names
that uses fewer temporary strings and doesn't require use of the
non-Unicode-aware space trimming function (fixes MT08552).
osd/modules/input_dinput.cpp: Improved polling logic.
osd: Made various parts of the input code less dependent on concrete emu
objects, and reduced inappropriately passing around the machine object.
Made input modules less dependent on OSD implementation. Encapsulated
some stuff and got rid of some vestigial newui and SDL1 support code.
Cleaned up some interfaces. Moved OSD options classes to their own
files.
Prepare to remove main.h from emu.h - it's mostly used to get the
application name, which the vast majority of emulated devices don't need
to do.
Diffstat (limited to 'src/osd/windows')
| -rw-r--r-- | src/osd/windows/video.cpp | 11 | ||||
| -rw-r--r-- | src/osd/windows/window.cpp | 102 | ||||
| -rw-r--r-- | src/osd/windows/window.h | 12 | ||||
| -rw-r--r-- | src/osd/windows/winmain.cpp | 159 | ||||
| -rw-r--r-- | src/osd/windows/winmain.h | 250 | ||||
| -rw-r--r-- | src/osd/windows/winmenu.cpp | 33 | ||||
| -rw-r--r-- | src/osd/windows/winopts.cpp | 157 | ||||
| -rw-r--r-- | src/osd/windows/winopts.h | 232 |
8 files changed, 477 insertions, 479 deletions
diff --git a/src/osd/windows/video.cpp b/src/osd/windows/video.cpp index df5f531a2e0..e5ed5b99e3d 100644 --- a/src/osd/windows/video.cpp +++ b/src/osd/windows/video.cpp @@ -6,12 +6,13 @@ // //============================================================ -// standard windows headers -#include <windows.h> +#include "modules/monitor/monitor_module.h" +#include "modules/osdwindow.h" // MAME headers #include "emu.h" #include "emuopts.h" +#include "main.h" #include "render.h" #include "uiinput.h" @@ -20,8 +21,8 @@ #include "window.h" #include "strconv.h" -#include "modules/monitor/monitor_module.h" -#include "modules/osdwindow.h" +// standard windows headers +#include <windows.h> //============================================================ // CONSTANTS @@ -109,7 +110,7 @@ void windows_osd_interface::update(bool skip_redraw) void windows_osd_interface::input_update() { // poll the joystick values here - winwindow_process_events(machine(), true, false); + process_events(true, false); poll_input(machine()); check_osd_inputs(); } diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index d206ea41273..b0ab9f2eef0 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -86,8 +86,6 @@ static DWORD main_threadid; //============================================================ // event handling -static std::chrono::steady_clock::time_point last_event_check; - static int ui_temp_pause; static int ui_temp_was_paused; @@ -355,26 +353,44 @@ void win_window_info::show_pointer() ShowCursor(FALSE); } + +bool windows_osd_interface::has_focus() const +{ + return winwindow_has_focus(); +} + + //============================================================ // winwindow_process_events_periodic // (main thread) //============================================================ -void winwindow_process_events_periodic(running_machine &machine) +void windows_osd_interface::process_events() { - auto currticks = std::chrono::steady_clock::now(); - assert(GetCurrentThreadId() == main_threadid); + auto const currticks = std::chrono::steady_clock::now(); + // update once every 1/8th of a second - if (currticks - last_event_check < std::chrono::milliseconds(1000 / 8)) + if (currticks < (m_last_event_check + std::chrono::milliseconds(1000 / 8))) return; - winwindow_process_events(machine, true, false); + + process_events(true, false); } //============================================================ +// winwindow_video_window_proc_ui +// (window thread) +//============================================================ + +static LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) +{ + return win_window_info::video_window_proc(wnd, message, wparam, lparam); +} + +//============================================================ // is_mame_window //============================================================ @@ -418,14 +434,12 @@ inline static BOOL handle_keypress(windows_osd_interface *osd, int vkey, int dow // (main thread) //============================================================ -void winwindow_process_events(running_machine &machine, bool ingame, bool nodispatch) +void windows_osd_interface::process_events(bool ingame, bool nodispatch) { - MSG message; - assert(GetCurrentThreadId() == main_threadid); // remember the last time we did this - last_event_check = std::chrono::steady_clock::now(); + m_last_event_check = std::chrono::steady_clock::now(); do { @@ -434,75 +448,77 @@ void winwindow_process_events(running_machine &machine, bool ingame, bool nodisp WaitMessage(); // loop over all messages in the queue + MSG message; while (PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { // prevent debugger windows from getting messages during reset - int dispatch = TRUE && !nodispatch; + bool dispatch = !nodispatch; - if (message.hwnd == nullptr || is_mame_window(message.hwnd)) + if (!message.hwnd || is_mame_window(message.hwnd)) { - dispatch = TRUE; + dispatch = true; switch (message.message) { // ignore keyboard messages case WM_SYSKEYUP: case WM_SYSKEYDOWN: - dispatch = FALSE; + dispatch = false; break; // forward mouse button downs to the input system case WM_LBUTTONDOWN: - dispatch = !handle_mouse_button(WINOSD(machine), 0, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); + dispatch = !handle_mouse_button(this, 0, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); break; case WM_RBUTTONDOWN: - dispatch = !handle_mouse_button(WINOSD(machine), 1, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); + dispatch = !handle_mouse_button(this, 1, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); break; case WM_MBUTTONDOWN: - dispatch = !handle_mouse_button(WINOSD(machine), 2, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); + dispatch = !handle_mouse_button(this, 2, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); break; case WM_XBUTTONDOWN: - dispatch = !handle_mouse_button(WINOSD(machine), 3, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); + dispatch = !handle_mouse_button(this, 3, TRUE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); break; // forward mouse button ups to the input system case WM_LBUTTONUP: - dispatch = !handle_mouse_button(WINOSD(machine), 0, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); + dispatch = !handle_mouse_button(this, 0, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); break; case WM_RBUTTONUP: - dispatch = !handle_mouse_button(WINOSD(machine), 1, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); + dispatch = !handle_mouse_button(this, 1, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); break; case WM_MBUTTONUP: - dispatch = !handle_mouse_button(WINOSD(machine), 2, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); + dispatch = !handle_mouse_button(this, 2, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); break; case WM_XBUTTONUP: - dispatch = !handle_mouse_button(WINOSD(machine), 3, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); + dispatch = !handle_mouse_button(this, 3, FALSE, GET_X_LPARAM(message.lParam), GET_Y_LPARAM(message.lParam)); break; case WM_KEYDOWN: if (NOT_ALREADY_DOWN(message.lParam)) - dispatch = !handle_keypress(WINOSD(machine), message.wParam, TRUE, SCAN_CODE(message.lParam), IS_EXTENDED(message.lParam)); + dispatch = !handle_keypress(this, message.wParam, TRUE, SCAN_CODE(message.lParam), IS_EXTENDED(message.lParam)); break; case WM_KEYUP: - dispatch = !handle_keypress(WINOSD(machine), message.wParam, FALSE, SCAN_CODE(message.lParam), IS_EXTENDED(message.lParam)); + dispatch = !handle_keypress(this, message.wParam, FALSE, SCAN_CODE(message.lParam), IS_EXTENDED(message.lParam)); break; } } // dispatch if necessary if (dispatch) - winwindow_dispatch_message(machine, &message); + winwindow_dispatch_message(machine(), &message); } - } while (ui_temp_pause > 0); + } + while (ui_temp_pause > 0); // update the cursor state after processing events - winwindow_update_cursor_state(machine); + winwindow_update_cursor_state(machine()); } @@ -669,7 +685,7 @@ void winwindow_update_cursor_state(running_machine &machine) if (osd_common_t::s_window_list.empty()) return; - auto window = osd_common_t::s_window_list.front(); + auto &window = static_cast<win_window_info &>(*osd_common_t::s_window_list.front()); // if we should hide the mouse cursor, then do it // rules are: @@ -678,22 +694,22 @@ void winwindow_update_cursor_state(running_machine &machine) // 3. we also hide the cursor in windowed mode if we're not paused and // the input system requests it if (winwindow_has_focus() && ( - (window->fullscreen() && !window->win_has_menu()) + (window.fullscreen() && !GetMenu(window.platform_window())) || (!machine.paused() && WINOSD(machine)->should_hide_mouse()))) { // hide cursor - window->hide_pointer(); + window.hide_pointer(); // clip pointer to game video window - window->capture_pointer(); + window.capture_pointer(); } else { // show cursor - window->show_pointer(); + window.show_pointer(); // allow cursor to move freely - window->release_pointer(); + window.release_pointer(); } } @@ -948,7 +964,7 @@ int win_window_info::wnd_extra_width() RECT temprect = { 100, 100, 200, 200 }; if (fullscreen()) return 0; - AdjustWindowRectEx(&temprect, WINDOW_STYLE, win_has_menu(), WINDOW_STYLE_EX); + AdjustWindowRectEx(&temprect, WINDOW_STYLE, GetMenu(platform_window()) ? true : false, WINDOW_STYLE_EX); return rect_width(&temprect) - 100; } @@ -964,7 +980,7 @@ int win_window_info::wnd_extra_height() RECT temprect = { 100, 100, 200, 200 }; if (fullscreen()) return 0; - AdjustWindowRectEx(&temprect, WINDOW_STYLE, win_has_menu(), WINDOW_STYLE_EX); + AdjustWindowRectEx(&temprect, WINDOW_STYLE, GetMenu(platform_window()) ? true : false, WINDOW_STYLE_EX); return rect_height(&temprect) - 100; } @@ -978,7 +994,6 @@ int win_window_info::complete_create() { RECT client; int tempwidth, tempheight; - HMENU menu = nullptr; HDC dc; assert(GetCurrentThreadId() == window_threadid); @@ -986,13 +1001,6 @@ int win_window_info::complete_create() // get the monitor bounds osd_rect monitorbounds = monitor()->position_size(); - // create the window menu if needed - if (downcast<windows_options &>(machine().options()).menu()) - { - if (win_create_menu(machine(), &menu)) - return 1; - } - // are we in worker UI mode? HWND hwnd; const char *attach_window_name = downcast<windows_options &>(machine().options()).attach_window(); @@ -1015,7 +1023,7 @@ int win_window_info::complete_create() monitorbounds.left() + 20, monitorbounds.top() + 20, monitorbounds.left() + 100, monitorbounds.top() + 100, nullptr,//(osd_common_t::s_window_list != nullptr) ? osd_common_t::s_window_list->m_hwnd : nullptr, - menu, + nullptr, GetModuleHandleUni(), nullptr); } @@ -1099,7 +1107,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR PAINTSTRUCT pstruct; HDC hdc = BeginPaint(wnd, &pstruct); window->draw_video_contents(hdc, true); - if (window->win_has_menu()) + if (GetMenu(window->platform_window())) DrawMenuBar(window->platform_window()); EndPaint(wnd, &pstruct); } @@ -1107,7 +1115,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR // non-client paint: punt if full screen case WM_NCPAINT: - if (!window->fullscreen() || window->win_has_menu()) + if (!window->fullscreen() || GetMenu(window->platform_window())) return DefWindowProc(wnd, message, wparam, lparam); break; diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h index 784703e2885..3449a8ea1ac 100644 --- a/src/osd/windows/window.h +++ b/src/osd/windows/window.h @@ -61,11 +61,6 @@ public: void update() override; - virtual bool win_has_menu() override - { - return GetMenu(platform_window()) ? true : false; - } - virtual osd_dim get_size() override { RECT client; @@ -150,23 +145,16 @@ struct osd_draw_callbacks bool winwindow_has_focus(void); void winwindow_update_cursor_state(running_machine &machine); -extern LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam); - void winwindow_toggle_full_screen(void); void winwindow_take_snap(void); void winwindow_take_video(void); void winwindow_toggle_fsfx(void); -void winwindow_process_events_periodic(running_machine &machine); -void winwindow_process_events(running_machine &machine, bool ingame, bool nodispatch); - void winwindow_ui_pause(running_machine &machine, int pause); int winwindow_ui_is_paused(running_machine &machine); void winwindow_dispatch_message(running_machine &machine, MSG *message); -extern int win_create_menu(running_machine &machine, HMENU *menus); - //============================================================ diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp index 3311031228f..115853c15d9 100644 --- a/src/osd/windows/winmain.cpp +++ b/src/osd/windows/winmain.cpp @@ -6,14 +6,17 @@ // //============================================================ +#include "winmain.h" + +#include "window.h" +#include "winopts.h" + // MAME headers #include "emu.h" -#include "emuopts.h" -#include "strconv.h" +#include "main.h" // MAMEOS headers -#include "winmain.h" -#include "window.h" +#include "strconv.h" #include "winutf8.h" #include "winutil.h" #include "winfile.h" @@ -158,130 +161,6 @@ static int is_double_click_start(int argc); //************************************************************************** -// OPTIONS -//************************************************************************** - -// struct definitions -const options_entry windows_options::s_option_entries[] = -{ - // performance options - { nullptr, nullptr, core_options::option_type::HEADER, "WINDOWS PERFORMANCE OPTIONS" }, - { WINOPTION_PRIORITY "(-15-1)", "0", core_options::option_type::INTEGER, "thread priority for the main game thread; range from -15 to 1" }, - { WINOPTION_PROFILE, "0", core_options::option_type::INTEGER, "enables profiling, specifying the stack depth to track" }, - - // video options - { nullptr, nullptr, core_options::option_type::HEADER, "WINDOWS VIDEO OPTIONS" }, - { WINOPTION_MENU, "0", core_options::option_type::BOOLEAN, "enables menu bar if available by UI implementation" }, - { WINOPTION_ATTACH_WINDOW, "", core_options::option_type::STRING, "attach to arbitrary window" }, - - // post-processing options - { nullptr, nullptr, core_options::option_type::HEADER, "DIRECT3D POST-PROCESSING OPTIONS" }, - { WINOPTION_HLSLPATH, "hlsl", core_options::option_type::PATH, "path to HLSL support files" }, - { WINOPTION_HLSL_ENABLE";hlsl", "0", core_options::option_type::BOOLEAN, "enable HLSL post-processing (PS3.0 required)" }, - { WINOPTION_HLSL_OVERSAMPLING, "0", core_options::option_type::BOOLEAN, "enable HLSL oversampling" }, - { WINOPTION_HLSL_WRITE, OSDOPTVAL_AUTO, core_options::option_type::PATH, "enable HLSL AVI writing (huge disk bandwidth suggested)" }, - { WINOPTION_HLSL_SNAP_WIDTH, "2048", core_options::option_type::STRING, "HLSL upscaled-snapshot width" }, - { WINOPTION_HLSL_SNAP_HEIGHT, "1536", core_options::option_type::STRING, "HLSL upscaled-snapshot height" }, - { WINOPTION_SHADOW_MASK_TILE_MODE, "0", core_options::option_type::INTEGER, "shadow mask tile mode (0 for screen based, 1 for source based)" }, - { WINOPTION_SHADOW_MASK_ALPHA";fs_shadwa(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "shadow mask alpha-blend value (1.0 is fully blended, 0.0 is no mask)" }, - { WINOPTION_SHADOW_MASK_TEXTURE";fs_shadwt(0.0-1.0)", "shadow-mask.png", core_options::option_type::STRING, "shadow mask texture name" }, - { WINOPTION_SHADOW_MASK_COUNT_X";fs_shadww", "6", core_options::option_type::INTEGER, "shadow mask tile width, in screen dimensions" }, - { WINOPTION_SHADOW_MASK_COUNT_Y";fs_shadwh", "4", core_options::option_type::INTEGER, "shadow mask tile height, in screen dimensions" }, - { WINOPTION_SHADOW_MASK_USIZE";fs_shadwu(0.0-1.0)", "0.1875", core_options::option_type::FLOAT, "shadow mask texture width, in U/V dimensions" }, - { WINOPTION_SHADOW_MASK_VSIZE";fs_shadwv(0.0-1.0)", "0.25", core_options::option_type::FLOAT, "shadow mask texture height, in U/V dimensions" }, - { WINOPTION_SHADOW_MASK_UOFFSET";fs_shadwou(-1.0-1.0)", "0.0", core_options::option_type::FLOAT, "shadow mask texture offset, in U direction" }, - { WINOPTION_SHADOW_MASK_VOFFSET";fs_shadwov(-1.0-1.0)", "0.0", core_options::option_type::FLOAT, "shadow mask texture offset, in V direction" }, - { WINOPTION_DISTORTION";fs_dist(-1.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen distortion amount" }, - { WINOPTION_CUBIC_DISTORTION";fs_cubedist(-1.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen cubic distortion amount" }, - { WINOPTION_DISTORT_CORNER";fs_distc(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen distort corner amount" }, - { WINOPTION_ROUND_CORNER";fs_rndc(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen round corner amount" }, - { WINOPTION_SMOOTH_BORDER";fs_smob(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen smooth border amount" }, - { WINOPTION_REFLECTION";fs_ref(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen reflection amount" }, - { WINOPTION_VIGNETTING";fs_vig(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "image vignetting amount" }, - /* Beam-related values below this line*/ - { WINOPTION_SCANLINE_AMOUNT";fs_scanam(0.0-4.0)", "0.0", core_options::option_type::FLOAT, "overall alpha scaling value for scanlines" }, - { WINOPTION_SCANLINE_SCALE";fs_scansc(0.0-4.0)", "1.0", core_options::option_type::FLOAT, "overall height scaling value for scanlines" }, - { WINOPTION_SCANLINE_HEIGHT";fs_scanh(0.0-4.0)", "1.0", core_options::option_type::FLOAT, "individual height scaling value for scanlines" }, - { WINOPTION_SCANLINE_VARIATION";fs_scanv(0.0-4.0)", "1.0", core_options::option_type::FLOAT, "individual height varying value for scanlines" }, - { WINOPTION_SCANLINE_BRIGHT_SCALE";fs_scanbs(0.0-2.0)", "1.0", core_options::option_type::FLOAT, "overall brightness scaling value for scanlines (multiplicative)" }, - { WINOPTION_SCANLINE_BRIGHT_OFFSET";fs_scanbo(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "overall brightness offset value for scanlines (additive)" }, - { WINOPTION_SCANLINE_JITTER";fs_scanjt(0.0-4.0)", "0.0", core_options::option_type::FLOAT, "overall interlace jitter scaling value for scanlines" }, - { WINOPTION_HUM_BAR_ALPHA";fs_humba(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "overall alpha scaling value for hum bar" }, - { WINOPTION_DEFOCUS";fs_focus", "0.0,0.0", core_options::option_type::STRING, "overall defocus value in screen-relative coords" }, - { WINOPTION_CONVERGE_X";fs_convx", "0.0,0.0,0.0", core_options::option_type::STRING, "convergence in screen-relative X direction" }, - { WINOPTION_CONVERGE_Y";fs_convy", "0.0,0.0,0.0", core_options::option_type::STRING, "convergence in screen-relative Y direction" }, - { WINOPTION_RADIAL_CONVERGE_X";fs_rconvx", "0.0,0.0,0.0", core_options::option_type::STRING, "radial convergence in screen-relative X direction" }, - { WINOPTION_RADIAL_CONVERGE_Y";fs_rconvy", "0.0,0.0,0.0", core_options::option_type::STRING, "radial convergence in screen-relative Y direction" }, - /* RGB colorspace convolution below this line */ - { WINOPTION_RED_RATIO";fs_redratio", "1.0,0.0,0.0", core_options::option_type::STRING, "red output signal generated by input signal" }, - { WINOPTION_GRN_RATIO";fs_grnratio", "0.0,1.0,0.0", core_options::option_type::STRING, "green output signal generated by input signal" }, - { WINOPTION_BLU_RATIO";fs_bluratio", "0.0,0.0,1.0", core_options::option_type::STRING, "blue output signal generated by input signal" }, - { WINOPTION_SATURATION";fs_sat(0.0-4.0)", "1.0", core_options::option_type::FLOAT, "saturation scaling value" }, - { WINOPTION_OFFSET";fs_offset", "0.0,0.0,0.0", core_options::option_type::STRING, "signal offset value (additive)" }, - { WINOPTION_SCALE";fs_scale", "1.0,1.0,1.0", core_options::option_type::STRING, "signal scaling value (multiplicative)" }, - { WINOPTION_POWER";fs_power", "1.0,1.0,1.0", core_options::option_type::STRING, "signal power value (exponential)" }, - { WINOPTION_FLOOR";fs_floor", "0.0,0.0,0.0", core_options::option_type::STRING, "signal floor level" }, - { WINOPTION_PHOSPHOR";fs_phosphor", "0.0,0.0,0.0", core_options::option_type::STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" }, - { WINOPTION_CHROMA_MODE, "3", core_options::option_type::INTEGER, "number of phosphors to use: 1 - monochrome, 2 - dichrome, 3 - trichrome (color)" }, - { WINOPTION_CHROMA_CONVERSION_GAIN, "0.299,0.587,0.114", core_options::option_type::STRING, "gain to be applied when summing RGB signal for monochrome and dichrome modes" }, - { WINOPTION_CHROMA_A, "0.64,0.33", core_options::option_type::STRING, "chromaticity coordinate for first phosphor" }, - { WINOPTION_CHROMA_B, "0.30,0.60", core_options::option_type::STRING, "chromaticity coordinate for second phosphor" }, - { WINOPTION_CHROMA_C, "0.15,0.06", core_options::option_type::STRING, "chromaticity coordinate for third phosphor" }, - { WINOPTION_CHROMA_Y_GAIN, "0.2126,0.7152,0.0722", core_options::option_type::STRING, "gain to be applied for each phosphor" }, - /* NTSC simulation below this line */ - { nullptr, nullptr, core_options::option_type::HEADER, "NTSC POST-PROCESSING OPTIONS" }, - { WINOPTION_YIQ_ENABLE";yiq", "0", core_options::option_type::BOOLEAN, "enable YIQ-space HLSL post-processing" }, - { WINOPTION_YIQ_JITTER";yiqj", "0.0", core_options::option_type::FLOAT, "jitter for the NTSC signal processing" }, - { WINOPTION_YIQ_CCVALUE";yiqcc", "3.57954545", core_options::option_type::FLOAT, "color carrier frequency for NTSC signal processing" }, - { WINOPTION_YIQ_AVALUE";yiqa", "0.5", core_options::option_type::FLOAT, "A value for NTSC signal processing" }, - { WINOPTION_YIQ_BVALUE";yiqb", "0.5", core_options::option_type::FLOAT, "B value for NTSC signal processing" }, - { WINOPTION_YIQ_OVALUE";yiqo", "0.0", core_options::option_type::FLOAT, "outgoing Color Carrier phase offset for NTSC signal processing" }, - { WINOPTION_YIQ_PVALUE";yiqp", "1.0", core_options::option_type::FLOAT, "incoming Pixel Clock scaling value for NTSC signal processing" }, - { WINOPTION_YIQ_NVALUE";yiqn", "1.0", core_options::option_type::FLOAT, "Y filter notch width for NTSC signal processing" }, - { WINOPTION_YIQ_YVALUE";yiqy", "6.0", core_options::option_type::FLOAT, "Y filter cutoff frequency for NTSC signal processing" }, - { WINOPTION_YIQ_IVALUE";yiqi", "1.2", core_options::option_type::FLOAT, "I filter cutoff frequency for NTSC signal processing" }, - { WINOPTION_YIQ_QVALUE";yiqq", "0.6", core_options::option_type::FLOAT, "Q filter cutoff frequency for NTSC signal processing" }, - { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", core_options::option_type::FLOAT, "horizontal scanline duration for NTSC signal processing (microseconds)" }, - { WINOPTION_YIQ_PHASE_COUNT";yiqpc", "2", core_options::option_type::INTEGER, "phase count value for NTSC signal processing" }, - /* Vector simulation below this line */ - { nullptr, nullptr, core_options::option_type::HEADER, "VECTOR POST-PROCESSING OPTIONS" }, - { WINOPTION_VECTOR_BEAM_SMOOTH";vecsmooth", "0.0", core_options::option_type::FLOAT, "vector beam smoothness" }, - { WINOPTION_VECTOR_LENGTH_SCALE";vecscale", "0.5", core_options::option_type::FLOAT, "maximum vector attenuation" }, - { WINOPTION_VECTOR_LENGTH_RATIO";vecratio", "0.5", core_options::option_type::FLOAT, "minimum vector length affected by attenuation (vector length to screen size ratio)" }, - /* Bloom below this line */ - { nullptr, nullptr, core_options::option_type::HEADER, "BLOOM POST-PROCESSING OPTIONS" }, - { WINOPTION_BLOOM_BLEND_MODE, "0", core_options::option_type::INTEGER, "bloom blend mode (0 for brighten, 1 for darken)" }, - { WINOPTION_BLOOM_SCALE, "0.0", core_options::option_type::FLOAT, "intensity factor for bloom" }, - { WINOPTION_BLOOM_OVERDRIVE, "1.0,1.0,1.0", core_options::option_type::STRING, "overdrive factor for bloom" }, - { WINOPTION_BLOOM_LEVEL0_WEIGHT, "1.0", core_options::option_type::FLOAT, "bloom level 0 weight (full-size target)" }, - { WINOPTION_BLOOM_LEVEL1_WEIGHT, "0.64", core_options::option_type::FLOAT, "bloom level 1 weight (1/4 smaller that level 0 target)" }, - { WINOPTION_BLOOM_LEVEL2_WEIGHT, "0.32", core_options::option_type::FLOAT, "bloom level 2 weight (1/4 smaller that level 1 target)" }, - { WINOPTION_BLOOM_LEVEL3_WEIGHT, "0.16", core_options::option_type::FLOAT, "bloom level 3 weight (1/4 smaller that level 2 target)" }, - { WINOPTION_BLOOM_LEVEL4_WEIGHT, "0.08", core_options::option_type::FLOAT, "bloom level 4 weight (1/4 smaller that level 3 target)" }, - { WINOPTION_BLOOM_LEVEL5_WEIGHT, "0.06", core_options::option_type::FLOAT, "bloom level 5 weight (1/4 smaller that level 4 target)" }, - { WINOPTION_BLOOM_LEVEL6_WEIGHT, "0.04", core_options::option_type::FLOAT, "bloom level 6 weight (1/4 smaller that level 5 target)" }, - { WINOPTION_BLOOM_LEVEL7_WEIGHT, "0.02", core_options::option_type::FLOAT, "bloom level 7 weight (1/4 smaller that level 6 target)" }, - { WINOPTION_BLOOM_LEVEL8_WEIGHT, "0.01", core_options::option_type::FLOAT, "bloom level 8 weight (1/4 smaller that level 7 target)" }, - { WINOPTION_LUT_TEXTURE, "lut-default.png", core_options::option_type::PATH, "3D LUT texture filename for screen, PNG format" }, - { WINOPTION_LUT_ENABLE, "0", core_options::option_type::BOOLEAN, "Enables 3D LUT to be applied to screen after post-processing" }, - { WINOPTION_UI_LUT_TEXTURE, "lut-default.png", core_options::option_type::PATH, "3D LUT texture filename of UI, PNG format" }, - { WINOPTION_UI_LUT_ENABLE, "0", core_options::option_type::BOOLEAN, "enable 3D LUT to be applied to UI and artwork after post-processing" }, - - // full screen options - { nullptr, nullptr, core_options::option_type::HEADER, "FULL SCREEN OPTIONS" }, - { WINOPTION_TRIPLEBUFFER ";tb", "0", core_options::option_type::BOOLEAN, "enable triple buffering" }, - { WINOPTION_FULLSCREENBRIGHTNESS ";fsb(0.1-2.0)", "1.0", core_options::option_type::FLOAT, "brightness value in full screen mode" }, - { WINOPTION_FULLSCREENCONTRAST ";fsc(0.1-2.0)", "1.0", core_options::option_type::FLOAT, "contrast value in full screen mode" }, - { WINOPTION_FULLSCREENGAMMA ";fsg(0.1-3.0)", "1.0", core_options::option_type::FLOAT, "gamma value in full screen mode" }, - - // input options - { nullptr, nullptr, core_options::option_type::HEADER, "INPUT DEVICE OPTIONS" }, - { WINOPTION_DUAL_LIGHTGUN ";dual", "0", core_options::option_type::BOOLEAN, "enable dual lightgun input" }, - - { nullptr } -}; - -//************************************************************************** // MAIN ENTRY POINT //************************************************************************** @@ -369,16 +248,6 @@ static BOOL WINAPI control_handler(DWORD type) return TRUE; } -//============================================================ -// windows_options -//============================================================ - -windows_options::windows_options() -: osd_options() -{ - add_entries(s_option_entries); -} - //============================================================ // output_oslog @@ -400,6 +269,7 @@ void windows_osd_interface::output_oslog(const char *buffer) windows_osd_interface::windows_osd_interface(windows_options &options) : osd_common_t(options) , m_options(options) + , m_last_event_check(std::chrono::steady_clock::time_point::min()) { } @@ -534,18 +404,7 @@ void windows_osd_interface::osd_exit() timeEndPeriod(timecaps.wPeriodMin); // one last pass at events - winwindow_process_events(machine(), false, false); -} - - -//============================================================ -// osd_setup_osd_specific_emu_options -//============================================================ - -void osd_setup_osd_specific_emu_options(emu_options &opts) -{ - opts.add_entries(osd_options::s_option_entries); - opts.add_entries(windows_options::s_option_entries); + process_events(false, false); } diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h index 7c148c94e5b..7c4f746a943 100644 --- a/src/osd/windows/winmain.h +++ b/src/osd/windows/winmain.h @@ -5,232 +5,19 @@ // winmain.h - Win32 main program and core headers // //============================================================ +#ifndef MAME_OSD_WINDOWS_WINMAIN_H +#define MAME_OSD_WINDOWS_WINMAIN_H -#ifndef __WINDOWS_WINMAIN_H__ -#define __WINDOWS_WINMAIN_H__ +#pragma once -#include "osdepend.h" -#include "modules/lib/osdobj_common.h" +#include "winopts.h" +#include "modules/lib/osdobj_common.h" +#include "osdepend.h" -//============================================================ -// CONSTANTS -//============================================================ +#include <chrono> +#include <vector> -// performance options -#define WINOPTION_PRIORITY "priority" -#define WINOPTION_PROFILE "profile" - -// video options -#define WINOPTION_MENU "menu" -#define WINOPTION_ATTACH_WINDOW "attach_window" - -// core post-processing options -#define WINOPTION_HLSLPATH "hlslpath" -#define WINOPTION_HLSL_ENABLE "hlsl_enable" -#define WINOPTION_HLSL_OVERSAMPLING "hlsl_oversampling" -#define WINOPTION_HLSL_WRITE "hlsl_write" -#define WINOPTION_HLSL_SNAP_WIDTH "hlsl_snap_width" -#define WINOPTION_HLSL_SNAP_HEIGHT "hlsl_snap_height" -#define WINOPTION_SHADOW_MASK_TILE_MODE "shadow_mask_tile_mode" -#define WINOPTION_SHADOW_MASK_ALPHA "shadow_mask_alpha" -#define WINOPTION_SHADOW_MASK_TEXTURE "shadow_mask_texture" -#define WINOPTION_SHADOW_MASK_COUNT_X "shadow_mask_x_count" -#define WINOPTION_SHADOW_MASK_COUNT_Y "shadow_mask_y_count" -#define WINOPTION_SHADOW_MASK_USIZE "shadow_mask_usize" -#define WINOPTION_SHADOW_MASK_VSIZE "shadow_mask_vsize" -#define WINOPTION_SHADOW_MASK_UOFFSET "shadow_mask_uoffset" -#define WINOPTION_SHADOW_MASK_VOFFSET "shadow_mask_voffset" -#define WINOPTION_REFLECTION "reflection" -#define WINOPTION_DISTORTION "distortion" -#define WINOPTION_CUBIC_DISTORTION "cubic_distortion" -#define WINOPTION_DISTORT_CORNER "distort_corner" -#define WINOPTION_ROUND_CORNER "round_corner" -#define WINOPTION_SMOOTH_BORDER "smooth_border" -#define WINOPTION_VIGNETTING "vignetting" -#define WINOPTION_SCANLINE_AMOUNT "scanline_alpha" -#define WINOPTION_SCANLINE_SCALE "scanline_size" -#define WINOPTION_SCANLINE_HEIGHT "scanline_height" -#define WINOPTION_SCANLINE_VARIATION "scanline_variation" -#define WINOPTION_SCANLINE_BRIGHT_SCALE "scanline_bright_scale" -#define WINOPTION_SCANLINE_BRIGHT_OFFSET "scanline_bright_offset" -#define WINOPTION_SCANLINE_JITTER "scanline_jitter" -#define WINOPTION_HUM_BAR_ALPHA "hum_bar_alpha" -#define WINOPTION_DEFOCUS "defocus" -#define WINOPTION_CONVERGE_X "converge_x" -#define WINOPTION_CONVERGE_Y "converge_y" -#define WINOPTION_RADIAL_CONVERGE_X "radial_converge_x" -#define WINOPTION_RADIAL_CONVERGE_Y "radial_converge_y" -#define WINOPTION_RED_RATIO "red_ratio" -#define WINOPTION_GRN_RATIO "grn_ratio" -#define WINOPTION_BLU_RATIO "blu_ratio" -#define WINOPTION_OFFSET "offset" -#define WINOPTION_SCALE "scale" -#define WINOPTION_POWER "power" -#define WINOPTION_FLOOR "floor" -#define WINOPTION_PHOSPHOR "phosphor_life" -#define WINOPTION_SATURATION "saturation" -#define WINOPTION_CHROMA_MODE "chroma_mode" -#define WINOPTION_CHROMA_CONVERSION_GAIN "chroma_conversion_gain" -#define WINOPTION_CHROMA_A "chroma_a" -#define WINOPTION_CHROMA_B "chroma_b" -#define WINOPTION_CHROMA_C "chroma_c" -#define WINOPTION_CHROMA_Y_GAIN "chroma_y_gain" -#define WINOPTION_YIQ_ENABLE "yiq_enable" -#define WINOPTION_YIQ_JITTER "yiq_jitter" -#define WINOPTION_YIQ_CCVALUE "yiq_cc" -#define WINOPTION_YIQ_AVALUE "yiq_a" -#define WINOPTION_YIQ_BVALUE "yiq_b" -#define WINOPTION_YIQ_OVALUE "yiq_o" -#define WINOPTION_YIQ_PVALUE "yiq_p" -#define WINOPTION_YIQ_NVALUE "yiq_n" -#define WINOPTION_YIQ_YVALUE "yiq_y" -#define WINOPTION_YIQ_IVALUE "yiq_i" -#define WINOPTION_YIQ_QVALUE "yiq_q" -#define WINOPTION_YIQ_SCAN_TIME "yiq_scan_time" -#define WINOPTION_YIQ_PHASE_COUNT "yiq_phase_count" -#define WINOPTION_VECTOR_BEAM_SMOOTH "vector_beam_smooth" -#define WINOPTION_VECTOR_LENGTH_SCALE "vector_length_scale" -#define WINOPTION_VECTOR_LENGTH_RATIO "vector_length_ratio" -#define WINOPTION_BLOOM_BLEND_MODE "bloom_blend_mode" -#define WINOPTION_BLOOM_SCALE "bloom_scale" -#define WINOPTION_BLOOM_OVERDRIVE "bloom_overdrive" -#define WINOPTION_BLOOM_LEVEL0_WEIGHT "bloom_lvl0_weight" -#define WINOPTION_BLOOM_LEVEL1_WEIGHT "bloom_lvl1_weight" -#define WINOPTION_BLOOM_LEVEL2_WEIGHT "bloom_lvl2_weight" -#define WINOPTION_BLOOM_LEVEL3_WEIGHT "bloom_lvl3_weight" -#define WINOPTION_BLOOM_LEVEL4_WEIGHT "bloom_lvl4_weight" -#define WINOPTION_BLOOM_LEVEL5_WEIGHT "bloom_lvl5_weight" -#define WINOPTION_BLOOM_LEVEL6_WEIGHT "bloom_lvl6_weight" -#define WINOPTION_BLOOM_LEVEL7_WEIGHT "bloom_lvl7_weight" -#define WINOPTION_BLOOM_LEVEL8_WEIGHT "bloom_lvl8_weight" -#define WINOPTION_LUT_TEXTURE "lut_texture" -#define WINOPTION_LUT_ENABLE "lut_enable" -#define WINOPTION_UI_LUT_TEXTURE "ui_lut_texture" -#define WINOPTION_UI_LUT_ENABLE "ui_lut_enable" - -// full screen options -#define WINOPTION_TRIPLEBUFFER "triplebuffer" -#define WINOPTION_FULLSCREENBRIGHTNESS "full_screen_brightness" -#define WINOPTION_FULLSCREENCONTRAST "full_screen_contrast" -#define WINOPTION_FULLSCREENGAMMA "full_screen_gamma" - -// input options -#define WINOPTION_DUAL_LIGHTGUN "dual_lightgun" - -//============================================================ -// TYPE DEFINITIONS -//============================================================ - -class windows_options : public osd_options -{ -public: - // construction/destruction - windows_options(); - - // performance options - int priority() const { return int_value(WINOPTION_PRIORITY); } - int profile() const { return int_value(WINOPTION_PROFILE); } - - // video options - bool menu() const { return bool_value(WINOPTION_MENU); } - const char *attach_window() const { return value(WINOPTION_ATTACH_WINDOW); } - - // core post-processing options - const char *screen_post_fx_dir() const { return value(WINOPTION_HLSLPATH); } - bool d3d_hlsl_enable() const { return bool_value(WINOPTION_HLSL_ENABLE); } - bool d3d_hlsl_oversampling() const { return bool_value(WINOPTION_HLSL_OVERSAMPLING); } - const char *d3d_hlsl_write() const { return value(WINOPTION_HLSL_WRITE); } - int d3d_snap_width() const { return int_value(WINOPTION_HLSL_SNAP_WIDTH); } - int d3d_snap_height() const { return int_value(WINOPTION_HLSL_SNAP_HEIGHT); } - int screen_shadow_mask_tile_mode() const { return int_value(WINOPTION_SHADOW_MASK_TILE_MODE); } - float screen_shadow_mask_alpha() const { return float_value(WINOPTION_SHADOW_MASK_ALPHA); } - const char *screen_shadow_mask_texture() const { return value(WINOPTION_SHADOW_MASK_TEXTURE); } - int screen_shadow_mask_count_x() const { return int_value(WINOPTION_SHADOW_MASK_COUNT_X); } - int screen_shadow_mask_count_y() const { return int_value(WINOPTION_SHADOW_MASK_COUNT_Y); } - float screen_shadow_mask_u_size() const { return float_value(WINOPTION_SHADOW_MASK_USIZE); } - float screen_shadow_mask_v_size() const { return float_value(WINOPTION_SHADOW_MASK_VSIZE); } - float screen_shadow_mask_u_offset() const { return float_value(WINOPTION_SHADOW_MASK_UOFFSET); } - float screen_shadow_mask_v_offset() const { return float_value(WINOPTION_SHADOW_MASK_VOFFSET); } - float screen_scanline_amount() const { return float_value(WINOPTION_SCANLINE_AMOUNT); } - float screen_scanline_scale() const { return float_value(WINOPTION_SCANLINE_SCALE); } - float screen_scanline_height() const { return float_value(WINOPTION_SCANLINE_HEIGHT); } - float screen_scanline_variation() const { return float_value(WINOPTION_SCANLINE_VARIATION); } - float screen_scanline_bright_scale() const { return float_value(WINOPTION_SCANLINE_BRIGHT_SCALE); } - float screen_scanline_bright_offset() const { return float_value(WINOPTION_SCANLINE_BRIGHT_OFFSET); } - float screen_scanline_jitter() const { return float_value(WINOPTION_SCANLINE_JITTER); } - float screen_hum_bar_alpha() const { return float_value(WINOPTION_HUM_BAR_ALPHA); } - float screen_reflection() const { return float_value(WINOPTION_REFLECTION); } - float screen_distortion() const { return float_value(WINOPTION_DISTORTION); } - float screen_cubic_distortion() const { return float_value(WINOPTION_CUBIC_DISTORTION); } - float screen_distort_corner() const { return float_value(WINOPTION_DISTORT_CORNER); } - float screen_round_corner() const { return float_value(WINOPTION_ROUND_CORNER); } - float screen_smooth_border() const { return float_value(WINOPTION_SMOOTH_BORDER); } - float screen_vignetting() const { return float_value(WINOPTION_VIGNETTING); } - const char *screen_defocus() const { return value(WINOPTION_DEFOCUS); } - const char *screen_converge_x() const { return value(WINOPTION_CONVERGE_X); } - const char *screen_converge_y() const { return value(WINOPTION_CONVERGE_Y); } - const char *screen_radial_converge_x() const { return value(WINOPTION_RADIAL_CONVERGE_X); } - const char *screen_radial_converge_y() const { return value(WINOPTION_RADIAL_CONVERGE_Y); } - const char *screen_red_ratio() const { return value(WINOPTION_RED_RATIO); } - const char *screen_grn_ratio() const { return value(WINOPTION_GRN_RATIO); } - const char *screen_blu_ratio() const { return value(WINOPTION_BLU_RATIO); } - bool screen_yiq_enable() const { return bool_value(WINOPTION_YIQ_ENABLE); } - float screen_yiq_jitter() const { return float_value(WINOPTION_YIQ_JITTER); } - float screen_yiq_cc() const { return float_value(WINOPTION_YIQ_CCVALUE); } - float screen_yiq_a() const { return float_value(WINOPTION_YIQ_AVALUE); } - float screen_yiq_b() const { return float_value(WINOPTION_YIQ_BVALUE); } - float screen_yiq_o() const { return float_value(WINOPTION_YIQ_OVALUE); } - float screen_yiq_p() const { return float_value(WINOPTION_YIQ_PVALUE); } - float screen_yiq_n() const { return float_value(WINOPTION_YIQ_NVALUE); } - float screen_yiq_y() const { return float_value(WINOPTION_YIQ_YVALUE); } - float screen_yiq_i() const { return float_value(WINOPTION_YIQ_IVALUE); } - float screen_yiq_q() const { return float_value(WINOPTION_YIQ_QVALUE); } - float screen_yiq_scan_time() const { return float_value(WINOPTION_YIQ_SCAN_TIME); } - int screen_yiq_phase_count() const { return int_value(WINOPTION_YIQ_PHASE_COUNT); } - float screen_vector_beam_smooth() const { return float_value(WINOPTION_VECTOR_BEAM_SMOOTH); } - float screen_vector_length_scale() const { return float_value(WINOPTION_VECTOR_LENGTH_SCALE); } - float screen_vector_length_ratio() const { return float_value(WINOPTION_VECTOR_LENGTH_RATIO); } - int screen_bloom_blend_mode() const { return int_value(WINOPTION_BLOOM_BLEND_MODE); } - float screen_bloom_scale() const { return float_value(WINOPTION_BLOOM_SCALE); } - const char *screen_bloom_overdrive() const { return value(WINOPTION_BLOOM_OVERDRIVE); } - float screen_bloom_lvl0_weight() const { return float_value(WINOPTION_BLOOM_LEVEL0_WEIGHT); } - float screen_bloom_lvl1_weight() const { return float_value(WINOPTION_BLOOM_LEVEL1_WEIGHT); } - float screen_bloom_lvl2_weight() const { return float_value(WINOPTION_BLOOM_LEVEL2_WEIGHT); } - float screen_bloom_lvl3_weight() const { return float_value(WINOPTION_BLOOM_LEVEL3_WEIGHT); } - float screen_bloom_lvl4_weight() const { return float_value(WINOPTION_BLOOM_LEVEL4_WEIGHT); } - float screen_bloom_lvl5_weight() const { return float_value(WINOPTION_BLOOM_LEVEL5_WEIGHT); } - float screen_bloom_lvl6_weight() const { return float_value(WINOPTION_BLOOM_LEVEL6_WEIGHT); } - float screen_bloom_lvl7_weight() const { return float_value(WINOPTION_BLOOM_LEVEL7_WEIGHT); } - float screen_bloom_lvl8_weight() const { return float_value(WINOPTION_BLOOM_LEVEL8_WEIGHT); } - const char *screen_offset() const { return value(WINOPTION_OFFSET); } - const char *screen_scale() const { return value(WINOPTION_SCALE); } - const char *screen_power() const { return value(WINOPTION_POWER); } - const char *screen_floor() const { return value(WINOPTION_FLOOR); } - const char *screen_phosphor() const { return value(WINOPTION_PHOSPHOR); } - float screen_saturation() const { return float_value(WINOPTION_SATURATION); } - int screen_chroma_mode() const { return int_value(WINOPTION_CHROMA_MODE); } - const char *screen_chroma_a() const { return value(WINOPTION_CHROMA_A); } - const char *screen_chroma_b() const { return value(WINOPTION_CHROMA_B); } - const char *screen_chroma_c() const { return value(WINOPTION_CHROMA_C); } - const char *screen_chroma_conversion_gain() const { return value(WINOPTION_CHROMA_CONVERSION_GAIN); } - const char *screen_chroma_y_gain() const { return value(WINOPTION_CHROMA_Y_GAIN); } - const char *screen_lut_texture() const { return value(WINOPTION_LUT_TEXTURE); } - bool screen_lut_enable() const { return bool_value(WINOPTION_LUT_ENABLE); } - const char *ui_lut_texture() const { return value(WINOPTION_UI_LUT_TEXTURE); } - bool ui_lut_enable() const { return bool_value(WINOPTION_UI_LUT_ENABLE); } - - // full screen options - bool triple_buffer() const { return bool_value(WINOPTION_TRIPLEBUFFER); } - float full_screen_brightness() const { return float_value(WINOPTION_FULLSCREENBRIGHTNESS); } - float full_screen_contrast() const { return float_value(WINOPTION_FULLSCREENCONTRAST); } - float full_screen_gamma() const { return float_value(WINOPTION_FULLSCREENGAMMA); } - - // input options - bool dual_lightgun() const { return bool_value(WINOPTION_DUAL_LIGHTGUN); } - - static const options_entry s_option_entries[]; -}; //============================================================ // TYPE DEFINITIONS @@ -261,14 +48,9 @@ struct MouseButtonEventArgs int ypos; }; -// Forward declarations -struct _EXCEPTION_POINTERS; class windows_osd_interface : public osd_common_t { - // Access to exception filter static method - friend int main(int argc, char *argv[]); - public: // construction/destruction windows_osd_interface(windows_options &options); @@ -295,11 +77,14 @@ public: void extract_video_config(); - // windows osd specific + // windows OSD specific bool handle_input_event(input_event eventid, void *eventdata) const; bool should_hide_mouse() const; void poll_input(running_machine &machine) const; + virtual bool has_focus() const override; + virtual void process_events() override; + virtual windows_options &options() override { return m_options; } int window_count(); @@ -311,22 +96,23 @@ protected: void check_osd_inputs(); private: + void process_events(bool ingame, bool nodispatch); virtual void osd_exit() override; static void output_oslog(const char *buffer); windows_options & m_options; - static const int DEFAULT_FONT_HEIGHT = 200; + std::chrono::steady_clock::time_point m_last_event_check; + + static inline constexpr int DEFAULT_FONT_HEIGHT = 200; }; + //============================================================ // GLOBAL VARIABLES //============================================================ -extern const options_entry mame_win_options[]; - // defined in winwork.c extern int osd_num_processors; - -#endif +#endif // MAME_OSD_WINDOWS_WINMAIN_H diff --git a/src/osd/windows/winmenu.cpp b/src/osd/windows/winmenu.cpp deleted file mode 100644 index d55bd3e3a79..00000000000 --- a/src/osd/windows/winmenu.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Aaron Giles -//============================================================ -// -// winmenu.cpp - Win32 OSD core dummy menu implementation -// -//============================================================ - -// standard windows headers -#include <windows.h> - -#include "emu.h" - -#include "window.h" - -//============================================================ -// winwindow_video_window_proc_ui -// (window thread) -//============================================================ - -LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) -{ - return win_window_info::video_window_proc(wnd, message, wparam, lparam); -} - -//============================================================ -// win_create_menu -//============================================================ - -int win_create_menu(running_machine &machine, HMENU *menus) -{ - return 0; -} diff --git a/src/osd/windows/winopts.cpp b/src/osd/windows/winopts.cpp new file mode 100644 index 00000000000..0408593dda3 --- /dev/null +++ b/src/osd/windows/winopts.cpp @@ -0,0 +1,157 @@ +// license:BSD-3-Clause +// copyright-holders:Aaron Giles +//============================================================ +// +// winopts.cpp - Win32 options +// +//============================================================ + +#include "winopts.h" + + +namespace { + +//************************************************************************** +// OPTIONS +//************************************************************************** + +options_entry const f_win_option_entries[] = +{ + // performance options + { nullptr, nullptr, core_options::option_type::HEADER, "WINDOWS PERFORMANCE OPTIONS" }, + { WINOPTION_PRIORITY "(-15-1)", "0", core_options::option_type::INTEGER, "thread priority for the main game thread; range from -15 to 1" }, + { WINOPTION_PROFILE, "0", core_options::option_type::INTEGER, "enables profiling, specifying the stack depth to track" }, + + // video options + { nullptr, nullptr, core_options::option_type::HEADER, "WINDOWS VIDEO OPTIONS" }, + { WINOPTION_ATTACH_WINDOW, "", core_options::option_type::STRING, "attach to arbitrary window" }, + + // post-processing options + { nullptr, nullptr, core_options::option_type::HEADER, "DIRECT3D POST-PROCESSING OPTIONS" }, + { WINOPTION_HLSLPATH, "hlsl", core_options::option_type::PATH, "path to HLSL support files" }, + { WINOPTION_HLSL_ENABLE";hlsl", "0", core_options::option_type::BOOLEAN, "enable HLSL post-processing (PS3.0 required)" }, + { WINOPTION_HLSL_OVERSAMPLING, "0", core_options::option_type::BOOLEAN, "enable HLSL oversampling" }, + { WINOPTION_HLSL_WRITE, OSDOPTVAL_AUTO, core_options::option_type::PATH, "enable HLSL AVI writing (huge disk bandwidth suggested)" }, + { WINOPTION_HLSL_SNAP_WIDTH, "2048", core_options::option_type::STRING, "HLSL upscaled-snapshot width" }, + { WINOPTION_HLSL_SNAP_HEIGHT, "1536", core_options::option_type::STRING, "HLSL upscaled-snapshot height" }, + { WINOPTION_SHADOW_MASK_TILE_MODE, "0", core_options::option_type::INTEGER, "shadow mask tile mode (0 for screen based, 1 for source based)" }, + { WINOPTION_SHADOW_MASK_ALPHA ";fs_shadwa(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "shadow mask alpha-blend value (1.0 is fully blended, 0.0 is no mask)" }, + { WINOPTION_SHADOW_MASK_TEXTURE ";fs_shadwt(0.0-1.0)", "shadow-mask.png", core_options::option_type::STRING, "shadow mask texture name" }, + { WINOPTION_SHADOW_MASK_COUNT_X ";fs_shadww", "6", core_options::option_type::INTEGER, "shadow mask tile width, in screen dimensions" }, + { WINOPTION_SHADOW_MASK_COUNT_Y ";fs_shadwh", "4", core_options::option_type::INTEGER, "shadow mask tile height, in screen dimensions" }, + { WINOPTION_SHADOW_MASK_USIZE ";fs_shadwu(0.0-1.0)", "0.1875", core_options::option_type::FLOAT, "shadow mask texture width, in U/V dimensions" }, + { WINOPTION_SHADOW_MASK_VSIZE ";fs_shadwv(0.0-1.0)", "0.25", core_options::option_type::FLOAT, "shadow mask texture height, in U/V dimensions" }, + { WINOPTION_SHADOW_MASK_UOFFSET ";fs_shadwou(-1.0-1.0)", "0.0", core_options::option_type::FLOAT, "shadow mask texture offset, in U direction" }, + { WINOPTION_SHADOW_MASK_VOFFSET ";fs_shadwov(-1.0-1.0)", "0.0", core_options::option_type::FLOAT, "shadow mask texture offset, in V direction" }, + { WINOPTION_DISTORTION ";fs_dist(-1.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen distortion amount" }, + { WINOPTION_CUBIC_DISTORTION ";fs_cubedist(-1.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen cubic distortion amount" }, + { WINOPTION_DISTORT_CORNER ";fs_distc(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen distort corner amount" }, + { WINOPTION_ROUND_CORNER ";fs_rndc(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen round corner amount" }, + { WINOPTION_SMOOTH_BORDER ";fs_smob(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen smooth border amount" }, + { WINOPTION_REFLECTION ";fs_ref(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "screen reflection amount" }, + { WINOPTION_VIGNETTING ";fs_vig(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "image vignetting amount" }, + // Beam-related values below this line + { WINOPTION_SCANLINE_AMOUNT ";fs_scanam(0.0-4.0)", "0.0", core_options::option_type::FLOAT, "overall alpha scaling value for scanlines" }, + { WINOPTION_SCANLINE_SCALE ";fs_scansc(0.0-4.0)", "1.0", core_options::option_type::FLOAT, "overall height scaling value for scanlines" }, + { WINOPTION_SCANLINE_HEIGHT ";fs_scanh(0.0-4.0)", "1.0", core_options::option_type::FLOAT, "individual height scaling value for scanlines" }, + { WINOPTION_SCANLINE_VARIATION ";fs_scanv(0.0-4.0)", "1.0", core_options::option_type::FLOAT, "individual height varying value for scanlines" }, + { WINOPTION_SCANLINE_BRIGHT_SCALE ";fs_scanbs(0.0-2.0)", "1.0", core_options::option_type::FLOAT, "overall brightness scaling value for scanlines (multiplicative)" }, + { WINOPTION_SCANLINE_BRIGHT_OFFSET ";fs_scanbo(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "overall brightness offset value for scanlines (additive)" }, + { WINOPTION_SCANLINE_JITTER ";fs_scanjt(0.0-4.0)", "0.0", core_options::option_type::FLOAT, "overall interlace jitter scaling value for scanlines" }, + { WINOPTION_HUM_BAR_ALPHA ";fs_humba(0.0-1.0)", "0.0", core_options::option_type::FLOAT, "overall alpha scaling value for hum bar" }, + { WINOPTION_DEFOCUS ";fs_focus", "0.0,0.0", core_options::option_type::STRING, "overall defocus value in screen-relative coords" }, + { WINOPTION_CONVERGE_X ";fs_convx", "0.0,0.0,0.0", core_options::option_type::STRING, "convergence in screen-relative X direction" }, + { WINOPTION_CONVERGE_Y ";fs_convy", "0.0,0.0,0.0", core_options::option_type::STRING, "convergence in screen-relative Y direction" }, + { WINOPTION_RADIAL_CONVERGE_X ";fs_rconvx", "0.0,0.0,0.0", core_options::option_type::STRING, "radial convergence in screen-relative X direction" }, + { WINOPTION_RADIAL_CONVERGE_Y ";fs_rconvy", "0.0,0.0,0.0", core_options::option_type::STRING, "radial convergence in screen-relative Y direction" }, + // RGB colorspace convolution below this line + { WINOPTION_RED_RATIO ";fs_redratio", "1.0,0.0,0.0", core_options::option_type::STRING, "red output signal generated by input signal" }, + { WINOPTION_GRN_RATIO ";fs_grnratio", "0.0,1.0,0.0", core_options::option_type::STRING, "green output signal generated by input signal" }, + { WINOPTION_BLU_RATIO ";fs_bluratio", "0.0,0.0,1.0", core_options::option_type::STRING, "blue output signal generated by input signal" }, + { WINOPTION_SATURATION ";fs_sat(0.0-4.0)", "1.0", core_options::option_type::FLOAT, "saturation scaling value" }, + { WINOPTION_OFFSET ";fs_offset", "0.0,0.0,0.0", core_options::option_type::STRING, "signal offset value (additive)" }, + { WINOPTION_SCALE ";fs_scale", "1.0,1.0,1.0", core_options::option_type::STRING, "signal scaling value (multiplicative)" }, + { WINOPTION_POWER ";fs_power", "1.0,1.0,1.0", core_options::option_type::STRING, "signal power value (exponential)" }, + { WINOPTION_FLOOR ";fs_floor", "0.0,0.0,0.0", core_options::option_type::STRING, "signal floor level" }, + { WINOPTION_PHOSPHOR";fs_phosphor", "0.0,0.0,0.0", core_options::option_type::STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" }, + { WINOPTION_CHROMA_MODE, "3", core_options::option_type::INTEGER, "number of phosphors to use: 1 - monochrome, 2 - dichrome, 3 - trichrome (color)" }, + { WINOPTION_CHROMA_CONVERSION_GAIN, "0.299,0.587,0.114", core_options::option_type::STRING, "gain to be applied when summing RGB signal for monochrome and dichrome modes" }, + { WINOPTION_CHROMA_A, "0.64,0.33", core_options::option_type::STRING, "chromaticity coordinate for first phosphor" }, + { WINOPTION_CHROMA_B, "0.30,0.60", core_options::option_type::STRING, "chromaticity coordinate for second phosphor" }, + { WINOPTION_CHROMA_C, "0.15,0.06", core_options::option_type::STRING, "chromaticity coordinate for third phosphor" }, + { WINOPTION_CHROMA_Y_GAIN, "0.2126,0.7152,0.0722", core_options::option_type::STRING, "gain to be applied for each phosphor" }, + // NTSC simulation below this line + { nullptr, nullptr, core_options::option_type::HEADER, "NTSC POST-PROCESSING OPTIONS" }, + { WINOPTION_YIQ_ENABLE ";yiq", "0", core_options::option_type::BOOLEAN, "enable YIQ-space HLSL post-processing" }, + { WINOPTION_YIQ_JITTER ";yiqj", "0.0", core_options::option_type::FLOAT, "jitter for the NTSC signal processing" }, + { WINOPTION_YIQ_CCVALUE ";yiqcc", "3.57954545", core_options::option_type::FLOAT, "color carrier frequency for NTSC signal processing" }, + { WINOPTION_YIQ_AVALUE ";yiqa", "0.5", core_options::option_type::FLOAT, "A value for NTSC signal processing" }, + { WINOPTION_YIQ_BVALUE ";yiqb", "0.5", core_options::option_type::FLOAT, "B value for NTSC signal processing" }, + { WINOPTION_YIQ_OVALUE ";yiqo", "0.0", core_options::option_type::FLOAT, "outgoing Color Carrier phase offset for NTSC signal processing" }, + { WINOPTION_YIQ_PVALUE ";yiqp", "1.0", core_options::option_type::FLOAT, "incoming Pixel Clock scaling value for NTSC signal processing" }, + { WINOPTION_YIQ_NVALUE ";yiqn", "1.0", core_options::option_type::FLOAT, "Y filter notch width for NTSC signal processing" }, + { WINOPTION_YIQ_YVALUE ";yiqy", "6.0", core_options::option_type::FLOAT, "Y filter cutoff frequency for NTSC signal processing" }, + { WINOPTION_YIQ_IVALUE ";yiqi", "1.2", core_options::option_type::FLOAT, "I filter cutoff frequency for NTSC signal processing" }, + { WINOPTION_YIQ_QVALUE ";yiqq", "0.6", core_options::option_type::FLOAT, "Q filter cutoff frequency for NTSC signal processing" }, + { WINOPTION_YIQ_SCAN_TIME ";yiqsc", "52.6", core_options::option_type::FLOAT, "horizontal scanline duration for NTSC signal processing (microseconds)" }, + { WINOPTION_YIQ_PHASE_COUNT ";yiqpc", "2", core_options::option_type::INTEGER, "phase count value for NTSC signal processing" }, + // Vector simulation below this line + { nullptr, nullptr, core_options::option_type::HEADER, "VECTOR POST-PROCESSING OPTIONS" }, + { WINOPTION_VECTOR_BEAM_SMOOTH ";vecsmooth", "0.0", core_options::option_type::FLOAT, "vector beam smoothness" }, + { WINOPTION_VECTOR_LENGTH_SCALE ";vecscale", "0.5", core_options::option_type::FLOAT, "maximum vector attenuation" }, + { WINOPTION_VECTOR_LENGTH_RATIO ";vecratio", "0.5", core_options::option_type::FLOAT, "minimum vector length affected by attenuation (vector length to screen size ratio)" }, + // Bloom below this line + { nullptr, nullptr, core_options::option_type::HEADER, "BLOOM POST-PROCESSING OPTIONS" }, + { WINOPTION_BLOOM_BLEND_MODE, "0", core_options::option_type::INTEGER, "bloom blend mode (0 for brighten, 1 for darken)" }, + { WINOPTION_BLOOM_SCALE, "0.0", core_options::option_type::FLOAT, "intensity factor for bloom" }, + { WINOPTION_BLOOM_OVERDRIVE, "1.0,1.0,1.0", core_options::option_type::STRING, "overdrive factor for bloom" }, + { WINOPTION_BLOOM_LEVEL0_WEIGHT, "1.0", core_options::option_type::FLOAT, "bloom level 0 weight (full-size target)" }, + { WINOPTION_BLOOM_LEVEL1_WEIGHT, "0.64", core_options::option_type::FLOAT, "bloom level 1 weight (1/4 smaller that level 0 target)" }, + { WINOPTION_BLOOM_LEVEL2_WEIGHT, "0.32", core_options::option_type::FLOAT, "bloom level 2 weight (1/4 smaller that level 1 target)" }, + { WINOPTION_BLOOM_LEVEL3_WEIGHT, "0.16", core_options::option_type::FLOAT, "bloom level 3 weight (1/4 smaller that level 2 target)" }, + { WINOPTION_BLOOM_LEVEL4_WEIGHT, "0.08", core_options::option_type::FLOAT, "bloom level 4 weight (1/4 smaller that level 3 target)" }, + { WINOPTION_BLOOM_LEVEL5_WEIGHT, "0.06", core_options::option_type::FLOAT, "bloom level 5 weight (1/4 smaller that level 4 target)" }, + { WINOPTION_BLOOM_LEVEL6_WEIGHT, "0.04", core_options::option_type::FLOAT, "bloom level 6 weight (1/4 smaller that level 5 target)" }, + { WINOPTION_BLOOM_LEVEL7_WEIGHT, "0.02", core_options::option_type::FLOAT, "bloom level 7 weight (1/4 smaller that level 6 target)" }, + { WINOPTION_BLOOM_LEVEL8_WEIGHT, "0.01", core_options::option_type::FLOAT, "bloom level 8 weight (1/4 smaller that level 7 target)" }, + { WINOPTION_LUT_TEXTURE, "lut-default.png", core_options::option_type::PATH, "3D LUT texture filename for screen, PNG format" }, + { WINOPTION_LUT_ENABLE, "0", core_options::option_type::BOOLEAN, "Enables 3D LUT to be applied to screen after post-processing" }, + { WINOPTION_UI_LUT_TEXTURE, "lut-default.png", core_options::option_type::PATH, "3D LUT texture filename of UI, PNG format" }, + { WINOPTION_UI_LUT_ENABLE, "0", core_options::option_type::BOOLEAN, "enable 3D LUT to be applied to UI and artwork after post-processing" }, + + // full screen options + { nullptr, nullptr, core_options::option_type::HEADER, "FULL SCREEN OPTIONS" }, + { WINOPTION_TRIPLEBUFFER ";tb", "0", core_options::option_type::BOOLEAN, "enable triple buffering" }, + { WINOPTION_FULLSCREENBRIGHTNESS ";fsb(0.1-2.0)", "1.0", core_options::option_type::FLOAT, "brightness value in full screen mode" }, + { WINOPTION_FULLSCREENCONTRAST ";fsc(0.1-2.0)", "1.0", core_options::option_type::FLOAT, "contrast value in full screen mode" }, + { WINOPTION_FULLSCREENGAMMA ";fsg(0.1-3.0)", "1.0", core_options::option_type::FLOAT, "gamma value in full screen mode" }, + + // input options + { nullptr, nullptr, core_options::option_type::HEADER, "INPUT DEVICE OPTIONS" }, + { WINOPTION_DUAL_LIGHTGUN ";dual", "0", core_options::option_type::BOOLEAN, "enable dual lightgun input" }, + + { nullptr } +}; + +} // anonymous namespace + + +//============================================================ +// windows_options +//============================================================ + +windows_options::windows_options() : osd_options() +{ + add_entries(f_win_option_entries); +} + + +//============================================================ +// osd_setup_osd_specific_emu_options +//============================================================ + +void osd_setup_osd_specific_emu_options(emu_options &opts) +{ + opts.add_entries(osd_options::s_option_entries); + opts.add_entries(f_win_option_entries); +} diff --git a/src/osd/windows/winopts.h b/src/osd/windows/winopts.h new file mode 100644 index 00000000000..44936f2d192 --- /dev/null +++ b/src/osd/windows/winopts.h @@ -0,0 +1,232 @@ +// license:BSD-3-Clause +// copyright-holders:Aaron Giles +//============================================================ +// +// winopts.h - Win32 options +// +//============================================================ +#ifndef MAME_OSD_WINDOWS_WINOPTS_H +#define MAME_OSD_WINDOWS_WINOPTS_H + +#pragma once + +#include "modules/lib/osdobj_common.h" + + +//============================================================ +// Option identifiers +//============================================================ + +// performance options +#define WINOPTION_PRIORITY "priority" +#define WINOPTION_PROFILE "profile" + +// video options +#define WINOPTION_ATTACH_WINDOW "attach_window" + +// core post-processing options +#define WINOPTION_HLSLPATH "hlslpath" +#define WINOPTION_HLSL_ENABLE "hlsl_enable" +#define WINOPTION_HLSL_OVERSAMPLING "hlsl_oversampling" +#define WINOPTION_HLSL_WRITE "hlsl_write" +#define WINOPTION_HLSL_SNAP_WIDTH "hlsl_snap_width" +#define WINOPTION_HLSL_SNAP_HEIGHT "hlsl_snap_height" +#define WINOPTION_SHADOW_MASK_TILE_MODE "shadow_mask_tile_mode" +#define WINOPTION_SHADOW_MASK_ALPHA "shadow_mask_alpha" +#define WINOPTION_SHADOW_MASK_TEXTURE "shadow_mask_texture" +#define WINOPTION_SHADOW_MASK_COUNT_X "shadow_mask_x_count" +#define WINOPTION_SHADOW_MASK_COUNT_Y "shadow_mask_y_count" +#define WINOPTION_SHADOW_MASK_USIZE "shadow_mask_usize" +#define WINOPTION_SHADOW_MASK_VSIZE "shadow_mask_vsize" +#define WINOPTION_SHADOW_MASK_UOFFSET "shadow_mask_uoffset" +#define WINOPTION_SHADOW_MASK_VOFFSET "shadow_mask_voffset" +#define WINOPTION_REFLECTION "reflection" +#define WINOPTION_DISTORTION "distortion" +#define WINOPTION_CUBIC_DISTORTION "cubic_distortion" +#define WINOPTION_DISTORT_CORNER "distort_corner" +#define WINOPTION_ROUND_CORNER "round_corner" +#define WINOPTION_SMOOTH_BORDER "smooth_border" +#define WINOPTION_VIGNETTING "vignetting" +#define WINOPTION_SCANLINE_AMOUNT "scanline_alpha" +#define WINOPTION_SCANLINE_SCALE "scanline_size" +#define WINOPTION_SCANLINE_HEIGHT "scanline_height" +#define WINOPTION_SCANLINE_VARIATION "scanline_variation" +#define WINOPTION_SCANLINE_BRIGHT_SCALE "scanline_bright_scale" +#define WINOPTION_SCANLINE_BRIGHT_OFFSET "scanline_bright_offset" +#define WINOPTION_SCANLINE_JITTER "scanline_jitter" +#define WINOPTION_HUM_BAR_ALPHA "hum_bar_alpha" +#define WINOPTION_DEFOCUS "defocus" +#define WINOPTION_CONVERGE_X "converge_x" +#define WINOPTION_CONVERGE_Y "converge_y" +#define WINOPTION_RADIAL_CONVERGE_X "radial_converge_x" +#define WINOPTION_RADIAL_CONVERGE_Y "radial_converge_y" +#define WINOPTION_RED_RATIO "red_ratio" +#define WINOPTION_GRN_RATIO "grn_ratio" +#define WINOPTION_BLU_RATIO "blu_ratio" +#define WINOPTION_OFFSET "offset" +#define WINOPTION_SCALE "scale" +#define WINOPTION_POWER "power" +#define WINOPTION_FLOOR "floor" +#define WINOPTION_PHOSPHOR "phosphor_life" +#define WINOPTION_SATURATION "saturation" +#define WINOPTION_CHROMA_MODE "chroma_mode" +#define WINOPTION_CHROMA_CONVERSION_GAIN "chroma_conversion_gain" +#define WINOPTION_CHROMA_A "chroma_a" +#define WINOPTION_CHROMA_B "chroma_b" +#define WINOPTION_CHROMA_C "chroma_c" +#define WINOPTION_CHROMA_Y_GAIN "chroma_y_gain" +#define WINOPTION_YIQ_ENABLE "yiq_enable" +#define WINOPTION_YIQ_JITTER "yiq_jitter" +#define WINOPTION_YIQ_CCVALUE "yiq_cc" +#define WINOPTION_YIQ_AVALUE "yiq_a" +#define WINOPTION_YIQ_BVALUE "yiq_b" +#define WINOPTION_YIQ_OVALUE "yiq_o" +#define WINOPTION_YIQ_PVALUE "yiq_p" +#define WINOPTION_YIQ_NVALUE "yiq_n" +#define WINOPTION_YIQ_YVALUE "yiq_y" +#define WINOPTION_YIQ_IVALUE "yiq_i" +#define WINOPTION_YIQ_QVALUE "yiq_q" +#define WINOPTION_YIQ_SCAN_TIME "yiq_scan_time" +#define WINOPTION_YIQ_PHASE_COUNT "yiq_phase_count" +#define WINOPTION_VECTOR_BEAM_SMOOTH "vector_beam_smooth" +#define WINOPTION_VECTOR_LENGTH_SCALE "vector_length_scale" +#define WINOPTION_VECTOR_LENGTH_RATIO "vector_length_ratio" +#define WINOPTION_BLOOM_BLEND_MODE "bloom_blend_mode" +#define WINOPTION_BLOOM_SCALE "bloom_scale" +#define WINOPTION_BLOOM_OVERDRIVE "bloom_overdrive" +#define WINOPTION_BLOOM_LEVEL0_WEIGHT "bloom_lvl0_weight" +#define WINOPTION_BLOOM_LEVEL1_WEIGHT "bloom_lvl1_weight" +#define WINOPTION_BLOOM_LEVEL2_WEIGHT "bloom_lvl2_weight" +#define WINOPTION_BLOOM_LEVEL3_WEIGHT "bloom_lvl3_weight" +#define WINOPTION_BLOOM_LEVEL4_WEIGHT "bloom_lvl4_weight" +#define WINOPTION_BLOOM_LEVEL5_WEIGHT "bloom_lvl5_weight" +#define WINOPTION_BLOOM_LEVEL6_WEIGHT "bloom_lvl6_weight" +#define WINOPTION_BLOOM_LEVEL7_WEIGHT "bloom_lvl7_weight" +#define WINOPTION_BLOOM_LEVEL8_WEIGHT "bloom_lvl8_weight" +#define WINOPTION_LUT_TEXTURE "lut_texture" +#define WINOPTION_LUT_ENABLE "lut_enable" +#define WINOPTION_UI_LUT_TEXTURE "ui_lut_texture" +#define WINOPTION_UI_LUT_ENABLE "ui_lut_enable" + +// full screen options +#define WINOPTION_TRIPLEBUFFER "triplebuffer" +#define WINOPTION_FULLSCREENBRIGHTNESS "full_screen_brightness" +#define WINOPTION_FULLSCREENCONTRAST "full_screen_contrast" +#define WINOPTION_FULLSCREENGAMMA "full_screen_gamma" + +// input options +#define WINOPTION_DUAL_LIGHTGUN "dual_lightgun" + + +//============================================================ +// TYPE DEFINITIONS +//============================================================ + +class windows_options : public osd_options +{ +public: + // construction/destruction + windows_options(); + + // performance options + int priority() const { return int_value(WINOPTION_PRIORITY); } + int profile() const { return int_value(WINOPTION_PROFILE); } + + // video options + const char *attach_window() const { return value(WINOPTION_ATTACH_WINDOW); } + + // core post-processing options + const char *screen_post_fx_dir() const { return value(WINOPTION_HLSLPATH); } + bool d3d_hlsl_enable() const { return bool_value(WINOPTION_HLSL_ENABLE); } + bool d3d_hlsl_oversampling() const { return bool_value(WINOPTION_HLSL_OVERSAMPLING); } + const char *d3d_hlsl_write() const { return value(WINOPTION_HLSL_WRITE); } + int d3d_snap_width() const { return int_value(WINOPTION_HLSL_SNAP_WIDTH); } + int d3d_snap_height() const { return int_value(WINOPTION_HLSL_SNAP_HEIGHT); } + int screen_shadow_mask_tile_mode() const { return int_value(WINOPTION_SHADOW_MASK_TILE_MODE); } + float screen_shadow_mask_alpha() const { return float_value(WINOPTION_SHADOW_MASK_ALPHA); } + const char *screen_shadow_mask_texture() const { return value(WINOPTION_SHADOW_MASK_TEXTURE); } + int screen_shadow_mask_count_x() const { return int_value(WINOPTION_SHADOW_MASK_COUNT_X); } + int screen_shadow_mask_count_y() const { return int_value(WINOPTION_SHADOW_MASK_COUNT_Y); } + float screen_shadow_mask_u_size() const { return float_value(WINOPTION_SHADOW_MASK_USIZE); } + float screen_shadow_mask_v_size() const { return float_value(WINOPTION_SHADOW_MASK_VSIZE); } + float screen_shadow_mask_u_offset() const { return float_value(WINOPTION_SHADOW_MASK_UOFFSET); } + float screen_shadow_mask_v_offset() const { return float_value(WINOPTION_SHADOW_MASK_VOFFSET); } + float screen_scanline_amount() const { return float_value(WINOPTION_SCANLINE_AMOUNT); } + float screen_scanline_scale() const { return float_value(WINOPTION_SCANLINE_SCALE); } + float screen_scanline_height() const { return float_value(WINOPTION_SCANLINE_HEIGHT); } + float screen_scanline_variation() const { return float_value(WINOPTION_SCANLINE_VARIATION); } + float screen_scanline_bright_scale() const { return float_value(WINOPTION_SCANLINE_BRIGHT_SCALE); } + float screen_scanline_bright_offset() const { return float_value(WINOPTION_SCANLINE_BRIGHT_OFFSET); } + float screen_scanline_jitter() const { return float_value(WINOPTION_SCANLINE_JITTER); } + float screen_hum_bar_alpha() const { return float_value(WINOPTION_HUM_BAR_ALPHA); } + float screen_reflection() const { return float_value(WINOPTION_REFLECTION); } + float screen_distortion() const { return float_value(WINOPTION_DISTORTION); } + float screen_cubic_distortion() const { return float_value(WINOPTION_CUBIC_DISTORTION); } + float screen_distort_corner() const { return float_value(WINOPTION_DISTORT_CORNER); } + float screen_round_corner() const { return float_value(WINOPTION_ROUND_CORNER); } + float screen_smooth_border() const { return float_value(WINOPTION_SMOOTH_BORDER); } + float screen_vignetting() const { return float_value(WINOPTION_VIGNETTING); } + const char *screen_defocus() const { return value(WINOPTION_DEFOCUS); } + const char *screen_converge_x() const { return value(WINOPTION_CONVERGE_X); } + const char *screen_converge_y() const { return value(WINOPTION_CONVERGE_Y); } + const char *screen_radial_converge_x() const { return value(WINOPTION_RADIAL_CONVERGE_X); } + const char *screen_radial_converge_y() const { return value(WINOPTION_RADIAL_CONVERGE_Y); } + const char *screen_red_ratio() const { return value(WINOPTION_RED_RATIO); } + const char *screen_grn_ratio() const { return value(WINOPTION_GRN_RATIO); } + const char *screen_blu_ratio() const { return value(WINOPTION_BLU_RATIO); } + bool screen_yiq_enable() const { return bool_value(WINOPTION_YIQ_ENABLE); } + float screen_yiq_jitter() const { return float_value(WINOPTION_YIQ_JITTER); } + float screen_yiq_cc() const { return float_value(WINOPTION_YIQ_CCVALUE); } + float screen_yiq_a() const { return float_value(WINOPTION_YIQ_AVALUE); } + float screen_yiq_b() const { return float_value(WINOPTION_YIQ_BVALUE); } + float screen_yiq_o() const { return float_value(WINOPTION_YIQ_OVALUE); } + float screen_yiq_p() const { return float_value(WINOPTION_YIQ_PVALUE); } + float screen_yiq_n() const { return float_value(WINOPTION_YIQ_NVALUE); } + float screen_yiq_y() const { return float_value(WINOPTION_YIQ_YVALUE); } + float screen_yiq_i() const { return float_value(WINOPTION_YIQ_IVALUE); } + float screen_yiq_q() const { return float_value(WINOPTION_YIQ_QVALUE); } + float screen_yiq_scan_time() const { return float_value(WINOPTION_YIQ_SCAN_TIME); } + int screen_yiq_phase_count() const { return int_value(WINOPTION_YIQ_PHASE_COUNT); } + float screen_vector_beam_smooth() const { return float_value(WINOPTION_VECTOR_BEAM_SMOOTH); } + float screen_vector_length_scale() const { return float_value(WINOPTION_VECTOR_LENGTH_SCALE); } + float screen_vector_length_ratio() const { return float_value(WINOPTION_VECTOR_LENGTH_RATIO); } + int screen_bloom_blend_mode() const { return int_value(WINOPTION_BLOOM_BLEND_MODE); } + float screen_bloom_scale() const { return float_value(WINOPTION_BLOOM_SCALE); } + const char *screen_bloom_overdrive() const { return value(WINOPTION_BLOOM_OVERDRIVE); } + float screen_bloom_lvl0_weight() const { return float_value(WINOPTION_BLOOM_LEVEL0_WEIGHT); } + float screen_bloom_lvl1_weight() const { return float_value(WINOPTION_BLOOM_LEVEL1_WEIGHT); } + float screen_bloom_lvl2_weight() const { return float_value(WINOPTION_BLOOM_LEVEL2_WEIGHT); } + float screen_bloom_lvl3_weight() const { return float_value(WINOPTION_BLOOM_LEVEL3_WEIGHT); } + float screen_bloom_lvl4_weight() const { return float_value(WINOPTION_BLOOM_LEVEL4_WEIGHT); } + float screen_bloom_lvl5_weight() const { return float_value(WINOPTION_BLOOM_LEVEL5_WEIGHT); } + float screen_bloom_lvl6_weight() const { return float_value(WINOPTION_BLOOM_LEVEL6_WEIGHT); } + float screen_bloom_lvl7_weight() const { return float_value(WINOPTION_BLOOM_LEVEL7_WEIGHT); } + float screen_bloom_lvl8_weight() const { return float_value(WINOPTION_BLOOM_LEVEL8_WEIGHT); } + const char *screen_offset() const { return value(WINOPTION_OFFSET); } + const char *screen_scale() const { return value(WINOPTION_SCALE); } + const char *screen_power() const { return value(WINOPTION_POWER); } + const char *screen_floor() const { return value(WINOPTION_FLOOR); } + const char *screen_phosphor() const { return value(WINOPTION_PHOSPHOR); } + float screen_saturation() const { return float_value(WINOPTION_SATURATION); } + int screen_chroma_mode() const { return int_value(WINOPTION_CHROMA_MODE); } + const char *screen_chroma_a() const { return value(WINOPTION_CHROMA_A); } + const char *screen_chroma_b() const { return value(WINOPTION_CHROMA_B); } + const char *screen_chroma_c() const { return value(WINOPTION_CHROMA_C); } + const char *screen_chroma_conversion_gain() const { return value(WINOPTION_CHROMA_CONVERSION_GAIN); } + const char *screen_chroma_y_gain() const { return value(WINOPTION_CHROMA_Y_GAIN); } + const char *screen_lut_texture() const { return value(WINOPTION_LUT_TEXTURE); } + bool screen_lut_enable() const { return bool_value(WINOPTION_LUT_ENABLE); } + const char *ui_lut_texture() const { return value(WINOPTION_UI_LUT_TEXTURE); } + bool ui_lut_enable() const { return bool_value(WINOPTION_UI_LUT_ENABLE); } + + // full screen options + bool triple_buffer() const { return bool_value(WINOPTION_TRIPLEBUFFER); } + float full_screen_brightness() const { return float_value(WINOPTION_FULLSCREENBRIGHTNESS); } + float full_screen_contrast() const { return float_value(WINOPTION_FULLSCREENCONTRAST); } + float full_screen_gamma() const { return float_value(WINOPTION_FULLSCREENGAMMA); } + + // input options + bool dual_lightgun() const { return bool_value(WINOPTION_DUAL_LIGHTGUN); } +}; + +#endif // MAME_OSD_WINDOWS_WINOPTS_H |
