summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/diimage.cpp
Commit message (Collapse)AuthorAgeFilesLines
* sega/sega_beena.cpp: Hooked up barcode cards. Vas Crabb2023-12-141-6/+7
| | | | | | | | | | Systems promoted to working --------------------------- Sega TV Ocha-Ken [QUFB] Software list items promoted to working (tvochken.xml) ------------------------------------------------------ TV to Ocha-Card: Ocha-Ken 'Ho' to Seikatsu [Vas Crabb]
* emu/diimage.cpp: Added media change notifier and exposed to Lua. Vas Crabb2023-12-141-30/+66
| | | | | | | | | | | | | | | | | This allows interested parties to receive notifications on media changes. This is demonstrated by the file manager and media image information menus now updating immediately if the system ejects a mounted image, or a mounted image is changed by a script or something. ui/filemngr.cpp, ui/info.cpp: Update file manager and media image information menus immediately on media image changes. ui/menu.cpp: Return index of added item from item_append. bus/generic/slot.cpp: Use out-of-line virtual destructors to avoid vtable link errors in certain single-driver builds. bus/nubus: Tidy up some #include statements.
* srcclean in preparation for MAME 0.255 branch Vas Crabb2023-05-281-2/+2
|
* image: Executive decision: disk regions used the owner name (e.g., no :image) Olivier Galibert2023-05-091-1/+1
|
* image: Fix initialisation order, fix file menu enable, refine gdrom support Olivier Galibert2023-05-081-2/+7
|
* chd: Add dvd support. better abstraction in general, multi-image support in ↵ Olivier Galibert2023-05-041-0/+154
| | | | arcade-type drivers
* Restored ability of for image devices to report specific error messages. Vas Crabb2023-04-081-35/+34
| | | | | | | | | | | | | | Restores ability to give specific/detailed messages removed in 6f7e4141ea14acaaf9cb973c66788fabb3457023 while pandering to obsession with single return value. Moved responsibility for displaying the error message in the UI to the caller rather than device_image_interface, and made device_image_interface always log the error along with the full path and error condition content. Gave several image devices more detailed error messages. Added some FIXME comments for apparent bugs.
* API change for device_image_interface AJR2023-03-301-134/+55
| | | | | | | | | - Remove the seterror method for recording error messages and conditions. Condition codes have been made return values for call_load, call_create and various related callbacks. Error messages (which many devices weren't generating) are now displayed through osd_printf_error. - Eliminate the image_init_result and image_verify_result pass/fail enumeration types. Update many functions that were returning these enumerations or simply bools to return std::error_condition instead. In some cases, this type is now passed down from internal parsing/loading functions which were already returning it. In various other cases, the former default UNSPECIFIED has been used as a catchall for I/O errors; anticipated future refactorings should make these error returns more specific. - Expand the image_error categories to include INVALIDLENGTH, NOSOFTWARE and BADSOFTWARE. The first is largely self-explanatory. The second is generated by the core to indicate failure to find software items in lists. The third is provided for devices to indicate semantic errors in software list entries. - Change the return type of floppy_image_device::identify to a pair so the potential error condition can be passed along to the UI without storing it in a member variable. - Move device_image_interface::message down into snapshot_image_device and change its implementation to use string_format instead of printf. - Correct a typo in the shortname of the generic snapshot device.
* -emu/diimage.cpp: Fixed dumb regression in open plan (stray else). Vas Crabb2022-12-241-1/+1
| | | | -machine/micomxe1a.cpp: Added notes about how software reads inputs.
* imagedev: Allow command-line creation for tapes/memory cards/printouts. Vas Crabb2022-12-241-9/+14
| | | | | Also made image devices not request read access when creating files for write-only devices.
* diimage.cpp: Fix GCC build after e178fbd28127c526b212e5a4998058cebf530567 AJR2022-10-251-0/+1
|
* corefile.h: Move filename utilities to path.h AJR2022-09-251-0/+1
|
* Use util::streqlower in more places AJR2022-08-271-3/+1
|
* File handling cleanup AJR2022-04-191-31/+13
| | | | | | | | | | - Remove fgetc, fgets and ptr methods from device_image_interface. - Remove the core_file::buffer method to read an entire file into memory and rewrite emu_file::hashes to not depend on it. - Make core_in_memory_file a final class; now that buffering is gone, core_osd_file no longer subclasses it but a new superclass that retains some common methods. - Rename the offset and length methods used internally in core_file implementations to index and size due to frequent clashes with parameter names. - Convert comments in util/corefile.cpp to C++ style. - Add a new overload of the hash_collection::compute method which hashes data from a random_read stream, reading it into memory one chunk at a time. As a result, the hash_collection::begin and hash_collection::end methods have been removed as obsolete (similar methods are now used internally only). - Enhance error messages for the frontend media identifier when it encounters file errors.
* docs: Added page describing how MAME searches for media. Vas Crabb2022-03-101-0/+18
| | | | | | | Also made error messages for missing CHDs and missing files for software parts using the image file loader show search paths, and changed the (poorly named) bitbanger device to use the image file loader rather than the ROM loader for software items.
* Remove fileio.h from emu.h AJR2022-02-111-0/+1
|
* device_image_interface: Interface overhaul AJR2022-01-061-157/+23
| | | | | | | | | | | | | - Remove the iodevice_t classification, which was not used that much and was incomplete anyway. Image device implementations must now provide their own instance names and brief instance names. Several new parent classes have been created to make it easier to use the old standard names. - Change must_be_loaded from a pure virtual function to be overridden in implementations to a getter for a base class property that can be set on the host side (as was formerly made possible for NES, MD and "generic" cartridge slots) but defaults to false for all types. This restrictive property has been unset for a small number of cases. - Create parent classes for paper tape and magnetic tape devices. At present these are dummy classes that do little to nothing, but may help unify implementations in the future. - Change several member functions to take std::string_view parameters rather than const std::string & or const char *. - Make update_names take into account brief names, as discussed in PR #2555. - Remove the obsolete uses_file_extension function (which used thread-unsafe strtok). * portfolio_ccm_slot: Change image type from "cartridge" to "memcard" * i7220, datapack: Add custom instance names that weren't there before * pc11: Add note
* util: Further API cleanups: (#8661) Vas Crabb2021-10-051-7/+10
| | | | | * 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-related refactoring AJR2021-09-111-0/+1
| | | | | | - 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
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-130/+77
| | | | | | | | | 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.
* -Miscellaneous improvements for software lists: Vas Crabb2021-06-231-3/+2
| | | | | | | | | | | | * Show list name in software selection menu (machines have multiple lists). * Actually report software list parsing errors during validation. * Check that software list name attribute matches filename. * Limit software list names to 24 characters - they're getting too long, and they need to be practical in command lines. * c128.cpp: Fix dangling reference to renamed software list. -emu/ioport.cpp: Slightly better test for deselected slot cards.
* Added some swlist warnings for Tafoid's tests. Robbbert2021-04-021-0/+2
|
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-10/+8
| | | | | | | | | | * 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-134/+41
| | | | | | | | | | | | | | | - 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
* More Lua engine clean-up and documentation, resulting in core cleanup. Vas Crabb2020-12-181-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More Lua interface cleanup, additional properties and methods, and documentation migration/expansion. Emulated switch inputs can have "not" codes applied to host input axis directions. It works the same way as host switch inputs - push twice for a "not" prefix. Input polling helpers no longer need to store state in the input device items. There’s less leakage, and less chance of things interfering with each other. Allow snapshot view options to be configured through the internal UI via the video options menu. Made video options menus place initial focus on the currently selected view item. Removed some crud from the menu base class. Fixed the description of the "snapview" option. The value to get raw screen pixels was changed to "native" a long time ago but the description was never updated. Re-arranged the Golden Poker button lamps so that the 6-button layouts for Jolli Witch and Wild Witch make sense. In 6-button mode, the hold buttons double as bonus game and bet buttons, but the lamp outputs don't change. The simplest way to deal with this without requiring the user to switch views or using layout scripting is to place the dedicated buttons directly below the hold buttons that correspond to them. Removed some software list data that was redundantly copied into device_image_interface (m_supported was never even set, so it didn't even work), and made crc() work better (previously it wasn't recalculuated after unloading and loading another image). Made strformat.h and devcb.h play nicer with C++17 and pre-standard C++20. Format precision now correctly limits the length of string views. Confirmed that strformat.{h,cpp} works with pre-standard C++20 support in GCC 9. Removed an auto_alloc from cpu/arm7.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The things that were previously called device iterators are not iterators in the C++ sense of the word. This is confusing for newcomers. These have been renamed to be device enumerators. Several Lua methods and properties that previously returned tables now return lightweight wrappers for the underlying objects. This means creating them is a lot faster, but you can't modify them, and the performance characteristics of different operations varies. The render manager's target list uses 1-based indexing to be more like idiomatic Lua. It's now possible to create a device enumerator on any device, and then get subdevices (or sibling devices) using a relative tag. Much more render/layout functionality has been exposed to Lua. Layout scripts now have access to the layout file and can directly set the state of an item with no bindings, or register callbacks to obtain state. Some things that were previously methods are now read-only properties. Layout files are no longer required to supply a "name". This was problematic because the same layout file could be loaded for multiple instances of the same device, and each instance of the layout file should use the correct inputs (and in the future outputs) for the device instance it's associated with. This should also fix video output with MSVC builds by avoiding delegates that return things that don't fit in a register.
* emumem: Simplify memory management. [O. Galibert] Olivier Galibert2020-11-021-4/+3
| | | | | | | | | | | | | | | | | | | | API impact: - install_ram/rom/writeonly now requires a non-null pointer. If you want automatically managed ram, add it to a memory map, not in machine_start - install_*_bank now requires a memory_bank *, not a string - one can create memory banks outside of memory maps with memory_bank_creator - one can create memory shares outside of memory maps with memory_share_creator Memory maps impact: - ram ranges with overlapping addresses are not shared anymore. Use .share() - ram ranges touching each other are not merged anymore. Stay in your range Extra note: - there is no need to create a bank just to dynamically map some memory/rom. Just use install_rom/ram/writeonly
* Revert "remove colon as a patch seperator" hap2020-06-191-1/+1
| | | | This reverts commit e07e2c8b017a4f80641a2ae3bbb8566ef51e8a03.
* emu: correct some file headers (nw) hap2020-06-191-1/+1
|
* remove colon as a patch seperator tim lindner2020-05-031-1/+1
|
* softlist_dev.cpp: start adding validation for data areas Vas Crabb2020-04-161-25/+1
| | | | | | | | | | romload.cpp: reduce copy-pasta (nw) (nw) I fixed the errors found by adding validation to software list data areas. Most of them seem to be simple copy-paste errors hidden by the fact that the default device_image_interface loader ignores the data area size (as opposed to the "ROM" loader). There was one C64 cartridge with a missing zero on the data area size that was pretty clearly wrong.
* ROM loading cleanup: Vas Crabb2020-04-151-85/+62
| | | | | | | | | | | | | | * More flexible constructors for path_iterator and emu_file * More straightforward system/device ROM loading and software loading when using ROM loader * Proper parent walk when searching for identical CHDs with different names from software list * Fixed hangs if software item parents form a loop * Fixed layouts being loaded from bogus empty paths Note that there are changes in behaviour: * For software list ROMs/disks, MAME will now search the software path before searching the machine path * The search path for the owner of the software list device is used, which may not be the driver itself * MAME will no longer load loose CHDs from the media path - it's just too unwieldy with the number of supported systems * MAME will no longer search archives above the top level of the media path
* fixed some clang-tidy warnings (nw) (#6229) Oliver Stöneberg2020-01-291-1/+1
| | | | | | | | | | | | | | | | * fixed some readability-static-accessed-through-instance clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw) * fixed some readability-redundant-control-flow clang-tidy warnings (nw) * fixed some modernize-use-nullptr clang-tidy warnings (nw) * fixed some performance-faster-string-find clang-tidy warnings (nw) * fixed some performance-for-range-copy clang-tidy warnings (nw) * fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
* fixed some clang-tidy warnings (nw) (#6197) Oliver Stöneberg2020-01-221-6/+6
| | | | | | | | | | | | | | * fixed some bugprone-throw-keyword-missing clang-tidy warnings (nw) * fixed some modernize-use-nullptr clang-tidy warnings (nw) * fixed some readability-delete-null-pointer clang-tidy warnings (nw) * fixed some performance-faster-string-find clang-tidy warnings (nw) * fixed some performance-for-range-copy clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw)
* start putting noexcept on things that have no business throwing exceptions, ↵ Vas Crabb2019-11-101-7/+8
| | | | starting with diimage. also fix a slight bug in the interface matching function for software list parts. (nw)
* Make osd_printf_* use util/strformat semantics. Vas Crabb2019-09-261-5/+5
| | | | | | | | | | | | | | | | | (nw) This has been a long time coming but it's here at last. It should be easier now that logerror, popmessage and osd_printf_* behave like string_format and stream_format. Remember the differences from printf: * Any object with a stream out operator works with %s * %d, %i, %o, %x, %X, etc. work out the size by magic * No sign extending promotion to int for short/char * No widening/narrowing conversions for characters/strings * Same rules on all platforms, insulated from C runtime library * No format warnings from compiler * Assert in debug builds if number of arguments doesn't match format (nw) Also removed a pile of redundant c_str and string_format, and some workarounds for not being able to portably format 64-bit integers or long long.
* -avivideo.cpp: Added an image device to provide looping uncompressed AVI ↵ mooglyguy2019-09-231-20/+21
| | | | | | frames as input. [Ryan Holtz] -vino.cpp: Adapted to support both avivideo_image_device and picture_image_device. [Ryan Holtz]
* (nw) misc cleanup: Vas Crabb2019-09-201-3/+6
| | | | | * get rid of most assert_always * get rid of a few MCFG_*_OVERRIDE
* Add still-frame PNG image device for use by digitizers/cameras/etc. [R. Belmont] arbee2019-08-091-1/+2
| | | | Other formats can be added, we already have libjpeg in 3rdparty/.
* (nw) Clean up the mess on master Vas Crabb2019-03-261-0/+4
| | | | | | | | | | | | | 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-4/+0
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* Make -nonvram_save also inhibit saving of "battery" NVRAM for image devices AJR2019-02-191-0/+4
|
* Move ROM loading macros to romentry.h and remove romload.h from emu.h (nw) AJR2018-06-241-0/+1
|
* move some not-directly-emulation-related helpers to lib/util, further ↵ Vas Crabb2018-04-011-16/+16
| | | | extricate emu.h from tools (nw)
* Fix issue 2468 Olivier Galibert2017-07-131-8/+12
|
* Fixed issue loading reset_on_load() images (#2414) Nathan Woods2017-06-271-1/+5
|
* Overhaul to how MAME handles options, take two (#2341) npwoods2017-06-251-5/+6
|
* srcclean (nw) Vas Crabb2017-05-281-1/+1
|
* Fixed issue when the hash length is zero (#2314) npwoods2017-05-281-61/+57
| | | | | | | | | | * Fixed issue when the hash length is zero The following is illegal, even if no elements in the pointer are accessed: std::vector<my_struct> my_vec(0); // create an empty std::vector my_struct *ptr = &my_vec[0]; While this is a degenerate scenario, this should be fixed
* general cleanup: Vas Crabb2017-05-231-2/+2
| | | | | | | | | | | * move rarely-used output and pty interfaces out of emu.h * consolidate and de-duplicate forward declarations, also remove some obsolete ones * clean up more #include guard macros * scope down a few more things (nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h - this will make it far easier to keep them in sync with declarations than having them scattered through all the other files.