'*************************************************************************** ' ' Smooth Scroling in PowerBASIC V3.0-3.2 ' ' entwickelt von Th.Gohel FidoNet: Thomas Gohel@2:2410/330.1 ' InterNet: support@pbsound.snafu.de ' Homepage: http://www.snafu.de/~pbsound/ ' '*************************************************************************** FOR i% = 1 TO 25 LOCATE, 10 PRINT "Dies ist eine PowerBASIC Scrolling "; PRINT "Demonstration by Thomas Gohel" NEXT i% SetStart &h1000 Counter% = 8*25 FOR i% = 0 TO Counter% LOCATE 1,1: PRINT i% Split i% NEXT i% FOR i% = Counter% TO 0 STEP -1 LOCATE 1,1: PRINT i% Split i% NEXT i% SetStart 0 Split 0 END '************************************************************************** ' Aufspalten des Bildschirm's '************************************************************************** SUB Split(BYVAL Zeile%) public WaitRetrace: 'Warten auf VerRetrace ! mov dx, &h03da ! in al, dx ! test al, 8 ! jne WaitRetrace ;'vorbei?? SetPalette1: 'jetzt wieder warten ! in al, dx ! test al, 8 ! je SetPalette1 ! mov bl, Zeile% ! xor bh,bh ! shl bx,1 ;*2 wg. Zeilenverdopplung ! mov cx,bx ! mov dx, &h3d4 ;CRTC ! mov al, &h07 ;Register 7 (Overflow low) ! out dx,al ! inc dx ! in al,dx ! and al,&b11101111 ;Bit 4 mit Bit 8 der Zeile laden ! shr cx, 1 ! shr cx, 1 ! shr cx, 1 ! shr cx, 1 ! and cl,16 ! or al,cl ! out dx,al ;und setzen ! dec dx ! mov al,&h09 ;Register 9 (Maximum Row Adress) ! out dx,al ! inc dx ! in al, dx ! and al,&b10111111 ;Bit 6 mit Bit 9 der Zeile laden ! shr bl,1 ! shr bl,1 ! shr bl,1 ! and bl, 64 ! or al,bl ! out dx,al ;und setzen ! dec dx ! mov al,&h18 ;Register 18h (Line Compare/Split Screen) ! mov ah, Zeile% ;restlichen 8 Bit setzen ! shl ah,1 ! out dx,ax END SUB '*************************************************************************** ' Startadresse der darzustellenden Bildschirmseite '*************************************************************************** SUB SetStart(BYVAL Zeile??) public LOCAL High?, Low? ! mov ax, Zeile?? ! mov High?, ah ! mov Low?, al ! mov dx, &h3d4 ;CRTC ! mov al,&h0c ;Register 0ch(Linear Starting Adress Middle) ! mov ah, High? ;Bits 15:8 setzen ! out dx,ax ;Register 0dh (LSA Low) ! mov al,&h0d ;Bits 7:0 setzen ! mov ah, Low? ! out dx,ax END SUB