summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/diimage.cpp
Commit message (Collapse)AuthorAgeFilesLines
* -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.
* Copy longname, manufacturer, year, filetype, etc. for image info in all ↵ AJR2017-05-101-22/+17
| | | | softlisted cases
* Revert "Overhaul to how MAME handles options (#2260)" Vas Crabb2017-05-071-6/+5
| | | | | | | | | | | | This reverts commit 536990e77b49ccc50ef275bfbf1018cc29c16154. Conflicts: src/frontend/mame/mame.cpp Sorry, but this change was half-baked. It breaks a lot of existing functionality and clearly hasn't been tested in more than a tiny subset of use cases. Please play this work back onto your own branch, and test it before submitting another PR.
* Overhaul to how MAME handles options (#2260) npwoods2017-05-051-5/+6
| | | | | | | | | | | | This is an overhaul to how MAME handles options to provide a better foundation for what MAME is already doing in practice. Previously, core_options was designed to provide an input/output facility for reading options from the command line and INI files. However, the current needs (image/slot/get_default_card_software calculus and MewUI) go way beyond that. Broadly, this PR makes the following changes: * core_options now has an extensibility mechanism, so one can register options that behave dramatically differently * With that foundation, emu_options now encapsulates all of the funky image/slot/get_default_card_software calculus that were previously handled by static methods in mameopts.cpp. Changes to emu_options should not automatically cascade in such a way so that it stays in a consistent state * emu_options no longer provides direct access to the slot_options/image_options maps; there are simpler API functions that control these capabilities * Many core_options functions that expose internal data structures (e.g. - priority) that were only really needed because of previous (now obsolete) techniques have been removed. * core_options is now exception based (rather than dumping text to an std::string). The burden is on the caller to catch these, and discern between warnings and errors as needed. Obviously this is a risky change; that's why this is being submitted at the start of the dev cycle.
* Fixed an issue that could cause problems when loading reset_on_load devices ↵ Nathan Woods2017-04-301-7/+7
| | | | | | (like cartridges) from softlists at runtime This was not guaranteed to cause a problem; the specific issue here was reported by mr_gw in the context of the CoCo, and the proximate issue (hanging) was in CoCo-specific code. That said, this could cause problems elsewhere.
* srcclean (nw) Vas Crabb2017-04-231-3/+3
|
* Changes to make get_default_card_software() less stupid Nathan Woods2017-04-101-43/+22
| | | | | | | | | | The goals with this change is to make get_default_card_software() a bit more standalone by making it a const method that does not mutate the state of the device_image_interface. This is done by passing in a small structure that encapsulates the minimum of information that get_default_card_software() needs. This also eliminates the need for device_image_interface::open_image_file() I agree with Sarayan that get_default_card_software() is terrible and needs to ultimately go away. This is a small step in that direction. Lastly, I don't care for the name of get_default_card_software_hook (or get_default_card_software() for that matter). If anybody has better ideas, let me know.
* Fixed some regressions introduced in my recent refactoring related to ↵ npwoods2017-04-081-20/+17
| | | | | | | | | | software lists (#2217) This fixes crashes invoked by the following command lines mame nes zelda mame gamate cubeup These had two independent causes. The first crash was a consequence of open_image_file() doing something inappropriate required by implementations of get_default_card_software(). The second crash was a failure to access image options moved outside the core_options structure.
* Refactoring in response to MT#6531 Nathan Woods2017-04-061-60/+63
| | | | | | | | | | Prior to this change, options for images and slots were stored in the emu_options collection. Anything that might restart the emulation (such as slot changes and images that reset on load) had to manipulate the emu_options structure directly. The dynamic nature of images and slots meant that some elaborate conventions for setting up this collection had to be understood by clients. After this change, emu_options has two new members (image_options and slot_options) that expose image and slot selections via an std::map. Anything that changes images or slots in a fashion that needs to persist across sessions needs to modify these data structures. Additionally, some of the hairly logic (e.g. - get_default_card_software) now records its data here rather than trying to subvert the core_options system. This is how MT#6531 was fixed; now when diimage.cpp sees an image that resets on load, it just modifies the image_options structure and forces a reset. This allowed some further cleanups to happen within diimage. This should be considered a very risky change, and scrutiny/feedback is welcome. In particular, there seems to be functionality surrounding device bioses that I'm not 100% sure how it works; the syntax seems to imply that it only works on slot devices.
* Rename the write-only -printer image instance type to -printout. The former ↵ AJR2017-03-311-1/+1
| | | | option name conflicts with RS232 printer ports in several drivers.
* Changed a few more 'const char *' ==> 'const std::string &' (#2111) npwoods2017-03-041-2/+2
|
* Make device_image_interface::update_names a private method called ↵ AJR2017-03-031-0/+15
| | | | automatically at config_complete time (nw)
* Image instance name refactoring and bug fixing (nw) AJR2017-03-021-8/+14
| | | | | - update_names no longer takes arguments; the device type can be obtained easily, and the custom instance names are now overrides. Devices might not need to explicitly call update_names in the future. - Fix the frontend crash/assert failure resulting from instance names not being generated properly.
* Self-registering devices. Vas Crabb2017-03-031-2/+2
| | | | | | * MAME now walks all devices when generating -lx output irrespective of whether they're actually instantiated anywhere or not. * -lx is at least 30% faster than previous implementation. * Only possible drawback is that filtering drivers no longer filters devices.
* device_image_interface cleanups (nw) AJR2017-02-271-36/+40
| | | | | | | - Replace comparisons of software_entry() or part_entry() with nullptr with loaded_through_softlist() predicate. - Eliminate the superfluous m_software_info_ptr member. The software_entry() accessor is still provided, but now rarely used. - Eliminate two of the three arguments to load_software_part. - Remove some unnecessary auto-typing in ui/inifile.cpp.
* Revert "Make "requirement" field in softlists actually work (MT 6464)" Vas Crabb2017-02-191-32/+15
| | | | This reverts commit 17af0f9c661e0855607703faf66c1e807e888d82.
* Make "requirement" field in softlists actually work (MT 6464) AJR2017-01-111-15/+32
| | | | (nw) MAME's architecture for software loading remains gruesomely overcomplicated, and this makes it even less efficient than it already was. However, I think more invasive cleanups would best be left until later.
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-20/+20
| | | | | | | | | | | | * 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
* Revert "Added IS_ENABLED, so we have compiler check for non used part, it is ↵ Miodrag Milanovic2016-11-121-2/+2
| | | | | | checked but not compiled in (nw)" This reverts commit c0407f073bf7afe26407c4add5cfeaf7104913c9.
* Added IS_ENABLED, so we have compiler check for non used part, it is checked ↵ Miodrag Milanovic2016-11-111-2/+2
| | | | | | but not compiled in (nw) false and true now used instead of integer where used as bool
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-20/+20
| | | | | 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