summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpuexec.h
Commit message (Collapse)AuthorAgeFilesLines
* WARNING: There are likely to be regressions in both functionality and Aaron Giles2010-06-081-347/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Correct a long-standing design flaw: device configuration state Aaron Giles2010-01-181-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-13/+12
| | | | | | devtag_get_device ... machine->device() memory_find_address_space ... device->space()
* Fixed memory freeing so that is it released in the opposite order Aaron Giles2010-01-111-4/+1
| | | | | | | | | | | | | | | | it was originally allocated. Changed machine->region() to return a pointer to the now-public region_info class. Added new member function space() to the device_config, along with shorter constants to be used (AS_PROGRAM, AS_DATA, AS_IO). With no parameters, space() returns the first address space, which is commonly the only space present. Updated a few devices that referenced the old space[] array to call the new function instead. Added #define to emualloc to ensure delete can't be freely used.
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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!)
* Replaced all occurrences of cputag_get_cpu with devtag_get_device: the ↵ Fabio Priuli2010-01-061-17/+13
| | | | | former function was just an alias and now cpus are no different from other devices Removed cputag_get_cpu and cputag_reset (another alias, not even used in the source) from cpuexec.h
* Results of running the latest srcclean. Aaron Giles2009-12-281-7/+7
|
* Another step. Moved the address-space related get_info constants Aaron Giles2009-07-081-6/+2
| | | | | | 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.
* Move address_map array from cpu_config to device_config. Added Aaron Giles2009-07-081-7/+6
| | | | | | | | MDRV macros in the device for specifying address maps. Changed the memory system to fetch the maps from the new location. This is just a small step toward the end goal of getting address maps into arbitrary devices.
* Removed the MDRV_<devtype>_REMOVE macros. A simple DEVICE_REMOVE Aaron Giles2009-06-081-3/+0
| | | | works now that device types are not needed.
* Removed address_map2 items from the CPU config, etc. Aaron Giles2009-05-091-2/+1
|
* Removed second parameter from MDRV_CPU_PROGRAM_MAP, MDRV_CPU_DATA_MAP, Aaron Giles2009-05-091-6/+3
| | | | | | and MDRV_CPU_IO_MAP. For the remaining drivers that used multiple address maps, converted them to use AM_IMPORT_FROM to import the base map.
* Removed device types from device queries that use tags, under the Aaron Giles2009-03-021-5/+5
| | | | | | | | | | | | | | | assumption that all device tags are unique. Specifically, the following no longer need to provide a device type: AM_DEVREAD/WRITE DEVCB_DEVICE_HANDLER devtag_get_device devtag_reset device_list_find_by_tag as well as several device interfaces that referenced other devices. Also fixed assertion due to overflow in the recent sound fix.
* Modified the makefile to support experimental optional C++ Aaron Giles2009-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compilation: - new option CPP_COMPILE to trigger this (off by default) - split CFLAGS into common, C-only, and C++-only flags - when enabled, CPP_COMPILE causes 'pp' to be appended to the target name NOTE THAT THE SYSTEM CANNOT ACTUALLY BE COMPILED THIS WAY YET. IT IS JUST AN EXPERIMENT. Modified lib.mak to always build zlib/expat as C regardless of CPP_COMPILE. Modified windows.mak to fix warnings with MAXOPT=1, and to leverage the new CFLAGs definitions. Modified vconv.c to do appropriate conversions for new C++ options. Updated sources so that libutil, libocore (Windows), and libosd (Windows) can be cleanly compiled as C or C++. This was mostly adding some casts against void *. Fixed a few more general obvious problems at random locations in the source: - device->class is now device->devclass - TYPES_COMPATIBLE uses typeid() when compiled for C++ - some functions with reserved names ('xor' in particular) were renamed - nested enums and structs were pulled out into separate definitions (under C++ these would need to be scoped to be referenced) - TOKEN_VALUE cannot use .field=x initialization in C++ :(
* CPU interface organization shuffle. The file cpuintrf.h now merely Aaron Giles2008-12-221-1/+58
| | | | | | | | | | | | | | | | | | | 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).
* Made the concept of a "clock" native to devices. The clock is now Aaron Giles2008-12-181-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Improved 64-bit fix. R. Belmont2008-12-171-17/+2
|
* Fix fatal pointer truncation on 64-bit builds. R. Belmont2008-12-171-0/+15
|
* Made CPUs into proper devices. CPUs are now added in the Aaron Giles2008-12-161-17/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | machine configuration just as any other device, and the standard CPU configuration is performed via the inline configuration macros. Change cpu_type from an enumeration into a pointer to the CPU's get_info function, very similar to device behavior. For now all CPUs are declared in cpuintrf.h, but eventually they should be declared in the CPU's header file, and the driver should #include that header. Added function cpu_get_type() to return the CPU type. Changed several cpu_* functions into macros that call through to the equivalent device_* function. The device system now maintains a parallel list of devices based on type, for faster iteration through all devices of a given type. Cleaned up code that looped over CPUs via the machine->cpu array to now loop using the type-based device list. Removed start/stop/reset/nvram functions from the device_config in favor of grabbing them as needed. Cleaned up the generic interrupt_enable code to work with CPU devices instead of numbers. Mapped the devtag_* functions to device_* functions via macros instead of parallel implementations.
* Expanded cpuexec cycles <-> attotime functions to handle UINT64s. Aaron Giles2008-12-131-2/+2
|
* Here's the big one.... Aaron Giles2008-12-111-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | Added new function cpuexec_describe_context(machine) which can be used in logerror() and other printf-style functions to return a description of the current CPU/PC given only the machine. Changed several dozen sites to use this instead of directly interrogating the activecpu. Removed all other uses of activecpu throughout the system. Removed activecpu from the machine structure to prevent future abuse. Removed cpu_push_context() and cpu_pop_context(), and all call sites. Voodoo devices now require a CPU to be defined in the configuration in order to know whom to steal cycles from or stall when FIFOs get full. Updated all voodoo users to specify one. CPD1869 devices now also require a CPU to be defined in the configuration, in order to know which CPU's registers to fetch. Updated all cdp1869 users to specify one. Many other small changes to make this all work.
* 02687: emuopts.c: CORE INPUT AUTOMATIC ENABLE OPTIONS Aaron Giles2008-12-041-30/+13
| | | | | | | | | | | 02683: Pressing F5 while running debugger causes access violation 02669: pandoras: music tempo is too fast 02691: Some drivers with z80/ay8910 Audio: Audio tempo has changed Also fixed debugger memory leak. Added a number of new cputag_* macros to cpuexec.h.
* Changed timer_alloc, timer_set, timer_pulse, timer_call_after_resynch, Aaron Giles2008-11-261-1/+4
| | | | | and timer_get_time to pass the machine parameter. Moved timer globals to hang off of the running_machine.
* Removed globals from cpuexec. Aaron Giles2008-11-251-0/+6
| | | | | | | | Removed ATTOTIME_TO_CYCLES() and ATTOTIME_IN_CYCLES(). Replaced them with functions in cpuexec: cpu_clocks_to_attotime() and cpu_attotime_to_clocks(), both of which take CPU devices instead of indexes. Updated all callers, many of which were using the functions dubiously.
* Cleanups and version bump for 0.128u4.mame0128u4 Aaron Giles2008-11-241-4/+4
|
* WARNING: this compiles, but not fully cleanly, and a number of drivers Aaron Giles2008-11-141-0/+3
| | | | | | | | | | | | | | | | are broken. Changed READ/WRITE handlers to accept an address_space * instead of a machine *. The address_space object was enhanced to contain a machine and a pointer to the relevant CPU object. Fixed a number of errors found by the compiler, mostly in the core and CPU/sound handlers, but there is a lot remaining to fix. Added new function cpu_get_address_space() to fetch the address space for calling in manually to these functions. In some instances, code which should eventually be converted to a device is hard-coding fetching the program space of CPU #0 in order to have something valid to pass.
* Massive API cleanup/change. The primary goal is that all CPU- Aaron Giles2008-11-131-266/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | related APIs now take a device pointer instead of an index. All functions that take a CPU device are prefixed with cpu_* All functions that are globally related to cpu execution are prefixed with cpuexec_*. Below is a list of some of the mappings: cpu_boost_interleave -> cpuexec_boost_interleave cpunum_suspend -> cpu_suspend cpunum_resume -> cpu_resume cpunum_is_suspended -> cpu_is_suspended cpunum_get_clock -> cpu_get_clock cpunum_set_clock -> cpu_set_clock cpunum_get_clockscale -> cpu_get_clockscale cpunum_set_clockscale -> cpu_set_clockscale cpunum_get_localtime -> cpu_get_local_time cpunum_gettotalcycles -> cpu_get_total_cycles activecpu_eat_cycles -> cpu_eat_cycles activecpu_adjust_icount -> cpu_adjust_icount cpu_trigger -> cpuexec_trigger cpu_triggertime -> cpuexec_triggertime cpunum_set_input_line -> cpu_set_input_line cpunum_set_irq_callback -> cpu_set_irq_callback In addition, a number of functions retain the same name but now require a specific CPU parameter to be passed in: cpu_yield cpu_spin cpu_spinuntil_time cpu_spinuntil_int cpu_spinuntil_trigger cpu_triggerint Merged cpuint.c into cpuexec.c. One side-effect of this change is that driver reset callbacks are called AFTER the CPUs and devices are reset. This means that if you make changes to the CPU state and expect the reset vectors to recognize the changes in your reset routine, you will need to manually reset the CPU after making the change (since it has already been reset). Added a number of inline helper functions to cpuintrf.h for managing addresses Removed cpu_gettotalcpu(). This information is rarely needed outside of the core and can be obtained by looking at the machine->cpu[] array. Changed CPU interrupt acknowledge callbacks to pass a CPU device instead of machine/cpunum pair. Changed VBLANK and periodic timer callbacks to pass a CPU device instead of machine/cpunum pair. Renamed all information getters from cpu_* to cpu_get_* and from cputype_* to cputype_get_*.
* UPI-41/42 (still I8x41.c) changes: Couriersud2008-11-091-2/+5
| | | | | | | | | | | | * cpu/i8x41 should be renamed to UPI-4x, since UPI-41/42 was an intel chip family postponed for now until core moved to pointers. * removed I8041 definition from mcs48 * removed I8x41 cpu definition and config struct * added I8041, I8741, I8042, I8242 and I8742 cpus to i8x41.c * added internal memory maps * internal ram now uses DATA memory space * updated drivers * increased interleave to 70 in decocass. This fixes decocass hanging in countdown around 13 No idea when this bug was introduced.
* Added concept of scheduling quanta to the timer system. Also added Aaron Giles2008-11-051-1/+2
| | | | | | | | | | | | | | | | | means of setting the minimum useful scheduling quantum, and clamping all quanta to that value. Changed interleave/boost handling to use scheduling quanta instead of timers. Added machine parameter to cpu_boost_interleave. Updated cpuexec to compute the "perfect" interleave value taking into account the minimum number of cycles per instruction specified by the CPU core. Updated Z80 core to indicate that the minimum cpi is 2. Fixed incorrect minimum cpi in the 68020+ cores. Simplified a bit of logic in cpuexec_timeslice.
* More mcs51 updates Couriersud2008-10-201-0/+9
| | | | | | | | * Remaining games checked and adapted to changes in cpu core * Cardline still broken. I need the exact and complete cpu name. * Added more variants 803X, 80CXX, AT89C4051 * Fix segas18.c (segaic16.c) mcu maps. * Fix sslam.c * Fix limenko.c videopkr.c : Issue with core allocation of ram (duplicate savestate)
* Changed i8039 core to use the data address space for internal RAM. Aaron Giles2008-08-251-3/+7
| | | | | | | | | | | | | | | | | | Register access is still performed using direct memory accesses, but the pointers are fetched through the memory system. Now you can see i8039 RAM in the debugger. Added internal memory maps of the appropriate size so that drivers don't need to declare this RAM. Added a number of variants from the MCS-48 family as it was not clear which variants had what capabilities. All documented variants now have internal memory maps for internal ROM and RAM. Removed memory maps from drivers using embedded ROM/EPROM/OTPROM since they are defined by the core now. Added some initial logic to boot and run the PR-8210 ROM (i8049) in ldplayer.c. Currently this is disabled behind a compile-time switch. Once this is working, the plan is to incorporate this into the existing PR-8210 emulation, but we're not there yet.
* Added new generic laserdisc VIDEO_UPDATE handler to the laserdisc code. Aaron Giles2008-08-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handler works for both disc-only games and those with overlays. For disc-only games, the base macro is sufficient. For games with overlays, an additional set of configuration macros are provided: MDRV_LASERDISC_OVERLAY - specifies update function, width, height, and bitmap format of the overlay MDRV_LASERDISC_OVERLAY_CLIP - specifies the visible area of the overlay bitmap MDRV_LASERDISC_OVERLAY_POSITION - specifies default x,y position MDRV_LASERDISC_OVERLAY_SCALE - specifies default x,y scale factors The update function provided to MDRV_LASERDISC_OVERLAY is identical to a normal VIDEO_UPDATE callback, so a standard one can be used. All existing laserdisc drivers have been updated to support this new rendering mechanism, removing much duplicated code. Added the ability to configure the overlay position and scale parameters at runtime. Added OSD menus to control them. Added logic to save/restore the data in the game's configuration file. Added new macros MDRV_LASERDISC_SCREEN_ADD_NTSC and _PAL, which defines a standard screen with the correct video timing characteristics and update function for laserdiscs. Updated all drivers to use these macros instead of defining their own screens. Added DISK_REGIONS to all laserdisc drivers. Added DISK_IMAGE_READONLY_OPTIONAL to support games (like Cube Quest) where the disk is non-essential to the game's operation. Fixed bug in identifying the custom sound driver for the laserdisc. Updated ldverify to identify blank regions of the disc for post- processing. Fixed rendering 16bpp with alpha using bilinear filters (fixes screenshots of laserdisc games with overlays). Included support for parsing .gdi files in chdman. [ElSemi] Added new driver for Cube Quest. This includes CPU cores for the three bitslice processors, as well as laserdisc support for the hacked laserdisc that was used to drive the games. [Philip Bennett, Joe Magiera, Warren Ondras] Note that the SHA1/MD5 for the laserdisc will likely undergo at least one more change before being finalized.
* SH-2 DRC updates: R. Belmont2008-08-161-0/+1
| | | | | | | - Moved IRQ handling front-end into recompiled code - Added TSTM/ANDM/XORM instructions - Added SH-1 CPU support, including lower precision on MAC.W and locking out SH-2 only instructions
* Renamed "Nintendo z80gb" cpu core to "Sharp LR35902". Wilbert Pol2008-06-161-1/+1
|
* COP4xx: Curt Coder2008-06-121-0/+1
| | | | | | | | - Added COP421 variant Thayer's Quest: - Fixed SSI-263 timings, service mode works now - Changed to use COP421
* PowerPC dynamic recompiler: [Aaron Giles] Aaron Giles2008-06-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - rewrote PowerPC implementation as a dynamic recompiler on top of the universal recompiler engine - wrote a front-end to analyze PowerPC code paths and register usage - wrote a common shared module with C implementations of tricky CPU behaviors - added separate CPU types for the variants supported, instead of relying on a hidden model enum - rewrote the serial port emulation for the 4xx series to be more accurate and not rely on separate DMA handlers - rewrote the MMU handling to implement a software TLB that faults in pages and handles changed bits appropriately - implemented emulation of the PowerPC 603's software TLB, which allows the model 3 games to run without a hack to disable the MMU Updated the PowerPC disassembler to share constants with the rest of the core, and to more aggressively use simplified mnemonics, especially for branches. [Aaron Giles] Universal recompiler: - fixed frontend to handle opcode widths different from bus width - added several new opcodes: * (D)GETFLGS - copies the UML flags to a destination operand * FDRNDS - rounds a double precision value to single precision - renamed several opcodes: * SETC -> CARRY * XTRACT -> ROLAND * INSERT -> ROLINS - consolidated the following opcodes: * LOAD?U -> LOAD * LOAD?S -> LOADS * STORE? -> STORE * READ?U -> READ * READ?M -> READM * WRITE? -> WRITE * WRITM? -> WRITEM * SEXT? -> SEXT * FTOI?? -> FTOINT * FFRI? -> FFRINT * FFRF? -> FFRFLT - removed some opcodes: * FLAGS - can be done with GETFLGS/LOAD4/ROLINS * ZEXT - can be achieved with AND * READ?S - can be achieved with READ/SEXT - updated C, x86, and x64 back-ends to support these opcode changes - updated disassembler to support these opcode changes MIPS3 dynamic recompiler: - updated to use new/changed opcode forms - changed context switch so that it only swaps a single pointer Konami Hornet changes: [Aaron Giles] - updated to new PowerPC configurations - updated some memory handlers to be native 8-bit handlers - cleaned up JVS implementation to work with new serial code - added fast RAM for the work RAM to give a small speed boost Konami GTI Club changes: [Aaron Giles] - updated to new PowerPC configurations - updated some memory handlers to be native 8-bit handlers Konami Viper/ZR107 changes: [Aaron Giles] - updated to new PowerPC configurations Sega Model 3 changes: [Aaron Giles] - updated to new PowerPC configurations - reimplemented/centralized interrupt handling - these games are broken for the moment Fixed crasher due to some Konami games using 8 layers in the K056832 implementation, even though it was only written for 4. [Aaron Giles] Added fisttp opcode to i386 disassembler. [Aaron Giles]
* DS5002FP core Manuel Abadia2008-05-121-0/+1
|
* Fixed the SR masks for MTC0. smf-2008-04-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added ability to test the instruction/data cache ram. The scratchpad and BIU register are now handled internally to the CPU. All writes are performed with masks. SWL/SWR used to be implemented with two writes ( one byte and one word ) when writing three bytes, now it only ever performs one. Byte and Word writes use masks as they leave the rest of the register on the bus, which can be picked up by larger registers. The read/write functions to use are cached when the SR bits are updated, as are the bad address masks. Added coprocessor 1 & 3 support, though they don't do anything useful. All loads now go through the delay pipeline, a lwl/lwr will grab the value out of the pipeline if it's updating the same register. Added undocumented behaviour of BLEZ/BGTZ. The comparison for zero can be changed by specifying an alternate register in the RT field ( the documentation says you should always use register 0 ). Restricted to 16 COP0 registers & generate an exception if any of the 5 for the MMU are used. Added BCF/BCT instructions, although I have found no conditions that affect them yet. Generates an exception if any MMU instructions are executed. Sets the CE instruction for all exceptions, not just those involving a coprocessor. The bits of the opcode that specify the coprocessor are grabbed no matter what the instruction. Added TAR register and BT bit in SR. When an exception occurs during a branch, BT determines whether it was taken or not. The TAR register gets set to the destination of the branch. Fixed the BD bit when you are in a branch delay slot and you didn't take the branch, this shows up in the pipeline as !pc. Fixed branches within a branch delay slot. Multiply & divide instructions can be aborted if you write to HI/LO before reading the result. Added data breakpoints, you don't appear to be able to set breakpoints on any of the addresses internal to the CPU. Multiply/divide/GTE instructions can execute when an exception is taken, although the EPC indicates that it hasn't. The BIOS avoids rerunning GTE instructions as they are destructive, so you have to make sure they run. Added bus error handling, PSXCPU is limited to 8mb of ram & any access outside this range will trigger an exception. I believe this is to be an internal limit. Added CXD8611R as a specific CPU type, System 12 appears to allow more than 8mb of ram & it's possible that this is different. Mapped out all instructions to either generate an exception or ignore bits. Updated the disassembler to match the decoding. Fixed disassembling of branch instructions in a branch delay slot. Lui checks for a ori/addiu following and will show you the result. Added step over/out support. Fixed standalone disassembler.
* From: notaz [mailto:notasas@gmail.com] Aaron Giles2008-03-131-1/+1
| | | | | | | | | | | | | | | | | | | Subject: patch for SVP (Sega Virtua Processor) emulation hello, this patch adds support for Sega Virtua Processor, to run Genesis/MegaDrive version of Virtua Racing, intended to be used by MESS. It consists of a CPU core SSP1601, and updates in megadriv.c: * SSP1601 replaces SSP1610, as it has been confirmed by Stiletto and other sources that SVP actually contains SSP1601. The current SSP1610 is placeholder only (nearly completely unimplemented) anyway. * Changes in megadriv.c add a new driver for Genesis/MegaDrive+SVP combination, also add SVP memory controller logic and memory map. The diff has already been reviewed by Reip and SSP1610 removal was one of his suggestions (SSP1610 is not used by any drivers).
* WIP check-in. Things work now, but I'm still working on the code. Aaron Giles2008-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Moves watchdog processing logic into its own module Zsolt Vasvari2008-03-021-10/+0
|
* Most of this descriptions taken directly from an e-mail by Aaron: Zsolt Vasvari2008-02-291-0/+1
| | | | | | | | | | | - Define a new MDRV_CPU_VBLANK_INT_HACK() (ZV: defined in deprecat.h) which is a copy of the current MDRV_CPU_VBLANK_INT() - Find all the places where VBLANK_INT is used with something other than 1 interrupt per frame and change it to the new macro - Remove the "# per frame" parameter from the MDRV_SCREEN_VBLANK_INT() and add a screen tag in its place; updated all callers appropriately. - ZV: Added some validation of the interrupt setup to validate.c The idea behind this is that using a VBLANK interrupt with more than one interrupt per frame in conceptually wrong. The screen tag will allow us to move the interrupt timing code from cpuexec.c to video.c, where it really belongs.
* From: Wilbert Pol [mailto:wilbert@jdg.info] Aaron Giles2008-02-281-0/+3
| | | | | | | | | Subject: uPD7801, uPD78C05, and uPD78C06 cpu cores added to the uPD7810 cpu core This patch adds basic support for the NEC uPD7801, uPD78C05, and uPD78C06 cpus to the uPD7810 cpu core.
* Added i8749 CPU type for MESS. Curt Coder2008-02-191-0/+1
|
* From Atari Ace: Zsolt Vasvari2008-02-181-0/+1
| | | | | | | | | Hi mamedev, Here's my periodic batch of code cleanups. The usual batch of adding static/const plus some include fixes. In addition, I reverted some of the changes to build.mak from u1 which made some MSVC builds fail, and adjusted/optimized an m10.c gfx_layout. I also added some missing cores to cpuintrf.c, sndintrf.c and added some missing #if's to 5220intf.c. ~aa
* - New game: Puzzlet (NOT_WORKING) Luca Elia2008-02-021-0/+2
| | | | | | | | | | | | | | | | | | | | - Added some instructions to the H8/30xx CPU: or.l ERs, ERd rotl/shal.l ERd not.l/neg.l ERd exts.w Rd sub/or/xor.l #Imm:32, ERd bset/bnot/bclr.b Rn, @ERd bst/bist.b #Imm:3, @ERd bnot.b #Imm:3, @ERd - Added H8/3007 & H8/3044 variants with their memory maps. Preliminary implementation of the H8/3007 timers. (a make clean is required) P.S. I've moved the docs we have in docs/cpu/H8-30xx and added a couple more. Roms are in roms/current/p/puzzlet.zip
* Moved cpu_getiloops() and cpu_scalebyfcount() to deprecat.h. Aaron Giles2008-01-291-123/+91
| | | | | | | | Added #include "deprecat.h" where necessary to make this happen. Cleaned up cpuexec.c/.h to latest core style. Cleaned up implementation of extended INP header in inptport.c. Removed external access to cycles_currently_ran(). Replaced use of cycles_currently_ran() in v9938 code with mame_rand(), since that is effectively the same thing. :)
* Removed distinction between *_gettotalcycles() and *_gettotalcycles64(). Aaron Giles2008-01-291-4/+2
| | | | | All functions now return 64-bit results. Updated all call sites appropriately.
* - Added deprecat.h that contains some deprecated/discouraged contructs (see ↵ Zsolt Vasvari2008-01-251-20/+0
| | | | | | | | | 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
* First in a series of updates to remove the use of the global Machine from as ↵ Zsolt Vasvari2008-01-241-9/+9
| | | | many places as possible