'=========================================================================== ' Subject: STARWARS SCREEN SCROLL Date: 01-18-96 (08:17) ' Author: MJS Code: PB ' Origin: Rolf@ice.prima.ruhr.de Packet: GRAPHICS.ABC '=========================================================================== $huge deflng a-z screen 9,,0,0 ' To have some more pages dim huge Position(0400,0:1) as integer ' Array with Positios f. virt. Screen dim CharTable(0:255,0:13) as byte ' ASCII-Table dim ScrollScreen(0:400,0:79) as byte ' Screen with Scroll-Infos CharHeight=14 y=0 IncY=2 for z=0 to 400 call r3d22d(320,y,z,x2,y2) ' to get some "good" 3D's Position(z,0)=x2 ' outermost right border Position(z,1)=y2 ' 2D-Y-Position calculated from 3D-Pos. incr y,IncY next ' Simple CharTableRead def seg=&HA000 for a=0 to 255 locate 1,1 print chr$(a); CharPtr=0 for y=0 to CharHeight-1 CharTable(a,y)=peek(CharPtr) ' read ASCII-Table incr CharPtr,80 next next data 7 data -1,"ÚÄÄÄÄÄÄÄÄÄÄÄ¿" data -1,"³ This is a ³" data -1,"³ TEST !! ³" data -1,"³ written ³" data -1,"³ by MJS ³" data -1,"³ in 1996 ³" data -1,"ÀÄÄÄÄÄÄÄÄÄÄÄÙ" read WorkLines dim ScrollText$(WorkLines),ScrollCenter(WorkLines) for a=1 to WorkLines read ScrollCenter(a),ScrollText$(a) ' read Text to scroll next VisualPage=0:LastPage=1 ScrollScreenMax=CharHeight*4 ScrollLine=1 ScrollLineSub=0 ColorDiv=(ScrollScreenMax/14) r=0 for a=1 to 15 ' set colors (black -> white) out &H3c8,a for b=1 to 3 out &H3c9,r next incr r,4 next for a=1 to 15 palette a,a next while len(inkey$)=0 screen 9,,LastPage,VisualPage line (0,0)-(639,349),0,bf ' quicker than CLS :) for y=ScrollScreenMax-1 to 1 step -1 y2=y-1 for x=0 to 79 ScrollScreen(y,x)=ScrollScreen(y2,x) ' scroll 'up' next next h$=ScrollText$(ScrollLine) select case ScrollCenter(ScrollLine) ' centering line case -1 StartPos=40-(len(h$)\2) case else StartPos=ScrollCenter(ScrollLine) end select for c=1 to len(h$) ' read Lines of characters ScrollChar=asc(mid$(h$,c,1)) ScrollScreen(0,StartPos)=CharTable(ScrollChar,ScrollLineSub) incr StartPos next incr ScrollLineSub if ScrollLineSub=CharHeight then ScrollLineSub=0 incr ScrollLine if ScrollLine>WorkLines then ScrollLine=1 end if for y=0 to ScrollScreenMax-1 ' show 'viewable' scroll-Text RealY=349-Position(y,1) OldY=349-Position(y+1,1) MaxX=Position(y,0) WorkX=-320 for x=0 to 79 ScrollByte=ScrollScreen(y,x) if (ScrollByte>0) then OldX=(((MaxX*WorkX)\320)*4)+320 for b=7 to 0 step -1 incr WorkX RealX=(((MaxX*WorkX)\320)*4)+320 if bit(ScrollByte,b) then line (OldX,OldY)-(RealX,RealY),15-(y\ColorDiv),bf OldX=RealX next else incr WorkX,8 end if next next LastPage=VisualPage VisualPage=((VisualPage+1) and 1) ' switch Pages wend end SUB r3d22d(x1, y1, z, x2, y2) ' calculate 3D -> 2D ' Depth=128 ' x2=(x1*depth)/(z+depth) z2 = z + 128 x2 = x1 SHIFT LEFT x2, 7 x2 = x2 \ z2 y2 = y1 SHIFT LEFT y2, 7 y2 = y2 \ z2 END SUB