summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/imgtool/modules/fat.cpp
Commit message (Collapse)AuthorAgeFilesLines
* imgtool/modules/fat.cpp: Fix build AJR2025-09-081-1/+1
|
* Basic fix for pc_chd support in imgtool (#14148) Michael Karcher2025-09-081-1/+1
| | | | | | | | | | | * imgtool: Take ownership of stream in pc_chd_image_open `imgtool::image::internal_open` passes an rvalue reference to the stream to the `open` function of the image format module. It expects the `open` function to take ownership if it keeps a reference to the stream. If `open` does not do so, the `stream` is going to be destroyed at the end of `internal_open`. `pc_chd_image_open` fails to take ownership, yet it persists a reference to the stream as part of `info->hard_disk`. This causes an use-after-free condition * imgtool: Correct determination of total sectors of a FAT volume The number of total sectors of a FAT volume is stored either in the 16-bit word at offset 19 or, if that word is zero, in the 32-bit word at offset 32 instead. The 32-bit word is not a high word to build a 48-bit value in conjunction with the 16-bit word at offset 19, but it supersedes it.
* -tools/imgtool/modules: Fixed remaining calss memory access warnings. Vas Crabb2024-11-261-9/+23
| | | | | | | | -tools/imgtool/modules/vzdos.cpp: Fixed function returning floperr_t value as imgtoolerr_t. -devices: Fixed a bunch more #include guards that don't match file paths.
* Miscellaneous change roll-up: Vas Crabb2023-09-291-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | render/drawbgfx.cpp: Return an error if Wayland EGL surface can't be created for additional windows. emu/emucore.h: Added explicitly defaulted copy and move constructors for emu_fatalerror. Fixed apparent misunderstanding of const. Returning const value types and casting to const value types is pointless outside very narrow use cases. Putting const value type parameters in interfaces just makes trouble. cpu/adsp2100: Use count_leading_ones_32 where it's simple rather than inverting and counting leading zeroes. util/multibyte.h: Don't pollute global namespace, constexpr implies inline, make narrowing casts explicit. imagedev/simh_tape_image.h: inline is implied for member functions with bodies supplied at declaration. Tidied up some ugly casts in various places.
* imageutl.h: Retire pick_integer_[bl]e and place_integer_[bl]e in favor of ↵ AJR2023-09-171-41/+40
| | | | | | the simpler functions in multibyte.h * multibyte.h: Add constexpr for getters and noexcept for all functions
* Soul-crushingly frustrating clean-up: Vas Crabb2021-12-011-3/+1
| | | | | | * Patched up a pile of code that was rotting behind UNUSED_FUNCTION, and switched to [[maybe_unused]] attribute so it can't rot so easily. * Reduced a bit more redundancy in fruit machine layouts.
* Formats-related refactoring AJR2021-09-111-4/+8
| | | | | | - Remove opresolv.h from emu.h and some other base headers - Split legacy floppy image class into a separate file - Clean up a lot of #includes in src/lib and src/tools/imgtool
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-6/+6
| | | | | | | | | | * 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
* use C++ library includes (nw) firewave2020-01-221-2/+2
|
* Use canonical spelling of "canonical" (nw) AJR2019-08-021-10/+10
|
* tools/imgtool/modules/fat.cpp: fixed Coverity "Double Free" warning (nw) firewave2018-01-201-0/+1
|
* srcclean (nw) Vas Crabb2017-10-221-6/+6
|
* Created a more flexible imgtool::datetime structure for use within Imgtool ↵ npwoods2017-10-171-22/+14
| | | | | | | | | | | | | | (#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.
* Imgtool: Eliminated Imgtool-specific rand() function Nathan Woods2017-07-301-2/+5
|
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-1/+1
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* TRUE/FALSE in tools section (nw) Miodrag Milanovic2016-10-221-8/+8
|
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-147/+147
| | | | | 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
* use standard types uintptr_t, char16_t and char32_t instead of FPTR, ↵ Miodrag Milanovic2016-10-221-5/+5
| | | | utf16_char, unicode_char (nw)
* [Imgtool] Bulk change: 'imgtool::directory *' ==> 'imgtool::directory &' Nathan Woods2016-10-171-27/+27
|
* [Imgtool] Bulk change: 'imgtool::partition *' ==> 'imgtool::partition &' Nathan Woods2016-10-161-37/+37
|
* [Imgtool] Bulk change: 'imgtool::image *' ==> 'imgtool::image &' Nathan Woods2016-10-161-4/+4
|
* [Imgtool] Changed many 'imgtool::stream *' to 'imgtool::stream &' Nathan Woods2016-10-141-10/+10
|
* [Imgtool] More C++-ification (imgtool_stream ==> imgtool::stream) Nathan Woods2016-10-121-10/+10
| | | | 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-42/+42
| | | | | imgtool_partition ==> imgtool::partition imgtool_directory ==> imgtool::directory
* Made imgtool_image (now imgtool::image) a "real" C++ class Nathan Woods2016-09-271-8/+8
|
* fix after pass through the diff Vas Crabb2016-08-011-1/+1
|
* made constexprs lower case and used constexpr for returning input value as ↵ Miodrag Milanovic2016-07-311-5/+5
| | | | well for rest of defines in osdcomm.h (nw)
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-14/+14
| | | | to inline functions (nw)
* Fix up imgtool as well Vas Crabb2016-07-081-1/+1
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+2111