summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/chdman.cpp
Commit message (Collapse)AuthorAgeFilesLines
* -util/cdrom.cpp: Fixed issues with CUE, TOC and GDI parsers. (#12948) 9871238791132024-11-091-0/+45
| | | | | | | * 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.
* util/chd.cpp, util/chdcodec.cpp: Added a safer way to let codecs do special ↵ Vas Crabb2024-10-141-1/+1
| | | | stuff with hunks.
* tools/chdman.cpp: Throw errors when examining metadata to determine ↵ AJR2024-10-121-14/+41
| | | | compression defaults
* chd.cpp: More API changes AJR2024-10-111-3/+3
| | | | | | | | | - 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-3/+8
| | | | | | throwing exceptions. [AJR] Mostly salvaged from 901a68e2e0bb0d9178ffdb59e128718c1495250f.
* tools/chdman.cpp: Added support for extracting cue/bin GD-ROM images and ↵ 9871238791132024-03-311-134/+247
| | | | | | producing one binary file per track. (#12191) * Use --splitbin/-sb option for extractcd to produce one binary file per track. * When producing one binary file per track, the binary file name must contain a %t format conversion for the track number.
* util/cdrom.cpp: Refactored parse_cue and parse_gdicue (should fix GitHub ↵ 9871238791132024-03-071-5/+33
| | | | | | | | | | #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.
* util/ioprocs.cpp: Added wrappers for common patterns. (#11608) Vas Crabb2024-02-251-11/+8
| | | | | emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
* tools/chdman.cpp: Fixed bogus uninitialised local warning. Vas Crabb2024-02-101-1/+1
| | | | | It would never use template_id uninitialised because the same condition applied for assigning it and using it, but compilers are dumb.
* tools/chdman.cpp: Helps to git add everything (fixes variable scoping issue). Vas Crabb2024-02-101-7/+8
|
* tools/chdman.cpp: Fixed numerous issues, including: Vas Crabb2024-02-101-528/+504
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* chdman: Fixed a couple of issues and added preliminary web docs. Vas Crabb2024-02-051-3/+7
| | | | | | | | | | | | | tools/chdman.cpp: Added --hunksize/-hs option for createdvd command and default to 4K hunks (2 sectors, same size as hard disk hunks). Also removed --outputbin/-ob option from extractdvd command - it did nothing as it's CD-specific. docs: Added preliminary chdman documentation. Most common options have at least basic descriptions, supported options are listed for all commands, and supported compression algorithms are described. docs: Cleaned up heading levels in tools section.
* Revert "chd.cpp, chdcodec.cpp: Minor refactoring" Vas Crabb2023-10-271-6/+2
| | | | This reverts commit 901a68e2e0bb0d9178ffdb59e128718c1495250f.
* chd.cpp, chdcodec.cpp: Minor refactoring AJR2023-10-221-2/+6
| | | | | | | | | - 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
* chdman.cpp, imgtool/modules: Use multibyte.h functions AJR2023-09-241-3/+4
|
* aviio.cpp: Massive code cleanup AJR2023-09-171-2/+2
| | | | | | - Use multibyte.h functions and std::swap - Turn most macro constants into enums and move them down into classes - Change comments to C++ style
* chdman: Add extractdvd command Olivier Galibert2023-05-051-0/+93
|
* chd: Add dvd support. better abstraction in general, multi-image support in ↵ Olivier Galibert2023-05-041-0/+94
| | | | arcade-type drivers
* Reduced usage of sprintf. (#10892) Erik2023-02-201-8/+5
|
* Use EQUIVALENT_ARRAY to avoid issues with std::size on member arrays, enable ↵ Vas Crabb2023-02-011-2/+3
| | | | warnings for VLAs in C++.
* osd/tools: msvc fixes Patrick Mackinlay2023-02-011-1/+1
| | | | | * xinput.h depends on windows.h * avoid use of non-standard variable-length arrays
* corefile.h: Move filename utilities to path.h AJR2022-09-251-0/+1
|
* chdman: Fixed TOC session type detection for extractcd. (#10233) 9871238791132022-08-171-3/+36
|
* cdrom.cpp: Clean up code somewhat AJR2022-04-011-1/+1
| | | | | | - Use std::string_view for filename parameters - Use ioprocs rather than core_file - Reduce commenting out of miscellaneous logging
* cdrom_file: classify. Could use more internal work, but it's a step Olivier Galibert2022-04-011-77/+73
|
* chdman.cpp: correct copy-paste comment (nw) (#8936) Logan B2021-12-041-1/+1
|
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-23/+48
| | | | | * 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.
* -ui: Made zoom controls a bit more intuitive. Vas Crabb2021-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.)
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-131/+134
| | | | | | | | | 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.
* chdman: add a few more hard disk templates (#8352) Davide Cavalca2021-07-301-5/+13
|
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-14/+14
| | | | | | | | | | * 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
* -osd/windows: Minimise full-screen windows on losing focus (#2997). Vas Crabb2021-01-211-5/+6
| | | | | | | | -osd/modules/osdwindow.cpp: Clean up window title formatting. * Show data type model in window title. * Moved window title formatting to a single place. -tools/chdman.cpp: Removed some unnecessary .c_str() calls.
* Much more core std::string_view modernization AJR2021-01-201-8/+8
| | | | | | | | | | | | | | | - 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
* Low-level #include overhaul AJR2021-01-021-3/+3
| | | | | | | - 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.
* support Redump extended bin/cue format for Dreamcast discs (#7422) nhand422020-12-171-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Cleaned up bitmap API. Vas Crabb2020-09-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>.
* chdman.cpp: GCC 9.3 is actually the cutoff point for legacy MSVC-style long ↵ Vas Crabb2020-08-231-2/+2
| | | | long format flags.
* looks like I64 size qualifier is only needed for MSYS64 GCC 9 and earlier (nw) Vas Crabb2020-06-021-2/+2
|
* chdman: support characters outside ASCII in command line arguments Vas Crabb2020-05-291-67/+72
|
* split was using sha1.h directly - fix that (nw) Vas Crabb2020-04-131-7/+6
|
* use C++ library includes (nw) firewave2020-01-221-7/+7
|
* chdman.cpp: Attempted fix for naive code (nw) AJR2019-09-061-1/+1
|
* chdman.cpp: Another superfluous temporary removed (nw) AJR2019-09-061-1/+0
|
* chdman: Clean up some archaic string code (nw) AJR2019-09-061-72/+58
|
* (nw) Clean up the mess on master Vas Crabb2019-03-261-1/+1
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-1/+1
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* chdman: fix GDI 2048 extraction MetalliC2019-01-251-1/+1
|
* Fix tools as well (nw) Miodrag Milanovic2017-05-151-1/+1
|
* chdman: Add support for hard disk templates and add some initial ones Dirk Best2017-01-071-1/+76
|
* Misc typo fixes. Jordi Mallach2016-10-271-1/+1
|