summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/imgtool/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-0/+2
| | | | | | | | | 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.
* tools/imgtool: Removed legacy object pool usage. (#8215) Aaron Giles2021-06-241-3/+3
|
* 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
* Much more core std::string_view modernization AJR2021-01-201-2/+2
| | | | | | | | | | | | | | | - 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-2/+2
| | | | | | | - 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.
* Fixing an Imgtool build issue with LLVM on MSVC npwoods2020-09-101-2/+2
|
* use C++ library includes (nw) firewave2020-01-221-5/+5
|
* Add BASIC Thomson tokenizer (#5479) hadess2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [Imgtool] Add write support for Thomson BASIC * [Imgtool] Fix passing --filter= to imgtool get command This command should work: imgtool get thom_fd inondation-d-additions.fd INONDATI.BAS TEST.BAS --filter=thombas7 as it matches the expected syntax: Usage: imgtool get <format> <imagename> <filename> [newname] [--filter=filter] [--fork=fork] but does not because imgtool fewer "maxargs". Increase the maximum number of arguments by 2 to cater for --filter and --fork being passed. * [Imgtool] Fix handling multiple tokens in BASIC tokenizer The line: 10 LIMIT$=STR$(LIMIT(N)) was not getting tokenised properly because the loop looking for tokens wasn't exited and consumed consecutive tokens. So $ was getting detected, token_shift and token_value were set, the cursor position got incremented, then = got detected on the next iteration of the loop. We should instead exit the loop, and write what we already have. Closes: #5478
* (nw) Clean up the mess on master Vas Crabb2019-03-261-0/+2
| | | | | | | | | | | | | 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-2/+0
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* imgtool: new read-only filesystem: DEC RT-11 (take 2) Sergey Svishchev2019-02-201-0/+2
|
* imgtool: fix parsing options with enum values Fabrice Bellet2018-07-221-1/+17
| | | | | | | When parsing an enumerated option, we should use the parameter of the enumerated value, as an integer, instead of the raw identifier as a string. The behaviour probably changed around commit b60879e595, but modules still expect the old behaviour.
* Created a more flexible imgtool::datetime structure for use within Imgtool ↵ npwoods2017-10-171-3/+5
| | | | | | | | | | | | | | (#2263) * Created a more flexible imgtool::datetime structure for use within Imgtool This is intended to replace most usage of time_t * Changing the granularity of imgtool_clock from 1ms to 100ns, as per Vas' suggestion * Created arbitrary_datetime in timeconv.h to facilitate interpretation of datetime info I concluded that invoking std::mktime on manually assembled std::tm is bad, because it is indeterminate how the std::tm members may be "dominant". This required that I go further in imgtool, and update a number of drivers and eliminate the parameter of imgtool::datetime that takes std::tm.
* Support for HP85 tapes added to imgtool (#2688) fulivi2017-10-031-1/+1
|
* Attempted to sanitize/rationalize how we access UTF-8 command line arguments ↵ npwoods2017-09-181-0/+6
| | | | | | | | | | | (#2532) Specifically, this creates a call osd_get_command_line() that returns UTF-8 command line arguments as std::vector<std::string>. On non-Windows platforms, this does nothing more than build the vector. On Windows, this invokes GetCommandLineW() and CommandLineToArgvW(). This also attempts to unwind usage of wmain()/_tmain() on Windows, which is not standard. Related to this, this fixes a bug in Imgtool; specifically, non-7 bit ASCII was not being handled correctly in Windows. This is really an admission that the way that Windows handles Unicode and command line arguments sucks, and it is my belief that having a wmain() or _tmain() declaration specific for Windows is a worse solution. C'est la vie. I'm very open to the idea that src/osd/osdcore.[cpp|h] is not the best place to do this. Let me know if I should move it.
* [Imgtool] Fix to MT#6576 (#2275) npwoods2017-05-041-2/+2
| | | | | | | | * [Imgtool] Fixed issue with 'listfilters' command * [Imgtool] Extremely basic fix to the Imgtool <==> CHD HD bridge This really needs _much_ more work
* [Imgtool] Fixed recently introduced bug in the code that emits usage text Nathan Woods2017-01-231-1/+1
|
* [Imgtool] Fixed recently introduce bug on attribute listings Nathan Woods2017-01-151-1/+1
|
* Missed these, which needed wstring_from_utf8() Nathan Woods2017-01-041-5/+5
|
* Fixed incorrect util::string_format() ==> util::stream_format() Nathan Woods2017-01-041-1/+1
|
* Vas Crabb feedback: Nathan Woods2017-01-041-62/+60
| | | | | | | | 1. Changed the Win32 code to use _O_U8TEXT() 2. Reordered system #includes 3. Changed a number of 'std::wcout << ...' to use util::stream_format() I'm getting massive code compilation issues, and it isn't clear to me what the problem is. I'm committing my WIP right now, with the intention of reviewing the specifics soon.
* [Imgtool] Changed to use wcout/wcerr in order to support Unicode console output Nathan Woods2017-01-021-61/+77
| | | | I really don't like the prevalence of '#ifdef WIN32' in this change, both the _setmode() and bypassing codecvt. I strongly suspect that the latter is the consequence of some mistake that in practice doesn't cause problems in MSVC. I welcome all eyes.
* Merge pull request #1830 from npwoods/imgtool_dir_formatting_fix R. Belmont2016-12-131-8/+21
|\ | | | | [Imgtool] Cleaned up the output of the 'dir' command
| * [Imgtool] Cleaned up the output of the 'dir' command Nathan Woods2016-12-121-8/+21
| |
* | [Imgtool] Fixed a recently introduced error in the 'dir' command line command Nathan Woods2016-12-121-3/+3
|/
* Merge pull request #1543 from npwoods/imgtool_stream_open_smartpointer Vas Crabb2016-10-241-6/+2
|\ | | | | | | [Imgtool] Changed imgtool::stream::open*() to return imgtool::stream::ptr
| * [Imgtool] Changed imgtool::stream::open*() to return imgtool::stream::ptr Nathan Woods2016-10-221-6/+2
| | | | | | | | Updated quite a bit of client code that manually owned these pointers
* | srcclean (nw) Vas Crabb2016-10-231-1/+1
| |
* | TRUE/FALSE in tools section (nw) Miodrag Milanovic2016-10-221-1/+1
|/
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-6/+6
| | | | | 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-1/+1
|
* [Imgtool] Changed imgtool::image::info() to use std::stream and ↵ Nathan Woods2016-10-171-3/+4
| | | | std::stringstream
* [Imgtool] More C++-ification (imgtool_stream ==> imgtool::stream) Nathan Woods2016-10-121-9/+9
| | | | Still a bit of work to do, most notably around adoption of std::unique_ptr<>, which may be a challenge here on account of some assumptions regarding lifetime of streams by modules.
* [Imgtool] C++-ified a few more classes Nathan Woods2016-10-091-53/+35
| | | | | imgtool_partition ==> imgtool::partition imgtool_directory ==> imgtool::directory
* Made imgtool_image (now imgtool::image) a "real" C++ class Nathan Woods2016-09-271-47/+33
|
* srcclean (nw) Vas Crabb2016-09-261-1/+1
|
* Merge pull request #1444 from npwoods/imgtool_readsector_uses_stdvector Vas Crabb2016-09-261-11/+4
|\ | | | | Imgtool: Changed the read_sector apparatus to use std::vector
| * Imgtool: Changed the read_sector apparatus to use std::vector Nathan Woods2016-09-241-11/+4
| | | | | | | | | | | | | | | | This also eliminated the need for get_sector_size The asute reviewer will note that a side effect of this change is that in scenarios where we once returned IMGTOOLERR_OUTOFMEMORY, we now throw std::bad_alloc. This is deliberate. Having an error code for out of memory conditions no longer makes sense with MAME's embrace of the C++ way of doing things. It is highly likely that I will follow up this change with one that eliminates IMGTOOLERR_OUTOFMEMORY in favor of throwing std::bad_alloc. This commit also fixes a recent regression in which we passed nullptr to an std::string ctor
* | Retired imgtool_basename(), in favor of core_filename_extract_base() Nathan Woods2016-09-241-4/+6
|/
* Merge pull request #1398 from fulivi/hp9845_tools R. Belmont2016-09-161-1/+1
|\ | | | | Imgtool now supports HP9845B tape image
| * imgtool, hp9845_tape format: write&del done, brief info added at the fulivi2016-09-131-1/+1
| | | | | | | | start of file.
* | Imgtool: Changed the Imgtool module list to be std::list Nathan Woods2016-09-101-6/+2
|/
* Incorporating Vas Crabb feedback Nathan Woods2016-09-011-4/+3
|
* option_guide C++-ification, touched up imgtool Nathan Woods2016-08-271-63/+47
| | | | | | The main point of this change is to C++-ify option_guide. It was changed from a struct array to a class, namespaced etc, with the ultimate hope of incorporating an in-emulation image creation UI. Imgtool got hit with a number of changes; I'll probably have to bring that off of the backburner and touch that up too
* Fix up imgtool as well Vas Crabb2016-07-081-39/+33
|
* clang-modernize part 5 Miodrag Milanovic2015-12-041-49/+49
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+972