05.03.2013 Views

Amiga Computing - Commodore Is Awesome

Amiga Computing - Commodore Is Awesome

Amiga Computing - Commodore Is Awesome

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ler code, even when reasonably<br />

0 Vs well a documented, well known fact is rarely that assem- easy to<br />

understand unless you have a good idea of<br />

what the code is supposed to be doing in<br />

tie first place. Needless to say, this makes<br />

-<br />

',luage<br />

coders look far more difficult than<br />

a-<br />

ne<br />

Db of making an <strong>Amiga</strong> display 'smooth<br />

y ;croll' and since it seemed to me this would<br />

or<br />

:e an area many of you would be interested<br />

f e<br />

in, I've chosen to devote some time to<br />

pust<br />

ta<br />

this subject.<br />

In fact, over the next two instalments I'll<br />

hl<br />

no modifying and extending the 680x0<br />

e l<br />

code provided last month in order to pro-<br />

ty<br />

duce a demo that vertically smooth scrolls<br />

an ra<br />

Intuition screen. Before explaining how<br />

this ir<br />

type of smooth scrolling is actually<br />

done, ce<br />

however, let me kill off one false trail.<br />

k.<br />

Those of you who have the <strong>Amiga</strong>'s<br />

graphics s A library documentation may have<br />

seen ut<br />

that there is a library routine called<br />

ScrolIVPort() sy<br />

that can be used to produce<br />

display<br />

ep<br />

scrolling effects. The plain truth is<br />

that<br />

d i while, in theory, this routine could conceivably<br />

bc<br />

be used to produce smooth<br />

scrolls,<br />

y a the results obtained by using this<br />

function<br />

al<br />

are lust not good enough.<br />

The autodocs themselves mention that<br />

sc<br />

the ScrolIVPort() function is slow and can<br />

sa<br />

produce visible 'hashing' of the display, So,<br />

if es<br />

ScrolIVPort() can't be used, is there an<br />

alternative me<br />

course ot action available to us?<br />

The bi<br />

answer here is very definitely yes, but<br />

in ln<br />

order to appreciate it it's necessary to be<br />

clear y p in your mind how <strong>Amiga</strong> displays are<br />

generated. Io<br />

ai<br />

All displays are created by allocating<br />

blocks n of memory called 'bitplanes,' in<br />

which<br />

-t<br />

each 'bit' represents a pixel position<br />

on i the display. Normal displays will contain<br />

a s number of separate bitplanes and by<br />

taking<br />

t<br />

the appropriate pixel bit from<br />

each bitplane, the <strong>Amiga</strong>'s display hard-<br />

h<br />

ware is able to generate a colour register<br />

number. e<br />

F<br />

Values stored in each colour register<br />

177Z 7<br />

1<br />

, • P 9 r r , ri .- -• r F 9 F9 PI r4 F9 P9 ,<br />

17 1<br />

1 7 4 7 4 ; r 7 r<br />

. ii.14<br />

•7717 + , . P 7.<br />

.7 T7 .<br />

14 17 41 4 7 . 4<br />

17 1I!<br />

L. L11<br />

: -<br />

T 747 7 4 1 1'.117-T417 ; 17 TT17717 -T•<br />

. i.i.i<br />

1<br />

• WWIP1 • • - 1717 • gr; • 171;17 • , • 17 TrT•174117 . . . 7 117 . Te • ,<br />

17 + . 1 17417 1 7 .<br />

71+<br />

; ..1<br />

. 1 1.<br />

I. I. L 1 i I. 141: i I! i ill,Ahll! 1, J t L . 6 J 1, I. 1. .1 - J t t 1, 14<br />

7 1P<br />

F . 7 - • • F1 P<br />

77 .<br />

1 P 9 P P P P P<br />

4<br />

iT<br />

r .i.<br />

1i<br />

1+4..4 l; q T • .<br />

. l1<br />

41 +411 .<br />

.<br />

7<br />

4.<br />

j.. . 3 7 P P . 4 7 1 7.<br />

• • .• P + i P P P P P 9 P P 4<br />

, P 4i<br />

P P P P P F 9 P 1 F P F<br />

-<br />

7 P I ; ;<br />

7<br />

. Li<br />

. V . P 441+++<br />

14444++++++++++444++<br />

. P P?<br />

? P<br />

1 • • • • • -<br />

I 9 P<br />

7<br />

4.<br />

1iP P P F<br />

I1;<br />

1 ;<br />

P 4 l r i<br />

V . I,<br />

ill.<br />

P ++++ 4•<br />

eq17 P P P , • •<br />

l<br />

P P P<br />

i,<br />

. P + P 9 P<br />

+ 4+++++++++++++++++++++4444+++++J<br />

I<br />

11:47 . r t r • P9 e r r , P r y • r r o • I r p • r p r r r r y r • • F P P P P<br />

P • • 4P<br />

• P • • • I • • • • • • • - • • • • • • .<br />

4417<br />

g1<br />

± . 1 !<br />

71<br />

tP<br />

P P I P<br />

;<br />

P . 1494++<br />

1<br />

1<br />

P P P<br />

17<br />

