bsnes/hiro/gtk/timer.cpp
Tim Allen aaf094e7c4 Update to v106r69 release.
byuu says:

The biggest change was improving WonderSwan emulation. With help from
trap15, I tracked down a bug where I was checking the wrong bit for
reverse DMA transfers. Then I also emulated VTOTAL to support variable
refresh rate. Then I improved HyperVoice emulation which should be
unsigned samples in three of four modes. That got Fire Lancer running
great. I also rewrote the disassembler. The old one disassembled many
instructions completely wrong, and deviated too much from any known x86
syntax. I also emulated some of the quirks of the V30 (two-byte POP into
registers fails, SALC is just XLAT mirrored, etc) which probably don't
matter unless someone tries to run code to verify it's a NEC CPU and not
an Intel CPU, but hey, why not?

I also put more work into the MSX skeleton, but it's still just a
skeleton with no real emulation yet.
2019-01-02 10:52:08 +11:00

39 lines
888 B
C++

#if defined(Hiro_Timer)
namespace hiro {
static auto Timer_trigger(pTimer* p) -> signed {
//prevent all timers from firing once the program has been terminated
if(Application::state().quit) return false;
//timer may have been disabled prior to triggering, so check state
if(p->self().enabled(true)) p->self().doActivate();
//callback may have disabled timer, so check state again
if(p->self().enabled(true)) {
g_timeout_add(p->state().interval, (GSourceFunc)Timer_trigger, (gpointer)p);
}
//kill this timer instance (it is spawned above if needed again)
return false;
}
auto pTimer::construct() -> void {
}
auto pTimer::destruct() -> void {
}
auto pTimer::setEnabled(bool enabled) -> void {
if(enabled) {
g_timeout_add(state().interval, (GSourceFunc)Timer_trigger, (gpointer)this);
}
}
auto pTimer::setInterval(uint interval) -> void {
}
}
#endif