summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/memory.h
Commit message (Collapse)AuthorAgeFilesLines
* Cleanups and version bumpmame0149u1 Miodrag Milanovic2013-07-231-1/+1
|
* Memory system: added endianness to the memory_share class. Aaron Giles2013-07-201-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tilemap system: numerous changes: * Moved remaining legacy macros and typedefs to tilelgcy.h. This revealed a few drivers mixing and matching modern & legcy, which have now been fixed. * Changed get info callback signature to no longer pass the user_data pointer, but instead pass a reference to the tilemap object itself. Updated those few drivers using user_data to pull it out of the tilemap object with the new user_data() getter method. * Changed get info and mapping callbacks to be device_delegates so that they can be described at config time. * Added tilemap_memory object that is used internally for reading/ writing to memory that backs a tilemap. This object is used to track a memory pointer that backs tilemap memory, and also is designed to transparently handle all bus width and endianness associated with reading and writing data in a tilemap. * Incorporated two tilemap_memory objects (basemem and extmem) into the tilemap object and added accessors to them, as well as read/write handlers for reading/writing to entries stored in the memory. This means that tilemap get info callbacks can now easily read data out of the tilemap in a generic way. * Rejiggered the initialization sequence for tilemap objects so that the tilemap_manager is not required to be present at instantiation. * Created a new tilemap_device, which can be used to declare a tilemap in the machine config, and which also is a tilemap object itself. The tilemap device will look for shared memory regions called "<tag>" and "<tag>_ext" and automatically plug them into the tilemap. The device also provides write handlers that can be used to write to the tilemap memory and mark tiles dirty, saving the need for each driver to write their own. Device system: moved required/optional device finders to a new header devfind.h. Atari drivers: removed all playfield and alpha memory and tilemap variables, apart from those needed by atarivc-using games (this will become a device in a future update). Updated all Atari 16-bit drivers to use the new tilemap_device instead, which provides all the needed functionality in a more generic way.
* memory: Need moar tables [O. Galibert] Olivier Galibert2013-06-151-8/+10
|
* Cleanups and version bumpmame0149 Miodrag Milanovic2013-06-111-17/+17
|
* Cleanup. (nw) Curt Coder2013-06-101-8/+8
|
* Added macros for read/write delegates. [Curt Coder] Curt Coder2013-06-061-0/+20
|
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-212/+212
|
* added missing initialization of memory_share.m_next (nw) Oliver Stöneberg2012-12-261-1/+2
|
* memory: Fix dynamic recursive device mapping [O. Galibert] Olivier Galibert2012-10-101-1/+1
| | | | | | | | | | | Situation: - you have a device (pc-fdc) with a memory map on it - you map it dynamically into a cpu (maincpu) address space with install_device (isa-fdc does that) - the device pc-fdc has a subdevice (upd765) - the subdevice upd765 has its own memory map - the pc-fdc memory map includes the upd765 memory map through AM_DEVICE("upd765", ...) Before the fix, the code would search for upd765 as a subdevice of maincpu and not of pc-fdc.
* Moved device_delegates into their own files. Employed a Aaron Giles2012-09-261-10/+10
| | | | | | | | | | | | | non-templatized helper class so that the code can live co-located, rather than invading device.h. Changed the read/write delegates to derive from device_delegate. Updated the address map macros to create these properly. Removed remnants of the old AM_BASE/SIZE macros from the memory system.
* Remove all traces of read/write*_device_func from memory.c. Aaron Giles2012-09-181-12/+12
| | | | | | All legacy device callbacks are now promoted to delegates and handed off to the modern read/write handler managers. Fixed ibm5150 and surely many other broken systems. (nw)
* Memory handler cleanup 3. Add mem_mask parameter Aaron Giles2012-09-171-4/+13
| | | | | | | | to 8-bit handlers to match the others. To ease pain, added DECLARE_READ/WRITE_HANDLER macros that set up a default parameter. Also updated devcb so that the handlers can be called with or without the mem_mask. [Aaron Giles]
* Memory handler normalization, part 2. Change legacy Aaron Giles2012-09-171-31/+31
| | | | | | | read/write handlers to take an address_space & instead of an address_space *. Also update pretty much all other functions to take a reference where appropriate. [Aaron Giles]
* Memory handler normalization, part 1. Aaron Giles2012-09-171-16/+25
| | | | | | | | | | | | | READ/WRITE_DEVICE*_HANDLERs are now passed an address_space &, and the 8-bit variants get a mem_mask as well. This means they are now directly compatible with the member function delegates. Added a generic address space to the driver_device that can be used when no specific address space is available. Also added DECLARE_READ/WRITE_DEVICE*_HANDLER macros to declare device callbacks with default mem_mask parameters. [Aaron Giles]
* memory: Add support for dynamically mapping devices [O. Galibert] Olivier Galibert2012-08-031-1/+12
| | | | | | | | | | | | | | | | | | Just call install_device on the space with as parameters: - start and end of the mapping zone - device (not pointer to the device) - map method and optionally, if the device data width is not the same than the space data width: - device data width (for consistency checking) - unit mask For instance, the static mapping: AM_RANGE(0x02114100, 0x02114107) AM_DEVICE8("fdc", n82077aa_device, amap, 0xffffffff) can be converted to a dynamic mapping (where fdc is a pointer to the device): machine().device("maincpu")->memory().space(AS_PROGRAM)-> install_device(0x02114100, 0x02114107, *fdc, &n82077aa_device::amap, 8, 0xffffffff);
* Use a tagged_list for memory_banks. Aaron Giles2012-04-241-3/+2
|
* Clean-ups and version bumpmame0145u7 Angelo Salese2012-04-221-1/+1
|
* Make memory shares follow the same pattern as memory Aaron Giles2012-04-201-4/+1
| | | | regions and memory banks, accessible only via the device.
* Changed device->subregion to device->memregion. Moved Aaron Giles2012-04-201-1/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memory_region management into the memory manager instead of directly in the machine. Hid the global region method; now all regions must be looked up relative to a device. If you're a member function, you can just use memregion("tag") directly. If you're a global function or a device referencing global regions, use machine().root_device().memregion("tag") to look up regions relative to the root. S&R to convert all references: machine([()]*)\.region machine\1\.root_device\(\).subregion Then remove redundant machine().root_device() within src/mame: ([ \t])machine\(\)\.root_device\(\)\. \1 And use state->memregion() if we have a state variable present: (state *= *[^;]+driver_data[^}]+)([^ \t]*)machine[()]*\.root_device\(\)\. \1state-> Finally some cleanup: screen.state-> state-> device->state-> state-> space->state-> state-> And a few hand-tweaks.
* Memory banks are now device-relative only. Global lookups Aaron Giles2012-04-191-10/+4
| | | | | | are private. Renamed device_t::subbank to device_t::membank and updated a few remaining users of the global lookup.
* Remove global memory banking functions in favor of referencing Aaron Giles2012-04-191-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subbanks of a device and directly acting on them. First round S&R: memory_configure_bank( *)\(( *)([^,]+), *([^,]+), * \3.root_device().subbank\1\(\2\4\2\)->configure_entries\1\(\2 memory_configure_bank_decrypted( *)\(( *)([^,]+), *([^,]+), * \3.root_device().subbank\1\(\2\4\2\)->configure_decrypted_entries\1\(\2 memory_set_bank( *)\(( *)([^,]+), *([^,]+), * \3.root_device().subbank\1\(\2\4\2\)->set_entry\1\(\2 memory_set_bankptr( *)\(( *)([^,]+), *([^,]+), * \3.root_device().subbank\1\(\2\4\2\)->set_base\1\(\2 Then convert single entries to simpler form: configure_entries( *\( *[^,]+, *)1 *, *([^,]+),[^)]+\) configure_entry\1\2\) configure_decrypted_entries( *\( *[^,]+, *)1 *, *([^,]+),[^)]+\) configure_decrypted_entry\1\2\) Remove renundant root_device lookup for methods: ([ \t])machine\(\)\.root_device\(\)\. \1 Use state-> instead of root_device lookup where available (this one must be done by hand unfortunately): ([^ \t]*)machine[()]*\.root_device\(\)\. state->
* Now that memory_bank is exposed as an object, removed all the global Aaron Giles2012-04-181-26/+5
| | | | | | | | | | | | | | | | | | | bank manipulation APIs from memory_manager, and instead added a memory_manager::bank("tag") function which will return a pointer to the representative memory_bank. Operations can then be performed as expected directly on the memory_bank. Most code did not need an update yet, as I haven't done the search/replace to move away from global functions (which still exist for now). Added device_t::subbank("tag") to return a bank that is owned by the given device. Switched YM2151 interfaces over to devcb callbacks. Created proper sound devices for the Williams NARC, CVSD and ADPCM sound boards. Updated midyunit, midtunit, williams(joust2), and mcr68(archrivl/pigskin/trisport) to use the new devices.
* some DIRECT_UPDATE_HANDLER - > DIRECT_UPDATE_MEMBER (nw) Miodrag Milanovic2012-04-171-0/+1
|
* Psikyo and DCS fixes. Aaron Giles2012-04-091-1/+1
|
* Clean-ups and version bumpmame0145u6 Angelo Salese2012-04-081-5/+5
|
* Converted memory_private to memory_manager and moved global memory Aaron Giles2012-04-051-18/+250
| | | | | | operations into methods on it. Converted the less-popular cases over in drivers that used them, leaving the bank management APIs global for now.
* Move devices into a proper hierarchy and handle naming Aaron Giles2012-01-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and paths consistently for devices, I/O ports, memory regions, memory banks, and memory shares. [Aaron Giles] NOTE: there are likely regressions lurking here, mostly due to devices not being properly found. I have temporarily added more logging to -verbose to help understand what's going on. Please let me know ASAP if anything that is being actively worked on got broken. As before, the driver device is the root device and all other devices are owned by it. Previously all devices were kept in a single master list, and the hierarchy was purely logical. With this change, each device owns its own list of subdevices, and the hierarchy is explicitly manifest. This means when a device is removed, all of its subdevices are automatically removed as well. A side effect of this is that walking the device list is no longer simple. To address this, a new set of iterator classes is provided, which walks the device tree in a depth first manner. There is a general device_iterator class for walking all devices, plus templates for a device_type_iterator and a device_interface_iterator which are used to build iterators for identifying only devices of a given type or with a given interface. Typedefs for commonly-used cases (e.g., screen_device_iterator, memory_interface_iterator) are provided. Iterators can also provide counts, and can perform indexed lookups. All device name lookups are now done relative to another device. The maching_config and running_machine classes now have a root_device() method to get the root of the hierarchy. The existing machine->device("name") is now equivalent to machine->root_device().subdevice("name"). A proper and normalized device path structure is now supported. Device names that start with a colon are treated as absolute paths from the root device. Device names can also use a caret (^) to refer to the owning device. Querying the device's tag() returns the device's full path from the root. A new method basetag() returns just the final tag. The new pathing system is built on top of the device_t::subtag() method, so anyone using that will automatically support the new pathing rules. Each device has its own internal map to cache successful lookups so that subsequent lookups should be very fast. Updated every place I could find that referenced devices, memory regions, I/O ports, memory banks and memory shares to leverage subtag/subdevice (or siblingtag/siblingdevice which are built on top). Removed the device_list class, as it doesn't apply any more. Moved some of its methods into running_machine instead. Simplified the device callback system since the new pathing can describe all of the special-case devices that were previously handled manually. Changed the core output function callbacks to be delegates. Completely rewrote the validity checking mechanism. The validity checker is now a proper C++ class, and temporarily takes over the error and warning outputs. All errors and warnings are collected during a session, and then output in a consistent manner, with an explicit driver and source file listed for each one, as well as additional device and/or I/O port contexts where appropriate. Validity checkers should no longer explicitly output this information, just the error, assuming that the context is provided. Rewrote the software_list_device as a modern device, getting rid of the software_list_config abstraction and simplifying things. Changed the way FLAC compiles so that it works like other external libraries, and also compiles successfully for MSVC builds.
* Fixed memory unmap if mirror/mask was used [hap] Michaël Banaan Ananas2011-08-041-6/+6
|
* Added device-relative functions for memory banking. [Curt Coder] Curt Coder2011-06-231-0/+5
|
* Converted presave/postload functions to delegates. In a lot of Aaron Giles2011-04-301-1/+1
| | | | | | cases, we can get rid of the postload function entirely and just call directly to the target function. Drivers eventually should just override device_postload() instead of registering for callbacks.
* Latest delegate changes removed the need for bindable_object, so Aaron Giles2011-04-291-1/+1
| | | | get rid of it across the board.
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | existing modern devices and the legacy wrappers to work in this environment. This in general greatly simplifies writing a modern device. [Aaron Giles] General notes: * some more cleanup probably needs to happen behind this change, but I needed to get it in before the next device modernization or import from MESS :) * new template function device_creator which automatically defines the static function that creates the device; use this instead of creating a static_alloc_device_config function * added device_stop() method which is called at around the time the previous device_t's destructor was called; if you auto_free anything, do it here because the machine is gone when the destructor is called * changed the static_set_* calls to pass a device_t & instead of a device_config * * for many devices, the static config structure member names over- lapped the device's names for devcb_* functions; in these cases the members in the interface were renamed to have a _cb suffix * changed the driver_enumerator to only cache 100 machine_configs because caching them all took a ton of memory; fortunately this implementation detail is completely hidden behind the driver_enumerator interface * got rid of the macros for creating derived classes; doing it manually is now clean enough that it isn't worth hiding the details in a macro
* Privatized most of the m_machine pointers in the system to prevent Aaron Giles2011-04-191-1/+3
| | | | direct use.
* Delegates 2.0 implementation. Resdesigned how delegates work to make Aaron Giles2011-04-161-50/+10
| | | | | | | | | | | | | | | | | | | | | them more flexible and simpler to use. Got rid of the proto_delegates altogether in favor of supporting delegates that are bound to NULL objects. Added a front-end template that supports "natural" syntax favored by libraries like boost. Added support for static functions that take reference parameters instead of pointer parameters for the object type. Updated all delegate users in the system to the new syntax. [Aaron Giles] Changed the DIRECT_UPDATE_HANDLER to take a machine reference like everything else in the system. Updated all users. [Aaron Giles] Changed the FUNC() macro to automatically put an & in front of the item passed. In general this works transparently, however it does have the nice side-effect of catching situations where a variable is passed instead of a function name. Fixed those cases to push the naming upstream so that the name is now provided properly. Also added a FUNC_NULL macro since FUNC(NULL) no longer works. [Aaron Giles]
* Cleanups and version bump.mame0142 Aaron Giles2011-04-031-3/+3
|
* Remove redundant item cpu from address_space, in favor of Aaron Giles2011-03-291-4/+0
| | | | | | | | | | | space->device(). S: space->cpu-> R: space->device\(\)\. S: space->cpu R: \&space->device\(\)
* BIG update. Aaron Giles2011-03-291-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove redundant machine items from address_space and device_t. Neither machine nor m_machine are directly accessible anymore. Instead a new getter machine() is available which returns a machine reference. So: space->machine->xxx ==> space->machine().xxx device->machine->yyy ==> device->machine().yyy Globally changed all running_machine pointers to running_machine references. Any function/method that takes a running_machine takes it as a required parameter (1 or 2 exceptions). Being consistent here gets rid of a lot of odd &machine or *machine, but it does mean a very large bulk change across the project. Structs which have a running_machine * now have that variable renamed to m_machine, and now have a shiny new machine() method that works like the space and device methods above. Since most of these are things that should eventually be devices anyway, consider this a step in that direction. 98% of the update was done with regex searches. The changes are architected such that the compiler will catch the remaining errors: // find things that use an embedded machine directly and replace // with a machine() getter call S: ->machine-> R: ->machine\(\)\. // do the same if via a reference S: \.machine-> R: \.machine\(\)\. // convert function parameters to running_machine & S: running_machine \*machine([^;]) R: running_machine \&machine\1 // replace machine-> with machine. S: machine-> R: machine\. // replace &machine() with machine() S: \&([()->a-z0-9_]+machine\(\)) R: \1 // sanity check: look for this used as a cast (running_machine &) // and change to this: *(running_machine *)
* Fix address_space::unmap_write to pass ROW_WRITE instead of ROW_READWRITE Aaron Giles2011-03-281-2/+2
| | | | Fixes Amiga breakage.
* Cleanup of machine.h. Shuffled some fields around, and moved several Aaron Giles2011-03-281-0/+1
| | | | | | | | | | | | | to private member variables with accessors: machine->m_respool ==> machine->respool() machine->config ==> machine->config() machine->gamedrv ==> machine->system() machine->m_regionlist ==> machine->first_region() machine->sample_rate ==> machine->sample_rate() Also converted internal lists to use simple_list.
* Deprecate the old memory_install_* macros. Dynamic installation is now handled Aaron Giles2011-03-271-104/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directly by calling methods on the address_space, which have been expanded with aliases to cover all previous situations. In addition, variants with no mirror or mask value are provided to cover the common cases: memory_install_read*_handler(space, begin, end, mirror, mask, handler) ==> space->install_legacy_read_handler(begin, end [, mirror, mask], FUNC(handler)) memory_install_write*_handler(space, begin, end, mirror, mask, handler) ==> space->install_legacy_write_handler(begin, end [, mirror, mask], FUNC(handler)) memory_install_readwrite*_handler(space, begin, end, mirror, mask, rhandler, whandler) ==> space->install_legacy_readwrite_handler(begin, end [, mirror, mask], FUNC(rhandler), FUNC(whandler)) memory_install_read*_device_handler(space, device, begin, end, mirror, mask, handler) ==> space->install_legacy_read_handler(*device, begin, end [, mirror, mask], FUNC(handler)) memory_install_write*_device_handler(space, device, begin, end, mirror, mask, handler) ==> space->install_legacy_write_handler(*device, begin, end [, mirror, mask], FUNC(handler)) memory_install_readwrite*_device_handler(space, device, begin, end, mirror, mask, rhandler, whandler) ==> space->install_legacy_readwrite_handler(*device, begin, end [, mirror, mask], FUNC(rhandler), FUNC(whandler)) memory_install_read_port(space, begin, end, mirror, mask, port) ==> space->install_read_port(begin, end [, mirror, mask], port) memory_install_read_bank(space, begin, end, mirror, mask, bank) ==> space->install_read_bank(begin, end [, mirror, mask], bank) memory_install_rom(space, begin, end, mirror, mask, ptr) ==> space->install_rom(begin, end [, mirror, mask], ptr) memory_install_ram(space, begin, end, mirror, mask, ptr) ==> space->install_ram(begin, end [, mirror, mask], ptr) memory_unmap_read(space, begin, end, mirror, mask) ==> space->unmap_read(begin, end [, mirror, mask]) memory_nop_read(space, begin, end, mirror, mask) ==> space->nop_read(begin, end [, mirror, mask]) Below are the bulk search & replace regex'es used for this memory_install_read([0-9]+)_handler( *)\(( *)([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ )]+)( *)\) \4->install_legacy_read_handler\2\(\3\5FUNC\(\6\)\7\) memory_install_read([0-9]+)_handler( *)\(( *)([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ )]+)( *)\) \4->install_legacy_read_handler\2\(\3\5FUNC\(\6\)\7\) memory_install_write([0-9]+)_handler( *)\(( *)([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ )]+)( *)\) \4->install_legacy_write_handler\2\(\3\5FUNC\(\6\)\7\) memory_install_write([0-9]+)_handler( *)\(( *)([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ )]+)( *)\) \4->install_legacy_write_handler\2\(\3\5FUNC\(\6\)\7\) memory_install_readwrite([0-9]+)_handler( *)\(( *)([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ ,]+)( *, *)([^ )]+)( *)\) \4->install_legacy_readwrite_handler\2\(\3\5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_readwrite([0-9]+)_handler( *)\(( *)([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ ,]+)( *, *)([^ )]+)( *)\) \4->install_legacy_readwrite_handler\2\(\3\5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_read([0-9]+)_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ )]+)( *)\) \4->install_legacy_read_handler\2\(\3\*\5, \6FUNC\(\7\)\8\) memory_install_read([0-9]+)_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ )]+)( *)\) \4->install_legacy_read_handler\2\(\3\*\5, \6FUNC\(\7\)\8\) memory_install_write([0-9]+)_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ )]+)( *)\) \4->install_legacy_write_handler\2\(\3\*\5, \6FUNC\(\7\)\8\) memory_install_write([0-9]+)_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ )]+)( *)\) \4->install_legacy_write_handler\2\(\3\*\5, \6FUNC\(\7\)\8\) memory_install_readwrite8_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ ,]+)( *, *)([^ )]+)( *)\) \3->install_legacy_readwrite_handler\1\(\2\*\4, \5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_readwrite8_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ ,]+)( *, *)([^ )]+)( *)\) \3->install_legacy_readwrite_handler\1\(\2\*\4, \5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_readwrite16_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ ,]+)( *, *)([^ )]+)( *)\) \3->install_legacy_readwrite_handler\1\(\2\*\4, \5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_readwrite16_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ ,]+)( *, *)([^ )]+)( *)\) \3->install_legacy_readwrite_handler\1\(\2\*\4, \5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_readwrite32_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ ,]+)( *, *)([^ )]+)( *)\) \3->install_legacy_readwrite_handler\1\(\2\*\4, \5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_readwrite32_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ ,]+)( *, *)([^ )]+)( *)\) \3->install_legacy_readwrite_handler\1\(\2\*\4, \5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_readwrite64_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+, *)0 *, *0 *, *([^ ,]+)( *, *)([^ )]+)( *)\) \3->install_legacy_readwrite_handler\1\(\2\*\4, \5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_readwrite64_device_handler( *)\(( *)([^,]+), *([^,]+), *([^,]+,[^,]+,[^,]+,[^,]+, *)([^ ,]+)( *, *)([^ )]+)( *)\) \3->install_legacy_readwrite_handler\1\(\2\*\4, \5FUNC\(\6\)\7FUNC\(\8\)\9\) memory_install_read_port( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_read_port\1\(\2\4, memory_install_read_port( *)\(( *)([^,]+), * \3->install_read_port\1\(\2 memory_install_write_port( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_write_port\1\(\2\4, memory_install_write_port( *)\(( *)([^,]+), * \3->install_write_port\1\(\2 memory_install_readwrite_port( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_readwrite_port\1\(\2\4, memory_install_readwrite_port( *)\(( *)([^,]+), * \3->install_readwrite_port\1\(\2 memory_install_read_bank( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_read_bank\1\(\2\4, memory_install_read_bank( *)\(( *)([^,]+), * \3->install_read_bank\1\(\2 memory_install_write_bank( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_write_bank\1\(\2\4, memory_install_write_bank( *)\(( *)([^,]+), * \3->install_write_bank\1\(\2 memory_install_readwrite_bank( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_readwrite_bank\1\(\2\4, memory_install_readwrite_bank( *)\(( *)([^,]+), * \3->install_readwrite_bank\1\(\2 memory_install_rom( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_rom\1\(\2\4, memory_install_rom( *)\(( *)([^,]+), * \3->install_rom\1\(\2 memory_install_ram( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_ram\1\(\2\4, memory_install_ram( *)\(( *)([^,]+), * \3->install_ram\1\(\2 memory_install_writeonly( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *, \3->install_writeonly\1\(\2\4, memory_install_writeonly( *)\(( *)([^,]+), * \3->install_writeonly\1\(\2 memory_unmap_read( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *\) \3->unmap_read\1\(\2\4\) memory_unmap_read( *)\(( *)([^,]+), * \3->unmap_read\1\(\2 memory_unmap_write( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *\) \3->unmap_write\1\(\2\4\) memory_unmap_write( *)\(( *)([^,]+), * \3->unmap_write\1\(\2 memory_unmap_readwrite( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *\) \3->unmap_readwrite\1\(\2\4\) memory_unmap_readwrite( *)\(( *)([^,]+), * \3->unmap_readwrite\1\(\2 memory_nop_read( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *\) \3->nop_read\1\(\2\4\) memory_nop_read( *)\(( *)([^,]+), * \3->nop_read\1\(\2 memory_nop_write( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *\) \3->nop_write\1\(\2\4\) memory_nop_write( *)\(( *)([^,]+), * \3->nop_write\1\(\2 memory_nop_readwrite( *)\(( *)([^,]+), *([^,]+,[^,]+), *0 *, *0 *\) \3->nop_readwrite\1\(\2\4\) memory_nop_readwrite( *)\(( *)([^,]+), * \3->nop_readwrite\1\(\2
* Created new enum type address_spacenum for specifying an address Aaron Giles2011-03-271-10/+16
| | | | | | | | | | | | space by index. Update functions and methods that accepted an address space index to take an address_spacenum instead. Note that this means you can't use a raw integer in ADDRESS_SPACE macros, so instead of 0 use the enumerated AS_0. Standardized the project on the shortened constants AS_* over the older ADDRESS_SPACE_*. Removed the latter to prevent confusion. Also centralized the location of these definitions to memory.h.
* Added device_t::memory() to fetch a reference to the memory interface, Aaron Giles2011-03-271-60/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or assert if not present. Split address_space::install_[legacy_]handler into install_[legacy_]read_handler, install_[legacy_]write_handler, and install_[legacy_]readwrite_handler. Added variants of address_space handler installers which don't take mirror or mask parameters, since this is by far the most common case. Deprecated API cleanup. Simple search & replace: cpu_suspend ==> device_suspend cpu_resume ==> device_resume cpu_yield ==> device_yield cpu_spin ==> device_spin cpu_spinuntil_trigger ==> device_spin_until_trigger cpu_spinuntil_time ==> device_spin_until_time cpu_spinuntil_int ==> device_spin_until_interrupt cpu_eat_cycles ==> device_eat_cycles cpu_adjust_icount ==> device_adjust_icount cpu_triggerint ==> device_triggerint cpu_set_input_line ==> device_set_input_line cpu_set_input_line_vector ==> device_set_input_line_vector cpu_set_input_line_and_vector ==> device_set_input_line_and_vector cpu_set_irq_callback ==> device_set_irq_callback More complex changes: device_memory(device) ==> device->memory() device_get_space(device, spacenum) ==> device->memory().space(spacenum) cpu_get_address_space(cpu, spacenum) ==> cpu->memory().space(spacenum) cputag_get_address_space(mach, tag, spacenum) ==> mach->device("tag")->memory().space(spacenum) cputag_get_clock(mach, tag) ==> mach->device("tag")->unscaled_clock() cputag_set_clock(mach, tag, hz) ==> mach->device("tag")->set_unscaled_clock(hz) Some regex'es for the more prevalent cases above: S: cpu_get_address_space( *)\(( *)([^,]+)( *), * R: \3->memory().space\1\(\2 S: cputag_get_address_space( *)\(( *)([^,]+)( *),( *)([^,]+)( *), * R: \3->device\1\(\2\6\7\)->memory().space\1\(\2 S: cputag_get_clock( *)\(( *)([^,]+)( *),( *)([^ )]+) *\) R: \3->device\1\(\2\6\7\)->unscaled_clock\(\)
* Remove some straggling const address_space references, and get rid of Aaron Giles2011-03-171-40/+40
| | | | explicit const_casts in memory.h.
* Add directxor parameter to direct memory accessors. Update all callers Aaron Giles2010-12-311-30/+30
| | | | | | | | | that manually XORed addresses to pass the XOR instead. This improves behavior when direct accessors hit non-RAM regions, or when watchpoints are used, because we now know the original, un-xored address and can fall back to standard read/write handlers properly. Also fixes glitched disassembly when read watchpoints are enabled.
* Change shared memory regions to track their size. Added memory_get_shared() Aaron Giles2010-09-041-0/+4
| | | | functions to retrieve a pointer to a shared region and optionally the size.
* Cleanups and version bump.mame0139u2 Aaron Giles2010-08-301-15/+15
|
* Fixed TMS340x0 disassembly view (no whatsnew) Phil Bennett2010-08-241-1/+1
|
* Added mask-free versions of read_word/read_dword/read_qword to Aaron Giles2010-08-211-6/+24
| | | | | | | | | | | | address_space. Also added unaligned variants that can read unaligned values. Rewrote the core handler as a template that handles all cases, along with a simple unit test to verify that everything is correct. Updated 68k, v60, i86, and nec cores to use unaligned read/ write instead of their own stubs for handling misalinged reads. Fixed memory management of ga2 decryption.
* Remove final set of legacy inlines from memory.h. Mostly affects CPU Aaron Giles2010-08-191-19/+0
| | | | | cores, which all now cache a copy of space->direct() and use it for direct accesses.
* Remove most of the temporary inline helpers. Aaron Giles2010-08-191-48/+0
| | | | | | | | The only one that touched a lot of drivers is this one: S: memory_set_decrypted_region( *)\(( *)([^,]+)( *),( *) R: \3->set_decrypted_region\1\(\2