summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* API cleanups and miscellaneous fixes. Vas Crabb2021-07-152-22/+13
| | | | | | | | | | | | | | | | emu/ioport.cpp: Allow controller files to override input sequences for inputs that don't use defaults, and to override the toggle setting for digital inputs. emu/config.cpp: Expose configuration level (mostly matters for controller files), improved verbose diagnostic messages, and moved a few things out of the global and preprocessor namespaces. docs: Added documentation for some controller configuration file features. The device mapping feature documentation will be merged in at some point. util/unicode.cpp, emu/input.cpp: API cleanups.
* delegate: Fix Visual Studio case with displaced object base (internal ↵ Aaron Giles2021-07-141-3/+3
| | | | representation seems to have drifted since it was originally written).
* video/voodoo.cpp: Major rewrite: (#8267) Aaron Giles2021-07-091-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Changed to use modern poly.h instead of polylgcy.h. * Moved helper classes into separate voodoo namespace. * Derived device classes from video_device_interface. * Split classes so that later versions derive from earlier versions. * Created device maps to be directly included. * Redesigned register mapping to use helper classes and delegates. * Rewrote rasterizers to use C++ templates instead of macros. * Added logic to compute equations for color/texture combine units. * Added special generic identity-texel rasterizer cases. * Removed pipeline stalls on texture and palette changes. * Removed pipeline stalls on most all parameter changes. * Generally re-thought and cleaned up logic throughout. * Parameterized cycle stealing on status reads; updated all existing voodoo consumers to configure it as it was before. -vidoe/poly.h: Various improvements: * Exposed poly_array class for broader use. * Changed poly_array to intelligently determine maximum size. * Added logic to track multiple "last" instances in poly_array. * Extended logic to support up to 16m work items. * Removed MaxPolys parameter from poly_manager template. * Added Flags parameter to poly_manager template. * Added POLY_FLAG_NO_CLIPPING flag to remove clipping code when not needed. * poly_manager now supports a MaxParams value of 0. * Made paramcount a template parameter for render_* functions. * Added reset_after_wait() method to be overridden by derived classes. * Switched to using std:: helpers instead of internal methods. * Removed useless dependency on screen_device. * TRACK_POLY_WAITS now produces more complete statistics. -video/polylgcy.cpp: Removed legacy implementation of polygon renderer. -machine/gt64xxx.cpp: Prevent lockups by disallowing 0-duration timers. -machine/pci.cpp: Added support for adding subdevice maps directly. -emu/video/rgbsse.h: Improved min/max for SSE4.1+ and scale+clamp operations for all. -emu/vidoe/rgbutil.h: Made palette expansion constexpr and added argbexpand function. -osd/osdcore.cpp: Changed osd_ticks to use QueryPerformanceCounter on Windows since the mingw std::chrono::high_resolution_clock is anything but.
* -util: Retire legacy object pool, removing vestigial references. Vas Crabb2021-06-242-743/+0
| | | | | | | Thanks to AJR, Ivan Vangelista and Aaron Giles for helping make this possible. Also fixed debug build of imgtool.
* Added helpers for 64-bit count leading zeroes/ones. Vas Crabb2021-06-131-2/+2
|
* srcclean for release Vas Crabb2021-05-231-2/+2
|
* Avoid name collision on Y2 Olivier Galibert2021-05-021-11/+11
|
* prodos: Start of read support Olivier Galibert2021-05-022-0/+19
|
* util/cdrom.cpp: Disable debug log message when parsing TOC. Vas Crabb2021-04-241-24/+20
| | | | Also some miscellaneous cleanup/consistency.
* Miscellaneous formatting adjustments Vas Crabb2021-03-311-5/+6
|
* util/cdrom.cpp: Return index 1/start of track data instead of index 0/start ↵ 9871238791132021-03-312-22/+51
| | | | | | | | of pregap data in generated TOC. (#7878) * Add a pre-calculated field for data from current logofs to end of track. * Removed pregap adjustment from FM Towns code. * Added pregap adjustment so track ends when audio data ends in PSX CD player. * Fixed pce_cd load error.
* Restore validation for command-line and .ini options (disabled since 0.188) ↵ AJR2021-03-211-11/+17
| | | | and make some errors non-fatal
* corefile.cpp: Make core_filename_extract_base behave more robustly in ↵ AJR2021-03-051-0/+2
| | | | degenerate cases
* srcclean in preparation for branching release Vas Crabb2021-02-211-1/+1
|
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-1411-38/+47
| | | | | | | | | | * 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
* util/palette.cpp: Fix assertion failure in some GCC builds AJR2021-02-101-1/+1
|
* coretmpl.h: Move lru_cache_map to separate header AJR2021-02-032-387/+408
|
* Much more core std::string_view modernization AJR2021-01-2010-131/+154
| | | | | | | | | | | | | | | - Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
* zippath.cpp: Checkpoint #2 AJR2021-01-081-32/+12
| | | | | - Fix unintialized variable issue in zippath_resolve - Eliminate one internal helper function
* util/zippath.cpp: Fix suffix for zip archives. Vas Crabb2021-01-081-1/+1
|
* zippath.cpp: Checkpoint AJR2021-01-062-97/+44
| | | | | - Adopt std::string_view as the input parameter type for most functions. (This necessitates some explicit copying to std::string since other APIs have not been updated yet.) - Remove zippath_parent_basename, whose implementation was utterly broken and fortunately unused.
* options.h: Be more honest about #including prerequisites AJR2021-01-021-0/+7
|
* vbiparse.cpp: Add missing #include AJR2021-01-021-0/+1
|
* disasmintf.h: Attempt at fixing build on other compilers AJR2021-01-021-0/+1
|
* Low-level #include overhaul AJR2021-01-0250-105/+100
| | | | | | | - vecstream.h: Revert changes made in aa29519528cb3dbdbfac56819bea670ed8c56c5d. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h. - strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified. - osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments. - Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
* palette.cpp: Use std::fill instead of memset for dirty vector; add range check AJR2021-01-021-2/+3
|
* Further additions of std::string_view AJR2021-01-015-33/+70
| | | | | | | - corefile.cpp, fileio.cpp: Change puts to take a std::string_view parameter - rendlay.cpp: Use std::string_view instead of bare pointers in various functions - vecstream.h: Add std::string_view conversion operator to obtain output buffer without needing to make it a C string with explicit null termination - xmlfile.cpp: Add get_attribute_string_ptr method that distinguishes between empty strings and absent attributes without falling back to C strings
* hash.cpp, hashing.cpp: Change string processing to use std::string_view ↵ AJR2021-01-014-43/+158
| | | | parameters; add sum16 type
* util/xmlfile.cpp: C++ comment conversion AJR2020-12-311-225/+225
|
* srcclean for 0.227 Vas Crabb2020-12-271-5/+5
|
* util/wavwrite.cpp: Hopefully fix build with clang libc++. Vas Crabb2020-12-271-0/+1
|
* More Lua interface cleanup - it's simpler with cleaner underlyng APIs. Vas Crabb2020-12-273-65/+91
| | | | | | | | | | | Made the sound manager mute controls readable, and got rid of system enable since it just controls system mute anyway. This was causing confusion: phantom2 was trying to use both independentlyt casuing the mute bit to be ignored. THe Lua interface changes are mostly changing methods to properties, some renames to make things clearer, and some additional properties for better control over snapshots.
* util/png: Use std::string_view internally in another function AJR2020-12-221-8/+6
|
* util/png: Update add_text to take std::string_view for arguments AJR2020-12-212-12/+11
|
* Fix some oversights and emergent behaviour with view selection. Vas Crabb2020-12-202-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | Exposed the "native snapview" option on the video manager. Trying to use presence of a single view is a poor proxy that breaks with multi-screen systems. Allow rotation to be changed for native snapshot views, and disable the zoom to screen area control when it has no effect on the selected view. Treat an empty string identically to "auto" for view selectction. Previously this was being used for prefix matching so it would force the first view. (This caused the bad snapshot view selection. It had been relying on "internal" not being a common view name prefix so it fell through to automatic selection, but when changed to an empty string it forced the first view.) Documented "auto" as well as "native" for the -snapview option and changed the default to auto rather than an empty string for consistency with the -viewN options. Added [w]string_view handlers to the stuff that's instantiated in strformat.cpp since we'll be increasingly using them. Cleaned up and updated some documentation.
* More Lua engine clean-up and documentation, resulting in core cleanup. Vas Crabb2020-12-181-61/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More Lua interface cleanup, additional properties and methods, and documentation migration/expansion. Emulated switch inputs can have "not" codes applied to host input axis directions. It works the same way as host switch inputs - push twice for a "not" prefix. Input polling helpers no longer need to store state in the input device items. There’s less leakage, and less chance of things interfering with each other. Allow snapshot view options to be configured through the internal UI via the video options menu. Made video options menus place initial focus on the currently selected view item. Removed some crud from the menu base class. Fixed the description of the "snapview" option. The value to get raw screen pixels was changed to "native" a long time ago but the description was never updated. Re-arranged the Golden Poker button lamps so that the 6-button layouts for Jolli Witch and Wild Witch make sense. In 6-button mode, the hold buttons double as bonus game and bet buttons, but the lamp outputs don't change. The simplest way to deal with this without requiring the user to switch views or using layout scripting is to place the dedicated buttons directly below the hold buttons that correspond to them. Removed some software list data that was redundantly copied into device_image_interface (m_supported was never even set, so it didn't even work), and made crc() work better (previously it wasn't recalculuated after unloading and loading another image). Made strformat.h and devcb.h play nicer with C++17 and pre-standard C++20. Format precision now correctly limits the length of string views. Confirmed that strformat.{h,cpp} works with pre-standard C++20 support in GCC 9. Removed an auto_alloc from cpu/arm7.
* support Redump extended bin/cue format for Dreamcast discs (#7422) nhand422020-12-172-1/+519
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial check-in of Redump bin/cue support for Dreamcast GDI * correctly identifies multi-cue format and sets GDROM flags * creates a working Crazy Taxi chd from a Redump bin/cue * disabled debugging code and started tidying up * simple tool to compare chdman bin/cue and bin/gdi conversions, should be identical * final tidy up, the testing is going well * testing failed for Aero Dancing i (Japan), didnt zero last track * added some comments about .gdi compatibility * addressing review feedback on pull request #7422 * match TOSEC layout for Pattern I discs (3 tracks) * initial support for Pattern III discs * Pattern III discs now work and match TOSEC layout * reading datasize from wrong track, same result though * identify the GDI pattern, makes the code clearer * support for Pattern II and consecutive AUDIO tracks * use C99 type not POSIX type to build on Windows * support Redump tracks split across two .bin files
* unicode.h: Updates AJR2020-12-152-43/+16
| | | | | - Remove from emu.h (except for UTF8_xxx macros, which have been transplanted to emucore.h since a lot of drivers use them) and osdepend.h - Add std::string_view overrides for uchar_from_utf8 and normalize_unicode
* Fix most implicit fallthrough warnings from clang Vas Crabb2020-11-171-1/+1
|