home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
DBA
/
ST
/
DBA_08A.MSA
/
GFA_SOUR.CES
/
GFASCROL.LST
< prev
next >
Wrap
File List
|
2010-01-01
|
3KB
|
68 lines
' EXAMPLE HOW TO DO A SCROLL-TEXT IN G.F.A.
' THE SIMPLE WAY, AND NOT THE BEST, BUT YOU MUST START SOMEWHERE.
'
' O.T.M. OF THE D.B.A. 30/12/1992
'
ON BREAK GOSUB einde ! STANDARD PROCEDURE FOR ME
ON ERROR GOSUB einde
RESERVE 200000 ! RESERVE SOME WORKSPACE.
DIM font$(255),fontbuf%(32066 DIV 4) ! BUFFER FOR FONT AND SOME CHARACTERS
start%=(V:fontbuf%(0)+255) AND &HFFFFFF00! CALCULATE STARTADRES FOR FONTBUFFER
rez%=XBIOS(4) ! CHECK REZ
IF rez%=2 THEN ! IF HIGH RES
CLS ! (NO COLOUR MONITOR)
PRINT "SORRY, ONLY FOR LOW-RES"
einde
ELSE IF rez%<>0
' ELSE CHANGE TO LOW RES
VOID XBIOS(5,L:-1,L:-1,0) ! CHANGE TO LOW REZ
VSYNC ! WAIT TILL MON/TV IS READY
ENDIF
BLOAD "A:\FONT_3.PI1",start%! LOAD THE FONT INTO THE BUFFER
color_zero
get_font
main
PROCEDURE color_zero
FOR i%=0 TO 15 ! ALL COLOURS "OUT"
SETCOLOR i%,0
NEXT i%
RETURN
PROCEDURE get_font
BMOVE start%+34,XBIOS(3),32000 ! GET FONT ON SCREEN
count%=65 ! THE FONT STARTS WITH A
' AND 65 IS THE ASCII VALUE FOR A
FOR y%=0 TO 96 STEP 33
FOR x%=0 TO 288 STEP 33 !GET ONLY THE 30 BY 30 PARTS
GET x%,y%,x%+30,y%+30,font$(count%)
INC count% ! A,B,C,D,E,F,G,.....
NEXT x%
NEXT y%
CLS
GET 0,0,30,30,font$(32) ! GET THE SPACE " "
VOID XBIOS(6,L:start%+2) ! INIT COLOURS
RETURN
PROCEDURE main
text$=" I HOPE YOU UNDERSTAND HOW THE PROGRAM WORKS SO YOU CAN DO SOMETHING SERIOUS AGAIN "
DO
FOR i%=0 TO LEN(text$) ! GO AS LONG AS THE TEXT IS
IF INP?(2) THEN ! IF A KEY IS PRESSED
einde ! GOODBYE
ENDIF
x$=MID$(text$,i%,1) ! GET ONE (1) CHARACTER OUT OF THE TEXT
PUT 0,100,rest$ ! PUT REST OF SCROLL ON SCREEN
PUT 319-32,100,font$(ASC(x$)) ! PUT WANTED CHARACTER ON SCREEN
GET 32,100,319,100+32,rest$ ! AND GET THE NEXT BIT
PAUSE 5 ! WAIT A BIT(CH)
NEXT i%
LOOP
RETURN
PROCEDURE einde
VOID XBIOS(5,L:-1,L:-1,rez%) ! ALWAYS CHANGE BACK TO OLD REZ
VSYNC ! WAIT
CLS ! AND CLEAN UP THE MESS
RESERVE ! GIVE MEM BACK
SETCOLOR 0,1911 ! MAKE SURE WE CAN SEE WHAT WE READ
SETCOLOR 15,0
EDIT ! AND EXIT
RETURN