summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/adsp2100/adsp2100.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move all devices into separate part of src tree (nw) Miodrag Milanovic2015-09-131-1908/+0
|
* memory: Remove support for decrypted bases, use an address space instead [O. ↵ Olivier Galibert2015-06-241-1/+1
| | | | Galibert]
* moved all to std::string (nw) Miodrag Milanovic2015-04-221-7/+7
|
* string -> str rename due to future conflicts (nw) Miodrag Milanovic2015-04-121-2/+2
|
* There is no implicit conversion to char* in std::string (nw) Miodrag Milanovic2015-04-121-4/+4
|
* fixed most of the -Wunreachable-code-break and -Wunreachable-code-return ↵ Oliver Stöneberg2014-09-081-1/+0
| | | | warnings of clang 3.5 when compiling MESS (nw)
* adsp21xx_device: converted to devcb2 (nw) Ivan Vangelista2014-04-221-16/+7
|
* modernized cage, dcs and midwayic (nw) Miodrag Milanovic2014-04-201-4/+4
| | | | | removed mcfglgcy.h and nvram legacy support in machine and mconfig also updated adsp2100 so I can do dcs changes this require clean build
* renamed a few more files from *.c to *.inc Oliver Stöneberg2014-03-191-1/+1
|
* Bulk convert files that already had standard BSD license in my name Aaron Giles2013-10-161-31/+2
| | | | to new license tagged form.
* Fix duplicate shortnames to allow XML to show device (nw) Scott Stone2013-08-201-5/+5
|
* did modern cpu cores as well (nw) Miodrag Milanovic2013-06-211-10/+10
|
* pass this instead of NULL and options instead of 0 in the class based cpu ↵ smf-2013-03-061-1/+1
| | | | cores (nw)
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-67/+67
|
* Since nobody checks for NULLs anyway, make Aaron Giles2012-09-191-3/+3
| | | | | | | | | | | | device_memory_interface::space() assert against NULL and return a reference, and pushed references throughout all address space usage in the system. Added a has_space() method to check for those rare case when it is ambiguous. [Aaron Giles] Also reinstated the generic space and added fatal error handlers if anyone tries to actually read/write from it.
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-223/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Switch from m_machine to machine() everywhere. In some cases this Aaron Giles2011-04-181-1/+1
| | | | | | | | | | | 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 update. Aaron Giles2011-03-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 *)
* Created new enum type address_spacenum for specifying an address Aaron Giles2011-03-271-3/+3
| | | | | | | | | | | | 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.
* Removed short name as parameter from device_config this way it is not ↵ Miodrag Milanovic2011-02-111-10/+10
| | | | | 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-10/+10
| | | | | | 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
* Get rid of state_save_register_device_* macros in favor of direct Aaron Giles2011-02-091-78/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | calls on the device object. Regex used: state_save_register_device_item( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\) \3->save_item\1\(\2NAME\(\6\),\5\4\7\) state_save_register_device_item_array( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\) \3->save_item\1\(\2NAME\(\6\),\5\4\7\) state_save_register_device_item_2d_array( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\) \3->save_item\1\(\2NAME\(\6\),\5\4\7\) state_save_register_device_item_bitmap( *)\(( *)([^,]+), *([^,]+),( *)([^ )]+)( *)\) \3->save_item\1\(\2NAME\(\*\6\),\5\4\7\) state_save_register_device_item_pointer( *)\(( *)([^,]+), *([^,]+),( *)([^,]+), *([^ )]+)( *)\) \3->save_pointer\1\(\2NAME\(\6\),\5\7,\5\4\8\) this->save_ save_ (save_item[^;]+), *0( *)\); \1\2\); (save_pointer[^;]+), *0( *)\); \1\2\);
* C++-ified the DSP32 code so Andrew has something modern to work from. Aaron Giles2011-01-281-0/+3
|
* Fix type found by clang. Aaron Giles2010-09-301-1/+1
|
* Cleanups and version bump.mame0139u3 Aaron Giles2010-09-191-14/+14
|
* Convert ADSP21xx core to a modern CPU device. Aaron Giles2010-09-091-1614/+1416
|
* Remove final set of legacy inlines from memory.h. Mostly affects CPU Aaron Giles2010-08-191-1/+3
| | | | | cores, which all now cache a copy of space->direct() and use it for direct accesses.
* Remove memory_read/write_byte/word/dword/qword* variants. Again, this is mostly Aaron Giles2010-08-191-6/+6
| | | | | | | | | | | | | | | | | | bulk search & replace: S: memory_read_([bytewordq]+)_[0-9lbe_maskd]+( *)\(( *)([^,]+)( *),( *) R: \4->read_\1\2\(\3 S: memory_read_([bytewordq]+)( *)\(( *)([^,]+)( *),( *) R: \4->read_\1\2\(\3 S: memory_write_([bytewordq]+)_[0-9lbe_maskd]+( *)\(( *)([^,]+)( *),( *) R: \4->write_\1\2\(\3 S: memory_write_([bytewordq]+)( *)\(( *)([^,]+)( *),( *) R: \4->write_\1\2\(\3 Gets 99% of the cases.
* Replace "const address_space" with "address_space" throughout the system. Aaron Giles2010-08-191-3/+3
| | | | | | | | | | | The purpose of making it const before was to discourage direct tampering, but private/protected does a better job of that now anyhow, and it is annoying now. s/const[ \t]+address_space\b/address_space/g; Is basically what I did.
* Created CPU-specific device types for all CPUs, using new macros Aaron Giles2010-07-031-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | DECLARE_LEGACY_CPU_DEVICE and DEFINE_LEGACY_CPU_DEVICE. Changed CPUs to be their own device types, rather than all of type CPU with a special internal subtype. Note that as part of this process I removed the CPU_ prefix from the ALL-CAPS device name, so CPU_Z80 is just plain old Z80 now. This required changing a couple of names like 8080 to I8080 so that there was an alphabetic first character. Added memory interfaces to the list of fast-access interfaces. To do this properly I had to add a separate method to devices which is called immediately after construction, when it is possible to perform dynamic_casts on fully-constructed objects. (This is just internal, no changes necessary to the devices themselves.) Some additional notes: * SH2 and SH4 had typedefs that conflicted with their CPU_-less names so I bulk renamed to structures to sh2_state and sh4_state; RB, feel free to choose alternate names if you don't like 'em * SCSP was caught doing something to the 3rd indexed CPU. Since several systems that use SCSP don't even have 3 CPUs, I had no idea what this was supposed to do, so I changed to it reference "audiocpu" assuming that stv was the assumed target. This is really gross and should be a configuration parameter, not a hard-coded assumption.
* Change cpu_device into a base class. Rename old cpu_device to legacy_cpu_device. Aaron Giles2010-06-171-3/+3
| | | | Update interfaces as appropriate.
* Change cpu execute function to just use the icount stuffed by Aaron Giles2010-06-091-5/+0
| | | | | the scheduler, rather than manging an incoming cycle count. It was confusing to have multiple sources of cycle counts.
* Changed CPU callbacks to use cpu_device, eliminating a bunch of casting. Aaron Giles2010-06-081-6/+6
|
* WARNING: There are likely to be regressions in both functionality and Aaron Giles2010-06-081-158/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | performance as a result of this change. Do not panic; report issues to the list in the short term and I will look into them. There are probably also some details I forgot to mention. Please ask questions if anything is not clear. NOTE: This is a major internal change to the way devices are handled in MAME. There is a small impact on drivers, but the bulk of the changes are to the devices themselves. Full documentation on the new device handling is in progress at http://mamedev.org/devwiki/index.php/MAME_Device_Basics Defined two new casting helpers: [Aaron Giles] downcast<type>(value) should be used for safe and efficient downcasting from a base class to a derived class. It wraps static_cast<> by adding an assert that a matching dynamic_cast<> returns the same result in debug builds. crosscast<type>(value) should be used for safe casting from one type to another in multiple inheritance scenarios. It compiles to a dynamic_cast<> plus an assert on the result. Since it does not optimize down to static_cast<>, you should prefer downcast<> over crosscast<> when you can. Redefined running_device to be a proper C++ class (now called device_t). Same for device_config (still called device_config). All devices and device_configs must now be derived from these base classes. This means each device type now has a pair of its own unique classes that describe the device. Drivers are encouraged to use the specific device types instead of the generic running_device or device_t classes. Drivers that have a state class defined in their header file are encouraged to use initializers off the constructor to locate devices. [Aaron Giles] Removed the following fields from the device and device configuration classes as they never were necessary or provided any use: device class, device family, source file, version, credits. [Aaron Giles] Added templatized variant of machine->device() which performs a downcast as part of the device fetch. Thus machine->device<timer_device>("timer") will locate a device named "timer", downcast it to a timer_device, and assert if the downcast fails. [Aaron Giles] Removed most publically accessible members of running_device/device_t in favor of inline accessor functions. The only remaining public member is machine. Thus all references to device->type are now device->type(), etc. [Aaron Giles] Created a number of device interface classes which are designed to be mix- ins for the device classes, providing specific extended functionality and information. There are standard interface classes for sound, execution, state, nvram, memory, and disassembly. Devices can opt into 0 or more of these classes. [Aaron Giles] Converted the classic CPU device to a standard device that uses the execution, state, memory, and disassembly interfaces. Used this new class (cpu_device) to implement the existing CPU device interface. In the future it will be possible to convert each CPU core to its own device type, but for now they are still all CPU devices with a cpu_type() that specifies exactly which kind of CPU. [Aaron Giles] Created a new header devlegcy.h which wraps the old device interface using some special template classes. To use these with an existing device, simply remove from the device header the DEVICE_GET_INFO() declaration and the #define mapping the ALL_CAPS name to the DEVICE_GET_INFO. In their place #include "devlegcy.h" and use the DECLARE_LEGACY_DEVICE() macro. In addition, there is a DECLARE_LEGACY_SOUND_DEVICE() macro for wrapping existing sound devices into new-style devices, and a DECLARE_LEGACY_NVRAM_DEVICE() for wrapping NVRAM devices. Also moved the token and inline_config members to the legacy device class, as these are not used in modern devices. [Aaron Giles] Converted the standard base devices (VIDEO_SCREEN, SPEAKER, and TIMER) from legacy devices to the new C++ style. Also renamed VIDEO_SCREEN to simply SCREEN. The various global functions that were previously used to access information or modify the state of these devices are now replaced by methods on the device classes. Specifically: video_screen_configure() == screen->configure() video_screen_set_visarea() == screen->set_visible_area() video_screen_update_partial() == screen->update_partial() video_screen_update_now() == screen->update_now() video_screen_get_vpos() == screen->vpos() video_screen_get_hpos() == screen->hpos() video_screen_get_vblank() == screen->vblank() video_screen_get_hblank() == screen->hblank() video_screen_get_width() == screen->width() video_screen_get_height() == screen->height() video_screen_get_visible_area() == screen->visible_area() video_screen_get_time_until_pos() == screen->time_until_pos() video_screen_get_time_until_vblank_start() == screen->time_until_vblank_start() video_screen_get_time_until_vblank_end() == screen->time_until_vblank_end() video_screen_get_time_until_update() == screen->time_until_update() video_screen_get_scan_period() == screen->scan_period() video_screen_get_frame_period() == screen->frame_period() video_screen_get_frame_number() == screen->frame_number() timer_device_adjust_oneshot() == timer->adjust() timer_device_adjust_periodic() == timer->adjust() timer_device_reset() == timer->reset() timer_device_enable() == timer->enable() timer_device_enabled() == timer->enabled() timer_device_get_param() == timer->param() timer_device_set_param() == timer->set_param() timer_device_get_ptr() == timer->get_ptr() timer_device_set_ptr() == timer->set_ptr() timer_device_timeelapsed() == timer->time_elapsed() timer_device_timeleft() == timer->time_left() timer_device_starttime() == timer->start_time() timer_device_firetime() == timer->fire_time() Updated all drivers that use the above functions to fetch the specific device type (timer_device or screen_device) and call the appropriate method. [Aaron Giles] Changed machine->primary_screen and the 'screen' parameter to VIDEO_UPDATE to specifically pass in a screen_device object. [Aaron Giles] Defined a new custom interface for the Z80 daisy chain. This interface behaves like the standard interfaces, and can be added to any device that implements the Z80 daisy chain behavior. Converted all existing Z80 daisy chain devices to new-style devices that inherit this interface. [Aaron Giles] Changed the way CPU state tables are built up. Previously, these were data structures defined by a CPU core which described all the registers and how to output them. This functionality is now part of the state interface and is implemented via the device_state_entry class. Updated all CPU cores which were using the old data structure to use the new form. The syntax is currently awkward, but will be cleaner for CPUs that are native new devices. [Aaron Giles] Converted the okim6295 and eeprom devices to the new model. These were necessary because they both require multiple interfaces to operate and it didn't make sense to create legacy device templates for these single cases. (okim6295 needs the sound interface and the memory interface, while eeprom requires both the nvram and memory interfaces). [Aaron Giles] Changed parameters in a few callback functions from pointers to references in situations where they are guaranteed to never be NULL. [Aaron Giles] Removed MDRV_CPU_FLAGS() which was only used for disabling a CPU. Changed it to MDRV_DEVICE_DISABLE() instead. Updated drivers. [Aaron Giles] Reorganized the token parsing for machine configurations. The core parsing code knows how to create/replace/remove devices, but all device token parsing is now handled in the device_config class, which in turn will make use of any interface classes or device-specific token handling for custom token processing. [Aaron Giles] Moved many validity checks out of validity.c and into the device interface classes. For example, address space validation is now part of the memory interface class. [Aaron Giles] Consolidated address space parameters (bus width, endianness, etc.) into a single address_space_config class. Updated all code that queried for address space parameters to use the new mechanism. [Aaron Giles]
* Remove some aliases between CPUINFO_ and DEVINFO_ to help clarify Aaron Giles2010-01-211-9/+9
| | | | | | usage. Also converted a few more places to use the new accessors.
* Correct a long-standing design flaw: device configuration state Aaron Giles2010-01-181-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is now separate from runtime device state. I have larger plans for devices, so there is some temporary scaffolding to hold everything together, but this first step does separate things out. There is a new class 'running_device' which represents the state of a live device. A list of these running_devices sits in machine->devicelist and is created when a running_machine is instantiated. To access the configuration state, use device->baseconfig() which returns a reference to the configuration. The list of running_devices in machine->devicelist has a 1:1 correspondance with the list of device configurations in machine->config->devicelist, and most navigation options work equally on either (scanning by class, type, etc.) For the most part, drivers will now deal with running_device objects instead of const device_config objects. In fact, in order to do this patch, I did the following global search & replace: const device_config -> running_device device->static_config -> device->baseconfig().static_config device->inline_config -> device->baseconfig().inline_config and then fixed up the compiler errors that fell out. Some specifics: Removed device_get_info_* functions and replaced them with methods called get_config_*. Added methods for get_runtime_* to access runtime state from the running_device. DEVICE_GET_INFO callbacks are only passed a device_config *. This means they have no access to the token or runtime state at all. For most cases this is fine. Added new DEVICE_GET_RUNTIME_INFO callback that is passed the running_device for accessing data that is live at runtime. In the future this will go away to make room for a cleaner mechanism. Cleaned up the handoff of memory regions from the memory subsystem to the devices.
* Within src/emu, basic conversions: Aaron Giles2010-01-121-3/+3
| | | | | | devtag_get_device ... machine->device() memory_find_address_space ... device->space()
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Created new central header "emu.h"; this should be included by pretty much any driver or device as the first include. This file in turn includes pretty much everything a driver or device will need, minus any other devices it references. Note that emu.h should *never* be included by another header file. - Updated all files in the core (src/emu) to use emu.h. - Removed a ton of redundant and poorly-tracked header includes from within other header files. - Temporarily changed driver.h to map to emu.h until we update files outside of the core. Added class wrapper around tagmap so it can be directly included and accessed within objects that need it. Updated all users to embed tagmap objects and changed them to call through the class. Added nicer functions for finding devices, ports, and regions in a machine: machine->device("tag") -- return the named device, or NULL machine->port("tag") -- return the named port, or NULL machine->region("tag"[, &length[, &flags]]) -- return the named region and optionally its length and flags Made the device tag an astring. This required touching a lot of code that printed the device to explicitly fetch the C-string from it. (Thank you gcc for flagging that issue!)
* NOTE: This change requires two new osd functions: osd_malloc() and Aaron Giles2010-01-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd_free(). They take the same parameters as malloc() and free(). Renamed mamecore.h -> emucore.h. New C++-aware memory manager, implemented in emualloc.*. This is a simple manager that allows you to add any type of object to a resource pool. Most commonly, allocated objects are added, and so a set of allocation macros is provided to allow you to manage objects in a particular pool: pool_alloc(p, t) = allocate object of type 't' and add to pool 'p' pool_alloc_clear(p, t) = same as above, but clear the memory first pool_alloc_array(p, t, c) = allocate an array of 'c' objects of type 't' and add to pool 'p' pool_alloc_array_clear(p, t, c) = same, but with clearing pool_free(p, v) = free object 'v' and remove it from the pool Note that pool_alloc[_clear] is roughly equivalent to "new t" and pool_alloc_array[_clear] is roughly equivalent to "new t[c]". Also note that pool_free works for single objects and arrays. There is a single global_resource_pool defined which should be used for any global allocations. It has equivalent macros to the pool_* macros above that automatically target the global pool. In addition, the memory module defines global new/delete overrides that access file and line number parameters so that allocations can be tracked. Currently this tracking is only done if MAME_DEBUG is enabled. In debug builds, any unfreed memory will be printed at the end of the session. emualloc.h also has #defines to disable malloc/free/realloc/calloc. Since emualloc.h is included by emucore.h, this means pretty much all code within the emulator is forced to use the new allocators. Although straight new/delete do work, their use is discouraged, as any allocations made with them will not be tracked. Changed the familar auto_alloc_* macros to map to the resource pool model described above. The running_machine is now a class and contains a resource pool which is automatically destructed upon deletion. If you are a driver writer, all your allocations should be done with auto_alloc_*. Changed all drivers and files in the core using malloc/realloc or the old alloc_*_or_die macros to use (preferably) the auto_alloc_* macros instead, or the global_alloc_* macros if necessary. Added simple C++ wrappers for astring and bitmap_t, as these need proper constructors/destructors to be used for auto_alloc_astring and auto_alloc_bitmap. Removed references to the winalloc prefix file. Most of its functionality has moved into the core, save for the guard page allocations, which are now implemented in osd_alloc and osd_free.
* Results of running the latest srcclean. Aaron Giles2009-12-281-6/+6
|
* Another step. Moved the address-space related get_info constants Aaron Giles2009-07-081-12/+12
| | | | | | to devintrf (including endianness). Removed space array from the CPU class header. Made the memory system much more device-neutral. Various other cleanups along the way.
* Moved some of the CPU cores over to use get_safe_token like other devices. Aaron Giles2009-03-121-11/+32
| | | | Also cleaned them so they compile.
* CPU interface organization shuffle. The file cpuintrf.h now merely Aaron Giles2008-12-221-3/+3
| | | | | | | | | | | | | | | | | | | describes the interface, but does not contain any implementation. All remaining bits of implementation have been migrated either to cpuexec.c or to debugcpu.c. Specifically, cpu_dasm() is now debug_cpu_disassemble(), and cpu_set_dasm_override() is now debug_cpu_set_dasm_override(). Also moved memory_address_physical() to debug_cpu_translate(), since it was only ever used for debugging. Changed all CPU and sound cores to use memory_find_address_space() instead of cpu_get_address_space(). The former is reliable even during early initialization when the CPU cores generally need it. Removed the dummy CPU core and cpuintrf.c. Changed the core execution loop to directly call the execute function instead of using the inline helper (which has been removed).
* Cleanups and version bump. Aaron Giles2008-12-221-6/+6
|
* More cleanup. Added address-space-specific constants for the various Aaron Giles2008-12-201-272/+74
| | | | | | | | | | | | | | bus width and shift CPU interface constants. Changed all the cores to use them. Minor spacing cleanup in Z80, Z180, TMS34010, ADSP21xx cores. Changed ADSP21xx cores to accept a configuration struct instead of using set_info to specify serial port callbacks. Simplified the ADSP21xx get/set info significantly. Removed support for only including certain variants of the chips; they are now either all supported or all unsupported.
* Renamed CPUINFO_PTR_* to CPUINFO_FCT_* for function get infos. Aaron Giles2008-12-191-19/+19
| | | | Changed Z80 over to the new cpu_state_table mechanism.
* Cleaned up device and sound interfaces to match the CPU Aaron Giles2008-12-191-321/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interfaces when handling strings. Namely, the generic get_info functions allocate a temporary string and the device in question copies its string to the target, instead of assigning a const char *. Updated all device and sound cores to operate this way. Added the concept of a cpu_state_table, which is supplied by the CPU cores and which describes all the register state accessible to the debugger and other subsystems. The format of the table is such that most data can be simply fetched from memory without the further involvement of the CPU core, including the display of common formats. Extensibility points are available for custom display and for importing/exporting the data to intermediate variables for more complicated scenarios. Updated the ADSP21xx, TMS340x0, and i86 cores to use this. Removed the old debugger register list, which was never used. Replaced it with using ordering from the cpu_state_table. Renamed REG_PC -> REG_GENPC, REG_SP -> REG_GENSP, and REG_PREVIOUSPC -> REG_GENPCBASE. Updated a few spots that were using these directly. Moved these definitions into the end of the register area rather than leaving them outside which put them in a weird range.
* Removed index and clock parameters from CPU_INIT function. Aaron Giles2008-12-181-7/+7
|
* Made the concept of a "clock" native to devices. The clock is now Aaron Giles2008-12-181-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified when the device is added, and the clock is available in the device_config directly via device->clock. Updated all devices that have a clock to specify it when adding the device, rather than as part of their configuration. As part of this work, also created device-specific _ADD and _REMOVE macros to simplify configuration. Dfined a generic device execute function callback, though it is not used yet. The long term plan is that any device with an execute callback will be scheduled along with the CPUs. Now that CPUs are devices, their scheduling will be moved over to this logic eventually. Changed various NVRAM devices to fetch their default memory region from the device->region rather than specifying it in the configuration. Moved a number of CPUINFO_PTR_* constants to CPUINFO_FCT_*. Fixed several drivers that manually created their own gfx_elements to fill in the machine object, so they no longer crash. Fixed incorrect CPU display on info screen (recently broken). Moved device startup to *before* the DRIVER_INIT is called. This is to allow the DRIVER_INIT to configure devices that have been properly allocated. So far I don't see any negative effects, but be on the lookout if something weird shows up. Rewrote the device iteration logic to make use of the typenext field and the newly-introduced classnext field for iterating more efficiently through devices of a given type or class. Fixed behavior of MDRV_CPU_REPLACE so it does not delete and then re-add a CPU (causing the order to change).
* Removed get context/set context calls from the CPU interface entirely. Aaron Giles2008-12-111-2/+0
| | | | Pointer-ified the TMS99xx core (missed that one!)