'=========================================================================== ' Subject: SCROLLING WITH BIGGER TEXT Date: 06-25-98 (00:00) ' Author: Matt Gulden Code: QB, QBasic, PDS ' Origin: www.thrillhaus.com/basic.html Packet: GRAPHICS.ABC '=========================================================================== ' SCRLTXT2.BAS ' by Matt Gulden (mattg@thrillhaus.com) ' http://www.thrillhaus.com/ ' The second version of smooth text scrolling... Now with bigger ' text! ;) ... This doesn't run very smooth when other programs are running ' under Win95... Freakin Microsoft ;) ' This is public domain and may be redistributed in any form but if modified ' must be accompanied by the original version which can be grabbed from ' http://www.thrillhaus.com/source.html DEFINT A-Z ' Prints text double size DECLARE SUB BigPrint (BYTE$) ' A fast palette routine DECLARE SUB PAL (A, R, G, B) ' Draws stuff in background DECLARE SUB DrawBGStuff () DIM DataString(1193) AS SINGLE SCREEN 13 DEF SEG = &HA000 DrawBGStuff WHILE INKEY$ = "" ' Get a line from the DATA statements below READ TEXT$ NextPrint = 8 ' If "END" is encountered in DATA statement, start from beginning of text. IF UCASE$(TEXT$) = "END" THEN RESTORE ScrollTextStart READ TEXT$ NextPrint = 8 END IF FOR NUM = 1 TO LEN(TEXT$) IF NextPrint = 8 THEN BYTE$ = MID$(TEXT$, NUM, 1) ' If the ascii code is over 150 then the it will be colored text where ' 150 actually equals 0, 151 is 1, and so on... Feel free to change this ' it won't harm anything. IF ASC(BYTE$) > 150 THEN COLOR ASC(BYTE$) - 150 BYTE$ = MID$(TEXT$, NUM + 1, 1) NUM = NUM + 1 END IF BigPrint BYTE$ NextPrint = 0 ELSE NUM = NUM - 1 END IF GET (2, 94)-(319, 108), DataString PUT (0, 94), DataString, PSET NextPrint = NextPrint + 1 ' Wait for vertical retrace, helps eliminate flicker and adds pause WAIT &H3DA, 8 IF INKEY$ <> "" THEN END NEXT WEND ScrollTextStart: DATA "½S¾C¿RÀLÁTÂXÃTÄ2Å.ÆBÇAÈS¥ -- The 2nd smooth scrolltext demo by Matt Gulden " DATA "(aka Folter) ... " DATA "This may not run all that smooth in Win95 with other programs running, " DATA "but it may just be my crappy computer. " DATA "I don't really consider this a 'demo' in the conventional way, " DATA "but it's just a demonstration of the routines... " DATA "feel free to use code in this source file in your own program but if " DATA "you do, please give me credit. Also if you have made any changes, " DATA "and think I should know about them, you can mail me at: " DATA "¶w·e¸b¹mºa»s¼t½e¾r¿@ÀtÁhÂrÃiÄlÅlÆhÇaÈuÉsÊ.ËcÌoÍm¥ " DATA "... That's all for now... Happy coding! ;) DATA " —Restarting Text...¥ " DATA "END" SUB BigPrint (BYTE$) LOCATE 1, 1: PRINT BYTE$; FOR X = 0 TO 6 FOR Y = 0 TO 7 IF PEEK(Y * 320 + X) THEN PSET (X * 2 + 305, Y * 2 + 94) END IF NEXT NEXT LOCATE 1, 1: PRINT " "; END SUB SUB DrawBGStuff ' Set colors 64 through 191 from shades of black to red to white FOR NUM = 64 TO 127 PAL NUM, NUM, 0, 0 NEXT NUM2 = 63 FOR NUM = 128 TO 191 PAL NUM, NUM2, NUM, NUM NUM2 = NUM2 - 1 NEXT ' Draw stars FOR NUM = 0 TO 500 PSET (INT(RND * 320), INT(RND * 200)), INT(RND * 10) + 17 NEXT ' Draw cool red patterns FOR X = 0 TO 99: LINE (X, X)-(319 - X, 199 - X), X + 64: NEXT FOR X = 0 TO 99: LINE (319 - X, X)-(X, 199 - X), X + 64: NEXT FOR X = 0 TO 99: LINE (140, X)-(180, 199 - X), X + 64: NEXT FOR X = 0 TO 99: LINE (180, X)-(140, 199 - X), X + 64: NEXT ' Draw gradiated box around scrolltext LINE (0, 92)-(319, 109), 0, BF LINE (0, 91)-(319, 91), 25 LINE (0, 110)-(319, 110), 25 LINE (0, 90)-(319, 90), 28 LINE (0, 111)-(319, 111), 28 LINE (0, 89)-(319, 89), 31 LINE (0, 112)-(319, 112), 31 END SUB SUB PAL (A, R, G, B) OUT &H3C8, A OUT &H3C9, R OUT &H3C9, G OUT &H3C9, B END SUB