summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/schedule.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Re-enable SCHEDULER_DEBUG. Add timer list validation. Aaron Giles2021-09-121-0/+73
|
* Switch to using an exception to escape the inner timeslice loop. Clean up ↵ Aaron Giles2021-08-301-170/+115
| | | | some no longer necessary bits in the scheduler.
* Add working support for mid-timeslice saves/loads from the debugger. Aaron Giles2021-08-231-85/+237
|
* Clean up save state handling. Timers are now restored in proper order. ↵ Aaron Giles2021-08-221-201/+225
| | | | Mid-timeslice saves are supported in theory. Added cleaner mechanism for quick exiting needed upon restore or hard reset/exit.
* Since I already had to touch all device_timer signatures, bite the bullet ↵ Aaron Giles2021-08-201-3/+8
| | | | and make device_timer callbacks match the native form to eliminate trampolines.
* Minor cleanups. Aaron Giles2021-08-191-2/+0
|
* Remove timer_alloc from scheduler, keeping it exclusively in the device_t ↵ Aaron Giles2021-08-171-36/+6
| | | | class. Eventually we should replace all timer_allocs with persistent_timers embedded in the consumer.
* Add absolute time scheduling for transient times (call_at) and persistent ↵ Aaron Giles2021-04-241-7/+9
| | | | timers (adjust_absolute). Also fix templates for form 5 and 6 callbacks.
* Simplify the suspend model, now the suspend reason implies eatcycles. Aaron Giles2021-04-231-5/+3
|
* Handle null schedulers during machine config. Keep suspend_changes_pending ↵ Aaron Giles2021-04-231-5/+5
| | | | flag live if the timeslice suspend reason is in play.
* Rebuilding the execute list made no sense, so just do it once. Also ensure ↵ Aaron Giles2021-04-231-48/+17
| | | | start/expire are set for persistent timers if not inserted.
* Update to-do list. Aaron Giles2021-04-221-4/+3
|
* Fix logging to report accurate cycle counts. Aaron Giles2021-04-221-6/+8
|
* Fix quantum management. Aaron Giles2021-04-221-8/+6
|
* More clang fixes that don't show up on my machine. Aaron Giles2021-04-171-2/+2
|
* Save states working again. Changed to save persistent timers directly, using ↵ Aaron Giles2021-04-131-134/+113
| | | | the save buffer only for transient timers. Now saving quantum state as well. Switched to using an array for that.
* Moved 'seconds_to_run' functionality to core machine. Consolidated logic for ↵ Aaron Giles2021-04-121-103/+143
| | | | handling hard/soft resets and exits. Added hard_stop() to scheduler to force it to exit ASAP.
* Only output stats if we ran. Aaron Giles2021-04-081-35/+38
|
* Quantum was getting set too high for single-CPU systems. Aaron Giles2021-04-081-5/+5
|
* Create SCHEDULER_DEBUG flag which can be used to enable scheduler asserts. Aaron Giles2021-04-071-3/+3
|
* Fix logging. Aaron Giles2021-04-071-4/+4
|
* Rename raw_subseconds() to frac(). Create initial cut at new attotime ↵ Aaron Giles2021-04-041-1/+1
| | | | implementation. Still a couple of functions missing.
* Subseconds is now signed, +/-2 seconds, to more closely align with expected ↵ Aaron Giles2021-04-031-102/+14
| | | | usage. Cleaned up several core pieces to leverage this.
* Switch out attoseconds in favor of more abstract subseconds. Update everyone ↵ Aaron Giles2021-04-021-112/+71
| | | | to use subseconds abstractly where possible. Builds, and many games work, but some are failing, so there be dragons here.
* 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
|