summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util
Commit message (Collapse)AuthorAgeFilesLines
* Moved CRC and size calculations into the streamers. Improved validation when ↵ Aaron Giles2021-04-181-1/+1
| | | | parsing.
* 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
|
* Remove some deprecated instantiations of static constexpr members (MSVC ↵ Vas Crabb2020-11-151-6/+2
| | | | complains about them now)
* -Switch to building MAME as C++17. Vas Crabb2020-11-155-255/+258
| | | | | | | * Updated sol2 to 3.2.2 * Updated pugixml to 1.10 * Increased minimum clang version to 6 * Cleaned up some stuff that can use new features
* emu/debug: Removed more macros, added more const, make a couple more things ↵ Vas Crabb2020-10-121-2/+2
| | | | use smart pointers.
* Various improvements to image file handling: Vas Crabb2020-10-085-149/+867
| | | | | | | | | | | | | | | | | | | | | | | | Moved MS DIB parser out of ICO file reader and made it available for artwork and layout images. Added more efficient I/O and better error checking for JPEG file loading (MAME will no longer exit immediately on a bad JPEG file). Made caller responsible for opening files for loading images, to avoid decompressing images used in ZIP/7z artwork multiple times. Added support for JPEG and Windows DIB to picture_image_device. Added support for SVG image files in external artwork. Added support for using I/O port value for animation state and masking animation state values. Made bounds elements more flexible in layouts. Reworked headers to reduce dependencies. Updated layout file format documentation.
* 3rdparty/nanosvg: Re-base on latest upstream. Vas Crabb2020-10-051-1/+5
| | | | | | | Now based on upstream cc6c08d3a80f1a305021af3d6394cdf1535d02a2. Among other things, this version is supposed to be less sensitive to the global locale.
* -emu/rendlay.cpp: Allow item animation. Vas Crabb2020-10-051-5/+4
| | | | -cgang.cpp: Make internal artwork more fun.
* Got rid of global_alloc/global_free. Vas Crabb2020-10-032-38/+8
| | | | | | | | | | | | | | | | | | | | | | | | | The global_alloc/global_free functions have outlived their usefulness. They don't allow consistently overriding the default memory allocation behaviour because they aren't used consistently, and we don't have standard library allocator wrappers for them that we'd need to use them consistently with all the standard library containers we're using. If you need to change the default allocator behaviour, you can override the new/delete operators, and there are ways to get more fine-grained control that way. We're already doing that to pre-fill memory in debug builds. Code was already starting to depend on global_alloc/global_free wrapping new/delete. For example some parts of the code (including the UI and Windows debugger) was putting the result of global_alloc in a std::unique_ptr wrappers without custom deleters, and the SPU sound device was assuming it could use global_free to release memory allocated with operator new. There was also code misunderstanding the behaviour of global_alloc, for example the GROM port cartridge code was checking for nullptr when a failure will actually throw std::bad_alloc. As well as substituting new/delete, I've made several things use smart pointers to reduce the chance of leaks, and fixed a couple of leaks, too.
* Cleaned up bitmap API. Vas Crabb2020-09-277-101/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return const-qualified references/pointers to pixesl, and added non-const versions. This makes bitmap more like standard library containers where const protects the content as well as the dimensions. Made the templated pixt accessor protected - having it public makes it too easy to inadvertently get a pointer to the wrong location. Removed the pix(8|16|32|64) accessors from the specific bitmaps. You could only use the "correct" one anyway, and having the "incorrect" ones available prevented explicit instantiations of the class template because the static assertions would fail. You can still see the pixel type in the bitmap class names, and you can't assign the result of &pix(y, x) to the wrong kind of pointer without a cast. Added fill member functions to the specific bitmap template, and added a explicit instantiations. This allows the bitmap size check to be skipped on most bitmap fills, although the clipping check is still there. Also fixed a couple of places that were trying to fill an indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with zero to get the same net effect). The explicit template instantiations in the .cpp file mean the compiler can inline the function if necessary, but don't need to generate a local out-of-line body if it chooses not to. Extended the size of the fill value parameter in the base bitmap class to 64 bits so it works correctly for 64-bit bitmaps. Fixed places where IE15 and VGM visualiser weren't accounting for row bytes potentially being larger than width. Fixed an off-by-one in an HP-DIO card where it was treating the Topcat cursor right edge as exclusive. Updated everything to work with the API changes, reduced the scope of many variables, added more const, and replaced a few fill/copy loops with stuff from <algorithm>.
* util/bitmap.cpp: Use std::fill_n to get better code for modern CPUs. Vas Crabb2020-09-201-74/+15
|
* xmlfile.cpp: Put newline where it’s supposed to go after element content. Vas Crabb2020-09-061-1/+2
|
* -util/xmlfile: Escape attribute and element content. Vas Crabb2020-09-061-4/+42
| | | | | | | | | | | | | | | | | | | | The previous behaviour was unintuitive - parsing an XML file and writing it out immediately would produce invalid XML if the file contained any characters that needed escaping. It makes far more sense to escape on writing rather than expecting the user to escape input. -Add preliminary support for visibility toggles to artwork system. This allows the user to show/hide related elements in a view, with nesting. The view can specify whether elements are shown or hidden by default. Settings are saved per host window/screen per view. There is no way to set the initial visibility state on the command line. Legacy "Space Invaders cabinet model" layers are mapped onto visibility toggles. This is not stable yet. In particular, the XML element/attribute names have not been finalised. The new features have not been added to complay.py to prevent them from being used before they're finalised.
* Don't ignore config elements with attributes but no child nodes. Vas Crabb2020-09-022-5/+16
|
* frontend: Added option to skip repeated imperfect emulation warnings. Vas Crabb2020-09-022-11/+10
| | | | | | | | | | | | | | | | The option is called skip_warnings, and it must be set in ui.ini (it can be set using the internal UI). Red warnings cannot be skipped; yellow warning can be skipped under certain circumstances. For a yellow warning to be skipped, the system must have been launched in a way that allows warnings to be displayed, in a configuration with the same set of devices flagged with unemulated/imperfect features, within the last seven days, and the warning must have been displayed within the past 14 days. Also fixed a bug with display of the MACHINE_NO_COCKTAIL flag in the internal UI, and increased the size of XML integer attributes to 64 bits.
* recording: fix frame sync regression (nw) hap2020-06-192-4/+4
|
* With permission from Dirk Best, apply 3-clause BSD license to common devices ↵ Vas Crabb2020-04-131-1/+0
| | | | | | and image handling (nw) Note that this does not apply to machine drivers or device implementations for a single machine family (e.g. Amiga chips or VTech expansion bus)
* split was using sha1.h directly - fix that (nw) Vas Crabb2020-04-131-1/+1
|
* util: re-implement SHA-1 and get rid of the two third-party implementations (nw) Vas Crabb2020-04-137-731/+198
|
* Revert "fixed some modernize-use-equals-default clang-tidy warnings (… (#6360) Oliver Stöneberg2020-04-0818-15/+110
| | | | | | | * Revert "fixed some modernize-use-equals-default clang-tidy warnings (nw)" This reverts commit 54486ab9 * fixed merge error
* centralise instantiation of more of the util::strformat engine Vas Crabb2020-04-082-0/+1066
|