summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/schedule.cpp
Commit message (Collapse)AuthorAgeFilesLines
* More statistics improvements Aaron Giles2021-03-311-6/+8
|
* Add lots of statistics. Don't put never timers on the active list. Aaron Giles2021-03-311-34/+80
|
* Reorganized diexec fields to be more optimal. Moved execution and suspend ↵ Aaron Giles2021-03-301-152/+80
| | | | logic into the execute interface. Added minimum duration parameter to the timeslice function. Switched to using delegates to call the various execute paths.
* Some internal name cleanup. Don't bother registering the internal periodic ↵ Aaron Giles2021-03-301-242/+176
| | | | timer. Switched back to a permanent tail timer to dodge nullptr checks. Moved timer list management out of helper class and back into the core logic now that we're back to a single list. Reduced some unecessary friending.
* Change the way timers are saved. Use presave to populate a fixed array of ↵ Aaron Giles2021-03-291-293/+401
| | | | data, and postsave to restore it, rather than saving each timer. Add a device_persistent_timer to accept device parameters and keep those details out of schedule.cpp. Device timers now using parameter 2 to store the ID, rather than the ID being special.
* Added stricter checks on allocation of device timers. Fixed several places ↵ Aaron Giles2021-03-271-20/+9
| | | | that were caught by this. Updated all interfaces and core systems to use new timer classes.
* Small cleanups. Properly differentiate persistent_timer::init for device ↵ Aaron Giles2021-03-261-11/+10
| | | | timers. Update sound manager to use native callback form. Update screen to use persistent timers.
* Fixes to mingw build. Aaron Giles2021-03-261-1/+1
|
* Major timer object reshuffling. timer_expired_delegate wraps the various ↵ Aaron Giles2021-03-261-462/+531
| | | | callback types. timer_callback is a class containing a timer_expired_delegate plus a user-supplied pointer, and accounting information for registration. timer_instance is a single active timer in the scheduler. persistent_timer is what you get back from timer_alloc() now, and has methods for dynamic changes. transient_timer_factory is what you use to create transient timers. Devices now own a transient_timer_factory for transient device timers. persistent_timers can be emedded and initialized directly.
* Add scheduler object and accessor to device_t. Upgrade all 3 timer ↵ Aaron Giles2021-03-241-10/+12
| | | | parameters to u64. Change first parameter of device timers to be emu_timer const. Updated all device timers to follow suit.
* Unsplit timer.h and just moved schedule.h up higher in the emu.h include ↵ Aaron Giles2021-03-241-33/+13
| | | | order. Created new timer_expired_delegate class which is based on a new native timer expired function signature, and which can convert the old function signature automatically via a trampoline. Added several other function signatures which can now be used directly as timer callbacks.
* Fully deprecate unregistered timer_set/synchronize. Standardize on ↵ Aaron Giles2021-03-241-83/+51
| | | | emu_timer_cb for all timers internally. Split out timer-related classes into their own header timer.h, which is included before device.h. Devices now own their own emu_timer_cb for device timers.
* Remove some old-school synchronize calls. Add an optional unique ID pointer ↵ Aaron Giles2021-03-231-3/+18
| | | | to enregistration to help differentiate in non-device cases.
* Add 2 extra u64 parameters to timers. Currently not passed to the callback; ↵ Aaron Giles2021-03-231-13/+28
| | | | this will be addressed once we have flexible callback signatures. A few more synchronize conversions.
* enregister_interface -> interface_enregister Aaron Giles2021-03-231-1/+1
|
* Renamed timer_expired_registered_delegate to emu_timer_cb. Removed all ↵ Aaron Giles2021-03-231-7/+41
| | | | timer_set instances and moved timer_set to private (since it's still used by synchronize). Added timer_alloc template to device_t for common case of allocating a device callback bound to the device. Added interface_timer_alloc template to device_interface as well. Extended emu_timer_cb to allow enregistering directly on the scheduler or on a device_interface.
* Removed ptr parameter from temporary timers. Fixed a handful of places that ↵ Aaron Giles2021-03-221-8/+75
| | | | used it. Created timer_expired_registered_delegate for registering timer callbacks. Updated the callbacks in dcs.cpp to use them as a testbed.
* Timer streamlining. Maintain timers in two lists (active/inactive). Fix ↵ Aaron Giles2021-03-221-213/+570
| | | | several situations where timers would be inserted/removed unnecessarily. Moved basetime_relative class into the device scheduler.
* Track the relative time of the next expiring timer, rather than using ↵ Aaron Giles2021-03-191-63/+127
| | | | relative times on all timers. More heavily document the inner scheduler loop. Cache several variables locally. Split cycle eating logic out.
* Split timeslice() into debugging and non-debugging versions to save a ↵ Aaron Giles2021-03-191-8/+7
| | | | compare in the inner loop.
* Aim for overshoot rather than undershoot when scheduling devices, reducing ↵ Aaron Giles2021-03-191-50/+46
| | | | needless extra loops in core scheduler.
* Quick test to see performance difference of using attoseconds exclusively ↵ Aaron Giles2021-03-181-34/+56
| | | | during core scheduling. Seems to be ~4% on firetrap as an example.
* Remove logic to handle execution longer than 1 second. This shouldn't ↵ Aaron Giles2021-03-171-9/+4
| | | | happen. Small performance uplift from removing code in the inner scheduling loop.
* -osd: Clean up inline maths utilities. Vas Crabb2021-01-181-1/+1
| | | | | | | | | | * Removed inline assembly for operations compilers handle well. * Added ARM and AArch64 implementation for a few operations. * Added unsigned integer add with carry out operations. -cpu/drccache.cpp: Detect whether RWX pages are supported. -dynax.cpp: Improved a few hanafuda DIP switch descriptions.
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The things that were previously called device iterators are not iterators in the C++ sense of the word. This is confusing for newcomers. These have been renamed to be device enumerators. Several Lua methods and properties that previously returned tables now return lightweight wrappers for the underlying objects. This means creating them is a lot faster, but you can't modify them, and the performance characteristics of different operations varies. The render manager's target list uses 1-based indexing to be more like idiomatic Lua. It's now possible to create a device enumerator on any device, and then get subdevices (or sibling devices) using a relative tag. Much more render/layout functionality has been exposed to Lua. Layout scripts now have access to the layout file and can directly set the state of an item with no bindings, or register callbacks to obtain state. Some things that were previously methods are now read-only properties. Layout files are no longer required to supply a "name". This was problematic because the same layout file could be loaded for multiple instances of the same device, and each instance of the layout file should use the correct inputs (and in the future outputs) for the device instance it's associated with. This should also fix video output with MSVC builds by avoiding delegates that return things that don't fit in a register.
* emu: correct some file headers (nw) hap2020-06-191-1/+1
|
* save/restore otuput values in save states Vas Crabb2019-12-131-4/+3
|
* schedule: pick some really low-hanging fruit (nw) Vas Crabb2019-11-151-43/+52
|
* assert aborts on failure - abort is not an exception. conditional noexcept ↵ Vas Crabb2019-11-101-3/+3
| | | | is an antipattern, get rid of it. (nw)
* Make many device_execute_interface functions noexcept, including the ↵ AJR2019-11-091-3/+3
| | | | | | | | "information" overrides. This also covers several time-related functions in attotime, running_machine and emu_timer. (nw) m6805: Calculate min_cycles and max_cycles once at device_start time (Nw) attotime: Add as_khz and as_mhz (nw)
* Spring cleaning: Vas Crabb2019-11-011-21/+5
| | | | | | | | | | | | * Changed emu_fatalerror to use util::string_format semantics * Fixed some incorrectly marked up stuff in build scripts * Make internal layout compression type a scoped enum (only zlib is supported still, but at least the values aren't magic numbers now) * Fixed memory leaks in Xbox USB * There can only be one "perfect quantum" device - enforce that only the root machine can set it, as allowing subdevices to will cause weird issues with slot cards overiding it * Allow multiple devices to set maximum quantum and use the most restrictive one (it's maximum quantum, it would be minimum interleave) * Got rid of device_slot_card_interface as it wasn't providing value * Added a helper template to reduce certain kinds of boilerplate in slots/buses * Cleaned up some particularly bad slot code (plenty more of that to do), and made some slots more idiomatic
* don't try to update m_totalcycles on devices with a zero clock, as it will ↵ smf-2018-07-291-1/+5
| | | | crash. (nw)
* Revert part of 20b5f5d0e6f73b9ce6fffa4fc5dbe3f2b83d2a27 smf-2018-07-291-26/+25
|
* Fix setting sample rate back to zero & crash for synchronous streams when ↵ smf-2018-07-291-25/+26
| | | | rate is zero. This fixes all reported bugs. (nw)
* Revert part of 20b5f5d0e6f73b9ce6fffa4fc5dbe3f2b83d2a27 Olivier Galibert2018-07-291-26/+25
| | | | | | | This is damn sensitive code, and generates differences all over the place we don't really explain. The changes should be justified by themselves and tested in collaboration with Tafoid to ensure the differences are not a problem.
* vgmplay: start all clocks at zero and reset all sound chips on a song change ↵ smf-2018-07-271-25/+26
| | | | [smf]
* Kludge some absolute tag lookups in the core that can't really be helped (nw) AJR2018-05-211-1/+1
|
* Reshuffle some stuff: Vas Crabb2018-03-281-2/+2
| | | | | | * Move around the debugger hooks to get a small but measurable performance increase * Remove emucore from external tools * Improve performance of DSP16 interpreter a little by generating six variants of execution loop
* Stop save and load logging timers unless VERBOSE is set. [smf] smf-2017-12-201-2/+6
|
* Fix scheduler overflow when a device executes for more cycles than there are ↵ AJR2017-06-271-1/+9
| | | | in a second
* Retired min/max in attotime.h, in favor of std::[min|max]() Nathan Woods2017-05-251-4/+4
|
* RIP timer_pulse (nw) AJR2017-05-201-12/+0
|
* Check for callback name being a null pointer before sending it to %s. (nw) Ted Green2017-05-051-1/+4
|
* Introduce u8/u16/u32/u64/s8/s16/s32/s64 Vas Crabb2016-11-191-5/+5
| | | | | | | | | | | | * New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h" * Get rid of import of cstdint types to global namespace (C99 does this anyway) * Remove the cstdint types from everything in emu * Get rid of U64/S64 macros * Fix a bug in dps16 caused by incorrect use of macro * Fix debugcon not checking for "do " prefix case-insensitively * Fix a lot of messed up tabulation * More constexpr * Fix up many __names
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-5/+5
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-2/+2
| | | | to inline functions (nw)
* - removed FUNC_NULL macro Miodrag Milanovic2016-07-011-3/+8
| | | | | - made emu_timer register_save properly handle timer_expired_delegate() - removed timer_expired_func and calls using it
* Iterate over devices C++11 style AJR2016-04-181-8/+7
| | | | | | Replace the old device_iterator and its specialized versions with functionally equivalent classes that use standard operators to yield references to devices/interfaces rather than pointers. With range-based for loops, they no longer have to be stored in named variables, though they can also be reused concurrently since the iteration state is now maintained by a subclass. Add a few more typical getters to device_t::subdevice_list.
* Iterate over core classes C++11 style AJR2016-03-311-3/+3
| | | | | | | | C++11 range-based for loops can now iterate over simple_list, tagged_list, core_options, device_t::subdevice_list, device_t::interface_list, render_primitive_list and all subclasses of the above, and much code has been refactored to use them. Most core classes that have these lists as members now have methods that return the lists themselves, replacing most of the methods that returned the object at an owned list's head. (A few have been retained due to their use in drivers or OSD.) device_t now manages subdevice and interface lists through subclasses, but has given up the work of adding and removing subdevices to machine_config. memory_manager has its tagged lists exposed, though the old rooted tag lookup methods have been removed (they were privatized already).
* * Support *n conversion in stream_format/string_format Vas Crabb2016-03-011-1/+1
| | | | | | | | | * Make stream_format return characters printed * Add iostreams with std::vector storage * Move to type-safe templates for logerror and popmessage * Remove now-unnecessary I64FMT from calls to logerror/popmessage * Put some lib/util stuff in util:: namespace * Some fixes to Japanese translation