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

Re: animation skip problem



In <1993Apr7.235507.13390@news.columbia.edu> Steven T Chiang writes:
>In article <9304071530.aa24114@Bonnie.ics.uci.edu> jlee@Bonnie.ICS.UCI.EDU ("Joseph T. Lee") writes:
>>
>>I've synced the draw code to erase and draw the shape only when $E0C019 is
>>low (in vertical blank). The erase/draw code sets the interrupt flag when
>>it is running and the draw code uses the same direct page technique used in
>>FTA's Bouncin' Ferno.

>	I'm not sure what Bouncin' Ferno does to the interrupt flag,
>but I wouldn't suggest putting draw/erase code in an interrupt.
>Although, I'm not sure if that is what you are doing.  My reasoning
>which may or may not apply to your situation is interrupts require
>overhead.

Hey, thanks for answering and no, it's not in an interrupt because that's bad
to start with and I can't figure out how to do anything like that, yet.  What's
going on in my code is that I set the interrupt flag (sei) when I start my
erase routine and the (cli) when my draw routine is finished.  All necessary
calculations are done before the erase/draw routines.

BTW, was my description of the problem that bad? :)

>>The problem is that every once in a while, the sprite skips.  Say I'm moving
[my own stuff imploded *]
>	This may be the problem.  Are you using QD2 to draw the mouse
>cursor?

Actually no, instead I call HideCursor() so QD2 is NOT drawing a pointer.
Then in the event loop, I call GetMouse() to get the current mouse position
and send those coordinates to my updateSprite() routine which in turn calls
my erase/draw code.  Therefore, right now, I got a cool spaceship where my
mouse pointer would be, and it doesn't flicker (yessss! :).

>>I think the problem is every once in a while my sync code has to wait more
>>than 1 tick before $E0C019 goes low and so the skipping occurs.  I've looked
[ more of my stuff imploded * ]
>	I'd say, put a php/sei combo in front of your animation loop
>(make sure to plp when exiting the loop).  If the jumps go away, the
>problem due to the computer servicing an interrupt that takes, as you

What I'm doing is something like:
sei/phb/phd/tya/tcd/lda $c068/ora #$30/sta $c068...
lda $c068/and #$FFCF/sta $c068/pld/plb/cli

Therefore, no interrupts occur when I'm erasing/drawing, so the only thing I
can narrow down to is my vertical blank sync code which is:
flicklup    lda $E0C019
            and #$80
            beq flicklup

>	If that's the case, monitor $e1c02e until the beam passes the
>top of your sprite, and start the draw erase procedure.

I think I tried this before with the code you gave me before, but I got a
bigger lag/skip when trying to sync it.

How about if I sent you the EXE with the source and see if I'm doing anything
wrong somewhere in the code or if you can give me a fuller source for the scan
line lookup?

>Steven Chiang                  Order - DreamGrafix:  The ONLY 16/256/3200
>stc7@cunixb.cc.columbia.edu       color paint program for the Apple IIGS.

Again, thank you for your time in this problem of mine. 8^)

Joseph
--
jlee@bonnie.ics.uci.edu          | I thought my life was at a boring end and
IRC: OrionPaks                   | then more things to do popped up...