A85: Re: routine help


[Prev][Next][Index][Thread]

A85: Re: routine help




You can't do that in an interrupt routine!  You need to exit an interrupt
routine before it gets called again, which would be 1/200th of a second, or
else the calc will crash.  What you want to do is declare a word inside the
interrupt routine and use that as your counter.  Each time, increment it and
check if it is 400.  If it is, reset it to 0 and do your sprite stuff.  If
it's not, just exit the interrupt routine.


-----Original Message-----
From: S43R80@aol.com <S43R80@aol.com>
To: assembly-85@lists.ticalc.org <assembly-85@lists.ticalc.org>
Date: Wednesday, October 21, 1998 8:36 PM
Subject: A85: routine help


>
>I have installed an interrupt at this routine,and I want it to wait for 2
>seconds to pass...I first did it with 1 second and it went way to fast(what
i
>am doing is displaying a sprite, wait 2 seconds, erase sprite, display
sprite
>over a few pixels, waiting 2 seconds, erase sprite, and go back to the
>beginning...But I can't figure out what is going wrong here, it crashes my
>calc but the only thing that is displayed is the prog description that is
>usually displayed at the bottom of the usgard shell without the
>shell(coolshell) appearing...that's odd, huh
>
>please help...i am only a beginner trying to make a game...so no insults!
>
>
>
>IntCounter:   ;wait for 2 seconds to pass
> ld b,2
> ld a,(IntValue)
> inc a
> ld (IntValue),a    ;waits for 1 second to pass
> cp 200
> jr nz, IntCounter
> ld (IntValue),a;resets (IntValue) because when you cp 200, a = 0 = reset
> djnz IntCounter
> ret