summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_rawinput.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update accumulating relative inputs exactly once per frame. Vas Crabb2023-02-241-17/+27
| | | | | | | | | | | | | This fixes "amplification" effects that would happen if the frame rate rose above 100 Hz (whether by unthrottling or otherwise). Synchronise with wall clock any time inputs are read. Not doing this has weird effects on relative inputs with frame skipping and contributes to unresponsiveness of menus. Reduce visual latency for mouse movement on menus when paused or skipping frames. The rest of the code changes to menus won't provide benefits until draw can happen after event handling.
* Input refactoring: Vas Crabb2023-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | osd/modules/input, emu/inpttype.cpp: Made most default joystick assignments supplied by input modules. Input modules take available controls into consideration when generating default assignments. emu/inpttype.ipp: Added a separate "Back" UI input separate from Cancel. You may want an easier to hit combination for moving to the previous menu than for exiting or cancelling input. They both default to Escape. emu/inpttype.ipp: Added a UI Help control. Currently only used by analog inputs menu emu/inpttype.h: Moved I/O port field type enum to its own header and sorted UI controls so they appear in a more logical order. ui: Don't use UI Select to restore defaults - people should be getting used to the UI Clear input by now. UI Select cycles multi-value items instead. ui/inputmap.cpp: Don't use immediate cancel to cycle between clearing and restoring default assignment (use UI Clear instead). osd: Reduced the number of files needing to include the dreaded emu.h. Got some implementation out of headers.
* Small batch of input refactoring: Vas Crabb2023-02-051-6/+12
| | | | | | | | | | | | | | | | | | | | | emu/input.cpp: Fixed regression in display of some joystick inputs. osd/interface: Split up interface classes into a few more files to reduce where the input device interface class needs to be included. Made OSD independent of concrete input_device class. osd/modules/input, emu/inputdev.cpp, emu/ioport.cpp: Allow input devices to provide tokens for controls without standard item types and additional default input assignments. Fixes issues assigning Yen and Backslash on Japanese keyboards. ui/textbox.cpp: Added a fixed-content text box menu class for future use. Got main.h out of emu.h as it’s only used in a very small number of places, mostly for getting the application name. Added eminline.h to attotime.h as it's used without emu.h. Cleaned up forward declarations in emufwd.h a little.
* osd: Turned video modules into actual modules, fixed various issues. Vas Crabb2023-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't ignore the return status of OSD module initialisation. Attempt to fall back to an alternate module if the selected module fails to initialise. Log more useful diagnostic information at verbose level. Fixed BGFX crash on exit after toggling fullscreen. Also persist more settings than just the selected chains across toggling fullscreen. Turned video modules into OSD modules in the same sense as all the other OSD modules. They now use the same selection/fallback mechanism as all the other modules without special extra code in the OSD implementations. Untangled some object ownership mess. Windows own renderers, OSD objects own windows. Fixed a refrence loop that caused the first window object to always leak. Don't create renderer object until after underlying window has been created. Fixed issues with order of creation/destruction when toggling fullscreen or changing prescale in fullscreen with -switchres in SDL builds. Use more smart pointers in BGFX and Direct3D render modules. Most of the code now reutrns a smart pointer when handing over ownership or a naked pointer when retaining ownership. Fixed a few leaks and simplified cleanup code. Encapsulated various OSD modules better.
* Various input and OSD refactoring: Vas Crabb2023-01-291-199/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* osd: Added option to accept SDL game controller/joystick input when losing ↵ Vas Crabb2023-01-141-2/+2
| | | | UI focus.
* Optimisation, and baby steps towards untangling stuff: Vas Crabb2022-06-161-6/+6
| | | | | | | | | | Optimised the scheduler's handling of unscheduled timers - gives a 50% performance improvement in some timer-heavy drivers. Added better endianness swizzling helpers. Got rid of some of the OSD input modules' dependence on concrete input classes from emu.
* Fix 9ce44fa048793de5e14d1e7af98e8b5ca148d0f3 for non-Windows builds AJR2022-05-251-0/+2
|
* osd: Cleaned up Windows API usage a little. Vas Crabb2022-05-261-16/+13
| | | | | | | | | * Bumped target windows version to 6.0.0 (Vista). * Use WRL COM pointers to manage some COM-like objects. * Cleaned up logging in DirectSound module. * Cleaned up includes in Windows input modules. * Switched to Common Item Dialogs in Windows debugger. * Replaced disabled code that never really worked with a TODO comment.
* osd/modules/input: Detect joystick reconnection with SDL. (#9605) Vas Crabb2022-04-241-11/+11
| | | Also improved display name scheme for joystick axes and buttons.
* osd/modules/input/input_rawinput.cpp: Allow re-plugging mouse/keyboard. Vas Crabb2022-03-111-104/+165
|
* Slightly cleaned up OSD input modules. Vas Crabb2021-07-291-17/+19
| | | | | | | | | | Removed support for DirectInput 7 and earlier. It hasn't been tested in years, and it's not relevant on any supported OS. DirectInput is effectively finalised at version 8, and is unlikely to get an API update in the future. Use more string[_view] and fewer C strings, and tightened up scope of a few things.
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-3/+3
| | | | | | | | | | * osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
* Tidy up loose ends: Vas Crabb2021-01-061-2/+2
| | | | | | | | * Fixed a couple of fixed-size buffers in Windows OSD code. * Marked MAME as aware of long paths in Windows manifest. * Made a cleaner, thread-safe API for getting volume names. * Added compile-time option to disable recompiler W^X mode. * NuBus image device current directory doesn't need to be pinned.
* -bus/a2bus: Added Apple II Parallel Printer Interface Card. Vas Crabb2020-11-011-159/+142
| | | | | | -frontend/mame/audit.cpp: Fixed another annoying edge case. -Cleaned up RawInput code slightly.
* fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) Oliver Stöneberg2020-01-301-4/+4
|
* Move special windows.h include directives to build defines (nw) Brad Hughes2016-12-281-3/+0
|
* Change window handle storage to template instead of void* (nw) (#1725) Brad Hughes2016-11-171-1/+1
| | | | * Change window handle storage to template instead of void* (nw)
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-3/+3
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* Bulk renaming of Windows string conversion functions Nathan Woods2016-10-031-3/+3
| | | | | utf8_from_[a|w|t]string ==> osd::text::from_[a|w|t]string [a|w|t]string_from_utf8 ==> osd::text::to_[a|w|t]string
* srcclean (nw) Vas Crabb2016-09-261-1/+1
|
* Adding id() property to input_device Tomer Verona2016-09-201-19/+14
| | | | | | | | | | | | This change adds id() property to input_device, which represents the unique device id. This allows the osd layer when creating a device to pass a friendly display name along with a unique identifier. Currently the device id is only used to map a physical controller device to controller id, but can be used more generally in the future. For raw input devices, we use the full raw input name as the device id. For all other devices, we fall back to device name as the device id. The "uniqueness" of the device id is not currently enforced in code.
* Support for configuring device to conrtoller id Tomer Verona2016-09-121-2/+10
| | | | | | | | This change adds support for configuring device to conrtoller id. This allows for stable controller ids even if USB devices are plugged / unplugged, system is rebooted, etc. See documentation for additional context.
* osd input code cleanup (nw) Brad Hughes2016-08-221-15/+18
|
* Patch to fix the Gun#2 not working in Mame, please refer to Bug id 6185 on ↵ Patrick Lessard2016-08-021-22/+131
| | | | Mametesters.
* Turn image init/validate into scoped enums to avoid accidental casts to/from ↵ Vas Crabb2016-08-011-2/+1
| | | | | | integer and boolean types The image error should also be turned into a scoped enum - the menus were assuming it was the same thing as an init result
* for bool type use true and false (nw) Miodrag Milanovic2016-07-311-5/+5
|
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-0/+2
| | | | to inline functions (nw)
* Changed strconv.[cpp|h] functions to return their results as std::string and ↵ Nathan Woods2016-07-241-7/+4
| | | | std::wstring
* Fix input issues on big endian systems (fixes #963) Brad Hughes2016-06-291-3/+11
|
* The calling convention goes inside the brackets of pointers to functions. ↵ smf-2016-06-151-4/+4
| | | | | | | | | | | | | Allows compiling with MSVC (nw) Revision: 58dc78b6eba373d88fe7ef68f9ce3c2c43e635d6 Author: Giuseppe Gorgoglione <gorgogsp@gmail.com> Date: 28/05/2016 03:14:15 Message: Introduce dynamic_module This is a central cross-platform facility to dynamically bind functions from shared libraries. Updated all OSD modules to use it.
* Introduce dynamic_module Giuseppe Gorgoglione2016-06-111-51/+37
| | | | | This is a central cross-platform facility to dynamically bind functions from shared libraries. Updated all OSD modules to use it.
* Move window_list to osd_common_t Brad Hughes2016-06-111-1/+1
|
* Unify window_list in Windows and SDL OSD Brad Hughes2016-06-101-1/+1
|
* Revert "Temp revert of Brad changes (nw)" Miodrag Milanovic2016-04-251-1/+1
| | | | This reverts commit 5e831f6506ee06f8c30cb113551ee0fec53804db.
* Temp revert of Brad changes (nw) Miodrag Milanovic2016-04-251-1/+1
|
* Refactor OSD window. Brad Hughes2016-04-211-1/+1
| | | | | | | | | | Unified renderer in osd_window as std::unique_ptr Made windows all std::shared_ptr<window_type> Made window lists std::list<std::shared_ptr<window_type>> Updated OSD SDL worker_param to not use malloc (not compatible with smart pointers) Made renderer pointer to window a weak reference. May not be available during destruction of the window.
* Standardize platform window pointer storage in osd_window. Brad Hughes2016-04-181-1/+1
| | | | Also encapsulate show/hide capture/release cursor functionality.
* Cleanups and version bump Miodrag Milanovic2016-03-301-5/+5
|
* Rewrote overly complex rawinput_device_improve_name function for rawinput ↵ Brad Hughes2016-03-181-154/+208
| | | | module, plus fixing some other defects in input modules as detected by coverity.
* Revert "Fix that makes non-Unicode build to work (nw)" Miodrag Milanovic2016-03-141-1/+1
| | | | This reverts commit 560e350e22d3b2dfdedf67c4296852166d5b4fd1.
* Fix that makes non-Unicode build to work (nw) Miodrag Milanovic2016-03-111-1/+1
|
* With latest package from MSYS of clang 3.8.0 build at least compile fine on ↵ Miodrag Milanovic2016-03-111-5/+5
| | | | | | windows (nw) Strange crashing while executing
* Code cleanup in rawinput plus use common code for dynamic function binding. Brad Hughes2016-03-031-55/+41
|
* cleanup (nw) Miodrag Milanovic2016-02-291-1/+0
|
* Refactor OSD input into modules Brad Hughes2016-02-281-0/+649