summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/tms32051
Commit message (Collapse)AuthorAgeFilesLines
...
* Changed CPU callbacks to use cpu_device, eliminating a bunch of casting. Aaron Giles2010-06-081-4/+4
|
* WARNING: There are likely to be regressions in both functionality and Aaron Giles2010-06-081-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-11/+11
| | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | 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-102-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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!)
* Results of running the latest srcclean. Aaron Giles2009-12-281-13/+13
|
* Memory shares are now specified by tag instead of index. Aaron Giles2009-12-051-2/+2
| | | | | | | | | | | The AM_SHARE() macro now takes a tag parameter. All existing shares have been bulk renamed to "share##". However, the name does not matter, so please use descriptive tags going forward. Also added tag validation for bank and share tags. Added flag to tagmap_add functions that optionally will replace existing objects if a duplicate is found.
* Another step. Moved the address-space related get_info constants Aaron Giles2009-07-081-6/+6
| | | | | | 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.
* CPU cores are now enabled on a per cpu core family basis instead of per cpu ↵ Wilbert Pol2009-03-252-4/+0
| | | | core variant. As a result CPUDEFS is no longer needed in the makefile.
* CPU cores now compile cleanly. Aaron Giles2009-03-151-9/+18
|
* More cleanup. Added address-space-specific constants for the various Aaron Giles2008-12-201-11/+11
| | | | | | | | | | | | | | 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-8/+8
| | | | Changed Z80 over to the new cpu_state_table mechanism.
* From: Atari Ace [atari_ace@verizon.net] Aaron Giles2008-12-171-0/+1
| | | | | | | | | | | | | | | | | | | | | Sent: Tuesday, December 16, 2008 12:20 PM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Migrate CPU defines to cpu header files Hi mamedev, This patch migrates all the CPU definitions into the cpu header files. The #defines and CPU_GET_INFO declarations were added by hand to the cpu cores in the first patch, plus a few partly related fixes to the non-DRC cores. The second patch was produced by the attached script which inserts all needed #includes, except for two that were added by hand in the first patch. The first patch also removed an extra define of N2A03_DEFAULTCLOCK that would have caused problems with the second patch. ~aa
* Cleanups and version bump. Aaron Giles2008-12-151-2/+2
|
* 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!)
* Pointer-ified the TMS32051 core. Aaron Giles2008-12-103-954/+955
|
* CPU_IS_LE -> ENDIANNESS_LITTLE Aaron Giles2008-12-041-1/+1
| | | | | | CPU_IS_BE -> ENDIANNESS_BIG Also fixed help for step over/in to specify correct keys.
* change_pc? What change_pc? Aaron Giles2008-11-241-1/+0
|
* Removed NO_LEGACY_MEMORY_HANDLERS defines. Aaron Giles2008-11-241-1/+0
|
* TMS* CPUs conversion ... almost there. Aaron Giles2008-11-231-6/+11
|
* Debugger interfaces cleanup. Still more to do but this compiles and Aaron Giles2008-11-211-1/+1
| | | | | | | works. Added callback parameters to the expression engine. Improved CPU parsing so you can use a CPU tag or index in most commands that take one. Switched to passing CPU and address space objects around where appropriate. Lots of other minor tweaks.
* Generalized the concept of opbase access into "direct" access. Aaron Giles2008-11-171-1/+1
| | | | | | | | Removed opbase globals to the address_space structure. Cleaned up names of pointers (decrypted and raw versus rom and ram). Added inline functions to read/write data via any address space. Added macros for existing functions to point them to the new functions. Other related cleanups.
* This patch replaces the Machine parameter where an running_machine * Aaron Giles2008-11-131-2/+1
| | | | | | is available and removes the deprecat.h where unnecessary. [Oliver Stoeneberg]
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Sent: Wednesday, November 05, 2008 8:22 AM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] Add ADDRESS_MAP_NAME macro Hi mamedev, In theory, MAME's interface macros should completely hide the naming conventions from the drivers and sound/cpu cores. So as an experiment, I renamed all the core apis and looked to see what broke. The most common api coupling was with address maps in the CPU cores, which this patch addresses by introducing a new macro, ADDRESS_MAP_NAME (mimicing what is done in devintrf.h). There were a handful of related problems in some drivers which this patch also fixes. Some remaining issues I left alone (laserdisk apis reference rom, video_update, machine_config, ksys573 use of nvram_handler, megadriv use of ipt), in principle all the apis need _NAME variants to encode the conventions. ~aa
* Added macros for all CPU callbacks to ease future changes. Aaron Giles2008-11-083-17/+17
| | | | Updated all CPU cores to use them.
* WARNING: This is a significant change. If you are risk-averse and Aaron Giles2008-11-061-11/+12
| | | | | | | | | | | | | | | | | | | | | working on something, hold off syncing. Defined macros for core CPU functions: CPU_INIT, CPU_RESET, CPU_EXIT, CPU_EXECUTE, along with macros for the name and for calling, in the spirit of the devintrf.h macros. More will come later. Changed init, reset, exit, and execute interfaces to be passed a const device_config * object. This is a fake object for the moment, but encapsulates the machine pointer and token. Eventually this will be a real device. Changed the CPU IRQ callbacks to a proper type, and added a device parameter to them. Updated all CPU cores to the new macros and parameters. Note that this changes the way we "pointer"-ify cores. I'll send an update shortly.
* From Oliver Stoeneberg [oliverst@online.de] Aaron Giles2008-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This contains three different patches: 20080829.patch Introducing the running_machine* parameter in a few more places. Next step would be to make the execute_* function aware of it, if that's OK. Also used the machine parameter in memory.c were it's available. 20080829_1.patch The already discussed and probably being rejected removal of dreprecat.h from debugger.h. I think this is a low-risk patch (we had worse cleanups) and it lowers the risk of new code using deprecated function beign introduced in MAME/MESS, because there is no invisible inclusion of deprecat.h anymore (I think one driver - kofball.c - got it with deprecated code). 20080829_2.patch The last Machine -> machine conversion I had sitting in my local tree. I know the proper way is to turn them into devices, but I still haven't looked into that.
* Final CPU header updates. Mostly just re-naming the re-inclusions. Derrick Renaud2008-08-132-4/+7
| | | | | The structures/names were getting too complex for my macros to handle. They would require hand editing and my computer is too slow to keep re-compiling. Passes a clean compile.
* Removed DEBUGGER flag from makefile and ENABLE_DEBUGGER Aaron Giles2008-06-262-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | macro from the source code. All MAME builds now include the debugger, and it is enabled/disabled exclusively by the runtime command-line/ini settings. This is a minor speed hit for now, but will be further optimized going forward. Changed the 'd' suffix in the makefile to apply to DEBUG builds (versus DEBUGGER builds as it did before). Changed machine->debug_mode to machine->debug_flags. These flags now indicate several things, such as whether debugging is enabled, whether CPU cores should call the debugger on each instruction, and whether there are live watchpoints on each address space. Redesigned a significant portion of debugcpu.c around the concept of maintaining these flags globally and a similar, more complete set of flags internally for each CPU. All previous functionality should work as designed but should be more robust and faster to work with. Added new debugger hooks for starting/stopping CPU execution. This allows the debugger to decide whether or not a given CPU needs to call the debugger on each instruction during the coming timeslice. Added new debugger hook for reporting exceptions. Proper exception breakpoints are not yet implemented. Added new module debugger.c which is where global debugger functions live.
* From: Atari Ace [mailto:atari_ace@verizon.net] Aaron Giles2008-04-241-1/+0
| | | | | | | | | | | | | | | | | | | Subject: [patch] Remove more Machine globals, #include "deprecat.h" Hi mamedev, The attached patch goes through and converts a number of Machine globals to machine locals, and then removes #include "deprecat.h" if appropriate. The script that generated it is included, since the patch itself is rather large and would have been time consuming to produce otherwise. The script doesn't convert cases of Machine that aren't in common macros. I'll try to tackle those later if someone doesn't beat me to it. ~aa
* WIP check-in. Things work now, but I'm still working on the code. Aaron Giles2008-03-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Converted address maps to tokens. Changed the address_map structure to house global map-wide information and hung a list of entries off of it corresponding to each address range. Introduced new functions address_map_alloc() and address_map_free() to build/destroy these structures. Updated all code as necessary. Fixed several instances of porttagtohandler*() in the address maps. Drivers should use AM_READ_PORT() macros instead. ADDRESS_MAP_EXTERN() now is required to specify the number of databits, just like ADDRESS_MAP_START. Removed ADDRESS_MAP_FLAGS() grossness. There are now three new macros which replace its former usage. ADDRESS_MAP_GLOBAL_MASK(mask) specifies a global address-space-wide mask on all addresses. Useful for cases where one or more address lines simply are not used at all. And ADDRESS_MAP_UNMAP_LOW/HIGH specifies the behavior of unmapped reads (do they come back as 0 or ~0). Changed internal memory mapping behavior to keep only a single address map and store the byte-adjusted values next in the address map entries rather than maintaining two separate maps. Many other small internal changes/cleanups.
* Changed debugger-related code to be based off a new makefile define ↵ Aaron Giles2008-02-022-4/+4
| | | | | | | | | | | | | (DEBUGGER) which sets a new compile-time define (ENABLE_DEBUGGER). This means that MAME_DEBUG no longer means "enable debugger", it simply enables debugging features such as assertions and debug code in drivers. Also removed the various levels of opbase protection in memory.h and always just turned on full bounds checking. Fixed build break due to missing ampoker.lay -> ampoker2.lay renaming.
* - Added deprecat.h that contains some deprecated/discouraged contructs (see ↵ Zsolt Vasvari2008-01-251-1/+2
| | | | | | | | | below) The idea is to create extra work if a driver wants to use these and hopefully gives an incentive to look for an alternate solution - Added #include of deprecat.h that rely on these contructs - Removed a bunch of unneccassary #include's from these files
* Added CPUINFO_INT_CLOCK_MULTIPLIER to support CPU clock multipliers. Aaron Giles2008-01-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Updated all CPU cores to return a CPUINFO_INT_CLOCK_MULTIPLIER of 1. Changed the core to actually respect both CPUINFO_INT_CLOCK_MULTIPLIER and CPUINFO_INT_CLOCK_DIVIDER. Updated a number of drivers to use cpunum_get_clock() instead of Machine->drv->cpu[x].clock. ***** Raw input clock speeds should now be specified for all CPUs in the MACHINE_DRIVER. ***** Removed explicit divisors from all drivers using the following CPU types, which were already specifying non-1 values for CPUINFO_INT_CLOCK_DIVIDER: * COP4x0 * I8039/8048 families * M68(7)05, HD63705 * M6809E * PIC16C5X * TMS32010 * TMS340x0 In a few cases, it appears that the divisor was not being used, so I guessed in those cases whether or not the specified clock speed was raw.
* Copyright cleanup: Aaron Giles2008-01-061-1/+1
| | | | | | - removed years from copyright notices - removed redundant (c) from copyright notices - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
* (From Oliver Stoneberg) Aaron Giles2008-01-031-1/+1
| | | | | | | This is an updated version of my earlier ATTR_PRINTF patch. It was reviewed by Atari Ace to use ATTR_PRINTF properly and fixes even more format errors. I also reviewed the whole source again and it is now used in all possible places.
* Changes for MAME 0.121u3.mame0121u3 Aaron Giles2007-12-172-6/+6
|
* Changes for MAME 0.121u1.mame0121u1 Aaron Giles2007-12-172-2/+2
|
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-175-0/+3590