12 return std::make_unique<EmuTimer>(
13 scheduler, cb, 1, 3579545, 64 * 2, 1024);
19 return std::make_unique<EmuTimer>(
20 scheduler, cb, 2, 3579545, 64 * 2 * 16, 256);
26 return std::make_unique<EmuTimer>(
27 scheduler, cb, 2, 3579545, 64 * 2 * 32, 256);
33 return std::make_unique<EmuTimer>(
34 scheduler, cb, 0x40, 3579545, 72 * 4, 256);
40 return std::make_unique<EmuTimer>(
41 scheduler, cb, 0x20, 3579545, 72 * 4 * 4, 256);
47 return std::make_unique<EmuTimer>(
48 scheduler, cb, 0x40, 33868800, 72 * 38, 256);
54 return std::make_unique<EmuTimer>(
55 scheduler, cb, 0x20, 33868800, 72 * 38 * 4, 256);
60 byte flag_,
unsigned freq_num,
unsigned freq_denom,
63 , maxVal(maxVal_), count(maxVal_)
66 clock.
setFreq(freq_num, freq_denom);
71 count = maxVal - value;
76 if (start != counting) {
86void EmuTimer::schedule(EmuTime::param time)
93void EmuTimer::unschedule()
98void EmuTimer::executeUntil(EmuTime::param time)
104template<
typename Archive>
107 ar.template serializeBase<Schedulable>(*
this);
108 ar.serialize(
"count", count,
109 "counting", counting);
void reset(EmuTime::param e)
Reset the clock to start ticking at the given time.
void setFreq(unsigned freq)
Change the frequency at which this clock ticks.
EmuTime::param getTime() const
Gets the time at which the last clock tick occurred.
virtual void callback(byte value)=0
static std::unique_ptr< EmuTimer > createOPM_1(Scheduler &scheduler, EmuTimerCallback &cb)
static std::unique_ptr< EmuTimer > createOPP_2(Scheduler &scheduler, EmuTimerCallback &cb)
EmuTimer(Scheduler &scheduler, EmuTimerCallback &cb, byte flag, unsigned freq_num, unsigned freq_denom, int maxVal)
static std::unique_ptr< EmuTimer > createOPM_2(Scheduler &scheduler, EmuTimerCallback &cb)
void setStart(bool start, EmuTime::param time)
static std::unique_ptr< EmuTimer > createOPL4_1(Scheduler &scheduler, EmuTimerCallback &cb)
static std::unique_ptr< EmuTimer > createOPL3_1(Scheduler &scheduler, EmuTimerCallback &cb)
void serialize(Archive &ar, unsigned version)
static std::unique_ptr< EmuTimer > createOPL3_2(Scheduler &scheduler, EmuTimerCallback &cb)
static std::unique_ptr< EmuTimer > createOPL4_2(Scheduler &scheduler, EmuTimerCallback &cb)
Every class that wants to get scheduled at some point must inherit from this class.
void setSyncPoint(EmuTime::param timestamp)
This file implemented 3 utility functions:
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)