Re: A85: routine help
[Prev][Next][Index][Thread]
Re: A85: routine help
the interrupt routine should probably not work like that. i think
what you want is:
IntValue = TEXT_MEM
.org 0
.db "Prog name",0
Start:
ld hl,&IntCounter
call INT_INSTALL
NewSecondLoop:
ld a,200 ; 1 second
ld (IntValue),a
Loop:
ld a,(IntValue)
or a ; is it 0? (waited 1 sec)
jr nz,Loop
...
< do some interesting stuff here >
...
< conditional code >
jr ??,NewSecondLoop ; wait another second?
ret ; no, ret to shell
IntCounter:
ld hl,IntValue
dec (hl) ; 1/200th sec passed
ret
-mike pearce
On Wed, 21 Oct 1998 21:34:09 EDT, you wrote:
>
>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
>
References: