summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/devfind.h
Commit message (Collapse)AuthorAgeFilesLines
* (nw) Clean up the mess on master Vas Crabb2019-03-261-1/+139
| | | | | | | | | | | | | 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-139/+1
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* Add spacenum getter for required_/optional_address_space (nw) AJR2019-02-171-0/+6
|
* Add object finder for address spaces AJR2019-01-221-1/+133
| | | | (nw) The constructor and set_tag methods for required_address_space and optional_address_space work slightly differently from other finders in that they take the address space number as an extra argument. There is also an option to request a space having a specific data width, and validation checks this as well as the space number. There is also no (required|optional)_address_space_array, but that shouldn't really be necessary since devices shouldn't need large numbers of these finders.
* (nw) add warning comment to dangerous API Vas Crabb2018-07-311-10/+6
| | | | | | | | | | I'm not sure this API is a great idea - see inline comment on https://github.com/mamedev/mame/commit/796abaf7f3200a96499440a4c40bec3440d55209 I realise it seems intuitive, but it breaks with a use-after-free (not even a validity error) if you replace/remove the target device. Implementing it in a way that isn't fragile and doesn't hurt the performance of -romident, -validate and -listxml seems impossible. If it causes developer confusing and things start breaking, back to literal tags we go for this case.
* devfind.h: Fix the build by removing calls that don't exist when DeviceClass ↵ AJR2018-07-311-12/+2
| | | | happens to be an interface (nw)
* devfind: Allow set_tag() with a reference or a pointer to a device [O. Galibert] Olivier Galibert2018-07-301-0/+26
|
* as if millions of this pointers suddenly cried out in terror, and were ↵ Vas Crabb2018-06-081-18/+0
| | | | | | | suddenly silenced * streamline templates in addrmap.h * get rid of overloads on read/write member names - this will become even more important in the near future
* C++14 has one of these in the standard library (nw) Vas Crabb2018-06-011-9/+4
|
* devfind: add asserts to detect being resolved multiple times (nw) Vas Crabb2018-05-311-0/+8
|
* devfind: add asserts to detect tag being set after object resolution (nw) Vas Crabb2018-05-311-8/+32
|
* voodoo: deal with needing to be able to configure screen/CPU or set them at ↵ Vas Crabb2018-05-231-11/+1
| | | | | | | | start in a safer way devfind: revert previous change - if finders aren't set in stone after device_resolve_objects it's going to lead to all kinds of hard-to-diagnose bugs (I'll add more checks for this some time after release) (nw) also clean up rotting tabulation
* Uncrappify voodoo pci devices transfert. Fix some paths on midwayic. (nw) Olivier Galibert2018-05-221-1/+11
|
* Streamline machine configuration macros - everyone's a device edition. Vas Crabb2018-05-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Start replacing special device macros with additional constructors, starting with ISA, INTELLEC 4 and RS-232 buses. Allow an object finder to take on the target of another object finder. (For a combination of the previous two things in action, see either the INTELLEC 4 driver, or the Apple 2 PC Exporter card. Also check out looping over a device finder array to instantiate devices in some places. Lots of things no longer need to pass tags around.) Start supplying default clocks for things that have a standard clock or have all clocks internal. Eliminate the separate DEV versions of the DEVCB_ macros. Previously, the plain versions were a shortcut for DEVICE_SELF as the target. You can now supply a string tag (relative to current device being configured), an object finder (takes on the base and relative tag), or a reference to a device/interface (only do this if you know the device won't be replaced out from under it, but that's a safe assumption for your subdevices). In almost all cases, you can get the effect you want by supplying *this as the target. Eliminate sound and CPU versions of macros. They serve no useful purpose, provide no extra checks, make error messages longer, add indirection, and mislead newbies into thinking there's a difference. Remove a lot of now-unnecessary ":" prefixes binding things relative to machine root. Clean up some miscellaneous rot. Examples of new functionality in use in (some more subtle than others): * src/mame/drivers/intellec4.cpp * src/mame/drivers/tranz330.cpp * src/mame/drivers/osboren1.cpp * src/mame/drivers/zorba.cpp * src/mame/devices/smioc.cpp * src/devices/bus/a2bus/pc_xporter.cpp * src/devices/bus/isa/isa.h * src/devices/bus/isa/isa.h * src/devices/bus/intellec4/intellec4.h
* Make MCFG_DEVICE_ADD and callable device types more flexible: Vas Crabb2018-05-041-7/+2
| | | | | | | | | | | | | | | | | | | | | * Allows defaulted clocks (see subtle example with vboy) * Allows additional constructors (see RS232 port in tranz330) * Allows use of device finder in place of tag in MCFG_DEVICE_ADD * Requires out-of-line destructor for devices using incomplete types * Requires XTAL or explicit u32 for clocks for devices with private types Devices must still define the standard constructor. When writing additional constructors, be aware that the constructor runs before device_add_mconfig in the context of the existing device, not the new device. See osborne1, zorba, tranz330, and vboy for examples of this in use. Compilation is a bit slower, but this is temporary while refactoring is in progress. Eliminated the need for MCFG_SOUND_ROUTE_EX. Removed macros from slot option configuration - they just obfuscated code and slowed it down with needless dynamic casts, but didn't actually simplify it.
* Allow devcb to be bound to a device/mixin or the target of a device Vas Crabb2018-05-021-2/+10
| | | | | | | | | | finder. This works outside machine configuration context so the workarounds in ATA HLE and MSX slots are no longer necessary. It also allows reduction in tag repetition in machine configuration (see converted osborne1.cpp, zorba.cpp or the more extreme tranz330.cpp). Allow reimagined device instantiation to take a device finder based on current device being configured to reduce repetition (see tranz330.cpp).
* Route sound relative to current device. Vas Crabb2018-05-011-5/+62
| | | | | | | | Also, look Ma - no magic prologue! Slot card additions run in the context of the slot itself, which isn't entirely intuitive. Slot configuration needs a bunch of other cleanup anyway.
* Set finder tag relative to current device being configured rather than Vas Crabb2018-04-301-7/+25
| | | | | | | | | | | | | | the finder's owner. This meand you no longer need to care about the your relationship to the object being configured and a lot of ^ and : can disappear. There's a bit reduction in string pasting in macros from this. Yes, I have to make this apply to devcb etc. as well, but that's a job for another day. There's probably at least one thing broken by this where optional objects are involved. Most things can be solved by just getting rid of the now-problematic ^ and : prefixes.
* Fixes (nw) Olivier Galibert2018-02-131-0/+21
|
* make object finder arrays meet more Container/Sequence requirements (allows ↵ Vas Crabb2017-02-081-5/+96
| | | | range-based for and many algorithms to work)
* A round of spelling/typographical fixes to source comments (nw) Scott Stone2016-11-241-5/+5
|
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-62/+62
| | | | | | | | | | | | * 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
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-62/+62
| | | | | 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
* Fixed some Doxy comments, and addressed a few nits Nathan Woods2016-10-151-2/+5
|
* [COCO] Changed to use required_ioport_array and optional_ioport Nathan Woods2016-10-151-0/+3
| | | | Also, I added a size() accessor to object_array_finder. If there is a better way to do this, let me know.
* TEMPORARY PATCH to fix the build. Robbbert2016-08-271-2/+2
|
* * Make object finders behave like pointers for the purposes of implicit ↵ Vas Crabb2016-08-271-64/+177
| | | | | | | | | | casts, dereferencing and array access, not something that's part pointer, part reference, part vector * Require dummy tag to be specified explicitly, magical defaults are unhelpful here as the more common case it to search for a real object * Make the search methods private in concrete classes where possible as users should rely on the resolution process for these things Still can't hide the memory bank find method since atari400.cpp subverts the resolution process. Can't get rid of set_target on shared_ptr_finder as it's abused all over the place.
* More prep for removing pointer/reference duality (nw) Vas Crabb2016-08-271-1/+1
|
* Make object_array_finder a bit more flexible, centralise instantiation of ↵ Vas Crabb2016-08-261-25/+124
| | | | more templates, more preparation for crud removal
* hacks for MSVC building until better solutions are found. (nw) smf-2016-08-261-1/+1
|
* * Doxyfy a significant chunk of devfind.h Vas Crabb2016-08-251-342/+440
| | | | | | * Eliminate a lot of boilerplate code from devfind.h * Keep instantiation of templates in one place to improve build time * Remove some dangerous accessors
* Devices can be found array-style, too Vas Crabb2016-08-251-42/+79
|
* remove legacy forms of (required|optional)_(shared_ptr|ioport)_array Vas Crabb2016-08-251-53/+0
|
* shared_ptr arrays need love, too Vas Crabb2016-08-241-24/+30
|
* cleanup (nw) Vas Crabb2016-08-241-1/+1
|
* Make (required|optional)_ioport_array perform as well as a real array Vas Crabb2016-08-241-39/+78
|
* make &some_required_shared_ptr[offs] work as expected in const context Vas Crabb2016-08-161-5/+5
|
* Devfind revision phase 2 (nw) AJR2016-08-051-9/+31
| | | | | | | | | - Eliminate read_safe as a global function and make it a method of optional_ioport (and required_ioport, for which it makes less sense). - New constructor for optional_ioport_array and required_ioport_array using std::initializer_list to specify tag list - Remove pointer/reference conversion operators for required_ioport and optional_ioport. Explicit getters like found() and target() are now required when dereferencing isn't wanted. Many drivers have been changed to use required_ioport_array and optional_ioport_array to make this cleaner. - Update numerous drivers that were using read_safe to use I/O port finders generally. Port names have been kept the same as far as possible to avoid breaking saves.(Some of the optional finders should probably be required.) - Give edfbl and monkelf their own memory maps so hacky input reading routines can be removed. - Clean up some legacy static handlers in amiga.cpp and cubo.cpp.
* Cleanups and version bumpmame0173 Miodrag Milanovic2016-04-271-2/+2
|
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-4/+4
|
* Devfind revision phase 1, cleaning out some legacy stuff AJR2016-04-071-13/+24
| | | | | | | | - Eliminate the cached device_t::m_region pointer and its region() getter method. Devices that need to bind to a region with the same tag should use optional/required_memory_region or optional/required_region_ptr with DEVICE_SELF as the subtag; this improves error checking. (DEVICE_SELF has been moved to device.h for greater visibility in the source.) - Allow required/optional_region_ptr to specify a specific length which must match that of the region found. - Implement finder_base::finder_tag() getter for diagnostic purposes. - Perform some (not very efficient) validity checks on memory region finders instead of allowing them to automatically pass. - Privatize device_memory_interface::m_addrspace.
* Replace strformat, strprintf and strcatprintf with type-safe steam_format ↵ Vas Crabb2016-02-281-2/+2
| | | | | | | | | and string_format Update MAME to use new function Instantiate ODR-used static constant members Make some of the UI code more localisable Remove use of retired functions in tools
* reverting: Miodrag Milanovic2016-01-201-39/+39
| | | | | | | SHA-1: 1f90ceab075c4869298e963bf0a14a0aac2f1caa * tags are now strings (nw) fix start project for custom builds in Visual Studio (nw)
* Revert "rest of device parameters to std::string (nw)" Miodrag Milanovic2016-01-201-1/+1
| | | | This reverts commit caba131d844ade3f2b30d6be24ea6cf46b2949d7.
* Driver configuration fixes AJR2016-01-161-1/+2
| | | | | | | - Implement found() method for object finders - a1200, cubo, midzeus2, etc.: remove spurious palette tags - bagman, sbagman & clones: correct PROM region lengths - atomicp, snapper: remove unused(?) sprite device w/no ROMs
* rest of device parameters to std::string (nw) Miodrag Milanovic2016-01-161-1/+1
|
* tags are now strings (nw) Miodrag Milanovic2016-01-161-39/+39
| | | | fix start project for custom builds in Visual Studio (nw)
* Return std::string objects by value rather than pass by reference AJR2016-01-101-2/+2
| | | | | | - strprintf is unaltered, but strformat now takes one fewer argument - state_string_export still fills a buffer, but has been made const - get_default_card_software now takes no arguments but returns a string
* cleanup Miodrag Milanovic2015-12-061-1/+1
|
* fixing some more override (nw) Miodrag Milanovic2015-12-061-2/+2
|