[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: animation skip problem
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.
>The problem is that every once in a while, the sprite skips. Say I'm moving
>the mouse slowly left and right, the sprite would move smoothly, but a few
>times every few seconds, the sprite jumps a >5 pixel distance as it is moving
>in a certain direction. This makes the animation look bad and unclean.
This may be the problem. Are you using QD2 to draw the mouse
cursor?
>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
>through FTA's code and I can't figure out what they used to fix this problem.
>They have wait_sync code lying around all over the place, but I don't know
>which one is the right one and one that doesn't take 2 ticks in order to
>sync. I may think about trying to figure out scan line positions again.
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
suggested, longer than a vbl to complete.
If that's the case, monitor $e1c02e until the beam passes the
top of your sprite, and start the draw erase procedure.
>jlee@bonnie.ics.uci.edu | "Why is the world so complicated?"
Steven Chiang Order - DreamGrafix: The ONLY 16/256/3200
stc7@cunixb.cc.columbia.edu color paint program for the Apple IIGS.
America On_Line: DWS Steve
Genie: S.Chiang4 Apple IIGS Forever!