summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util
Commit message (Collapse)AuthorAgeFilesLines
* flac.cpp: Add some missing standard headers AJR2022-02-061-1/+3
|
* Treat WinImage compressed disk images (*.imz) as ZIP archives. [Justin Kerk] Justin Kerk2022-02-051-1/+1
|
* -Significant updates to the CD-i driver [Ryan Holtz] (#9102) MooglyGuy2022-01-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | -mcd212: Assorted changes. [Ryan Holtz] * Replaced verboselog with logmacro. * Corrected end-of-line region control handling, fixing garbage in The Apprentice. * Fixed screen bitmap handling to be more in line with MAME standards. * Simplified region-control handling. * Removed historical reliance on debug machine switches. * Converted to use a map() function rather than an internal switch. * Converted to use dipalette and rgb_t internally instead of separate CLUT arrays. * Optimized by replacing rgb_t usage with uint32_t values. * Optimized by calculating plane transparency on the fly. * Templatized mix_lines to reduce inner-loop branching. * Fixed a clamping issue with pre-calculated DYUV limits. * Reduce effective color depth back to 6:6:6 to match hardware. -cdrom: Allow recognizing CDI/2352 in cuesheets. [Ryan Holtz] -cdic: Various audio-related changes. [Ryan Holtz] * Attempt to descramble sectors that don't initially appear sensible. * Added support for playing CDDA sectors. * Fixed faulty logic in TOC processing.
* Actually commit the source changes for ASIO 1.20.0 update. Vas Crabb2021-11-151-5/+5
| | | | | Also changed the fix to ASIO itself to match the upstream change in commit cd68912b7eb07f24e501e8cbff832b61ec292eea.
* -frontend: Refactored menu event handling and fixed a number of issues. (#8777) Vas Crabb2021-10-312-0/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Moved common code for drawing about box, info viewer, and other text box menus to a base class; removed the last of the info viewer logic and the multi-line item hack from the base menu class. * Added previous/next group navigation for general inputs and plugin input selection menus. * Moved message catalog logic to lib/util, allowing osd and emu to use localised messages. * Made the base menu class use the UI manager’s feature for holding session state rather than a static map and mutex. * Improved menu event handling model, and fixed many issues, particularly with menus behaving badly when hidden/shown. * Added better support for menus that don’t participate in the usual menu stack, like the menuless sliders and the save/load state menus. * Made a number of menus refresh state when being shown after being hidden (fixes MT08121 among other issues). * Fixed indication of mounted slot option in the slot option details menu. * Improved appearance of background menus when emulation isn't running - draw all menus in the stack, and darken the background menus to make the edges of the active menu clearer. * Fixed locale issues in -listxml. -debugger: Made GUI debuggers more uniform. * Added new memory view features to Win32 debugger. * Fixed spelling of hexadecimal in Cocoa debugger and added decimal address option. * Fixed duplicate keyboard shortcut in Cocoa debugger (Shift-Cmd-D was both new device window and 64-bit float format). * Made keyboard shortcuts slightly more consistent across debuggers. -plugins: Moved input selection menu and sequence polling code to a common library. Fixed the issue that prevented keyboard inputs being mapped with -steadykey on. -docs: Started adding some documentation for MAME's internal UI, and updated the list of example front-ends. -Regenerated message catalog sources. For translators, the new strings are mostly: * The names of the inputs provided by the OS-dependent layer for things like fullscreen and video features. These show up in the user interface inputs menu. * The names for automatically generated views. These show up in the video options menu - test with a system with a lot of screens to see more variants. * The input macro plugin UI. * A few format strings for analog input assignments. * A few strings for the about box header.
* unicode.cpp: Fix build on non-WIN32 systems AJR2021-10-081-1/+1
|
* util/unicode.cpp: string_view treatment for the last two holdouts. Vas Crabb2021-10-092-6/+6
|
* Overdue internal UI enhancements (#8674) Vas Crabb2021-10-091-1/+0
| | | | | | | | | | | | | | | | * frontend: Added support for message context to localisations. * frontend: Added string_view versions of the message lookup functions. * frontend: Added a few more folder options to the internal UI. * emu/softlist.cpp: Use more appropriate containers. * Switched to Python 3 by default - this will become a requirement. * Updated msgfmt.py for message context support. * frontend: Show all software item info in the internal UI. * frontend: Search alternate titles in software selection menu. * 3rdparty/utf8proc: Updated to v2.6.1 (has several fixes). * frontend: Added software filters for common info fields. * frontend: Allow UI manager to hold onto persistent session data. * frontend: Cache software lists for eight machines. * frontend: Added support for loading localised system names. * frontend: Add UI for selecting localised system names.
* ioprocsfilter.h: Add missing #include AJR2021-10-061-0/+1
|
* util/zippath.cpp: Fixed two issues affecting Windows: Vas Crabb2021-10-061-6/+9
| | | | | * Browsing from a location inside an archive causes MAME to hang. * Files inside archives are not listed.
* util/zippath.cpp: Made behaviour of trying to open things inside archives a ↵ Vas Crabb2021-10-061-12/+24
| | | | bit more consistent, fixed another bug with root paths.
* More low-effort cleanup. Vas Crabb2021-10-051-15/+1
| | | | | | | | * Got more slot card classes out of headers. * Changed most of the Apple II cards still looking up ROM regions manually to use required_region_ptr. * Removed an unreferenced function leftover from copy-pasting another device from the Videx Uniprint device.
* util: Further API cleanups: (#8661) Vas Crabb2021-10-0525-934/+2385
| | | | | * Turned `core_file` into an implementation of `random_read_write`. * Turned PNG errors into a standard error category. * Added a helper for generating what look like derived classes on-the-fly.
* bus/rs232: Added a configurable patch box device, and various cleanups. Vas Crabb2021-10-031-1/+1
| | | | | | | | | | Added comments with V.24 interchange circuit numbers and names to rs232.h to make the meanings of the abbreviated signal names clearer. Moved a few slot card classes out of headers and into anonymous namespaces to reduce compile depedencies and exported symbols. Transliterated a Korean NES game title.
* -ui: Work around GitHub issue #8634. Vas Crabb2021-10-011-0/+9
| | | | -util/delegate.cpp: Detect clang x86-64 thunk for first vtable entry.
* -minimaws: Changed geometry of disclosure triangles. Vas Crabb2021-09-291-1/+1
| | | | -util/delegate.cpp: Fixed typo in comment.
* util/delegate.cpp: Notes from experiments with clang. Vas Crabb2021-09-271-25/+104
|
* util/delegate.h: Use "compatible" delegates for MinGW GCC i686. Vas Crabb2021-09-241-3/+4
| | | | | | | | | | | | The Itanium delegate has questionable value on on MinGW i686 as it injects a conditional branch in the hot path for delegates anyway to deal with the different __thiscall convention. It's somehow breaking and causing memory corruption in full builds, but I don't have the time to work out exactly which delegate type is the problematic one, especially not with a release coming soon. This will probably cause 32-bit MinGW builds to become substantially larger.
* util/delegate.cpp: PowerPC-64 Little Endian drops function descriptors. Vas Crabb2021-09-241-1/+3
| | | | | | At some point I'll make a proper header ABI detection. There's too much stuff to keep in the delegate sources, and it will be useful for other stuff like recompilers.
* -minimaws: Made table sort widgets (and the code behind them) less ugly. Vas Crabb2021-09-231-0/+11
| | | | -util/delegate.cpp: Added a couple of comments about assumptions.
* util/delegate.cpp: Recognise a couple more MSVC thunks. Vas Crabb2021-09-221-6/+29
| | | | | | | | The MSVC C++ ABI doesn't reserve the first vtable entry for classes without a virtual destructor, so the instruction to load the virtual member function address may not need an immediate displacement. Also recognise virtual member function call thunks for AArch64.
* util/delegate.h: Make comparison operators more technically correct. Vas Crabb2021-09-221-3/+32
| | | | | | | | | | | | For Itanium ABI, two null member function pointers should compare equal even if the undefined bits differ. For MSVC ABI, there's all sorts of complexity around what happens when you compare pointers to member functions for different inheritance types. You'll still occasionally get weird results comparing pointers to members of different classes.
* cpu/drcbex64.cpp: Proof-of-concept for optimisation of calling out. Vas Crabb2021-09-222-6/+43
| | | | | | | | | | | | | | | | Resolve address space virtual member function addresses on constrcution and call them directly. Provides a small but measurable improvement to performance in drivers that use the recompiler and access the memory system a lot. Also made MSVC delegates capable of walking past all the thunks MSVC puts in the way of actually calling a member function. I'm not accounting for the "this" pointer being passed in RDX when the return value is an oversize scalar. This is harmless because it won't see anything that looks like a virtual call thunk using RCX when RCX points to uninitialised space for the return value. It just means virtual member function calls won't be bypassed if the return value is an oversize scalar, but that doesn't happen frequently anyway.
* -delegates: Fixed structure return with MSVC C++ ABI. Vas Crabb2021-09-211-26/+101
| | | | | | | | | | | | * Automatically use delegate_mfp_compatible to generate an adaptor for member functions that return non-scalar, non-reference types (partially addresses #8597). * Enabled the MSVC delegate implemenation for MSVC on AArch64. * Switched back to neater delegate types for layout item bounds and colour. -docs: Updated the example layout links to point to 0.235 - this means there's now an example of embedded SVG.
* Fix compile on GCC x64 Linux [R. Belmont] arbee2021-09-191-1/+1
|
* util/delegate.cpp: Fixed calculation of this pointer when casting member ↵ Vas Crabb2021-09-201-1/+2
| | | | function pointers across virtual inheritance relationships using MSVC with /vmg.
* util/delegate.h: Try to catch issues earlier, and some cleanup. Vas Crabb2021-09-202-136/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimised generation of late bind helper functions. The late bind helper function doesn't depend on the delegate signature - only on the late bind base class and function target class. Having it inside the delegate base class means it needs to be instantiated for every combination of late bind base class, function target class and delegate signature. In a typical driver file, there is only one late bind base class (delegate_late_bind), and there will be delegates with multiple signatures bound to function members of the same class (e.g. read and write handlers, possibly of different widths, bound to members of the driver state class). By moving the late bind helper out of the delegate base class, the number of required instantiations can be reduced. By moving the body out of the enclosing class declaration, the compiler can be encouraged to coalese instantiations across translation units. While this won't give a further reduction in compile time, it should at least reduce the output binary size by reducing duplication for devices that frequently have handlers installed in memory maps. Added an additional template parameter to delegates allowing the late bind base class to be changed if desired. Moved the MSVC implementation "this" pointer optimisation out-of-line and added logging. Also cleaned up the Itanium "this" pointer adjustment and code pointer resolution implementation to reduce duplication and conditional compilation. Made binding_type_exception give a more meaningful what() message than "std::exception". Added extensive validity tests for delegate functionality. Pointers to member functions are tested, including multiple inheritance, virtual and non-virtual member functions, and checking for generational loss across copying/assigning delegates. This should properly exercise "this" pointer adjustment for the Itanium and MSVC implementations, and vtable lookup for the Itanium implementation. So-called late binding functionality is tested, including exceptions on failure. Functoids are tested, although given the encapsulation it's not possible to check that an apator isn't generated when it shouldn't be.
* util/delegate.cpp: Fixed multiple issues. Vas Crabb2021-09-192-130/+277
| | | | | | | | | | | | | | | | | | | * Fixed this pointer displacement being reapplied after delegates are copied - caused issues with classes with multiple inheritance. * Made null member function pointer test conformant with Itanium C++ ABI specification. * Corrected size of this pointer displacement - fixes issues on big Endian targets. * Fixed function addresses for virtual member functions on targets that use function descriptors (e.g. PPC64). * Applied shift to this pointer displacement for targets that use the ARM variant of the Itanium ABI. * Fixed this pointer displacement not being applied for virtual member functions on targets using ARM variant of the Itanium ABI. * Fixed this pointer displacement being incorrectly applied to vptr on targets using ARM variant of the Itanium ABI. * Made less code conditionally compiled to make it easier to catch errors.
* harddisk.cpp: Allow specifying the desired block size for loose files / ↵ arbee2021-09-182-7/+47
| | | | verifying a CHD's block size. [R. Belmont]
* util/strformat.h: Detect C++ standard > C++17 before doing weird stuff. Vas Crabb2021-09-182-11/+16
|
* util/strformat.h, util/delegate.h: More cleanup and future-proofing. Vas Crabb2021-09-183-150/+136
| | | | | | | | | | | * util/strformat.h: Found a SFINAE trick to detect absence of stream-out operators. Fixes building with C++20 standard library (#6275). * util/delegate.h: Fixed a commend and removed an unused declaration from MSVC member function pointer wrapper. * util/delegate.h: Added support for discarding functoid return values for delegates returning void. * util/delegate.h: Added support for using std::ref to bind non-copyable functoids.
* plaparse: Fix regression caused by parser eating '#' comment characters AJR2021-09-161-6/+4
|
* Fix build on systems where size_t is not the same as uint64_t AJR2021-09-152-6/+6
|
* Convert JED, PLA and JEDBIN parsers to (mostly) use ioprocs instead of raw ↵ AJR2021-09-154-167/+201
| | | | memory interfaces
* Fixed some delegate use issues. Vas Crabb2021-09-161-2/+7
|
* -util/delegate.cpp: One less level of indirection for functoid delegates. Vas Crabb2021-09-162-34/+137
| | | | | | | | | | * If a delegate is set to a functoid (e.g. a lambda) with a signature that is an exact match for the delegate's signature, it will be bound directly. If arguments or the return value need conversion, a static adaptor will be generated. This removes unnecessary indirection through std::function::operator(). -Added a few more documentation comments.
* Formats-related refactoring AJR2021-09-111-0/+4
| | | | | | - Remove opresolv.h from emu.h and some other base headers - Split legacy floppy image class into a separate file - Clean up a lot of #includes in src/lib and src/tools/imgtool
* gamedrv.h, ioprocs.h: Fix typos in comments AJR2021-09-111-2/+2
|
* rectangles: Add operators & and | (intersection and union) from the Olivier Galibert2021-09-111-0/+14
| | | | existing &= and |= ones.
* Filesystem-related bug fixes AJR2021-09-081-1/+1
| | | | | - Fix recently-introduced path-trashing bug in zippath_resolve - Prevent UI file select menu from crashing in error cases where no files can be found
* util/coretmpl.h: Fixed clang narrowing warning. Vas Crabb2021-09-061-1/+1
|
* -ui: Made zoom controls a bit more intuitive. Vas Crabb2021-09-067-42/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The UI controls are described as zoom in/out, but they had the opposite effect on the palette and tile viewers. That has been changed to make them consistent with the tilemap viewer. * Made the default zoom key not act as a toggle. People are familiar with the function of Ctrl+0/=/- in web browsers, so making them behave similarly in MAME should make it more approachable. Also added the default zoom key to the relevant documentation page. * Implemented the default zoom key for the palette and tile viewers. * In the tilemap viewer, if the view is in default expand to fit mode, zoom in/out starting from the actual zoom ratio. Once again, this behaves more like the zoom controls in a web browser displaying an image so it should be more intuitive. * Made more messages from the tilemap viewer localisable. -util/zippath.cpp: Fixed MT08074. * There were multiple issues at play here. After #8443 was applied, is_root was simply never returning true on Windows, as OSD_WINDOWS isn't actually defined outside libosd and libocore. This caused phantom parent items to appear in disk roots on Windows, but it meant that the check in zippath_resolve would always fail so the trailing backslash would be trimmed. Fixing the macro test in is_root meant the trailing backslash from C:\ would no longer be trimmed, which caused the stat in zippath_resolve to fail. -bigbord2.cpp: Hooked up floppy DRQ that had somehow got lost. -Reduced tag map lookups in several drivers and devices. -util/coretmpl.h: Removed an overload of bitswap that can be avoided using if constexpr. -Added doxygen comments to some classes, and fixed several doxygen warnings. -util, osd: Test for _WIN32 rather than WIN32. * In C++17 mode, WIN32 is no longer a predefined macro, although various things in 3rdparty define it to maintain legacy support. We're better off moving forward anyway for when WIN32 disappears entirely. (WIN32 is not a reserved name, while _WIN32 is, starting with an underscore follwed by an uppercase letter.)
* endianness.h: Use namespace std::literals AJR2021-08-311-1/+1
|
* Move endianness type into lib/util header AJR2021-08-311-0/+76
|
* Miscellaneous clean-up. Vas Crabb2021-08-292-22/+24
| | | | | | | | | * play_1.cpp: Use output finders. * s3.cpp, s4.cpp, s6.cpp, s6a.cpp: Use output finders, reduced tag lookups. * taito_z.cpp: Use output finders, split up state class a little. * util/unzip.cpp: Use std::optional to make code clearer. * util/ioprocsfilter.cpp: Work around MSVC DevCom-1516410.
* Merge tag 'mame0235' into mainline-master Vas Crabb2021-08-271-1/+4
|\ | | | | | | MAME 0.235
| * util/zippath.cpp: OSD_WINDOWS isn't a safe way to detect Windows target, and ↵ Vas Crabb2021-08-261-1/+4
| | | | | | | | OSD_* macros must not be used outside libocore/libosd.
* | formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-2231-2081/+4550
|/ | | | | | | | | Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
* Use std::clamp in more source files AJR2021-08-151-7/+4
|
* sdl ui: fix choosing the root path (#8443) tim lindner2021-08-141-7/+13
|