diff options
Diffstat (limited to 'src/osd/modules')
-rw-r--r-- | src/osd/modules/file/winfile.cpp | 21 | ||||
-rw-r--r-- | src/osd/modules/input/input_sdl.cpp | 3 | ||||
-rw-r--r-- | src/osd/modules/input/input_xinput.cpp | 14 | ||||
-rw-r--r-- | src/osd/modules/input/input_xinput.h | 10 | ||||
-rw-r--r-- | src/osd/modules/lib/osdobj_common.cpp | 2 |
5 files changed, 35 insertions, 15 deletions
diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp index 745b9112b7b..66281d08b4a 100644 --- a/src/osd/modules/file/winfile.cpp +++ b/src/osd/modules/file/winfile.cpp @@ -185,6 +185,7 @@ osd_file::error osd_file::open(std::string const &orig_path, uint32_t openflags, { disposition = (!is_path_to_physical_drive(path.c_str()) && (openflags & OPEN_FLAG_CREATE)) ? CREATE_ALWAYS : OPEN_EXISTING; access = (openflags & OPEN_FLAG_READ) ? (GENERIC_READ | GENERIC_WRITE) : GENERIC_WRITE; + if (is_path_to_physical_drive(path.c_str())) access |= GENERIC_READ; sharemode = FILE_SHARE_READ; } else if (openflags & OPEN_FLAG_READ) @@ -230,7 +231,25 @@ osd_file::error osd_file::open(std::string const &orig_path, uint32_t openflags, // get the file size DWORD upper, lower; - lower = GetFileSize(h, &upper); + if (is_path_to_physical_drive(path.c_str())) + { + GET_LENGTH_INFORMATION gli; + DWORD ret; + if (!DeviceIoControl(h, IOCTL_DISK_GET_LENGTH_INFO, nullptr, 0, &gli, sizeof(gli), &ret, nullptr)) + { + upper = 0; + lower = INVALID_FILE_SIZE; + } + else + { + lower = gli.Length.LowPart; + upper = gli.Length.HighPart; + } + } + else + { + lower = GetFileSize(h, &upper); + } if (INVALID_FILE_SIZE == lower) { DWORD const err = GetLastError(); diff --git a/src/osd/modules/input/input_sdl.cpp b/src/osd/modules/input/input_sdl.cpp index 93e14313de8..a3cbed7c107 100644 --- a/src/osd/modules/input/input_sdl.cpp +++ b/src/osd/modules/input/input_sdl.cpp @@ -250,7 +250,8 @@ public: { machine().ui_input().push_mouse_down_event(window->target(), cx, cy); - if (click - last_click < double_click_speed + // avoid overflow with std::chrono::time_point::min() by adding rather than subtracting + if (click < last_click + double_click_speed && (cx >= last_x - 4 && cx <= last_x + 4) && (cy >= last_y - 4 && cy <= last_y + 4)) { diff --git a/src/osd/modules/input/input_xinput.cpp b/src/osd/modules/input/input_xinput.cpp index e6ecdd4d177..67348ebe162 100644 --- a/src/osd/modules/input/input_xinput.cpp +++ b/src/osd/modules/input/input_xinput.cpp @@ -130,9 +130,9 @@ void xinput_joystick_device::poll() gamepad.right_thumb_x = normalize_absolute_axis(xinput_state.xstate.Gamepad.sThumbRX, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); gamepad.right_thumb_y = normalize_absolute_axis(-xinput_state.xstate.Gamepad.sThumbRY, XINPUT_AXIS_MINVALUE, XINPUT_AXIS_MAXVALUE); - // Now the triggers - gamepad.left_trigger = normalize_absolute_axis(xinput_state.xstate.Gamepad.bLeftTrigger, 0, 255); - gamepad.right_trigger = normalize_absolute_axis(xinput_state.xstate.Gamepad.bRightTrigger, 0, 255); + // Now the triggers, place them on half-axes (negative side) + gamepad.left_trigger = -normalize_absolute_axis(xinput_state.xstate.Gamepad.bLeftTrigger, -255, 255); + gamepad.right_trigger = -normalize_absolute_axis(xinput_state.xstate.Gamepad.bRightTrigger, -255, 255); } void xinput_joystick_device::reset() @@ -179,16 +179,16 @@ void xinput_joystick_device::configure() } device()->add_item( - "Left Trigger", + "RT", ITEM_ID_ZAXIS, generic_axis_get_state<LONG>, - &gamepad.left_trigger); + &gamepad.right_trigger); device()->add_item( - "Right Trigger", + "LT", ITEM_ID_RZAXIS, generic_axis_get_state<LONG>, - &gamepad.right_trigger); + &gamepad.left_trigger); m_configured = true; } diff --git a/src/osd/modules/input/input_xinput.h b/src/osd/modules/input/input_xinput.h index 2cd8f15a250..9772e941bb7 100644 --- a/src/osd/modules/input/input_xinput.h +++ b/src/osd/modules/input/input_xinput.h @@ -62,12 +62,12 @@ static const char *const xinput_button_names[] = { "B", "X", "Y", - "Left Shoulder", - "Right Shoulder", + "LB", + "RB", "Start", "Back", - "Left Thumb", - "Right Thumb" + "LS", + "RS" }; struct gamepad_state @@ -85,7 +85,7 @@ struct gamepad_state // state information for a gamepad; state must be first element struct xinput_api_state { - uint32_t player_index; + uint32_t player_index; XINPUT_STATE xstate; XINPUT_CAPABILITIES caps; }; diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index 5bacf0c341d..704ee399819 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -91,7 +91,7 @@ const options_entry osd_options::s_option_entries[] = { nullptr, nullptr, OPTION_HEADER, "OSD ACCELERATED VIDEO OPTIONS" }, { OSDOPTION_FILTER ";glfilter;flt", "1", OPTION_BOOLEAN, "enable bilinear filtering on screen output" }, - { OSDOPTION_PRESCALE, "1", OPTION_INTEGER, "scale screen rendering by this amount in software" }, + { OSDOPTION_PRESCALE "(1-3)", "1", OPTION_INTEGER, "scale screen rendering by this amount in software" }, #if USE_OPENGL { nullptr, nullptr, OPTION_HEADER, "OpenGL-SPECIFIC OPTIONS" }, |