A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / coding tutorial: scrolling

 

Author Message
z5_
Member
#1 - Posted: 28 Dec 2004 12:15
Reply Quote
All things scrolling goes in here and i'll start with some questions. Suppose that i have setup a simple screen (40*256) with 1 bitplane. I have filled the screen with a picture and i want to scroll the whole picture to the right (or left, bottom or whatever) side, so that the picture moves out of the screen, line by line.

I have thought about it and i see two possibilities: with the blitter, copying the data one pixel to the right, but for a whole screen that probably wouldn't be fast enough (that would be a blitter copy of the entire 256 lines and the entire width of the screen, but the width would diminish with each word for every 16 pixels that have dissapeared out of the screen). This would also mean that the screenbuffer would have to be one word wider than my actual visible screen (as blitter is words and i don't want to move my pixels into a non-defined area). Could work for small parts of a screen though or a logo moving out of the screen line per line or effects like that.

The other solution seems to be to just move the bitplane pointers. But in that case, i should actually define a screenbuffer that is twice the size of my actual screen. For a scroller with is 3 screens wide (or high in case of a vertical scroller), it would mean setting up a buffer of 3 times the actual size of my screen.

What are you thoughts on that matter? Am i correct? Are there better ways?
Cyf
Member
#2 - Posted: 29 Dec 2004 14:59 - Edited
Reply Quote
the 2 ways are right
depend of what you want to do : for a simple picture scrolling to the left or to the right, hardware scrolling (bplcon1) with 2 screens wide for full scroll is enought. (and you can make an animation in the empty half screen during the shift, like in Rampage/Tek).
use Blitter if you have a screenbuffer and copy source pic to the buffer (the size of the screenbuffer is the size of the screen, no more)

for up and down scrolling, several ways... bitplane pointers with screen*2, diwstart if you just want to move the screen to the bottom and nothing above, or raster wait before bitplane registers in coplist and move raster up/down, you can keep another screen above or below.
or use Blitter.

for a loop scrolling (like in Shadow of the beast), use hardware scrolling (bitplane and bplcon1) with large pic.
example with the "fred" scoopex cracktro :
flash remake here and my asm remake here

I used for the remake the Blitter to do parallax scrolls (!) with this pic:
but in the original, it's hardware scroll with this picture :
FB_mach2
Member
#3 - Posted: 9 Jan 2005 20:51
Reply Quote
Hi,

In some cases it may be possible to simulate differential scrollings with sprites too?? I am wrong or not?
Cyf
Member
#4 - Posted: 9 Jan 2005 22:10 - Edited
Reply Quote
it's possible to simulate a fake playfield/bitplane, a picture made of sprites, like in Jim Power, the mountains in the background (edit: or Shadow of the Beast : little trees in the background, moon, ...)
in some demos, 3D objects, scrolltext or pics are copied in sprites datas (16 colors and multiplex sprites).
FB_mach2
Member
#5 - Posted: 9 Jan 2005 22:21
Reply Quote
Htnaks for your eplanatoin about sprites Cyf

If I understand well the Amiga is able to perform dual-playfield hardware scrollings. But what about trial-playfield scrollings used in agony for example? The third bitplane is software emulated?
Cyf
Member
#6 - Posted: 10 Jan 2005 15:45 - Edited
Reply Quote
Agony use 2 playfields : the first for the foreground and bobs (bitplane 1,3 & 5), the second for the background (bitplane 2,4 & 6).


background Moutains, clouds and moon are in the first bitplane of second playfield (bitplane 2) :


sprites are for : owl, rain (and perhaps other sprites if same colors)
FB_mach2
Member
#7 - Posted: 12 Jan 2005 23:15
Reply Quote
So it means each bitplane is able to scroll individually? Are there some restrictions?
Cyf
Member
#8 - Posted: 13 Jan 2005 10:57 - Edited
Reply Quote
not individually with hardware scroll :
- playfield 2: even bitplanes (2,4,6) use 4 low bits of bplcon1 : $000x
- playfield 1: odd bitplanes (1,3,5) use 4 hi bits of bplcon1 : $00x0

it's possible to change bplcon1 each rasterline (for parallax effect)
for individual scroll, use Blitter

in game, the blitter is also used : copy new block 16 pix. width and scroll with bplcon1.
the bitplane 2 stay fix, the bplpt is reinit each vbl.

see the Copperlist

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0