[A83] Re: Multi-directional scrolling


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

[A83] Re: Multi-directional scrolling




Zelda 86 is similar, and there is actually source you can look at :)

I used 8x8 tiles (12x12 is way too big, especially on a small screen like
the 83 has), so there are 16x8 tiles per screen/map, or 128 bytes per map.
I stored them all in a separate data string, and only loaded a map when it
was needed.  I used three screen buffers (actually six, because it was
grayscale).  They are defined in atom.asm: VideoRam, GrayMem and Buffer.
The 86 has a memory mapped display, not a crappy display controller driven
one like the 83, so you can do more tricks.  VideoRam is the currently
displayed screen.  It is not usually written to directly, as that would
cause flicker.  GrayMem is the "virtual screen".  Buffer is the currently
displayed map.

When the map is drawn, it gets drawn to Buffer.  Each frame, it is copied to
GrayMem, effectively erasing the screen.  This saves the effort and time
necessary to erase sprites.  It makes it a lot easier when you don't have to
track where things used to be.  Just draw everything would it should go
every frame.  After sprites and everything else is drawn to GrayMem, it gets
copied to VideoRam.

Scrolling between maps is fast and smooth.  I daresay it couldn't get much
faster.  The scrolling logic (scroll.asm) is actually very simple.  It
copies Buffer to VideoRam, displaying the current map.  Then the new map is
drawn to Buffer.  Then Buffer is scrolled into VideoRam from the appropriate
direction.  The actual scrolling is either a memory copy for up/down, and a
bit rotate for left/right.

If you want to know how games work, then check out the source code.
Anything by Matthew Shepcar or Jimmy Mardell would be a very good place to
start.

> Well, I am wondering how you would set something up like that if you have
a
> large area.   How do you store the data for which tile goes where?





References: