summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* chd: Add dvd support. better abstraction in general, multi-image support in ↵ Olivier Galibert2023-05-044-4/+138
| | | | arcade-type drivers
* ui: Don't use facets of destructed locales. Vas Crabb2023-05-017-8/+16
|
* frontend/mame/luaengine.ipp Fixed i686 Linux GCC build. Vas Crabb2023-04-241-3/+3
|
* Miscellaneous improvements: Vas Crabb2023-04-141-63/+106
| | | | | | | | | | | | | | infoxml.cpp: Thread device processing. Gives about a 10% speed improvement overall, and avoids the need to mess with the locale of the ultimate output stream. debugger/win/consolewininfo.cpp: Show image mount/create error messages on the console. emu/devdelegate.h, util/delegate.h: Added deduction guides for common delegate creation patterns (only used in sega/segas16a.cpp so far). More noexcept on things that have no business throwing exceptions.
* Allow loading PNG/JPEG/MS DIB bitmaps from Lua, and cleanup. Vas Crabb2023-04-131-1/+35
| | | | | | | | | | | Use VirtualAlloc rather than VirtualProtect on Windows to change page protection, as the latter can cause severe performance issues with some antivirus software. Added noexcept to lots of hash- and bitmap-related things, and added a little more error checking. Yes, I realise it will abort if an allocation fails while printing a log message, but if you get to that point, you're probably screwed already.
* clifront.cpp: Changed -listbios to work more like -listslots, showing all ↵ Vas Crabb2023-04-101-37/+63
| | | | BIOS options in a system.
* Restored ability of for image devices to report specific error messages. Vas Crabb2023-04-084-34/+92
| | | | | | | | | | | | | | Restores ability to give specific/detailed messages removed in 6f7e4141ea14acaaf9cb973c66788fabb3457023 while pandering to obsession with single return value. Moved responsibility for displaying the error message in the UI to the caller rather than device_image_interface, and made device_image_interface always log the error along with the full path and error condition content. Gave several image devices more detailed error messages. Added some FIXME comments for apparent bugs.
* Lua engine: Dispose of notifiers before closing Sol. Vas Crabb2023-04-073-38/+46
|
* Lua engine code changes for b67b969bf0911d71396c77e42d85ddfe80de6f20. Vas Crabb2023-04-073-91/+211
| | | | | Code changes to notifications and waiters corresponding to the docs/plugins changes in previous commit.
* Fixed unused lambda capture in Lua engine. Vas Crabb2023-04-061-1/+1
|
* Fixed various bugs: Vas Crabb2023-04-066-52/+108
| | | | | | | | | | | | | | | bus/nubus/nubus_image.cpp: Fixed failure to allocate memory for the image (regressed in b8c338858a101d14308c64c87b0f714db4f05326). bus/nes/karastudio.cpp, bus/nes/sunsoft_dcs.cpp: Fixed stack smash when loading loose software. Addressed some Lua engine fallout from running things in coroutines: * Don't crash accessing dead Lua thread state from callbacks. * Allow returning values via yielding functions. * Don't run address space tap and layout view callbacks in coroutines to save overhead. * Better logging of errors from callbacks.
* floppycntrl.cpp: Fix clang error: function definition is not allowed here AJR2023-04-011-1/+1
|
* leapfrog: Less redundancy in source file names. Vas Crabb2023-04-021-2/+2
| | | | | Also edited a pile of copy/pasted comments and made some minor code cleanups (reducing variable scope, etc.).
* API change for device_image_interface AJR2023-03-304-38/+19
| | | | | | | | | - Remove the seterror method for recording error messages and conditions. Condition codes have been made return values for call_load, call_create and various related callbacks. Error messages (which many devices weren't generating) are now displayed through osd_printf_error. - Eliminate the image_init_result and image_verify_result pass/fail enumeration types. Update many functions that were returning these enumerations or simply bools to return std::error_condition instead. In some cases, this type is now passed down from internal parsing/loading functions which were already returning it. In various other cases, the former default UNSPECIFIED has been used as a catchall for I/O errors; anticipated future refactorings should make these error returns more specific. - Expand the image_error categories to include INVALIDLENGTH, NOSOFTWARE and BADSOFTWARE. The first is largely self-explanatory. The second is generated by the core to indicate failure to find software items in lists. The third is provided for devices to indicate semantic errors in software list entries. - Change the return type of floppy_image_device::identify to a pair so the potential error condition can be passed along to the UI without storing it in a member variable. - Move device_image_interface::message down into snapshot_image_device and change its implementation to use string_format instead of printf. - Correct a typo in the shortname of the generic snapshot device.
* 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.
* -Lua engine: run everything in coroutines. (#11019) Vas Crabb2023-03-258-74/+107
| | | | | | | | | * This lets you use emu.wait(...) directly without mucking around creating coroutines. * Allow emu.wait to accept an attotime argument. * Added a couple more wait helper functions. -emu/profiler.h: Actually use scope-based profiling helpers. * This makes the comment at the top of emu/profile.h less dishonest, and makes it easier to write exception-safe code. * Got rid of some do { ... } while (0) loops that only existed so break could be used like a goto.
* luaengine.cpp: Try to get around the clang error, attempt two. Vas Crabb2023-03-231-35/+28
|
* luaengine.cpp: Hopefully fix clang builds. Vas Crabb2023-03-231-0/+1
|
* Retired the over-stretched "system type" flags. Vas Crabb2023-03-235-79/+72
| | | | | | | | | | | | | | | | Functionally, the only difference between the system definitions is that GAMEL lets you specify an additional internal layout and SYST lets you specify a compatible system. COMP and CONS are just aliases for SYST - the aliases can be phased out. Removed arcade.flt and mess.flt altogether - opinion seems to be split between misinterpreting them as fully supported and considering them unnecessary. They were marginally useful as a performance test for makedep.py, but that isn't important. We still have nl.flt as an example .flt file (although it doesn't use "-" exclude directives). Moved the UI active flag from the machine to the UI manager. Nothing else uses it anyway (it's still accessible to scripts).
* -luaengine.cpp: Expose UI controls toggle state. Vas Crabb2023-03-232-2/+4
| | | | -ui/ui.cpp: Honour UI enable for machines without keyboards.
* -ui/menu.cpp: Don't pass IPT_UI_BACK event to the implementation when ↵ Vas Crabb2023-03-231-1/+2
| | | | | | dismissing the menu. -plugins/autofire, plugins/inputmacro: Don't be so eager to create empty settings folders.
* dimemory: Add the target address space to translate, wrap the constants Olivier Galibert2023-03-181-16/+18
| | | | divtlb: Wrap the constants
* luaengine: fix msvc link failure due to mismatched signature Patrick Mackinlay2023-03-171-1/+1
|
* ddr/kc.cpp, ddr/kc_m.cpp: Tidied up a little. Vas Crabb2023-03-151-1/+1
|
* apple/mac.cpp, apple/maciici.cpp, dataeast/exprraid.cpp: Minor cleanup. Vas Crabb2023-03-141-4/+4
|
* Lua engine: Better bindings for device_state_interface. Vas Crabb2023-03-122-49/+93
| | | | | | | | | | | | This avoids creating a table every time the state property of a device is accessed, adds proper support for getting/setting floating/point state entries from Lua, calls the state entry's formatting method to convert to a string (for flags fields, etc.) and exposes more properties. This is a breaking change as the exposed properties on state entries have changed, and the value property has different semantics for floating-point state entries.
* Lua: Be more strict with concurrency and multiple contexts. Vas Crabb2023-03-081-11/+24
|
* plugins/console: Fixed tab completion after linenoise update. Vas Crabb2023-03-082-74/+93
| | | | | | * Can now cycle through candidates by repeatedly pushing Tab. * Also cleaned up Lua thread context object a little, and made it possible to pass any Lua object as a status value.
* Various updates, mostly around Lua: Vas Crabb2023-03-075-29/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compile Lua as C++. When Lua is compiled as C, it uses setjmp/longjmp for error handling, resulting in failure to unwind intermediate stack frames. Trying to ensure no objects with non-trivial destructors are in scope when raising a Lua error is error-prone. In particular, converting an exception to a Lua error becomes convoluted, and raising a Lua error from a constructor is effectively impossible. Updated Lua to 5.4.4 - this includes a brand-new garbage collector implementation with better performance. The main thing removed is the deprecated bitlib. Updated sol2 to version 3.3.0 - this adds support for Lua 5.4 and fixes a number of issues, including not correctly handling errors when Lua is built as C++. Updated LuaFileSystem to version 1.8.0 - this adds support for symbolic links on Windows, as well as Lua 5.4 compatibility. Updated LuaSQLite3 to version 0.9.5 - this fixes issues in multi-threaded environments, as well as Lua 5.4 compatibility. Fixed double-free after attempting to construct a debugger expression from Lua with an invalid string, and exposed expression error to Lua in a better way. Added warning level print function to Lua. Fixed saving cheats with shift operators in expressions, although this code isn't actually used as there's no cheat editor.
* ui/ui.cpp: Cleaned out more leftover crud and removed debug printfs. Vas Crabb2023-02-282-34/+10
|
* osd/modules/input: Always use DirectInput with desktop window in background ↵ Vas Crabb2023-02-281-14/+4
| | | | | | | | | | | | | | | | | | | mode. There are multiple issues with what MAME was doing, but the most glaring is that it violates the DirectInput interface contract that requires the window associated with an open device must not be destroyed. See documentation for IDirectInputDevice8::SetCooperativeLevel: "This parameter must be a valid top-level window handle that belongs to the process. The window associated with the device must not be destroyed while it is still active in a DirectInput device." The previous code also prevented DirectInput controllers from working when using multiple windows if any window other than the first window had focus. Also fixed SDL builds not correctly recognising when all windows lose focus, and save state menu not appearing.
* Various cleanups: Vas Crabb2023-02-271-2/+2
| | | | | | | * cpu/dsp56156: Removed vestigial (and excessively slow) "new" execution code. * apple/bandit.cpp: Got rid of unnecessary friend declaration. * nintendo/n64_v.cpp: More const. * Fixed a few "const qualifier has no effect" warnings.
* Update accumulating relative inputs exactly once per frame. Vas Crabb2023-02-2488-1613/+1945
| | | | | | | | | | | | | 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-234-2/+13
|
* Merge branch 'release0252' into mainline-master Vas Crabb2023-02-201-1/+1
|\
| * ui/analogipt.cpp: Fixed failure to display localised analog input ↵ Vas Crabb2023-02-191-1/+1
| | | | | | | | adjustments help.
* | Reduced usage of sprintf. (#10892) Erik2023-02-201-4/+2
|/
* Input refactoring: Vas Crabb2023-02-1824-79/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* xmlfile.cpp: Replace implementation of normalize_string with similar one in ↵ AJR2023-02-122-63/+50
| | | | infoxml.cpp that returns a new std::string instead of a static buffer
* Small batch of input refactoring: Vas Crabb2023-02-056-59/+216
| | | | | | | | | | | | | | | | | | | | | 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.
* Various input and OSD refactoring: Vas Crabb2023-01-295-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Miscellaneous fixes and refactoring: Vas Crabb2023-01-284-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ui/analogipt.cpp: Fixed bar graph display for fields with ranges that wrap through zero. emu/inputdev.cpp: Separateed analog axis deadzone and switch threshold settings, reduced default deadzone, and fixed a potential division by zero if the deadzone and saturation settings are equal. emu/ioport.cpp: Fixed behaviour of absolute analog fields where range passes through zero - it previously only worked for specific combinations of mask, minimum and default. Removed a workaround from universal/getaway.cpp that is no longer necessary. emu/input.cpp: Fixed unintuitive behaviour when an absolute field is assigned an OR combination of a relative control folled by an absolute control (e.g. Mouse X or Joy 1 LSX). Also fixed reading axis input sequences where an axis code is followed by a switch code (these can only be produced by manually editing configuration files, not through MAME's UI), and fixed the returned type when multiple relative axes sum to zero. osd/modules/input_dinput.cpp: Fixed hat switches being stuck in up position when input is suspended in the background taito/taitoio_yoke.cpp: Give throttle control a distinct type, and don't auto-centre. osd: Added option to select MIDI provider module (currently only PortMidi and the dummy module are available). Also put various things in namespaces, and fixed builds including SDL sound module with native Windows OSD. emu/validity.cpp: Added check to catch I/O port fields using UI input types. emu/inpttype.ipp: Renamed inputs that were causing confusion. "Bill" and "Track" were causing confusion for translators and hence likely causing confusion for many users, especially those who are not native English speakers. "Track" as an abbreviation for "Trackball" was frequently being mistranslated, e.g. in the sense of a CD track selection button or even in the sense of a railway track. There's no reason to abbreviate it. "Bill" in the US English sense as a banknote is too ambiguous and was causing confusion for translators. It's better to use the less ambiguous "Banknote". Corrected Greek translations of "Trackball". Don't run GitHub Actions on issue template changes.
* Add -listbios command to list alternate BIOSes for drivers and devices AJR2023-01-242-0/+46
|
* -osd: Better XInput and SDL game controller input enhancements: Vas Crabb2023-01-1282-218/+496
| | | | | | | | | | | | | | | * Added initial support for XInput controller subtypes, starting with driving, arcade and flight controllers. * Check XInput capabilities to ignore buttons and hats that aren't present. * Added preliminary SDL Game Controller joystick provider. Reconnection and mixed Game Controller/Joystick devices are unsupported. * Show the input token for the highlighted control on input device menus. -ui: Allow menus to set required space above and below menu when metrics change. Fixes the initial bad layout on the system selecton menu, or bad layout after resizing windows.
* More UI cleanup: Vas Crabb2023-01-058-141/+148
| | | | | | | | | * Got rid of more UI globals. * Cache more metrics in system/software selection menus. * Don't lose a BDF font specified on the command line when changing font size via the UI. * For win32 debugger, behave as though most recent history item was just entered when restoring session state.
* ui: Give menus an opportunity to recompute metrics on window resize. Vas Crabb2023-01-0433-609/+712
| | | | | | | | | | | | | | | Also reworked calculation of menu geometry in general, and limited width of left panel on system/software selection menus. Fixes images in the right panel and icons on the system/software selection menus not being scaled correctly when the window is resized (MT08539 is an example of this). Fixes bad font size selection at low resolutions when using bitmap fonts like uismall.bdf (GitHub #7105). Fixes collapse/expand arrows on left/right panels of system/softwre selection menus getting bigger if the window is made narrower.
* C++ guidelins update and cleanup: Vas Crabb2022-12-222-43/+12
| | | | | | | | | | | | | | | docs: Expanded C++ guidelines following suggestions by P. Mackinlay. ui/inifile.cpp: Got rid of the check for "arcade" systems - it broke managing favourites for the slotted Neo Geo. luaengine.cpp: Removed the "type" property from system driver metadata. It's effectively deprecated. bus/vme/vme_fcisio.cpp, commodore/mps1230.cpp: Fixed inappropriate use of machine type flag constants. megadriv.xml: Made notes about the two Galaxy Force 2 sets more explcit.
* ui: Rationalised right panel behaviour: Vas Crabb2022-12-2110-196/+334
| | | | | | | | | | | | | | Removed the "default" state for the image tab where it would show different things for different types of machine - it just confused users. Remember the selected tab and image in the right panel. State for system selection menu is remembered across sessions. Last used state for software selection menus is remembered across sessions. Within a session, state is remembered separately for recently selected machines, similarly to the way filter selection is remembered. Fixed some focus order issues in the software selection menu.
* Clear BIOS option setting when reloading empty pseudo-driver to prevent ↵ AJR2022-12-191-0/+3
| | | | spurious ROM loading errors for this and other drivers
* osd/modules/file: Don't magically substitute environment variables when ↵ npwoods2022-12-176-90/+113
| | | | | | | | 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.