libsidplayfp
1.8.3
|
#include <event.h>
Public Member Functions | |
virtual void | cancel (Event &event)=0 |
virtual void | schedule (Event &event, unsigned int cycles, event_phase_t phase)=0 |
virtual void | schedule (Event &event, unsigned int cycles)=0 |
virtual bool | isPending (Event &event) const =0 |
virtual event_clock_t | getTime (event_phase_t phase) const =0 |
virtual event_clock_t | getTime (event_clock_t clock, event_phase_t phase) const =0 |
virtual event_phase_t | phase () const =0 |
Fast EventScheduler, which maintains a linked list of Events. This scheduler takes neglible time even when it is used to schedule events for nearly every clock.
Events occur on an internal clock which is 2x the visible clock. The visible clock is divided to two phases called phi1 and phi2.
The phi1 clocks are used by VIC and CIA chips, phi2 clocks by CPU.
Scheduling an event for a phi1 clock when system is in phi2 causes the event to be moved to the next phi1 cycle. Correspondingly, requesting a phi1 time when system is in phi2 returns the value of the next phi1.
|
pure virtual |
|
pure virtual |
Get time with respect to a specific clock phase.
phase | the phase |
Implemented in EventScheduler.
|
pure virtual |
Get clocks since specified clock in given phase.
clock | the time to compare to |
phase | the phase to comapre to |
Implemented in EventScheduler.
|
pure virtual |
Is the event pending in this scheduler?
event | the event |
Implemented in EventScheduler.
|
pure virtual |
|
pure virtual |
Add event to pending queue.
At PHI2, specify cycles=0 and Phase=PHI1 to fire on the very next PHI1.
event | the event to add |
cycles | how many cycles from now to fire |
phase | the phase when to fire the event |
Implemented in EventScheduler.
|
pure virtual |
Add event to pending queue in the same phase as current event.
event | the event to add |
cycles | how many cycles from now to fire |
Implemented in EventScheduler.