rt:71777<br />

, s<br />

;<br />

? P P 9<br />

: 117,7 1P . 1 I P P 9<br />

A1<br />

7'<br />

T<br />

17 1<br />

z<br />

L<br />

1 P 9 P '<br />

q7.T;T;T; 47T;<br />

Z t : . 9 t++++ 4l<br />

1 4 + 4 4 4 4 4 4 +<br />

P P<br />

a-<br />

1t<br />

r<br />

7 a a? i . f , t LJL L L a al<br />

& JAI<br />

! i ;<br />

dT<br />

7<br />

I+<br />

Iilli<br />

. e<br />

• • •<br />

-<br />

• •<br />

, . ill<br />

i<br />

i 1<br />

1 . 1<br />

p 4<br />

&17<br />

r.<br />

diai IT-17;177<br />

•, 7 ,<br />

L<br />

. 7 AALAILILLILLEILLILILILL: •<br />

-•11-1111.1.: A L L L I S A : - 1 1 1 1 : - 1 1 1 1<br />

A11747<br />

; 4i<br />

7 • 1 :<br />

L1a.<br />

ir d<br />

,<br />

T+<br />

7 r 41, r<br />

J t e - . 1 r1<br />

1 - 1 1 1 :<br />

* 7. 7 ; •<br />

+ 1At<br />

177:11:7<br />

i s it<br />

+<br />

t<br />

•<br />

1774,717<br />

MI<br />

7 1<br />

•<br />

. 4-<br />

did<br />

a<br />

; . a7<br />

+ +++4 11;g7TT<br />

•<br />

g7<br />

17,17 :<br />

r<br />

! 1<br />

7x<br />

AZT;Taia; l . + +<br />

l<br />

r<br />

d,a;<br />

. 7<br />

7171717-177;47-T-7;q547.7171117WW177.177111;711174171717171711747117177;g74;;E;<br />

l<br />

1<br />

nothing but<br />

an old otp.<br />

05moothq!<br />

,*;„6,<br />

determine the actual colours seen on the<br />

screen, and it's because a screen's colour<br />

register number range depends on the<br />

number of bitplanes being used that the<br />

colours available with different screen<br />

types varies. A one bitplane screen can<br />

only have two colours (corresponding to<br />

any single bit in the bitplane, being either a<br />

0 or a 1). two bitplane screens can have<br />

four colours (each bit from each bitplane is<br />

combined to produce one of four values<br />

00, 01, 10, or 11) and so on.<br />

MEMORY<br />

Although display bitplanes have to be<br />

stored in chip memory (because they need<br />

to be accessible to the custom chips) they<br />

do not have fixed positions as such. In fact,<br />

when a screen is opened the bitplanes will<br />

be allocated in any convenient area of chip<br />

memory available.<br />

Needless to say this means the graphics<br />

system needs to have some way of identifying<br />

the position of these bitplanes and<br />

the structure used is called a BitMap_ This<br />

structure can be found in the graphics/06<br />

include file and you'll notice from the<br />

description below that it contains space for<br />

Smooth I S one of the 177051'<br />

LISP& ttirk5 1317 d501fing 58111111 fimiga<br />

(oder ran learn about th15 month<br />

Paul thiErdd 5tdrt5 Pllfildinifig how it 1.5<br />

Some simple<br />

smooth scroll<br />

rputinos in<br />

pction<br />

<strong>Amiga</strong> <strong>Computing</strong><br />

MAY 1995<br />

TUTORIAL<br />

Part 10<br />

done u5kg a55embN language<br />

up to eight bitplane pointers:<br />

STUCTUIE DitAR.D<br />

VOID bo_ D yte sPe rtoo<br />

VOID<br />

DTI bo_ Fie gs<br />

etvE be _ le pth<br />

VOID blue d<br />

PERT De _ PLa ne o, Doe<br />

the OitpLeoes<br />

LABEL bo_ SU EOF<br />

;R iote rs Co<br />

Because the BilMap's bitplane pointers<br />

define the memory locations used to produce<br />

the display that appears on your monitor,<br />

you might expect that, by arranging for<br />

a display's bitplane pointers to be<br />

increased by an amount which corresponds<br />

to the pixel-width of the screen, it would<br />

be possible to shift the display memory<br />

downwards by one line.<br />

Similarly, by decreasing those pointers<br />

by the same amount the display might be<br />

expected to shift upwards one line.<br />

Although very close to the truth, this<br />

doesn't work because a part of the story is<br />

still missing. While the BitMap structure<br />

certainly defines the initial display memory<br />

being used, the <strong>Amiga</strong>'s graphics coprocessor<br />

(the 'Copper') which handles the<br />

display generation doesn't actually collect<br />

its bitplane information from this source<br />

Instead it uses copies of the bitplane pointers<br />

that have been embedded into a sehes<br />

of instructions called a 'copper list'.<br />

Once Intuition has opened a screen and<br />

generated these copper instructions, the<br />

bitplane pointers held in the BitMap struc•<br />

hire's are essentially redundant as far as<br />

the display generation process is concerned.<br />

The important bitplane pointer<br />

91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!