summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/schedule.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-996/+0
|
* making logerror part of machine and device classes [Miodrag Milanovic] Miodrag Milanovic2015-11-011-10/+10
| | | | display tag of device that logged message
* Code enhancement Diego2015-09-241-1/+1
| | | Removed the assingment step by initializing target object with the value intended.
* Fix debug build. (nw) Sandro Ronco2015-08-161-1/+1
|
* Added seconds() and attoseconds() to attotime and prefixed members with couriersud2015-08-151-9/+10
| | | | | | | m_. Rewrote code accessing members to use seconds() and attoseconds(). The changes were triggered by a test how gcc __int128_t would perform as the internal representation. This test revealed that the current implementation is still faster. (nw)
* Cleanups and version bumpmame0164 Miodrag Milanovic2015-07-291-1/+0
|
* please bear with me.. these are needed to compile in GCC 5.2 and I want ↵ Cowering2015-07-231-0/+12
| | | | mingw guys to see them. with luck they can be reverted in a couple of days (nw)
* moved all to std::string (nw) Miodrag Milanovic2015-04-221-2/+2
|
* some astring to std::string conversion (nw) Miodrag Milanovic2015-04-181-1/+1
|
* There is no implicit conversion to char* in std::string (nw) Miodrag Milanovic2015-04-121-6/+6
|
* cstr() - > c_str() as preparation for move to std::string (nw) Miodrag Milanovic2015-04-111-2/+2
|
* Revert "Changing FASTDEBUG to be assert-free is too big a change to push ↵ Oliver Stöneberg2015-03-201-2/+0
| | | | | | through without public discussion" This reverts commit ca94bb7905e486fc68369893531db858645d38e7.
* Changing FASTDEBUG to be assert-free is too big a change to push through ↵ Vas Crabb2015-03-201-0/+2
| | | | without public discussion
* removed now obsolete modification for FASTDEBUG=1 (nw) Oliver Stöneberg2015-03-201-2/+0
|
* save: Give the device when available to the state save subsystem [O. Galibert] Olivier Galibert2015-02-141-5/+5
|
* fixed some C++11 compiler warnings (nw) Oliver Stöneberg2015-02-051-1/+1
|
* diexec.c: Cache a pointer directly to the machine scheduler at startup, Alex W. Jackson2014-09-181-1/+1
| | | | | | | | | | | to eliminate device().machine().scheduler() chains all over the place (nw) This change has been sitting in my local tree for months, from when I was (mostly unsuccessfully) working on c64 performance. It gives a small speedup to drivers with many tightly-interleaved executing devices (i.e. Commodore drivers) I didn't think it was worth making everyone do a clean build for such tiny gains but I didn't have the heart to chuck it. Since I'm already making another core-touching, clean-build-needed commit tonight, in it goes.
* small optimization to device_scheduler::timer_list_insert() (nw) Oliver Stöneberg2014-09-111-1/+1
|
* schedule.c: minor logging improvements (nw) Alex W. Jackson2014-07-091-7/+8
|
* schedule.c: rebuild_execute_list() after loading a saved state to ensure the ↵ Alex W. Jackson2014-07-081-0/+1
| | | | order of execution remains consistent [Alex Jackson]
* schedule.c: make yield() actually yield again, rather than be a synonym for ↵ Alex W. Jackson2014-07-041-4/+5
| | | | spin() [Alex Jackson]
* and a final batch of passing attotime as const reference (nw) Oliver Stöneberg2014-07-041-7/+7
|
* removed unnecessary assert from src/emu/schedule.c (nw) Oliver Stöneberg2014-07-011-1/+0
|
* Moved core template container classes up from emutempl.h to coretmpl.h: Aaron Giles2014-03-111-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Aaron Giles] * these classes now no longer take a resource_pool; everything is managed globally -- this means that objects added to lists must be allocated with global_alloc * added new auto_pointer<> template which wraps a pointer and auto-frees it upon destruction; it also defaults to NULL so it doesn't need to be explicitly initialized * moved tagged_list template to tagmap.h Redo of the low-level memory tracking system: [Aaron Giles] * moved low-level tracking out of emu\emualloc into lib\util\corealloc so it can be shared among all components and used by core libraries * global_alloc and friends no longer use a resource pool to track allocations; turns out this was a wholly redundant system that wasted a lot of memory * removed global_resource_pool entirely * added global_free_array to delete arrays allocated with global_alloc_array * added tracking of object versus array allocation; we will now error if you use global_free on an array, or global_free_array on an object Added new utility helper const_string_pool which can be used to efficiently accumulate strings that are not intended to be modified. Used by updated makelist and software list code. [Aaron Giles] Updated png2bdc and makelist tools to not leak memory and use more modern techniques (no more MAX_DRIVERS in makelist, for example). [Aaron Giles] Deprecated auto_strdup and removed all uses by way of caller-managed astrings and the software list rewrite. [Aaron Giles] Rewrote software list management: [Aaron Giles] * removed the notion of a software_list that is separate from a software_list_device; they are one and the same now * moved several functions into device_image_interface since they really didn't belong in the core software list class * lots of simplification as a result of the above changes Additional notes (no whatsnew): Moved definition of FPTR to osdcomm.h. Some changes happened in the OSD code to fix issues, especially regarding freeing arrays. SDL folks may need to fix up some of these. The following devices still are using tokens and should be modernized (I found them because they kept their token as void * and tried to delete it, which you can't): namco_52xx_device (mame/audio/namco52.c) namco_54xx_device (mame/audio/namco54.c) namco_06xx_device (mame/machine/namco06.c) namco_50xx_device (mame/machine/namco50.c) namco_51xx_device (mame/machine/namco51.c) namco_53xx_device (mame/machine/namco53.c) voodoo_device (emu/video/voodoo.c) mos6581_device (emu/sound/mos6581.c) aica_device (emu/sound/aica.c) scsp_device (emu/sound/scsp.c) dmadac_sound_device (emu/sound/dmadac.c) s3c2440_device (emu/machine/s3c2440.c) wd1770_device (emu/machine/wd17xx.c) latch8_device (emu/machine/latch8.c) duart68681_device (emu/machine/68681.c) s3c2400_device (emu/machine/s3c2400.c) s3c2410_device (emu/machine/s3c2410.c) strataflash_device (mess/machine/strata.c) hd63450_device (mess/machine/hd63450.c) tap_990_device (mess/machine/ti99/990_tap.c) omti8621_device (mess/machine/omti8621.c) vdt911_device (mess/video/911_vdt.c) apollo_graphics_15i (mess/video/apollo.c) asr733_device (mess/video/733_asr.c)
* Timers now execute at the end of each timeslice instead of at the start, as ↵ Alex W. Jackson2014-02-221-8/+7
| | | | they did prior to 0.141u2. Fixes MT 4308 [Alex Jackson]
* Bulk convert files that already had standard BSD license in my name Aaron Giles2013-10-161-31/+2
| | | | to new license tagged form.
* added makefile define FASTDEBUG to disable some debug-specific stuff, that ↵ Oliver Stöneberg2013-08-021-0/+2
| | | | is causing performance hits (for e.g. profiling) [Oliver Stöneberg]
* Cleanups and version bumpmame0148u3 Miodrag Milanovic2013-04-091-1/+1
|
* Minor schedule.c optimization Nathan Woods2013-03-281-13/+30
|
* Cleanups and version bumpmame0148 Miodrag Milanovic2013-01-111-16/+14
|
* 1. [M6809] Uninitialized variable fix (nw) Nathan Woods2012-12-241-1/+3
| | | | | 2. Added an assertion to catch a bad scenario in schedule.c (nw)
* placed back schedule change but with fixed logic (no whatsnew) Miodrag Milanovic2012-12-171-6/+6
|
* Place schedule thing back, will put it back after release (nw) Miodrag Milanovic2012-12-171-6/+6
|
* Minor optimizations to schedule.c (nw) Nathan Woods2012-12-161-6/+6
|
* Added some logging (currently turned off) Nathan Woods2012-12-161-1/+7
|
* added missing \n to even more fatalerror() calls (no whatsnew) Oliver Stöneberg2012-09-081-2/+2
|
* cothread removed, was not used for a long time and was commented (no whatsnew) Miodrag Milanovic2012-08-231-1/+0
|
* Made MCFG_QUANTUM_PERFECT_CPU able to work within devices (no whatsnew) Miodrag Milanovic2012-08-131-3/+3
| | | require clean compile
* Clamp timer->remaining() to 0 if the timer has expired. Aaron Giles2012-02-281-1/+4
|
* Some cleanup of some observed #include redundancy from source files which ↵ Scott Stone2012-02-061-1/+0
| | | | use emu.h (nw)
* Move devices into a proper hierarchy and handle naming Aaron Giles2012-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Clean-ups and version bumpmame0144u2 Angelo Salese2011-12-041-1/+1
|
* Commented (per Kale's request) not removed libcothread usage in core ↵ Miodrag Milanovic2011-11-301-1/+1
| | | | | (requires clean build), (no whatsnew) We can safely remove comments and cothread.* from /emu and /lib/cothread if it's confirmed way to go
* Added byuu's cothread library, along with a wrapper class. Switched to Aaron Giles2011-06-251-2/+3
| | | | | | | | | | | | using one cothread for each executable device. This functionality is strictly internal and should result in no changes in scheduling behavior. However, it now becomes possible to exit out of a device's execution in the midst of an instruction by calling machine().scheduler().make_active(). Note that this is somewhat dangerous for cores that have logic at the start of their execute loop to check for interrupts or other conditions, as those checks will be skipped upon resume, so consider this sort of early exiting to be highly experimental for now. [Aaron Giles, Miodrag Milanovic, byuu]
* Fix inverted check on anonymous timers prior to saving state. Also Aaron Giles2011-06-051-5/+57
| | | | | | | fix bug where we fail to ignore the permanent non-expiring anonymous timer. Added code to log timers, and we now log them at each save attempt as well as at restore time. Should fix most recent save state releated regressions. [Aaron Giles]
* Converted presave/postload functions to delegates. In a lot of Aaron Giles2011-04-301-1/+1
| | | | | | cases, we can get rid of the postload function entirely and just call directly to the target function. Drivers eventually should just override device_postload() instead of registering for callbacks.
* Switch to using delegates for some callbacks: Aaron Giles2011-04-271-19/+15
| | | | | | | | | | | | - non-device timer callbacks - machine state changing callbacks - configuration callbacks - per-screen VBLANK callbacks - DRC backend callbacks For the timer case only, I added wrappers for the old-style functions. Over time, drivers should switch to device timers instead, reducing the number of timers that are directly allocated through the scheduler.
* Collapsed device_config and device_t into one class. Updated all Aaron Giles2011-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename state_manager -> save_manager since the term "state" is overloaded. Aaron Giles2011-04-201-7/+7
|
* Switch from m_machine to machine() everywhere. In some cases this Aaron Giles2011-04-181-19/+19
| | | | | | | | | | | meant adding a machine() accessor but it's worth it for consistency. This will allow future changes from reference to pointer to happen transparently for devices. [Aaron Giles] Simple S&R: m_machine( *[^ (!=;]) machine()\1