Re: A82: Side-Scrolling
[Prev][Next][Index][Thread]
Re: A82: Side-Scrolling
Use shift (actually rotate) functions and work with the actual memory. I
assume you are trying to scroll left:
<--Graph Mem<--APD buffer
until the previous contents of the APD buffer are in the graph mem. The APD
buffer will then be filled with zeros
use the instruction RL (rotate left). this instruction copies the carry flag
into bit 0 (lsb), shifts each bit one bit to the left, and copies bit 7 (msb)
into the carry flag. Here's a picture (C is carry flag):
C <-- | 7 <-- 0 | <-- Previous C
for each line, do the following:
- start out by clearing the carry flag (use "or a")
- perform a RL on each byte of the apd buffer and the graph mem (in that
line!), starting from rightmost byte in the apd buffer
then repeat that 96 times (after doing that for every line)
~Adamman
In a message dated 12/12/99 10:15:22 PM Eastern Standard Time,
evil_sam@hotmail.com writes:
> Does anyone have any ideas on how to smooth scroll (pixel by pixel) a
> picture onto the screen horizontally? The only minor snag is that the
> current contents of GRAPH_MEM cannot be deleted as the new data scrolls
onto
>
> the screen (the old data scrolls off as the new scrolls on, and that is
> easily accomplished). The technique I'm using now treats the entire
picture
> as one gigantic sprite. The current screen is GRAPH_MEM, the new screen is
> APD_BUF. It scrolls APD_BUF by changing the x coord and using a hacked
> version of CrASH_Man's PutSprClip that'll automask and work for an entire
> screen. The GRAPH_MEM scrolls off of the screen using a simple routine
> similar to CrASH_Man's Scrolling routines. My technique works, but the
> hacked sprite routine and utility routines take up too much room(~250
bytes)
>
> for such a trivial effect. Zelda will be a pretty tight budget of space,
so
> I really can't afford to waste space unneccessarily. Any thoughts?
> Sam
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com