summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/devintrf.h
Commit message (Collapse)AuthorAgeFilesLines
* devintrf.* -> device.* Aaron Giles2011-06-281-544/+0
|
* Fix device clock modification to update all related parameters. Aaron Giles2011-05-261-1/+1
| | | | Fixes issue with segahang games in particular.
* Readd type checking to late-binding delegates. This is generally used in Aaron Giles2011-05-111-1/+1
| | | | | | | | | | | | a limited capacity (e.g., for devices), but the existing copy-and-rebind code would just cast the bound object without verifying the pointer was of the correct type or pointing to the correct class in the hierarchy. Objects that are late-bound must be derived from the delegate_late_bind class at some point so that a dynamic_cast from delegate_late_bind to the appropriate type succeeds. Updated the address map and custom NVRAM handlers to do the right thing with their re-binding.
* Switch input ports to use function-based constructors instead of tokens. Aaron Giles2011-05-101-3/+2
| | | | | | | | | Remove the old tokenizing helpers. Add basic classes for ports, fields, settings, and dip locations as a first step. These will be fully cleaned up later. Added machine() method to field to hide all the necessary indirection. Changed custom/changed handlers into generic read/write handlers, and added wrappers to convert them to device read/write lines. [Aaron Giles]
* Cleanups and version bumpmame0142u3 Angelo Salese2011-05-081-4/+4
|
* Converted btoads to a modern driver as a checkpoint to see what's Aaron Giles2011-05-041-0/+3
| | | | still gross about it.
* Be consistent about template argument naming. Aaron Giles2011-04-301-16/+16
|
* Converted presave/postload functions to delegates. In a lot of Aaron Giles2011-04-301-2/+2
| | | | | | 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-3/+3
| | | | get rid of it across the board.
* Switch to using delegates for some callbacks: Aaron Giles2011-04-271-6/+5
| | | | | | | | | | | | - non-device timer callbacks - machine state changing callbacks - configuration callbacks - per-screen VBLANK callbacks - DRC backend callbacks For the timer case only, I added wrappers for the old-style functions. Over time, drivers should switch to device timers instead, reducing the number of timers that are directly allocated through the scheduler.
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-284/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename state_manager -> save_manager since the term "state" is overloaded. Aaron Giles2011-04-201-3/+3
|
* Privatized most of the m_machine pointers in the system to prevent Aaron Giles2011-04-191-1/+3
| | | | direct use.
* Switch from m_machine to machine() everywhere. In some cases this Aaron Giles2011-04-181-0/+2
| | | | | | | | | | | meant adding a machine() accessor but it's worth it for consistency. This will allow future changes from reference to pointer to happen transparently for devices. [Aaron Giles] Simple S&R: m_machine( *[^ (!=;]) machine()\1
* (Big tangle of changes that all happened as I was looking into the ROM Aaron Giles2011-04-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loader rewrite, which is still in progress....) Replaced mamedriv.c with a new driver list mechanism that is generated by the build tools. The emulator core now expects the presence of a file called src/$(TARGET)/$(SUBTARGET).lst which is just a raw list of driver names, one per line. C and C++ comments are still permitted. This file is parsed by a new build tool makelist which extracts the driver names, sorts them, and generates a file called drivlist.c, which is consumed by the core. [Aaron Giles] Added new osdcore function osd_malloc_array() which is identical to osd_malloc() but obviously hints that the underlying allocation is for an array. Updated all callers to use the appropriate form. Modified the Windows allocator to only use guard pages for array-style allocations, allowing us to enable them once again in debug builds. [Aaron Giles] Created new static class driver_list to wrap accesses to the list of available drivers. Improved speed of driver lookups by relying on the presorting done by makelist. [Aaron Giles] Created helper class driver_enumerator as a helper for iterating through the list of drivers. This class supports basic filtering and iteration, and also serves as a temporary cache of machine_configs. [Aaron Giles] Created cli_frontend object to wrap all the CLI handling code in clifront.c. Updated/simplified all the code to take advantage of the driver_enumerator. [Aaron Giles] Created media_auditor object to wrap all the auditing functions in audit.c. Updated all users to the new interface. Note that the new auditing mechanism is slightly out of sync with the romload code in terms of finding ROMs owned by devices, so it may mis-report some issues until the new ROM loading code is in. [Aaron Giles] Added concept of a per-device searchpath. For most devices, their searchpath is just the short name of the device. For driver_devices, the searchpath is driver[;parent[;bios]]. This searchpath will eventually be used by the rom loader to find ROMs. For now it is used by the media auditor only. [Aaron Giles] Created info_xml_creator object to wrap all the info generation functions in info.c. Converted the file to C++ and cleaned up the input processing code. [Aaron Giles] (not for whatsnew ... Known issues: auditing of CHDs appears busted, and debug builds report unfreed memory if you use the built-in game picker)
* Move overridable device->rom_region(), device->machine_config_additions(), and Aaron Giles2011-03-301-6/+7
| | | | | device->input_ports() to protected methods. Added non-virtual wrappers around them.
* Add template specializations for device/state/memory interfaces that are Aaron Giles2011-03-291-0/+3
| | | | | non-const, so that the generic one doesn't get selected. Should fix some recent performance regressions.
* BIG update. Aaron Giles2011-03-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 *)
* Added device_t::memory() to fetch a reference to the memory interface, Aaron Giles2011-03-271-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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\(\)
* Added possibility of altering default input port setting for devices. ↵ Miodrag Milanovic2011-03-161-0/+6
| | | | [Miodrag Milanovic]
* Converted core_options to a class. Removed a bunch of marginal Aaron Giles2011-03-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functionality in favor of alternate mechanisms. Errors are now reported via an astring rather than via callbacks. Every option must now specify a type (command, integer, float, string, boolean, etc). Command behavior has changed so that only one command is permitted. [Aaron Giles] Changed fileio system to accept just a raw searchpath instead of an options/option name combination. [Aaron Giles] Created emu_options class dervied from core_options which wraps core emulator options. Added mechanisms to cleanly change the system name and add/remove system-specific options, versus the old way using callbacks. Also added read accessors for all the options, to ensure consistency in how parameters are handled. Changed most core systems to access emu_options instead of core_options. Also changed machine->options() to return emu_options. [Aaron Giles] Created cli_options class derived from emu_options which adds the command-line specific options. Updated clifront code to leverage the new class and the new core behaviors. cli_execute() now accepts a cli_options object when called. [Aaron Giles] Updated both SDL and Windows to have their own options classes, derived from cli_options, which add the OSD-specific options on top of everything else. Added accessors for all the options so that queries are strongly typed and simplified. [Aaron Giles] Out of whatsnew: I've surely screwed up some stuff, though I have smoke tested a bunch of things. Let me know if you hit anything odd. Also I know this change will impact the WINUI stuff, please let me know if there are issues. All the functionality necessary should still be present. If it's not obvious, please talk to me before adding stuff to the core_options class.
* Input ports can now be added to device, names are formed as sub tags from ↵ Miodrag Milanovic2011-02-131-0/+3
| | | | parent device tag. [Miodrag Milanovic]
* mame_file is now emu_file and is a class. It is required Aaron Giles2011-02-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | to pass a core_options object to the constructor, along with a search path. This required pushing either a running_machine or a core_options through some code that wasn't previously ready to handle it. emu_files can be reused over multiple open/close sessions, and a lot of core code cleaned up nicely as things were converted to them. Also created a file_enumerator class for iterating over files in a searchpath. This replaces the old mame_openpath functions. Changed machine->options() to return a reference. Removed public nvram_open() and fixed jchan/kaneko16 to stop directly saving NVRAM. Removed most of the mame_options() calls; this will soon go away entirely, so don't add any more. Added core_options to device_validity_check() so they can be used to validate things.
* Removed short name as parameter from device_config this way it is not ↵ Miodrag Milanovic2011-02-111-3/+3
| | | | | mandatory any more. Most of files is rolled back to previous state. (no whatsnew)
* - Added shortname to devices in order to make ROM loading per device ↵ Miodrag Milanovic2011-02-101-4/+5
| | | | | | possible. [Miodrag Milanovic] - Updated all devices containing ROM regions to have short names and all modern devices too - Created new validation to check existence of short name if device contain ROM region defined
* Cleanups and version bump.mame0141u2 Aaron Giles2011-02-091-1/+1
|
* Take advantage of the driver_device to clean up state saving for Aaron Giles2011-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | many drivers. Also move some allocated memory into arrays in the state structure where appropriate (this is still in progress). Regex'es used (in src/mame only): state_save_register_global( *)\(( *)([^,]+), *state->([^ )]+)( *)\) state->save_item\1\(\2NAME\(state->\4\)\5\) state_save_register_global_array( *)\(( *)([^,]+), *state->([^ )]+)( *)\) state->save_item\1\(\2NAME\(state->\4\)\5\) state_save_register_global_bitmap( *)\(( *)([^,]+), *state->([^ )]+)( *)\) state->save_item\1\(\2NAME\(*state->\4\)\5\) state_save_register_global_pointer( *)\(( *)([^,]+), *state->([^,]+), state->save_pointer\1\(\2NAME\(state->\4\)\5,
* Moved the state saving system to C++. For now the registration macros Aaron Giles2011-02-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are still intact. The new state_manager class has templatized methods for saving the various types, and through template specialization can save more complex system types cleanly (like bitmaps and attotimes). Added new mechanism to detect proper state save types. This is much more strict and there will likely be some games/devices that fatalerror at startup until they are remedied. Spot checking has caught the more common situations. The new state_manager is embedded directly in the running_machine, allowing objects to register state saving in their constructors now. Added NAME() macro which is a generalization of FUNC() and can be used to wrap variables that are registered when directly using the new methods as opposed to the previous macros. For example: machine->state().save_item(NAME(global_item)) Added methods in the device_t class that implicitly register state against the current device, making for a cleaner interface. Just a couple of required regexes for now: state_save_register_postload( *)\(( *)([^,;]+), * \3->state().register_postload\1\(\2 state_save_register_presave( *)\(( *)([^,;]+), * \3->state().register_presave\1\(\2
* Move generic templates from emucore.h to emutempl.h. Aaron Giles2011-02-071-7/+7
| | | | | | Normalize the tagged_list template to wrap a regular standard_list and have similar semantics. Updated a few direct callers to handle the changes.
* Convert emu_timers to objects. Move implementation and management of Aaron Giles2011-02-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timers into the scheduler. Retain TIMER devices as a separate wrapper in timer.c/.h. Inline wrappers are currently provided for all timer operations; a future update will bulk clean these up. Rather than using macros which hide generation of a string-ified name for callback functions, the new methods require passing both a function pointer plus a name string. A new macro FUNC() can be used to output both, and another macro MFUNC() can be used to output a stub-wrapped class member as a callback. Also added a time() method on the machine, so that machine->time() gives the current emulated time. A wrapper for timer_get_time is currently provided but will be bulk replaced in the future. For this update, convert all classic timer_alloc, timer_set, timer_pulse, and timer_call_after_resynch calls into method calls on the scheduler. For new device timers, added methods to the device_t class that make creating and managing these much simpler. Modern devices were updated to use these. Here are the regexes used; some manual cleanup (compiler-caught) will be needed since regex doesn't handle nested parentheses cleanly 1. Convert timer_call_after_resynch calls timer_call_after_resynch( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().synchronize\1\(\2FUNC(\6), \5, \4\) 2. Clean up trailing 0, NULL parameters (synchronize[^;]+), 0, NULL\) \1) 3. Clean up trailing NULL parameters (synchronize[^;]+), NULL\) \1) 4. Clean up completely empty parameter lists synchronize\(FUNC\(NULL\)\) synchronize() 5. Convert timer_set calls timer_set( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_set\1\(\2\4, FUNC(\7), \6, \5\) 6. Clean up trailing 0, NULL parameters (timer_set[^;]+), 0, NULL\) \1) 7. Clean up trailing NULL parameters (timer_set[^;]+), NULL\) \1) 8. Convert timer_set calls timer_pulse( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_pulse\1\(\2\4, FUNC(\7), \6, \5\) 9. Clean up trailing 0, NULL parameters (timer_pulse[^;]+), 0, NULL\) \1) 10. Clean up trailing NULL parameters (timer_pulse[^;]+), NULL\) \1) 11. Convert timer_alloc calls timer_alloc( *)\(( *)([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_alloc\1\(\2FUNC(\4), \5\) 12. Clean up trailing NULL parameters (timer_alloc[^;]+), NULL\) \1) 13. Clean up trailing 0 parameters (timer_alloc[^;]+), 0\) \1) 14. Fix oddities introduced \&m_machine->scheduler() m_machine.scheduler()
* Ok, last major rename for this round: Aaron Giles2011-01-011-4/+4
| | | | | | | | | | | | | | | | memory_region() == machine->region()->base() memory_region_length() == machine->region()->bytes() region_info -> memory_region Regex searches: S: memory_region( *)\(( *)([^,&]+), *([^)]+)\) R: \3->region\1\(\2\4\)->base\(\) S: memory_region_length( *)\(( *)([^,&]+), *([^)]+)\) R: \3->region\1\(\2\4\)->bytes\(\)
* running_device -> device_t Aaron Giles2010-12-311-4/+0
| | | | | They both already existed. No sense in having two names for the same object type.
* MDRV_* -> MCFG_* Aaron Giles2010-12-311-3/+3
| | | | | There hasn't been a machine driver for many years.
* More Clang fixes (verified OK with GCC) [Balrog] R. Belmont2010-10-161-4/+4
|
* Fix another Clang issue [Balrog] R. Belmont2010-10-031-6/+6
|
* Cleanups and version bump.mame0139u3 Aaron Giles2010-09-191-21/+21
|
* 04030: All sets in taito_f3.c, taito_z.c, kaneko16.c, konamigq.c, ↵ Aaron Giles2010-09-181-0/+1
| | | | overdriv.c: "16-bit EEPROM set with 8-bit data"
* Added an integral device_timer_id to device timers. This is a Aaron Giles2010-09-171-2/+6
| | | | | | | | | | | | | | | | cleaner way to differentiate between multiple timers rather than relying on the pointers. These values are also saved with the timers. Updated the few devices using device timers to leverage this. Added new function device_timer_call_after_resynch() which creates a temporary 0-length timer that calls back through the device's device_timer() method with a given device_timer_id. Updated i8257_device to initialize its state and use device timers. (Fixes 04032: All sets in dkong.c: [debug] Game does not start.)
* Moved auto-finding code down into the device_t object so it can be more Aaron Giles2010-09-141-0/+105
| | | | | | | | | | | | | | | | broadly used. Added memory interface to the intelfsh device so you can access/view the data in the debugger and via the standard memory interfaces. Removed the old memory() method in favor of new functions read_raw()/write_raw() which do direct reads/writes of the data. Cleaned up CPS3 No-CD sets to break up the "ROMs" into individual flash pieces which are automatically loaded by the intelfsh device on initialization. Also split the MACHINE_CONFIG to only populate the number of SIMMs actually present for each game, as documented in the top of the file. And replaced the NVRAM_HANDLER with an NVRAM device.
* Made the mc146818 a proper device, modernized it, and added an NVRAM interface Aaron Giles2010-09-101-0/+5
| | | | so that drivers don't have to ask it to be manually saved.
* Added DECLARE/DEFINE_TRIVIAL_DERIVED_DEVICE macros to simplify the Aaron Giles2010-09-091-1/+35
| | | | | | | | definition of devices that are based off of a parent device, but which differ in name and a single parameter. Added a UINT32 param to the device_config constructor to facilitate the use of the new macros.
* Move debug_setup() call to after the device_debug class is created. Aaron Giles2010-09-061-1/+0
|
* Added read_status() and write_command() methods to the okim6295_device Aaron Giles2010-09-051-0/+5
| | | | | | | | | | | | | | for the common case where these are done outside the context of a read or write handler (it was annoying to pass in the fake address space for these cases). Added DEVCB_DEVICE_MEMBER() macros which allow you to specify a READ8_MEMBER or WRITE8_MEMBER in a device callback (via dynamically generated trampolines). Replaced all remaining calls to okim6295_r/okim6295_w with calls to the new methods, and removed the static functions.
* Have each device create its own device_debug instead of letting the Aaron Giles2010-09-041-1/+0
| | | | | | | debugger do it. This allows the device to start itself up before the debugger tries to figure out what to do with it. Fixes the problem where register names were not populated into the symbol table correctly after I shuffled the initialization order.
* Changed driver_data objects to be devices. Replaced the driver_data_t Aaron Giles2010-09-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | class with a new driver_device class, which is the base class for all driver_data objects now. The new driver devices are added as the first device in the device list, with a tag of "root"; all other devices are now owned by the driver device. Moved core callbacks (machine_start/_reset, sound_start/_reset, video_start/_reset/_eof/_update, and palette_init) into device configuration parameters on these new devices. The driver_device base class overrides device_start(), ensures all other devices have been started, and then calls, in order, the following overridable methods: find_devices() - new, used to locate devices prior to DRIVER_INIT DRIVER_INIT function from the game driver palette_init() - by default calls the MDRV_PALETTE_INIT function driver_start() - new machine_start() - by default calls the MDRV_MACHINE_START function sound_start() - by default calls the MDRV_SOUND_START function video_start() - by default calls the MDRV_VIDEO_START function Similarly, the driver_device class overrides device_reset() and then calls these methods in order: driver_reset() - new machine_reset() - by default calls the MDRV_MACHINE_RESET function sound_reset() - by default calls the MDRV_SOUND_RESET function video_reset() - by default calls the MDRV_VIDEO_RESET function To accommodate these changes, initialization order is slightly altered from before. The tilemap, video, sound, and debug systems are now initialized prior to the devices' start. And the user callbacks for DRIVER_INIT, PALETTE_INIT, MACHINE_START, SOUND_START, and VIDEO_START are all called back-to-back. The net effect should be similar, however. Added methods (optional_device and required_device) to the new driver_device class to find devices, intended to be used from the find_devices() callback. See harddriv.h and beathead.h for examples of usage. Changed device_t::subtag to only prepend a prefix if the device is not the 'root' device, in order to keep compatibility with existing tag searching. Changed device startup to actively reorder devices when they report missing dependencies. This ensures that the reset functions get called in the same order that the start functions did. Bulk updated drivers as follows: First removed the old static alloc function from the driver_data_t: S: [ \t]*static driver_device \*alloc *\( *running_machine *\&machine *\) *\{ *return auto_alloc_clear *\( *\&machine *, *[a-zA-Z0-9_]+_state *\( *machine *\) *\); *\}[\r\n]* R: Then switched from driver_data_t to driver_device: S: driver_data_t R: driver_device Then changed the constructors to pass the correct parameters: S: ([a-zA-Z0-9_]+)_state *\( *running_machine *\&machine *\)([\r\n\t ]+): *driver_device *\( *machine *\) R: \1_state\(running_machine \&machine, const driver_device_config_base \&config\)\2: driver_device\(machine, config\)
* Cleanups and version bump.mame0139u2 Aaron Giles2010-08-301-1/+1
|
* De-converted MACHINE_DRIVER from tokens back to constructor functions, regaining Aaron Giles2010-08-261-29/+9
| | | | | | | | | | | type safety. If legacy devices still use inline data, those types are not checked. However, new devices no longer have access to the generic m_inline_data. Instead their MDRV_* macros should map to calls to static functions in the device config class which downcast a generic device_config to the specific device config, and then set the appropriate values. This is not to be done inline in order to prevent further code bloat in the constructors. See eeprom/7474/i2cmem/okim6295 for examples. #ifdef'ed several unused machine driver definitions that weren't referenced.
* Massive memory system change. This is another step along the path toward Aaron Giles2010-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | supporting cleaner implementations of drivers in the explicitly OO world. Expect a follow-on of several more changes to clean up from this one, which deliberately tried to avoid touching much driver code. Converted address_space to a class, and moved most members behind accessor methods, apart from space->machine and space->cpu. Removed external references to 8le/8be/16le/16be/32le/32be/64le/64be. All external access is now done via virtual functions read_byte()/read_word()/etc. Moved differentiation between the endianness and the bus width internal to memory.c, and also added a new axis to support small/large address spaces, which allows for faster lookups on spaces smaller than 18 bits. Provided methods for most global memory operations within the new address_space class. These will be bulk converted in a future update, but for now there are inline wrappers to hide this change from existing callers. Created new module delegate.h which implements C++ delegates in a form that works for MAME. Details are in the opening comment. Delegates allow member functions of certain classes to be used as callbacks, which will hopefully be the beginning of the end of fetching the driver_data field in most callbacks. All classes that host delegates must derive from bindable_object. Today, all devices and driver_data do implicitly via their base class. Defined delegates for read/write handlers. The new delegates are always passed an address_space reference, along with offset, data, and mask. Delegates can refer to methods either in the driver_data class or in a device class. To specify a callback in an address map, just use AM_READ_MEMBER(class, member). In fact, all existing AM_ macros that take read/write handlers can now accept delegates in their place. Delegates that are specified in an address map are proto-delegates which have no object; they are bound to their object when the corresponding address_space is created. Added machine->m_nonspecific_space which can be passed as the required address_space parameter to the new read/write methods in legacy situations where the space is not provided. Eventually this can go away but we will need it for a while yet. Added methods to the new address_space class to dynamically install delegates just like you can dynamically install handlers today. Delegates installed this way must be pre-bound to their object. Moved beathead's read/write handlers into members of beathead_state as an example of using the new delegates. This provides examples of both static (via an address_map) and dynamic (via install_handler calls) mapping using delegates. Added read/write member functions to okim6295_device as an example of using delegates to call devices. Updated audio/williams.c as a single example of calling the device via its member function callbacks. These will be bulk updated in a future update, and the old global callbacks removed. Changed the DIRECT_UPDATE_CALLBACKs into delegates as well. Updated all users to the new function format. Added methods on direct_read_data for configuring the parameters in a standard way to make the implementation clearer. Created a simple_list template container class for managing the common singly-linked lists we use all over in the project. Many other internal changes in memory.c, mostly involving restructuring the code into proper classes.
* Remove the global clock accessors and cpu_* aliases: Aaron Giles2010-07-071-28/+0
| | | | | | | | | | | | | | | | | | | | cpu_get_clock -> device_get_clock cpu_set_clock -> device_set_clock cpu_get_clockscale -> device_get_clock_scale cpu_set_clockscale -> device_set_clock_scale Search: device_get_clock([ \t]*)\(([ \t]*)([^)]+) Replace: \3->unscaled_clock\1\(\2 Search: device_set_clock([ \t]*)\(([ \t]*)([^,]+),[ \t]* Replace: \3->set_unscaled_clock\1\(\2 Search: device_get_clock_scale([ \t]*)\(([ \t]*)([^)]+) Replace: \3->clock_scale\1\(\2 Search: device_set_clock_scale([ \t]*)\(([ \t]*)([^,]+),[ \t]* Replace: \3->set_clock_scale\1\(\2
* Time to kill off some deadwood. Aaron Giles2010-07-071-1/+0
| | | | | | | | | | First to go is devtag_get_device() (what a stupid name). Use machine->device() instead. This was strictly a bulk replace: Search: devtag_get_device([ \t]*)\(([ \t]*)([^,]+),[ \t]* Replace: \3->device\1\(\2