summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows
Commit message (Collapse)AuthorAgeFilesLines
* -input/input_win32.cpp: Made Win32 lightgun module usable with pen/touch. Vas Crabb2026-04-182-1/+112
| | | | | | | * windows/window.cpp: Forward pointer events to input modules. -igs/igs011.cpp: Bad graphics on dbc title screen is an original game bug.
* windows/winmain.cpp: Use UTF-8 console I/O when built with UCRT. Vas Crabb2026-04-151-8/+17
|
* Switched language standard to C++20, bumped compiler requirement to GCC 11. ↵ Vas Crabb2026-04-023-18/+6
| | | | | | | | | | | (#15182) * Hackery to allow UTF-8 strings as well as plain strings: - emu/ioport.h: Allow char8_t for names in field configuration helper. - emu/device.h, emu/gamedrv.h: Allow char8_t for descriptions and manufacturers. - util/language.h: Allow char8_t message input. * util/strformat.h: Allow char8_t format and string arguments with char output. * ui/videoopt.cpp: Deal with UTF-8 strings as a distinct type. * osd/windows: Assume Windows 8 or later.
* osd/windows: only clip the cursor if we haven't already (#14933) npwoods2026-02-072-1/+8
| | | On Windows, cursor clipping is global and needlessly invoking `ClipCursor(nullptr)` will interfere with other applications that might also be trying to clip the cursor. With this change, MAME will only invoke `ClipCursor(nullptr)` if MAME previously clipped the cursor.
* windows/winmain.cpp: Suppress digit grouping. Too many things don't take it ↵ Vas Crabb2026-01-271-4/+23
| | | | into consideration.
* -windows/winmain.cpp: Set global C++ locale when the standard library isn't ↵ Vas Crabb2026-01-151-0/+4
| | | | | | | | | | | | | | broken. * GNU libstdc++ only provides a useless stub locale implementation when using anything other than the glibc standard C library. However, llvm libc++ provides a locale implementation that works fine with UCRT. -dynax/royalmah.cpp: Filled in Mahjong Raijinhai DIP switches from available manual pages. -docs: added note about MinGW clang/llvm issues with CodeView/PDB symbols at high detail levels.
* Fixed some things causing save states to be unportable: Vas Crabb2025-03-091-6/+0
| | | | | * emu/save.cpp: Don't save block stride as it depends on alignment rules. * windows/winmain.cpp: Don't send display orientation to machine outputs.
* osd/windows, osd/sdl: Only check for hold/drag conversion on losing pointer ↵ Vas Crabb2024-11-181-6/+2
| | | | if it hasn't already happened.
* -util/corefile.cpp: Fixed core_file failing to propagate write errors. Vas Crabb2024-06-212-7/+22
| | | | | | | | -util/ioprocs.cpp: Reverted gross hack. -osd/windows: Ensure WM_MOUSE* to WM_POINTER* event translation is always disabled. -tecmo/gaiden.cpp: Call base device_post_load(), use logmacro.h.
* ui/selmenu.cpp: Fixed issue with focus rotation when filter matches no items. Vas Crabb2024-05-111-2/+2
|
* -merit/mtouchxl.cpp: Added touch-enabled layout. Vas Crabb2024-05-092-10/+10
| | | | | | -ui/tapectrl.cpp: Ensure device monitored for media change is up-to-date. -osd/windows: Changed a pointer to a const reference in an API.
* -osd: Update slider list on demand rather than on frame updated (fixes MT08857). Vas Crabb2024-04-272-31/+1
| | | | -konami/konamigq.cpp: No need to cancel a newly allocated timer.
* input/input_sdl.cpp: Added an SDL lightgun provider. Vas Crabb2024-04-262-28/+39
| | | | | | | | | | This does essentially the same thing as the Win32 lightgun provider, mapping the absolute pointer position over the window to gun axes. Also added a bunch of const in the windows input handling code. docs: Bumped version, as features that are not in a releaesd version of MAME are now documented.
* Initial touch input support: Vas Crabb2024-04-123-54/+568
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feed mouse/pen/touch pointer events through UI input manager with Win32 and SDL. * Started migrating UI code to use new API and reworking mouse/touch interaction. * emu/render.cpp: Support pressing multiple clickable layout items simultaneously. * emu/render.cpp: Allow UI elements to be drawn in any window. * emu/rendlay.cpp, luaengine_render.cpp: Added layout view events for pointer input. * ui/ui.cpp: Allow the UI handler to control pointer display. * ui/analogipt.cpp: Added mouse/touch and more keys for navigating field state list. * ui/menu.cpp: Use vertical swipe to scroll and horizontal swipe to adjust. * ui/menu.cpp: Draw after processing input - greatly improves responsiveness. * ui/menu.cpp: Ignore keyboard/gamepad input during pointer actions. * ui/selmenu.cpp: Made left/right info pane arrows repeat when held. * ui/selmenu.cpp: Use middle click to move keyboard focus. * ui/selmenu.cpp: Let filter list scroll if it's too tall, and use a bit of horizontal padding. * ui/selmenu.cpp: Improved divider sizing. * ui/state.cpp: Don't allow clicks to pass through the confirm deletion prompt to the menu. * ui/simpleselgame.cpp: Fixed error message display and graphics/sound status not showing. * ui/simpleselgame.cpp: Allow tap/click to dismiss error message. * ui/utils.cpp: Show UI for choice filters when there are no choices - it's less confusing. * modules/input/input_sdl.cpp: Made scaling for mouse scroll better match RawInput and DirectInput. * modules/input/input_rawinput.cpp: Added support for horizontal scroll axis. * modules/input/input_win32.cpp: Added support for scroll axes and more buttons to mouse/lightgun. * modules/debugger/debugimgui.cpp: Don't fight over events with the UI manager - it breaks menus. * osd/windows/window.cpp: Translate mouse position to window cooridinates for scroll wheel events. * osd/sdl/window.cpp: Supply last mouse position for scroll wheel events if possible. * scripts/build/complay.py: Made zero input mask an error - it was only being used to block clicks.
* osd/modules/input: Various cleanup and minor enhancements. Vas Crabb2024-03-041-3/+3
| | | | | | | | | | | | | | | | | | | input_common.h: Got rid of the DirectInput key code macros. DirectInput headers are always available on Windows - it's just an opportunity for bygs. input_common.cpp: Added default names for keys mapped to MAME's "other switch" type. input_rawinput.cpp: Simulate Pause key being held for 30ms, similarly to what's done for Caps Lock on macOS with SDL. Also added a gross hack to give "correct" names for Pause and Num Lock. input_sdl.cpp: Get default key names from SDL. Not really that useful as it isn't aware of the current keyboard layout. Key map files are still needed for anything other than a US ANSI layout. Also added some comments.
* Skeleton driver for 600 Cellular Activation Tester (#11225) MooglyGuy2023-05-131-1/+1
| | | | | | | | | | | | | | | | | * New systems marked not working ------------------------------ 600 Cellular Activation Tester [Ryan Holtz, Leo Romo] -m6801.cpp: Fixed HD6303R to use an internal map, removed internal-only handlers from associated drivers. [Ryan Holtz] -video.cpp: Raised maximum prescale value to 20 to account for very small LCDs. [Ryan Holtz] -screen.cpp: Replaced old MCFG_ references in a warning message with member function names. [Ryan Holtz] * -timekpr: Added Dallas DS1643, a clone of the STMicro M48T58. [Ryan Holtz]
* osd/windows: Create single-threaded COM apartment on main thread. Vas Crabb2023-04-082-1/+6
|
* Various optimisations to code generaton. Vas Crabb2023-03-261-1/+1
| | | | | | | | | | | | | | | util/bitmap.cpp, util/palette.cpp: Marked lots of things constexpr. Bitmaps don't throw exceptions on allocation failure, they just become invalid. Almost nothing in MAME actually checks for this. emu/profiler.cpp: Abort if the profile stack overflows rather than throwing an exception. This is a developer feature and if it overflows, the code is broken. Calling a noreturn noexcept function generates less code than throwing an exception, which adds up. util/strformat.cpp: Traded away some unnecessary flexibility for more compact code. The stream objects must derive from std::basic_ostream now - they can't just be any old objects with the expected operators.
* osd: Moved some windows-specific stuff into osd/windows/window.{h,cpp}. Vas Crabb2023-02-262-3/+12
|
* Update accumulating relative inputs exactly once per frame. Vas Crabb2023-02-242-3/+3
| | | | | | | | | | | | | 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.
* osd: Cleaner way of dealing with input updates. Vas Crabb2023-02-233-8/+1
|
* osd: Don't pump events when reading inputs. Vas Crabb2023-02-232-2/+3
| | | | | | This was a drain on performance. If anything is trying to poll inputs in a loop, it needs to call input_update() to ensure it gets up-to-date state.
* -osd/windows/winutil.cpp: Better way to get module handle. Vas Crabb2023-02-121-3/+6
| | | | | | | * This was leftover support for Windows 2000 and earlier that hadn't been cleaned up. -atari: Don't forget your #include guards!
* osd/windows/window.cpp: Allow BGFX to bounce cleanly when toggling ↵ Vas Crabb2023-02-021-0/+4
| | | | fullscreen on Windows with multiple output screens/windows.
* osd: Turned video modules into actual modules, fixed various issues. Vas Crabb2023-02-015-273/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-298-479/+477
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-142-3/+0
| | | | UI focus.
* bgfx: Save values of most sliders per-system. Vas Crabb2023-01-081-1/+2
|
* util/options.cpp: Fixed overriden default option values from OSD. Vas Crabb2022-12-191-4/+4
|
* osd/modules/file: Don't magically substitute environment variables when ↵ npwoods2022-12-171-4/+4
| | | | | | | | opening files. (#9859) * util/options.cpp: Added option types for single and multiple paths. * util/options.cpp: Substitute environment variables in values from defaults and INI files. * ui/dirmenu.cpp: Removed hard-coded list of multi-path options. * plugins: Don't substitute environment variables in path options.
* osd/windows/window.cpp: Fixed a crash when toggling fullscreen. [Ryan Holtz] ↵ MooglyGuy2022-12-161-1/+4
| | | | | (#10692) osd/windows/window.cpp: Check for a non-null renderer before issuing a draw request to the renderer. [Ryan Holtz]
* Patched up some gaps in functionality and fixed some bugs. Vas Crabb2022-09-022-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ui: Added some missing functionality: * Added an option to copy input device IDs to the relevant menus. * Added an item for setting the software lists files path (-hashpath) to the folder setup menu. * Allow pasting text from clipboard in most places that allow typing (searching, entering filenames, entering barcodes). * Changed the software selection menu heading to be a bit less misleading. * Made barcode menu less eager to rebuild itself unnecessarily, and removed some confusing and apparently pointless code. Exposed more Lua bindings: * Added low-level palette objects. * Added indexed bitmap types. * Added a bitmap method for extracting pixels from a rectangular area as a packed binary string. * Changed screen device pixels method to return width and height in addition to the pixels. osd: Added some functionality and cleaned up a little: * Added a function for copying text to the clipboard. * Moved function for converting Windows error codes to standard error conditions to winutil.cpp so it can be used from more places. * Removed duplicate declaration of osd_get_clipboard_text and made the function noexcept (including fixing implementations). * Made macOS implementation of osd_get_clipboard_text skip the encoding conversion if it finds UTF-8 text first. * Changed the default -uimodekey setting so it doesn't lose the "not shift" that stops the default from interfering with UI paste. Various bug fixes: * util/unicode.cpp: Fixed the version of utf8_from_uchar that returns std::string blowing up on invalid codepoints. * util/bitmap.h: Fixed wrapping constructors for indexed bitmaps taking the wrong parameter type (nothing was using them before). * util/bitmap.cpp: Fixed potential use-after-free issues with bitmap palettes. * emu/input.cpp, emu/inputdev.cpp: Log 1-based device numbers, matching what's shown in the internal UI and used in tokens in CFG files. * emu/emumem.cpp: Added the bank tag to a fatal error message where it was missing. docs: Reworked and expanded documentation on configuring stable controller IDs. For translators, the changes are quite minor: * There's a menu item for copying a device ID to the clipboard, and associated success/failure messages. * There's the menu item for setting the software list file search path. * One of the lines in the software selection menu heading has changes as it could be interpreted as implying it showed a software list name.
* Clean up #includes in src/osd (#10029) ajrhacker2022-07-042-0/+2
| | | | | * Clean up #includes in src/osd * render/bgfx/view.cpp: Add license header
* osdcore.h: Changed osd_subst_env to accept a std::string_view and return a ↵ npwoods2022-06-151-3/+4
| | | | std::string. (#9928)
* util/options.h: Removed legacy OPTION_* option type constants. (#9851) npwoods2022-05-301-100/+100
| | | These constants were polluting the global namespace.
* osd: Cleaned up Windows API usage a little. Vas Crabb2022-05-262-14/+19
| | | | | | | | | * 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.
* sdl/window: add error retval check for bgfx on fallback hap2022-03-251-1/+1
|
* Updated BGFX fixes; verified as working on Linux and Windows. (#9420) MooglyGuy2022-03-151-1/+2
| | | | | | | * -bgfx: Improved stability when encountering missing files, and improved multi-window stability. [Ryan Holtz] * -osd: Added video-init fallback functionality to other OSDs. [Ryan Holtz] * -bgfx: Fixed issues from the previous batch of changes. [Ryan Holtz] * -osdwindow: Remove no-longer-needed addition of post_create(). [Ryan Holtz]
* Revert "More BGFX stability improvements (missing files + multi-window) (#9410)" Vas Crabb2022-03-161-2/+1
| | | | This reverts commit f5b75b74393646d1dc082ec807279451dc481854.
* More BGFX stability improvements (missing files + multi-window) (#9410) MooglyGuy2022-03-141-1/+2
| | | | | * -bgfx: Improved stability when encountering missing files, and improved multi-window stability. [Ryan Holtz] * -osd: Added video-init fallback functionality to other OSDs. [Ryan Holtz]
* -bgfx: Added default LUT PNG, fixes LUT-effect crash. Fixed external texture ↵ MooglyGuy2022-03-121-2/+2
| | | | loading, restoring HQx filters. [Ryan Holtz] (#9401)
* osd/modules/input/input_rawinput.cpp: Allow re-plugging mouse/keyboard. Vas Crabb2022-03-112-3/+17
|
* Correctly adjust window size based on the computed visible area for ↵ antonioginer2022-01-212-1/+20
| | | | different stretching cases. (#9140)
* emu/render.cpp: Improved scale factor selection. (#8961) antonioginer2022-01-062-1/+5
| | | Fixes aspect related issues, undesired overscan, etc. (GitHub #8209, GitHub #8387, MT08110)
* clang fixes smf-2021-11-191-4/+1
|
* osd/windows: Don't set parent window for error message box - it doesn't ↵ Vas Crabb2021-11-131-2/+4
| | | | appreciate the parent being pulled out from under it.
* -osd/windows: Fixed stupid potential deadlock on exit. Vas Crabb2021-11-131-1/+0
| | | | | -frontend: Some changes to menu item class that will make it possbile to reduce the number of menu rebuilds.
* -osd/windows: Show error message box on a separate thread (see MT08118). Vas Crabb2021-11-121-3/+64
| | | | | | | -emu/emuopts.cpp: Default to built-in UI language rather than English. * The external English message catalog is a placeholder anyway. -cpu/mcs48: Corrected comments - D87xxH have UVEPROM, not EEPROM.
* -frontend: Don't inappropriately truncate text in menu text boxes. Vas Crabb2021-11-082-6/+35
| | | | -osd/windows: Handle WM_UNICHAR.
* Remove OSD_UWP from rest of code Miodrag Milanovic2021-10-266-300/+8
|