'=========================================================================== ' Subject: SMOOTH MODE13H TEXT SCROLLER Date: 01-14-98 (21:45) ' Author: The ABC Programmer Code: PB ' Origin: voxel@freenet.edmonton.ab.ca Packet: GRAPHICS.ABC '=========================================================================== '=====================[ Mode 13h TEXT Scroller ]======================= ' Scrolls using an 8x8 Character Font (more like 16x16) ' Programmed by William Yu (1-14-98) for PowerBASIC ' ' I don't know who wrote the original Pascal code, but I used that as ' my basis for this demo. I had to use 16x16 for it to work properly ' but at the moment I don't know why... if you can tell me, that would ' really be appreciated! This code is Public Domain. '====================================================================== DEFINT A-Z DIM FOFS AS SHARED WORD, FSEG AS SHARED WORD DIM Bits (0 TO 7) AS SHARED BYTE DIM ColTab (0 TO 15) AS SHARED BYTE DIM ScrT AS SHARED STRING DIM Position AS SHARED BYTE FOR I = 0 to 7 READ Bits(I) next I FOR I = 0 to 15 READ ColTab(I) next I DATA 128,64,32,16,8,4,2,1 DATA 1,1,9,9,3,3,11,11,3,3,9,9,1,1,9,3,1 ScrT =" Hi folks, this scroller was brought to you by William Yu " ScrT=ScrT+"with the help of some Pascal code! " GetFont Mode13h Position = 1 Mode13h GetFont DO Scroll LOOP UNTIL INKEY$<>"" TextMode end SUB Scroll DIM I AS WORD,J AS WORD,A AS WORD DIM CharPos AS BYTE,Character AS BYTE DIM Colour AS BYTE DIM Addr AS WORD,COL AS BYTE Character = ASC(MID$(ScrT,Position,1)) for CharPos = 0 to 7 for I = 0 to 15 DEF SEG = FSeg Addr = PEEK(Fofs+(Character*16)+I) IF (Addr AND Bits(CharPos)) <> 0 then Colour = ColTab(I) else Colour = 0 end if DEF SEG=&HA000 POKE ((23*8)+I)*320+319, Colour next I WAIT &H3DA,8 DEF SEG=&HA000 for J = 0 to 15 for I = 0 to 318 A=((23*8)+J)*320+I Col = PEEK(A+1) POKE A,Col next I next J next CharPos incr Position if Position = len(ScrT) then Position = 1 END SUB SUB TextMode ! mov AX, &h3 ! int &h10 END SUB SUB Mode13h ! mov AX, &H13 ! Int &h10 END SUB SUB GetFont ! push bp ! mov ax,&H1130 ! mov bh,6 ! int &H10 ! mov fseg,es ! mov fofs,bp ! pop bp END SUB