summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util
Commit message (Collapse)AuthorAgeFilesLines
* Miscellaneous minor stuff: Vas Crabb2025-03-171-2/+6
| | | | | | | | * scripts/minimaws: Set option strict for JavaScript code. * util/mfpresolve.h: Be explicit about turning nullptr into a pointer to data. * cpu/drcbearm64.cpp: Reduced number of temporary registers used for AND with some operand combinations.
* Cleaned up some stuff: Vas Crabb2025-03-011-19/+13
| | | | | | | | * oberheim/xpander.cpp: Use multi-dimensional output finders algorithms and range-based for loops. * util/chd.cpp: Use a C++17ism to reduce if nesting a bit. * sound/tms5220.cpp: Five an example VERBOSE value that will actually do something rather than LOG_GENERAL which isn't used in the file at all.
* util/chd.cpp: Hacked around GitHub #13029 (issues creating delta CHDs). Vas Crabb2025-02-271-35/+41
| | | | | | | | | | | | The code depends on getting away with trying to read at least one hunk past the end of the parent CHD. Previously it just ignored any errors from reading the parent CHD, but adding error checking broke it. This hack just ignores that specific error. Also cleaned up some gross flow control and made more things const. The code should obviously be fixed properly, but that's non-trivial. This gets it to a state no worse than it was in 0.270.
* cdrom: fixed wrong track number in error messages [Robbbert] hap2025-02-211-14/+24
|
* -cpu/drcbex64.cpp: Fixed handling of address map global mask. Vas Crabb2025-02-062-20/+253
| | | | | | | | * Fixed Final Furlong failing to boot. -util/mfpresolve.cpp, emu/emumem_aspace.cpp: Moved some member function pointer manipulation stuff into the library. Gives another slight reduction in the size of libemu.
* util/corestr.cpp, sound/sdl_sound.cpp: Added missing standard library ↵ Julian Sikorski2025-01-211-0/+1
| | | | headers. (#13249)
* -cpu/drcbex64.cpp: Be nicer to the return address predictor. Vas Crabb2025-01-152-8/+8
| | | | | | -cpu/drcbex86.cpp: Give hints to use short displacements for jumps to local unbound labels. -util/mfpresolve.h: Use references for some things that must not be null pointers.
* util/mfpresolve.h: Fix build with MSVC ABI. Vas Crabb2025-01-141-3/+3
| | | All ABI paths must be valid C++ - can't use a static assertion.
* util/mfpresolve.h: Linux wants <cstddef> for ptrdiff_t. Vas Crabb2025-01-141-1/+2
|
* -util/mfpresolve.cpp: Moved member function resolution code to a common ↵ Vas Crabb2025-01-143-200/+352
| | | | | | | | | | location. * util/delegate.cpp, cpu/drcbex64.cpp, cpu/drcbearm64.cpp: Use common member function resolution code. -cpu/drcbearm64.cpp, cpu/drcbex64.cpp, cpu/drcbex86.cpp: Moved some stuff to anonymous namespaces. -cpu/drcbex64.cpp, cpu/drcbex86.cpp: Defer allocating labels if they aren't always needed.
* util/coretmpl.h: Added constexpr to the bitswap with explicit count. Vas Crabb2025-01-081-1/+1
| | | | This was a hangover from poor implementation of constexpr in older compilers.
* util/cdrom.cpp: Change fprintf(stderr, ...) calls to osd_printf_error AJR2024-11-081-3/+3
|
* -util/cdrom.cpp: Fixed issues with CUE, TOC and GDI parsers. (#12948) 9871238791132024-11-091-429/+506
| | | | | | | * Rewrote GDI parser to be more robust and identify more kinds of invalid input. * Don't ignore the last line in CUE and TOC files if there is no terminating newline. * Use osd_printf_ family functions for output. -tools/chdman.cpp: Added a sink for osd_printf_ family function output.
* machine/t10mmc.cpp: Added stub CD-TEXT TOC read; util/cdrom.cpp: Handle ↵ 9871238791132024-11-091-1/+37
| | | | | | | control flags in TOC files. (#12954) * machine/t10mmc.cpp: Return dummy data for CD-TEXT format TOC read. * machine/t10mmc.cpp: Fixed bug in track transition. * util/cdrom.cpp: Handle track type and serial copy management flags in TOC file input.
* util/chd.cpp, util/chdcodec.cpp: Added a safer way to let codecs do special ↵ Vas Crabb2024-10-144-51/+135
| | | | stuff with hunks.
* util/chd.cpp: Made a few more member functions return error conditions. Vas Crabb2024-10-132-482/+493
| | | | Also mark error paths as unexpected to optimise against them.
* chd.cpp: More API changes AJR2024-10-113-99/+121
| | | | | | | | | - Have metadata_find return std::error_condition instead of throwing an exception - Replace the is_XXX predicates with check_is_XXX methods that return a std::error_condition, enabling improved error reporting for cdrom_image_device - Retain read error information in chd_file_compressor - Make a bunch of methods noexcept This mostly restores the changes from cc772072fa635146b1df39a5694d2a8f8aa5a34f.
* util/chd.cpp, util/chdcodec.cpp: Made some APIs return errors rather than ↵ Vas Crabb2024-10-114-41/+64
| | | | | | throwing exceptions. [AJR] Mostly salvaged from 901a68e2e0bb0d9178ffdb59e128718c1495250f.
* -machine/atastorage.cpp: Log disk geometry at verbose level (rather than ↵ Vas Crabb2024-06-221-2/+3
| | | | | | | | | | debug) so it can be shown in release builds. * Also use logmacro.h for compile-time configurable logging. -util/ioprocs.cpp: Added assertion to write_at equivalent to the one in write. * Checks for invalid results from underlying write call. * Also more const.
* -util/corefile.cpp: Fixed core_file failing to propagate write errors. Vas Crabb2024-06-212-2/+3
| | | | | | | | -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.
* util/ioprocs.cpp: Count zero actual bytes written on a write call as an ↵ arbee2024-06-041-1/+1
| | | | error. Fixes lock-up writing to a write-protected image. [R. Belmont, Peter Ferrie]
* Cleanup: Vas Crabb2024-05-222-74/+86
| | | | | * olympia/dday.cpp: Correctly size the inappropriately named "color RAM". * util/cdrom.cpp, formats/fs_fat.cpp: More const, less copying.
* util/cdrom, machine/t10mmc: Add preliminary support for multisession ↵ 9871238791132024-05-122-146/+347
| | | | | | | | | | | CD-ROMs, indexes, and track flags (#12201) * util/cdrom: Refactoring * util/cdrom: Read all indexes from cue files * util/cdrom: Read in track flags from cues * util/cdrom: Multisession support for cues * machine/t10mmc: Playback from current head, other misc cleanup * machine/t10mmc: Implement T10MMC_CMD_MECHANISM_STATUS * machine/t10mmc: Implement TOC_FORMAT_FULL_TOC, TOC_FORMAT_SESSIONS, and return proper indexes for T10MMC_CMD_READ_SUB_CHANNEL
* emu/http.cpp, util/server_http_impl.hpp: Added override qualifiers for ↵ Vas Crabb2024-04-231-4/+4
| | | | overridden virtual member functions.
* Fixed a few class memory access warnings. Vas Crabb2024-04-141-3/+5
|
* util/cdrom.cpp: Zero entire output TOC structure in ↵ MetalSlug2024-04-091-1/+2
| | | | | cdrom_file::parse_metadata. (#12219) Fixes issues with fields that are not explicitly assigned in all situation.
* util/unzip.cpp: Work around spurious maybe uninitialised warning with ↵ Vas Crabb2024-03-251-1/+1
| | | | certain GCC versions.
* imagedev/cassette.cpp, formats/flacfile.cpp: Added support for saving ↵ wilbertpol2024-03-222-0/+38
| | | | | cassette images in FLAC format. (#12115) util/flac.cpp: Implemented seek/tell callbacks for FLAC library.
* util/cdrom.cpp: Refactored parse_cue and parse_gdicue (should fix GitHub ↵ 9871238791132024-03-072-468/+158
| | | | | | | | | | #12081). (#12087) This should greatly improve data integrity when creating and extracting GD-ROM images. * util/cdrom.cpp: Refactored parse_cue to handle GD-ROMs. * util/cdrom.cpp: Don't discard any data from GD-ROM cue/bin input including pre-gap data. * tools/chdman.cpp: Fixed splitframes handling. * tools/chdman.cpp: Added warning when extracting GD-ROM CHDs to cue/bin format.
* coreutil.h: Eliminate core_crc32 wrapper function in favor of ↵ AJR2024-02-262-19/+0
| | | | util::crc32_creator
* Merge branch 'release0263' into HEAD Vas Crabb2024-02-261-1/+9
|\
| * util/bitstream.h: Adjust m_doffset based on m_dbitoffs when flushing. (#12060) 9871238791132024-02-251-1/+9
| | | | | | Fixes issues exposed when reading LaserDisc CHDs.
* | util/ioprocs.cpp: Added wrappers for common patterns. (#11608) Vas Crabb2024-02-2521-312/+516
|/ | | | | emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
* util/bitstream.cpp: Fixed cases where bits would be dropped when reading and ↵ 9871238791132024-02-241-13/+45
| | | | | | writing. (#12057) * In some cases, bits would be dropped when writing if there wasn't enough space in the buffer. * Fixes bad hunk maps being written to CHD files and incorrect hunk map data being read.
* Revert "util/bitstream.cpp: Fixed cases where bits would be dropped when ↵ Vas Crabb2024-02-241-45/+13
| | | | | | | | | reading and writing. (#12057)" This reverts commit 69c3cd7daba9e8dd130af167c27ecd8b4131074f. This causes CHD SHA1 digests to change. Either it's buggy, or CHD SHA1 digests depend on the representation rather than the data itself.
* util/bitstream.cpp: Fixed cases where bits would be dropped when reading and ↵ 9871238791132024-02-241-13/+45
| | | | | | writing. (#12057) * In some cases, bits would be dropped when writing if there wasn't enough space in the buffer. * Fixes bad hunk maps being written to CHD files and incorrect hunk map data being read.
* util/chd.cpp: Calculate size of buffer needed to store hunk map (fixes ↵ balr0g2024-02-171-8/+19
| | | | #12023). (#12040)
* imagedev/floppy.cpp: Delete unused getter that leaked details AJR2024-02-111-1/+1
| | | | * util/options.h: Use forwarding header
* tools/chdman.cpp: Fixed numerous issues, including: Vas Crabb2024-02-102-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | Support input start/size options for createdvd. Fixed not reporting an error on unrecognised command line options. Fixed --fix/-f option for verify command not working. Report an error when conflicting options are supplied (e.g. hard disk template and C/H/S geometry, or input start offset in both bytes and hunks). Previously the results would be unpredictable. Detect more invalid combinations of options, and detect when output unit size or hunk size doesn't match parent. Changed order of processing options for createhd so using a template cannot not inadvertently result in an invalid combination of sector size and hunk size. Don't require an explicit unit size for createraw if an output parent CHD file is supplied. Fixed an object leak in createcd.
* util/cdrom.cpp: Removed unreachable additional handler for MODE2/2336 ↵ stonedDiscord2024-02-061-5/+0
| | | | tracks. (#12012)
* Miscellaneous cleanups: Vas Crabb2024-02-032-6/+6
| | | | | | | | | | | | | | | | konami/hexion.cpp: Fixed a potential heap smash, and don't mark tiles dirty unnecessarily. konami/spy.cpp: Fixed video enable never being set to false, added an object finder for ROM bank (reduce tag lookups). tvgames/xavix.cpp: It's stylised "Hi-kara" (no capital K), software list already uses this capitalisation. rm/rm380z*: Added object finder for character generator ROM, slightly cleaned up some code. homelab/homelab.cpp: Avoid some literal sizes.
* util/cdrom.h: Fixed size of track info array. Vas Crabb2024-01-262-27/+2
| | | | | Also made it possible to enable VERBOSE in cdrom.cpp without link errors.
* imagedev/cdromimg.cpp: Fixed object lifecycles when loading from softlist or ↵ Vas Crabb2024-01-261-1/+1
| | | | | | | ROM region. * Reverted workaround 4c0957d7f0ba6a72e7267270db07ee06fe717109. * Cleaned up a few things.
* lib/util/cdrom.h: fix out-of-bounds MAME init crash when disc is 99 tracks angelosa2024-01-251-1/+1
| | | | * cfr. pcecd:cosmfnt and pcecd:solbianc
* util/cdrom.cpp: Don't strip pregaps from Redump GD-ROM files (#11913) Maxime Gauduin2024-01-061-44/+1
|
* lib/util/flac.cpp: Add support for flac data where bits_per_sample != 16. ↵ wilbertpol2023-12-302-9/+62
| | | | (#11848)
* ui: remove use of utf8.h hap2023-12-221-5/+0
|
* misc: remove some use of utf8.h in input defs hap2023-12-221-29/+0
|
* formats/flacfile.cpp: Added support for compact cassette images in FLAC ↵ wilbertpol2023-12-171-0/+6
| | | | format. (#11841)
* Added Zstandard support for zip archives and CHDs. (#11827) Vas Crabb2023-12-114-10/+269
| | | | | | * 3rdparty/zstd: Added Zstandard compression library version 1.5.5. * util/unzip.cpp: Added support for Zstandard compression (method 93). * util/chdcodec.cpp: Added support for Zstandard compression. * 3rdparty/flac: Always define NDEBUG to avoid log spam.