'=========================================================================== ' Subject: PB FADING ROUTINE Date: Unknown Date ' Author: Dave Navarro, Jr. Code: PB ' Origin: dave@powerbasic.com Packet: GRAPHICS.ABC '=========================================================================== $CPU 8086 ' program works on any CPU $OPTIMIZE SIZE ' make smallest possible executable $COMPILE UNIT ' compile to a unit (PBU) $DEBUG MAP OFF ' turn off map file generation $DEBUG PBDEBUG OFF ' don't include pbdebug support in our executable $LIB ALL OFF ' turn off all unused PowerBASIC libraries $ERROR ALL OFF ' turn off bounds checking DEFINT A-Z ' default all variables to integers for maximum ' speed and minimum size %FLAGS = 0 %AX = 1 %BX = 2 %CX = 3 %DX = 4 %SI = 5 %DI = 6 %BP = 7 %DS = 8 %ES = 9 SHARED Target$ SUB FadeOut() PUBLIC IF LEN( Target$ ) = 0 THEN Target$ = STRING$( 765, 0 ) REG %AX, &H1017 REG %BX, 0 REG %CX, 255 REG %ES, STRSEG( Target$ ) REG %DX, STRPTR( Target$ ) CALL INTERRUPT &H10 END IF FOR J% = 1 TO 32 CALL FadeDAC( -4 ) NEXT J% END SUB SUB FadeIn() PUBLIC IF LEN( Target$ ) = 0 THEN EXIT SUB END IF FOR J% = 1 TO 32 CALL FadeDAC( 4 ) NEXT J% END SUB SUB FadeDAC( Inc% ) PRIVATE LOCAL Buff$, N%, K% Buff$ = STRING$( 765, 0 ) REG %AX, &H1017 REG %BX, 0 REG %CX, 255 REG %ES, STRSEG( Buff$ ) REG %DX, STRPTR( Buff$ ) CALL INTERRUPT &H10 FOR J% = 1 TO LEN( Buff$ ) N% = ASC( MID$( Buff$, J%, 1 )) + Inc% IF N% < 0 THEN N% = 0 K% = ASC( MID$( Target$, J%, 1 )) IF N% > K% THEN N% = K% MID$( Buff$, J%, 1 ) = CHR$( N% ) NEXT J% REG %AX, &H1012 REG %BX, 0 REG %CX, 255 REG %ES, STRSEG( Buff$ ) REG %DX, STRPTR( Buff$ ) CALL INTERRUPT &H10 END SUB