[comp.sys.amiga.tech] Interupts? Help

glmwc@marlin.jcu.edu.au (Matt Crowd) (12/19/90)

I have yet another minor problem with my program...

I have 2 screens swapping between each other for the title
sequence of a program.  I want these screens to swap about every
5 seconds.  I am using Delay() to do the timing for the screen
swapping.  However, I want the user to be able to click on the
mouse button to end this intro sequence and load the main program.
The problem is Delay() will not return for, at worse, just under 5
seconds, which is too long.  I would like to be able to detect the
mouse press straight away, and still have the program swap 
screens correctly no matter how fast the machine it is running on
is.  I am an old Z80 assembler programmer and my mind is screaming
interupts as the solution to this problem, but I have no idea how
to set one up on the Amiga to do this.  Examples/references/other
solutions would be appreciated.  

Wait! I have another idea!  How about using WaitTOF!  After
each of these I could check the mouse event and increment the timer...
Sound ok?

Thanks,

-- 
Matt Crowd       Amiga Man
Email Address    glmwc@marlin.jcu.edu.au

peter@cbmvax.commodore.com (Peter Cherna) (12/20/90)

In article <1990Dec19.101704.4071@marlin.jcu.edu.au> glmwc@marlin.jcu.edu.au (Matt Crowd) writes:
>
>Wait! I have another idea!  How about using WaitTOF!  After
>each of these I could check the mouse event and increment the timer...
>Sound ok?

You could use timer.device to give you a poke after 5 seconds.  Then
you could Wait() on signals from both timer and intuition.

Using WaitTOF() would be like a semi-busy loop.  While you're relinquishing
cycles you don't need, you're still waking up very often though nothing
may have happened.  You can use INTUITICKS messages instead of WaitTOF().
INTUITICKS wake you up about 10 times a second, compared to 50 or 60
for WaitTOF().  But the timer.device would be the most multitasking-friendly.
In your case, INTUITICKS will likely cause no difficulties.

>Matt Crowd       Amiga Man

     Peter
--
     Peter Cherna, Software Engineer, Commodore-Amiga, Inc.
     {uunet|rutgers}!cbmvax!peter    peter@cbmvax.commodore.com
My opinions do not necessarily represent the opinions of my employer.
"Oh, PIN-compatible!  I thought you wanted me to make it IN-compatible!"