summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/attotime.h
Commit message (Collapse)AuthorAgeFilesLines
* First round of an attempted cleanup of header files in the system. Aaron Giles2010-01-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
|
* Added an attotime_is_never() function Nathan Woods2009-10-311-0/+11
|
* Cleanups and version bump. Aaron Giles2008-12-151-1/+1
|
* Changed attotime_to_ticks/ticks_to_attotime to use UINTs and the eminline Aaron Giles2008-12-141-6/+18
| | | | functions where possible.
* Re-inlined core attotime functions. This makes a significant difference Aaron Giles2008-11-041-33/+218
| | | | | when running with high interleaves (~2x speed running Dig Dug at perfect interleave).
* Added new functions attotime_to_ticks() and ticks_to_attotime() to Aaron Giles2008-07-241-0/+6
| | | | | | | | | | | | | | | | | | | convert between attotimes and a clock tick at an integral frequency. Changed the 6532 RIOT device into a proper device. Rewrote the logic to be simpler and leverage the new attotime functions. Changed the I/O port setters to specify a mask, and changed the I/O port callbacks to pass in the previous value. Updated tourtabl and gameplan drivers to use the new device interface. Converted audio/starwars.c, audio/exidy.c, and audio/gottlieb.c to use the new RIOT implementation instead of rolling their own. Began gottlieb.c cleanup. Converted palette calculations to resistor weights. Corrected video timing. Reduced the number of separate machine drivers. Fixed incorrect spriteram sizes. Populated full memory maps for the main CPU and the rev 1 sound board. More to come.
* Converted MACHINE_DRIVER definitions from function Aaron Giles2008-02-261-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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-0/+6
|
* Initial checkin of MAME 0.121.mame0121 Aaron Giles2007-12-171-0/+212