'=========================================================================== ' Subject: PB SMOOTH SCROLLER Date: 05-28-97 (14:06) ' Author: Frank W. Zammetti Code: PB ' Origin: fzammett@fpsserv.com Packet: GRAPHICS.ABC '=========================================================================== $HUGE CLEAR: DEFINT a-z: SCREEN 7: CLS: RANDOMIZE TIMER ScrXSize = 320 ScrYSize = 200 StartLine = 95 ScrollSize = 8 ScrMode = 1 PALETTE 15,3 COLOR 4 Message$ = " (C)OPYRIGHT 1997 BY FRANK W. ZAMMETTI. USE IT AS YOU WISH" Message$ = Message$ + "... BUT PLEASE GIVE ME CREDIT SOMEWHERE! Message$ = Message$ + " WELL, AS YOU CAN SEE, THIS IS JUST" Message$ = Message$ + " AN EXAMPLE OF A SMOOTH SCROLLER IN POWERBASIC." Message$ = Message$ + " IT IS 99% PURE BASIC, WITH JUST" Message$ = Message$ + " A SPRINKLING OF ASSEMBLY IN IT OF COURSE! IT" Message$ = Message$ + " IS CAPABLE OF VARIABLE-HEIGHT SCROLLS, ANYWHERE" Message$ = Message$ + " FROM 8 X 8 TO 128 X 128 (ANY EVEN MULTIPLE OF" Message$ = Message$ + " 8 IN FACT, SINCE THE BASE CHARACTER FONT DATA" Message$ = Message$ + " IS AN 8 X 8 SET, WHICH I COPIED OVER FROM THE" Message$ = Message$ + " GOOD-OLD COMMODORE 64!). IT SHOULD RUN SMOOTH" Message$ = Message$ + " AS SILK ON A 486 AT 66MHZ AND UP, BUT I HAVEN'T" Message$ = Message$ + " TESTED IT BELOW THAT. THE SIZE OF THE SCROLL DOES" Message$ = Message$ + " MATTER THOUGH! LATER.... **** @" DIM Letter(ScrollSize + 1) GOSUB Fontsetup DEF SEG = &ha000 ResetIt: v = 1 Scroll: u = 1 z$ = MID$(Message$, v, 1) if z$ = "@" then goto resetIt z = ASC(z$) z = ((z - 32) * 8) + 1 FOR y = 1 TO 8: Letter(y) = Font(z): z = z + 1: NEXT y w = 0: x = 0: y = 0: z = 0 Scroll1: ! CLI PrevBit = BIT(Letter(1), 7) SLine = StartLine * (ScrXSize / 8) ZLine = (ScrXSize / 8) * ScrYSize ScrollLoop: FOR z = 0 TO ScrollSize - 1 FOR y = ((ScrXSize / 8) - 1) TO 0 Step -1 WhatByte? = PEEK(ZLine + (z * (ScrXSize / 8)) + y) PrevBitTemp = BIT(WhatByte?, 7) ! MOV al, WhatByte? ! SHL al, 1 ! MOV WhatByte?, al IF PrevBit = 1 THEN BIT SET WhatByte?, 0 IF PrevBit = 0 THEN BIT RESET WhatByte?, 0 PrevBit = PrevBitTemp POKE (ZLine + (z * (ScrXSize / 8)) + y), WhatByte? NEXT y PrevBit = BIT(Letter(z + 2), 7) NEXT z FOR z = 1 TO ScrollSize: WhatByte? = Letter(z) ! MOV al, WhatByte? ! SHL al, 1 ! MOV WhatByte?, al Letter(z) = WhatByte?: NEXT z u = u + 1 IF u > 9 THEN GOTO NextLetter TransferMe: WAIT &h3da,8 FOR z = SLine TO SLine + ((ScrollSize) * (ScrXSize / 8)) POKE z, PEEK(ZLine) ZLine = ZLine + 1 NEXT z ! STI x$ = INKEY$ IF x$ = CHR$(27) THEN GOTO BreakOut GOTO Scroll1 NextLetter: v = v + 1 WAIT &h3da,8 FOR z = SLine TO SLine + ((ScrollSize - 1) * (ScrXSize / 8)) POKE z, PEEK(ZLine) ZLine = ZLine + 1 NEXT z ! STI x$ = INKEY$ IF x$ = CHR$(27) THEN GOTO BreakOut GOTO Scroll BreakOut: SCREEN 0: CLS: WIDTH 80: CLS PRINT "Goodbye!...": PRINT: PRINT PRINT "Frank W. Zammetti (fzammett@fpsserv.com)": PRINT: PRINT: PRINT END fontsetup: DIM Font(480) z = 1 Looper: READ a$ IF a$="EOF" THEN RETURN b = 0 IF MID$(a$,8,1) = "#" THEN b = b + 1 IF MID$(a$,7,1) = "#" THEN b = b + 2 IF MID$(a$,6,1) = "#" THEN b = b + 4 IF MID$(a$,5,1) = "#" THEN b = b + 8 IF MID$(a$,4,1) = "#" THEN b = b + 16 IF MID$(a$,3,1) = "#" THEN b = b + 32 IF MID$(a$,2,1) = "#" THEN b = b + 64 IF MID$(a$,1,1) = "#" THEN b = b + 128 Font(z) = b z = z + 1 GOTO Looper data " " data " " data " " data " " data " " data " " data " " data " " data " ##### " data " #### " data " ### " data " ### " data " " data " ## " data " ## " data " " data " ## ## " data " ## ## " data " # # " data " " data " " data " " data " " data " " data " # # " data " ## ## " data "####### " data " ## # " data "####### " data " ## ## " data " # # " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " ## " data " ## " data " # " data " " data " " data " " data " " data " " data " ## " data " ## " data " ### " data " ### " data " #### " data " ### " data " ## " data " " data " ## " data " ## " data " ### " data " ### " data " #### " data " ### " data " ## " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " ## " data " ## " data " ###### " data " #### " data " ## " data " " data " " data " " data " " data " " data " " data " ## " data " ## " data " # " data " " data " " data " " data " " data " ###### " data " ### " data " " data " " data " " data " " data " " data " " data " " data " # " data " ### " data " # " data " " data " " data " ##" data " ## " data " ## " data " ## " data " ## " data " ## " data " " data " ##### " data " ### ###" data " ### ###" data " #######" data " #######" data " #######" data " ##### " data " " data " ## " data " ### " data " ## " data " ## " data " #### " data " ###### " data " ###### " data " " data " ##### " data " ## ##" data " ## ###" data " ### " data " ##### " data " #######" data " #######" data " " data " ##### " data " ## ###" data " ### " data " ##### " data " ####" data " ## ####" data " ##### " data " " data " ### " data " #### " data " ##### " data " ## ### " data " #######" data " ### " data " #####" data " " data " ######" data " ### " data " ###### " data " ###" data " ####" data " ## ####" data " ##### " data " " data " ##### " data " #### ##" data " #### " data " ###### " data " #### ##" data " #### ##" data " ##### " data " " data " #######" data " ## ###" data " ### " data " #### " data " #### " data " #### " data " #### " data " " data " ##### " data " #### ##" data " #### ##" data " ##### " data " #### ##" data " #### ##" data " ##### " data " " data " ##### " data " ## ####" data " ## ####" data " ######" data " ####" data " ## ####" data " ##### " data " " data " " data " ### " data " ## " data " " data " ## " data " ### " data " " data " " data " " data " ## " data " ## " data " " data " ## " data " ## " data " # " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " #### " data " ###### " data " " data " ###### " data " #### " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " ##### " data "## #### " data "## #### " data " ### " data " ### " data " " data " ### " data " " data " " data " " data " " data " " data " " data " " data " " data " " data " ### " data " ##### " data " ## ## " data "####### " data "### ### " data "### ### " data "### ### " data " " data "###### " data " # ## " data " ##### " data " # ## " data "####### " data "####### " data "###### " data " " data " #### " data " ## ## " data "### " data "#### # " data "####### " data "####### " data " ##### " data " " data " #### " data " # ## " data " # ## " data " ## ## " data "####### " data "####### " data "###### " data " " data " ###### " data " ## " data " ### " data " ### # " data "####### " data "####### " data "###### " data " " data " ###### " data " ## # " data " ### " data " ## " data "#### " data "#### " data "#### " data " " data " #### " data " ## ## " data "### " data "#### ## " data "####### " data "####### " data " ### ## " data " " data "### ### " data "### ### " data " # # " data " ##### " data " # # " data "### ### " data "### ### " data " " data " #### " data " ## " data " ## " data " ## " data " #### " data " #### " data " #### " data " " data " ##### " data " ## " data " ## " data " # ### " data "####### " data "####### " data " ##### " data " " data "#### ## " data " ## ### " data " #### " data " ##### " data "### ### " data "### ### " data "### ### " data " " data " #### " data " ## " data " ## " data " ### ## " data "####### " data "####### " data "####### " data " " data "### ### " data "### ### " data " ##### " data " # # # " data " # # " data "### ### " data "### ### " data " " data "### ### " data " ### # " data " # ### " data " # # " data "### ### " data "### ### " data "### ### " data " " data " ### " data " ## ## " data " # # " data "### ### " data "####### " data "####### " data " ##### " data " " data " ##### " data " ## # " data " # ## " data " ##### " data " ## " data "#### " data "#### " data " " data " #### " data " ## ## " data " # # " data "## ## " data "## ### " data "### ### " data " ### ## " data " " data " ##### " data " ## # " data " # ## " data " ##### " data " ## ### " data "### ### " data "### ### " data " " data " #### " data " ## ### " data " ## " data "# ## " data "####### " data "####### " data " ##### " data " " data "########" data "## ## ##" data " ## " data " ## " data " #### " data " #### " data " #### " data " " data " ### ## " data " ## ## " data " ## # " data "### # " data "####### " data "####### " data " ### ## " data " " data " ### ###" data " ### ###" data " # # " data " ## ## " data " # # " data " ### " data " ### " data " " data "### ### " data "### ### " data " # # " data "## # ## " data "####### " data "####### " data " ## ## " data " " data "### ### " data "### ### " data " ### " data " ##### " data "### ### " data "### ### " data "### ### " data " " data "### ## " data "### ## " data " ## ### " data "# ##### " data "## ### " data "###### " data " #### " data " " data " ###### " data " ## ### " data " ## " data " ### # " data "####### " data "####### " data "####### " data " " data "EOF"