aboutsummaryrefslogtreecommitdiff
path: root/morphos/morphos_timer.cpp
diff options
context:
space:
mode:
authorRuediger Hanke2002-08-13 10:24:42 +0000
committerRuediger Hanke2002-08-13 10:24:42 +0000
commitcafc73f949201c60f68c4c5d25af2bf8f20e8456 (patch)
tree3f1e8b6c434fe347a58c96d69d00d5ccd4ffd851 /morphos/morphos_timer.cpp
parent9792dc9f67bbdb6bdcdcea67c73a73338ccf9b97 (diff)
downloadscummvm-rg350-cafc73f949201c60f68c4c5d25af2bf8f20e8456.tar.gz
scummvm-rg350-cafc73f949201c60f68c4c5d25af2bf8f20e8456.tar.bz2
scummvm-rg350-cafc73f949201c60f68c4c5d25af2bf8f20e8456.zip
Vast update to the MorphOS port which optimises graphics rendering, esp. efficient handling of color cycling. Also new formatting of source
svn-id: r4732
Diffstat (limited to 'morphos/morphos_timer.cpp')
-rw-r--r--morphos/morphos_timer.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/morphos/morphos_timer.cpp b/morphos/morphos_timer.cpp
index ccec0b7468..d106b9a1a9 100644
--- a/morphos/morphos_timer.cpp
+++ b/morphos/morphos_timer.cpp
@@ -152,22 +152,24 @@ void Timer::TimerService(Timer *this_ptr)
if (tmsg->tsm_Interval > 1000)
unit = UNIT_VBLANK;
- OSystem_MorphOS::OpenATimer(&timer_slots[timers].ts_Port, (IORequest **) &timer_slots[timers].ts_IORequest, unit);
- timer_slots[timers].ts_Callback = tmsg->tsm_Callback;
- timer_slots[timers].ts_Interval = tmsg->tsm_Interval;
- timer_slots[timers].ts_SignalBit = 1 << timer_slots[timers].ts_Port->mp_SigBit;
-
- signal_mask |= timer_slots[timers].ts_SignalBit;
- timer_bits |= timer_slots[timers].ts_SignalBit;
-
- timerequest *req = timer_slots[timers].ts_IORequest;
- interval = timer_slots[timers].ts_Interval;
- req->tr_node.io_Command = TR_ADDREQUEST;
- req->tr_time.tv_secs = interval/1000;
- req->tr_time.tv_micro = (interval%1000)*1000;
- SendIO(req);
-
- timers++;
+ if (OSystem_MorphOS::OpenATimer(&timer_slots[timers].ts_Port, (IORequest **) &timer_slots[timers].ts_IORequest, unit))
+ {
+ timer_slots[timers].ts_Callback = tmsg->tsm_Callback;
+ timer_slots[timers].ts_Interval = tmsg->tsm_Interval;
+ timer_slots[timers].ts_SignalBit = 1 << timer_slots[timers].ts_Port->mp_SigBit;
+
+ signal_mask |= timer_slots[timers].ts_SignalBit;
+ timer_bits |= timer_slots[timers].ts_SignalBit;
+
+ timerequest *req = timer_slots[timers].ts_IORequest;
+ interval = timer_slots[timers].ts_Interval;
+ req->tr_node.io_Command = TR_ADDREQUEST;
+ req->tr_time.tv_secs = interval/1000;
+ req->tr_time.tv_micro = (interval%1000)*1000;
+ SendIO(req);
+
+ timers++;
+ }
}
break;
@@ -216,7 +218,7 @@ void Timer::TimerService(Timer *this_ptr)
(*timer_slots[t].ts_Callback)(interval);
GetSysTime(&end_callback);
SubTime(&end_callback, &start_callback);
- interval -= end_callback.tv_sec*1000+end_callback.tv_micro/1000+20;
+ interval -= end_callback.tv_sec*1000+end_callback.tv_micro/1000+40;
req->tr_node.io_Command = TR_ADDREQUEST;
req->tr_time.tv_secs = interval/1000;