summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/timer.h
Commit message (Collapse)AuthorAgeFilesLines
* Move devices into a proper hierarchy and handle naming Aaron Giles2012-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and paths consistently for devices, I/O ports, memory regions, memory banks, and memory shares. [Aaron Giles] NOTE: there are likely regressions lurking here, mostly due to devices not being properly found. I have temporarily added more logging to -verbose to help understand what's going on. Please let me know ASAP if anything that is being actively worked on got broken. As before, the driver device is the root device and all other devices are owned by it. Previously all devices were kept in a single master list, and the hierarchy was purely logical. With this change, each device owns its own list of subdevices, and the hierarchy is explicitly manifest. This means when a device is removed, all of its subdevices are automatically removed as well. A side effect of this is that walking the device list is no longer simple. To address this, a new set of iterator classes is provided, which walks the device tree in a depth first manner. There is a general device_iterator class for walking all devices, plus templates for a device_type_iterator and a device_interface_iterator which are used to build iterators for identifying only devices of a given type or with a given interface. Typedefs for commonly-used cases (e.g., screen_device_iterator, memory_interface_iterator) are provided. Iterators can also provide counts, and can perform indexed lookups. All device name lookups are now done relative to another device. The maching_config and running_machine classes now have a root_device() method to get the root of the hierarchy. The existing machine->device("name") is now equivalent to machine->root_device().subdevice("name"). A proper and normalized device path structure is now supported. Device names that start with a colon are treated as absolute paths from the root device. Device names can also use a caret (^) to refer to the owning device. Querying the device's tag() returns the device's full path from the root. A new method basetag() returns just the final tag. The new pathing system is built on top of the device_t::subtag() method, so anyone using that will automatically support the new pathing rules. Each device has its own internal map to cache successful lookups so that subsequent lookups should be very fast. Updated every place I could find that referenced devices, memory regions, I/O ports, memory banks and memory shares to leverage subtag/subdevice (or siblingtag/siblingdevice which are built on top). Removed the device_list class, as it doesn't apply any more. Moved some of its methods into running_machine instead. Simplified the device callback system since the new pathing can describe all of the special-case devices that were previously handled manually. Changed the core output function callbacks to be delegates. Completely rewrote the validity checking mechanism. The validity checker is now a proper C++ class, and temporarily takes over the error and warning outputs. All errors and warnings are collected during a session, and then output in a consistent manner, with an explicit driver and source file listed for each one, as well as additional device and/or I/O port contexts where appropriate. Validity checkers should no longer explicitly output this information, just the error, assuming that the context is provided. Rewrote the software_list_device as a modern device, getting rid of the software_list_config abstraction and simplifying things. Changed the way FLAC compiles so that it works like other external libraries, and also compiles successfully for MSVC builds.
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-71/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Converted core_options to a class. Removed a bunch of marginal Aaron Giles2011-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functionality in favor of alternate mechanisms. Errors are now reported via an astring rather than via callbacks. Every option must now specify a type (command, integer, float, string, boolean, etc). Command behavior has changed so that only one command is permitted. [Aaron Giles] Changed fileio system to accept just a raw searchpath instead of an options/option name combination. [Aaron Giles] Created emu_options class dervied from core_options which wraps core emulator options. Added mechanisms to cleanly change the system name and add/remove system-specific options, versus the old way using callbacks. Also added read accessors for all the options, to ensure consistency in how parameters are handled. Changed most core systems to access emu_options instead of core_options. Also changed machine->options() to return emu_options. [Aaron Giles] Created cli_options class derived from emu_options which adds the command-line specific options. Updated clifront code to leverage the new class and the new core behaviors. cli_execute() now accepts a cli_options object when called. [Aaron Giles] Updated both SDL and Windows to have their own options classes, derived from cli_options, which add the OSD-specific options on top of everything else. Added accessors for all the options so that queries are strongly typed and simplified. [Aaron Giles] Out of whatsnew: I've surely screwed up some stuff, though I have smoke tested a bunch of things. Let me know if you hit anything odd. Also I know this change will impact the WINUI stuff, please let me know if there are issues. All the functionality necessary should still be present. If it's not obvious, please talk to me before adding stuff to the core_options class.
* mame_file is now emu_file and is a class. It is required Aaron Giles2011-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | to pass a core_options object to the constructor, along with a search path. This required pushing either a running_machine or a core_options through some code that wasn't previously ready to handle it. emu_files can be reused over multiple open/close sessions, and a lot of core code cleaned up nicely as things were converted to them. Also created a file_enumerator class for iterating over files in a searchpath. This replaces the old mame_openpath functions. Changed machine->options() to return a reference. Removed public nvram_open() and fixed jchan/kaneko16 to stop directly saving NVRAM. Removed most of the mame_options() calls; this will soon go away entirely, so don't add any more. Added core_options to device_validity_check() so they can be used to validate things.
* Cleanups and version bump.mame0141u2 Aaron Giles2011-02-091-1/+1
|
* Convert emu_timers to objects. Move implementation and management of Aaron Giles2011-02-061-181/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | timers into the scheduler. Retain TIMER devices as a separate wrapper in timer.c/.h. Inline wrappers are currently provided for all timer operations; a future update will bulk clean these up. Rather than using macros which hide generation of a string-ified name for callback functions, the new methods require passing both a function pointer plus a name string. A new macro FUNC() can be used to output both, and another macro MFUNC() can be used to output a stub-wrapped class member as a callback. Also added a time() method on the machine, so that machine->time() gives the current emulated time. A wrapper for timer_get_time is currently provided but will be bulk replaced in the future. For this update, convert all classic timer_alloc, timer_set, timer_pulse, and timer_call_after_resynch calls into method calls on the scheduler. For new device timers, added methods to the device_t class that make creating and managing these much simpler. Modern devices were updated to use these. Here are the regexes used; some manual cleanup (compiler-caught) will be needed since regex doesn't handle nested parentheses cleanly 1. Convert timer_call_after_resynch calls timer_call_after_resynch( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().synchronize\1\(\2FUNC(\6), \5, \4\) 2. Clean up trailing 0, NULL parameters (synchronize[^;]+), 0, NULL\) \1) 3. Clean up trailing NULL parameters (synchronize[^;]+), NULL\) \1) 4. Clean up completely empty parameter lists synchronize\(FUNC\(NULL\)\) synchronize() 5. Convert timer_set calls timer_set( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_set\1\(\2\4, FUNC(\7), \6, \5\) 6. Clean up trailing 0, NULL parameters (timer_set[^;]+), 0, NULL\) \1) 7. Clean up trailing NULL parameters (timer_set[^;]+), NULL\) \1) 8. Convert timer_set calls timer_pulse( *)\(( *)([^,;]+), *([^,;]+), *([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_pulse\1\(\2\4, FUNC(\7), \6, \5\) 9. Clean up trailing 0, NULL parameters (timer_pulse[^;]+), 0, NULL\) \1) 10. Clean up trailing NULL parameters (timer_pulse[^;]+), NULL\) \1) 11. Convert timer_alloc calls timer_alloc( *)\(( *)([^,;]+), *([^,;]+), *([^);]+)\) \3->scheduler().timer_alloc\1\(\2FUNC(\4), \5\) 12. Clean up trailing NULL parameters (timer_alloc[^;]+), NULL\) \1) 13. Clean up trailing 0 parameters (timer_alloc[^;]+), 0\) \1) 14. Fix oddities introduced \&m_machine->scheduler() m_machine.scheduler()
* Attotime bulk conversion step: Aaron Giles2011-02-031-7/+7
| | | | | | | | | | | | | | | | | | attotime_zero => attotime::zero attotime_never => attotime::never ATTOTIME_IN_SEC(s) => attotime::from_seconds(s) ATTOTIME_IN_MSEC(m) => attotime::from_msec(m) ATTOTIME_IN_USEC(u) => attotime::from_usec(u) ATTOTIME_IN_NSEC(n) => attotime::from_nsec(n) ATTOTIME_IN_HZ(h) => attotime::from_hz(h) Also, changed the following MCFG macros to require a full attotime specification: MCFG_TIMER_ADD_PERIODIC MCFG_QUANTUM_TIME MCFG_WATCHDOG_TIME_INIT
* MDRV_* -> MCFG_* Aaron Giles2010-12-311-12/+12
| | | | | There hasn't been a machine driver for many years.
* Added an integral device_timer_id to device timers. This is a Aaron Giles2010-09-171-1/+4
| | | | | | | | | | | | | | | | cleaner way to differentiate between multiple timers rather than relying on the pointers. These values are also saved with the timers. Updated the few devices using device timers to leverage this. Added new function device_timer_call_after_resynch() which creates a temporary 0-length timer that calls back through the device's device_timer() method with a given device_timer_id. Updated i8257_device to initialize its state and use device timers. (Fixes 04032: All sets in dkong.c: [debug] Game does not start.)
* Made the mc146818 a proper device, modernized it, and added an NVRAM interface Aaron Giles2010-09-101-2/+3
| | | | so that drivers don't have to ask it to be manually saved.
* De-converted MACHINE_DRIVER from tokens back to constructor functions, regaining Aaron Giles2010-08-261-34/+21
| | | | | | | | | | | type safety. If legacy devices still use inline data, those types are not checked. However, new devices no longer have access to the generic m_inline_data. Instead their MDRV_* macros should map to calls to static functions in the device config class which downcast a generic device_config to the specific device config, and then set the appropriate values. This is not to be done inline in order to prevent further code bloat in the constructors. See eeprom/7474/i2cmem/okim6295 for examples. #ifdef'ed several unused machine driver definitions that weren't referenced.
* Modified way device_type constants are defined in order to get unidasm ↵ Miodrag Milanovic2010-06-291-1/+1
| | | | compile [Miodrag Milanovic]
* Changed device name from an overridable function to a parameter passed to Aaron Giles2010-06-251-3/+0
| | | | | | the device_config constructor. In situations where the proper name is not known at construction time, a generic name can be specified and then overridden later once the configuration is complete.
* Cleanups and version bump. Aaron Giles2010-06-171-6/+6
|
* WARNING: There are likely to be regressions in both functionality and Aaron Giles2010-06-081-77/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-4/+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!)
* NOTE: This change requires two new osd functions: osd_malloc() and Aaron Giles2010-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
|
* From: hoge hoge [c8cv@hotmail.com] Aaron Giles2009-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sent: Wednesday, August 12, 2009 4:27 PM To: submit@mamedev.org Subject: twin16 update Hello, Attached is an update for the Konami twin16 driver, see diff for details. Functional changes: - improved sprite status register, this fixed the rogue sprites problem in devilw - added fround coin counters - lowered k007232 volume - added savestate support - added shadows - fixed devilw and gradius2 sprite lag - added text layer x/y flipping - reverted gradius2 sprite-background priority hack, this fixes severe priority problems in devilw, but reintroduces bugs on gradius2 level 7 and ending affected mametesters bugs: fixed: 02267, 00191, 02553 partial, due to revert: 02523 (intro is ok again, but old priority bugs are reintroduced), 02268 (ok in-game, small priority problem in prologue) Greets, hap
* 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 device types from device queries that use tags, under the Aaron Giles2009-03-021-2/+2
| | | | | | | | | | | | | | | 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.
* Significantly optimized the inner execution loop. arknoid2 is ~2.5x Aaron Giles2008-12-221-4/+13
| | | | faster with maximum interleave now.
* Made the concept of a "clock" native to devices. The clock is now Aaron Giles2008-12-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Changed timer_alloc, timer_set, timer_pulse, timer_call_after_resynch, Aaron Giles2008-11-261-10/+10
| | | | | 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-14/+0
| | | | | | | | 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.
* Added concept of scheduling quanta to the timer system. Also added Aaron Giles2008-11-051-0/+7
| | | | | | | | | | | | | | | | | 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.
* Added 22VP931 emulation, which is mostly working. Communication works Aaron Giles2008-09-251-3/+18
| | | | | | | | | | | | | | | | | | fine and basic searching/playback/skipping is functional. Still a bit glitchy. Firefox improvements: - removed need for deprecat.h - memory map is complete from schematics - gutted laserdisc hacks in favor of actual laserdisc implementation - fixed all CPU and sound clocks Removed old laserdsc.c implementation. Added generic timer devices, which simply allocate a timer but don't prime it. This is the preferred method for allocating timers, and may eventually be the only mechanism for doing so in the future.
* From: Oliver Stoeneberg [mailto:oliverst@online.de] Aaron Giles2008-09-111-1/+1
| | | | | | | | Subject: Machine -> machine This is a big patch adding running_machine* parameters and using "machine" where available.
* Changes MDRV_TIMER_DURATION to MDRV_TIMER_START_DELAY Zsolt Vasvari2008-03-151-4/+42
| | | | | Renames duration to start_delay in timer_adjust_periodic() as well Moves MDRV_ macros into proper header files
* Implements scanline based timer devices. Zsolt Vasvari2008-03-141-2/+10
| | | | | | | | | | | | | | | Converted Centipede, as an example. To define a scanline timer, use something like this: MDRV_TIMER_ADD("32V", SCANLINE, generate_interrupt) MDRV_TIMER_SCANLINE("main", 0, 16) The first number is the first scanline the timer will fire on, the 2nd number is the increment. So in this case, the timer will fire on 0, 16, 32, ..., 224, 240, then wrap around because the screen is defined as 256 lines high. The current scanline is passed to the callback in its 'param' argument
* Added skeletion device interface for timers. Just wanted to get feedback. Zsolt Vasvari2008-03-141-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Where applicable, added a parallel set of timer functions that take a device_config instead of emu_timer: void timer_device_adjust_oneshot(const device_config *timer, attotime duration, INT32 param); void timer_device_adjust_periodic(const device_config *timer, attotime duration, INT32 param, attotime period); void timer_device_reset(const device_config *timer, attotime duration); int timer_device_enable(const device_config *timer, int enable); int timer_device_enabled(const device_config *timer); int timer_device_get_param(const device_config *timer); void *timer_device_get_param_ptr(const device_config *timer); attotime timer_device_timeelapsed(const device_config *timer); attotime timer_device_timeleft(const device_config *timer); attotime timer_device_starttime(const device_config *timer); attotime timer_device_firetime(const device_config *timer); - Added MACHINE_CONFIG macros: MDRV_TIMER_ADD(_tag, _type, _callback) /* type can only be PERIODIC right now (can scanline based later, or even NE555) */ MDRV_TIMER_REMOVE(_tag) MDRV_TIMER_MODIFY(_tag) MDRV_TIMER_TYPE(_type) MDRV_TIMER_CALLBACK(_callback) MDRV_TIMER_DURATION(_duration) MDRV_TIMER_PERIOD(_period) MDRV_TIMER_PARAM(_param) MDRV_TIMER_PTR(_ptr) - Modified Space Encounters to create two timers and use those: MDRV_TIMER_ADD("STROBE_ON", PERIODIC, spcenctr_strobe_timer_callback) MDRV_TIMER_PARAM(TRUE) /* indicates strobe ON */ MDRV_TIMER_PERIOD(UINT64_ATTOTIME_IN_HZ(SPCENCTR_STROBE_FREQ)) MDRV_TIMER_ADD("STROBE_OFF", PERIODIC, spcenctr_strobe_timer_callback) MDRV_TIMER_PARAM(FALSE) /* indicates strobe OFF */ MDRV_TIMER_DURATION(UINT64_ATTOTIME_IN_HZ(SPCENCTR_STROBE_FREQ * 100 / SPCENCTR_DUTY_CYCLE)) MDRV_TIMER_PERIOD(UINT64_ATTOTIME_IN_HZ(SPCENCTR_STROBE_FREQ))
* Normalized function pointer typedefs: they are now all Aaron Giles2008-03-031-4/+4
| | | | | | | | | | suffixed with _func. Did this throughout the core and drivers I was familiar with. Fixed gcc compiler error with recent render.c changes. gcc does not like explicit (int) casts on float or double functions. This is fracking annoying and stupid, but there you have it.
* Converted MACHINE_DRIVER definitions from function Aaron Giles2008-02-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constructors to tokenized lists. For the most part this is a non-invasive change, except for those drivers using MDRV_WATCHDOG_TIME_INIT. In order to allow for tokenization of attotimes, a set of new macros is provided called UINT64_ATTOTIME_IN_x() which follows the same pattern as ATTOTIME_IN_x() but packs the attotime down into a single 64-bit value for easier tokenization. Separated MDRV_DEVICE_CONFIG_DATA into 32-bit and 64-bit versions. Added floating-point versions with configurable resolutions. Fixed several errors in the machine drivers which were caught by the additional checks now done in the machine config detokenization code. Converted speakers into devices. Machine->config no longer houses an array of speakers; instead they are iterated through using the new macros (defined in sound.h) speaker_output_first() and speaker_output_next(). Updated all relevant code to do this. Improved game info display with multiple screens. Fixed bug which caused all screens to display equally. Added typedefs for all the machine config callback functions at the top of driver.h.
* Split timer_adjust() into timer_adjust_oneshot() and timer_adjust_periodic(). Aaron Giles2008-02-061-2/+5
| | | | | Updated all call sites. Fixed recent build breaks.
* 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"
* Changes for MAME 0.121u2.mame0121u2 Aaron Giles2007-12-171-39/+13
|
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+185