summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/chd.cpp
Commit message (Collapse)AuthorAgeFilesLines
* util/chd.cpp, util/chdcodec.cpp: Added a safer way to let codecs do special ↵ Vas Crabb2024-10-141-1/+100
| | | | stuff with hunks.
* util/chd.cpp: Made a few more member functions return error conditions. Vas Crabb2024-10-131-475/+488
| | | | Also mark error paths as unexpected to optimise against them.
* chd.cpp: More API changes AJR2024-10-111-89/+111
| | | | | | | | | - 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-111-28/+51
| | | | | | throwing exceptions. [AJR] Mostly salvaged from 901a68e2e0bb0d9178ffdb59e128718c1495250f.
* util/ioprocs.cpp: Added wrappers for common patterns. (#11608) Vas Crabb2024-02-251-13/+14
| | | | | emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
* util/chd.cpp: Calculate size of buffer needed to store hunk map (fixes ↵ balr0g2024-02-171-8/+19
| | | | #12023). (#12040)
* tools/chdman.cpp: Fixed numerous issues, including: Vas Crabb2024-02-101-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Added Zstandard support for zip archives and CHDs. (#11827) Vas Crabb2023-12-111-7/+7
| | | | | | * 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.
* Revert "chd.cpp, chdcodec.cpp: Minor refactoring" Vas Crabb2023-10-271-120/+53
| | | | This reverts commit 901a68e2e0bb0d9178ffdb59e128718c1495250f.
* Revert "chd.cpp: Refactoring, part 2" Vas Crabb2023-10-271-117/+130
| | | | This reverts commit cc772072fa635146b1df39a5694d2a8f8aa5a34f.
* chd.cpp: Refactoring, part 2 AJR2023-10-231-130/+117
| | | | | | | - Change is_XXX to return std::error_condition instead of bool so that errors can be passed down the line; rename these to check_is_XXX to indicate that they are no longer basic predicates - Change return type of internal function metadata_find to std::error_condition so that errors can be returned rather than thrown * imagedev/cdromimg.cpp: Fix bug where cdrom_file object could be constructed twice in a row for CD-ROMs and once for DVDs
* chd.cpp, chdcodec.cpp: Minor refactoring AJR2023-10-221-53/+120
| | | | | | | | | - Return std::error_condition from set_raw_sha1 and set_parent_sha1 instead of throwing exceptions - Fix a few cases where error codes could be swallowed - Catch exceptions in is_XXX predicates - Add const qualifier to SHA-1 extraction methods - Add noexcept qualifier to a few internal functions - Clean up various comments
* Allow clone CHDs to use parent CHDs as parents. Vas Crabb2023-10-201-22/+60
| | | | | | | | | | | * util/chd.cpp: Allow caller to provide a helper for finding parent CHDs and expose (recursive) missing parent status. * emu/romload.cpp: Search parent systems/devices/software for parent CHDs on encountering a delta CHD. * emu/romload.cpp: Report error on delta CHDs when parent can't be found. * emu/romload.cpp: Check parents for matching CHDs with different names for devices as well as systems and software.
* chd.cpp, chdcodec.cpp, flac.cpp: Use multibyte.h functions AJR2023-09-171-119/+90
| | | | * multibyte.h: Add functions for reading and writing 48-bit values
* chd: Add dvd support. better abstraction in general, multi-image support in ↵ Olivier Galibert2023-05-041-4/+38
| | | | arcade-type drivers
* chd: Optimize error return from read_metadata Olivier Galibert2022-04-041-1/+1
|
* cdrom_file: classify. Could use more internal work, but it's a step Olivier Galibert2022-04-011-1/+1
|
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-14/+5
| | | | | * 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.
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-343/+368
| | | | | | | | | 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.
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-4/+4
| | | | | | | | | | * 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
* -Switch to building MAME as C++17. Vas Crabb2020-11-151-0/+2
| | | | | | | * 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
* fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) Oliver Stöneberg2020-01-301-6/+6
|
* fixed some clang-tidy warnings (nw) (#6236) Oliver Stöneberg2020-01-301-1/+1
| | | | | | | | | | | | | | | | * fixed some modernize-redundant-void-arg clang-tidy warnings (nw) * fixed some modernize-use-bool-literals clang-tidy warnings (nw) * fixed some modernize-use-emplace clang-tidy warnings (nw) * fixed some performance-move-const-arg clang-tidy warnings (nw) * fixed some readability-redundant-control-flow clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw) * fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
* use C++ library includes (nw) firewave2020-01-221-4/+4
|
* imgtool: MT 6693 wip, solves mess_hd issue (nw) Sergey Svishchev2019-06-021-0/+1
|
* Fix off-by-one error (nw) Vas Crabb2017-05-051-1/+1
| | | | | | | | The +1 was previously needed becasue std::string::assign(char *) expects the string to be NUL-terminated. The final NUL is not part of the result. It's not needed when adjusting the length of the string directly. Can people please be careful when refactoring, and alo when reviewing pull requests? This stood out immediately.
* Minor improvement to CHD metadata loading Nathan Woods2017-05-041-6/+2
| | | | Writing into an std::string is now legal with C++11
* fix chd build (nw) Vas Crabb2017-02-021-7/+7
|
* Fix heap corruption when loading a new chd fails. Throw ↵ smf-2016-11-061-3/+4
| | | | CHDERR_FILE_NOT_WRITEABLE rather than CHDERR_UNSUPPORTED_VERSION if you try to open an old version for writing [smf]
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-215/+215
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* dynamic_buffer is just std::vector<UINT8> (nw) Miodrag Milanovic2016-10-211-9/+9
|
* fix after pass through the diff Vas Crabb2016-08-011-3/+3
|
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-7/+7
| | | | to inline functions (nw)
* Moved src/emu/hash.[cpp|h] into src/lib/util, and namespaced that code (and ↵ Nathan Woods2016-07-231-50/+50
| | | | hashing.[cpp|h]) into util::
* chdman: attempt to workaround hang during chd creation MetalliC2016-06-041-1/+4
| | | | TODO: find out its real cause
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-3/+3
|
* Make osd_file a polymorphic class that's held with smart pointers Vas Crabb2016-03-141-8/+8
| | | | | | | | | | | | | | | Make avi_file a class that's held with smart pointers, encapsulate various AVI I/O structures Make zip_file and _7z_file classes rather than having free functions everywhere Hide zip/7z class implementation behind an interface, no longer need to call close() to send back to the cache Don't dump as much crap in global namespace Add solaris PTY implementation Improve variable expansion for SDL OSD - supports ~/$FOO/${BAR} syntax Rearrange stuff so the same things are in file module for all OSDs Move file stuff into its own module 7z/zip open and destruct are still not thread-safe due to lack of interlocks around cache access Directory functions still need to be moved to file module SDL OSD may not initialise WinSock on Windows
* Turn core_file into a proper class that gets cleaned up safely using unique_ptr Vas Crabb2016-03-061-31/+37
| | | | Subverted somewhat by chd_file class
* use std::atomic in chd.cpp/h (nw) Miodrag Milanovic2016-03-011-6/+6
|
* clang-modernize part 5 Miodrag Milanovic2015-12-041-1/+1
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-57/+57
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+3279