timers in the atari ,what have i found?

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Re: timers in the atari ,what have i found?

Postby Nyh » Mon Jan 05, 2009 10:02 pm

charles wrote:i believe i found some timer related areas in the st

There is no need for believing. All variables in this area are well documented. Simply look them up in, for example, appendix B of The Atari Compendium.

And what you are calling timers are counters.

A timer, like those are found in the MFP are like kitchen timers:
You program them for a certain time interval.
Then you start the timer.
And when the time interval has passed a kitchen timer will ring and a MFP timer will generate an interrupt.

In those interrupts one can added to the system variables you are calling timers.

If I remember correctly you had a problem with timers because you couldn't grasp the idea of time differences:
delta_t = t_end - t_start

At the start you want the time to be zero so you can read times directly and don't have to calculate them.

charles wrote:does any body install a interrupt for timer a in gfa?

It is not possible to write interrupt routines in Gfa. An interrupt handler is written in assembly:

Code: Select all
pea    timer_A
move.w #245,-(sp)   ; count = 245
move.w #6,-(sp)     ; delay = 1:00
move.w #0,-(sp)     ; timer A
move.w #$1f,-(sp)   ; Xbtimer
trap   #14
lea    $c(sp),sp    ; correct stack

; now enable the interrupt
move.w #13,-(sp)    ; Timer A is interrupt 13 on the MFP
move.w #$1b,-(sp)   ; Jenabint
trap   #14
addq.l #4,ap        ; correct stack

loop:
; here a lot of code doing useful things
nop
bra.s  loop


timer_A:            ; timer A interrupt handler
rte


Hans Wessels
User avatar
Nyh
Atari God
Atari God
 
Posts: 1226
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Previous

Return to Coding

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests