Classic Computer Magazine Archive PROGRAM LISTING: 83-09/FORTHASM.4TH


Scr #10
 ( GRAPHICS - SUBROUTINE WORD   )
 : SUBROUTINE
     O VARIABLE
    -2 ALLOT
    [COMPILE] ASSEMBLER
    ?EXEC !CSP ;             -->

 Thanks to Valpar International
 for the use of this word.

Scr #11
( VBLANK EQUATES, INSTALL      )
HEX
224 @ CONSTANT OLDBLANK
E45C  CONSTANT SETVBL
E462  CONSTANT JVB

DECIMAL

CODE INSTALL ( ADDR -- )
 # 1 LDA, SETUP JSR, XSAVE STX,
 N LDY, N 1+ LDX, # 7 LDA,
 SETVBL JSR,
 XSAVE LDX,
 NEXT JMP, C;

                            -->
SCR #12
 ( GRAPHICS - VBLANK ROUTINE    )
 0 CONSTANT OFF
 1 CONSTANT ON

 : VBLANK ( ADDR/ON or OFF -- )
     IF INSTALL
     ELSE OLDBLANK INSTALL
     ENDIF ;
                             -->
  To use:
 Compose SUBROUTINE, then turn
 on with:
     SUBROUTINE ON VBLANK
 Turn off with:
     OFF VBLANK

Scr #13
 ( GRAPHICS - TEST VBLANK       )
 SUBROUTINE ROTBAK
  712 INC, ( INCREMENT COLOR4 )
  JVB JMP, ( MUST END THIS WAY )

 : TEST
     ROTBAK ON VBLANK ;
Scr #20
 ( DISPLAY LIST INSTALLATION    )
 : DLI ( ADDR/ON or OFF -- )
     IF 192 54286 C! 512 !
     ELSE 64 54286 C!
     ENDIF;

                              -->

 To use:
     Compose SUBROUTINE, then
 turn on with:
     SUBROUTINE ON DLI
 Turn off with:
     OFF DLI
Scr #21
 ( MODIFY THE GR. 7 DISPLAY LIST)
 : DLIMOD
     7 GR.
     560 @ ( FIND DISPLAY LIST )
     DUP 85 + SWAP 6 +
      DO I C@ 128 + I C!
      LOOP ;

                             -->

Sets the high bit in every mode
7 (Antic D) line.



Scr #22
 ( DISPLAY LIST INTERRUPT       )
 HEX
 0 VARIABLE COUNTR
 D01A CONSTANT COLBAK
 D40A CONSTANT WSYNC
 0200 CONSTANT COLTAB

SUBROUTINE GR7DLI
  PHA, TXA, PHA, COUNTR INC,
  WSYNC STA, COLBAK STA,
  # 4F CPX,
   EQ IF, # 0 LDA, COUNTR STA,
   ENDIF,
  PLA, TAX, PLA, RTI, C;
 DECIMAL                       -->
SCR #23
 ( 80 COLORS ON THE SCREEN !     )
 : 80COLORS
     DLIMOD
     GR7DLI ON DLI ;
SCR #24
 ( GRAPHICS 7 RAINBOW            )
 0 VARIABLE RESET
 SUBROUTINE RAINBOW
  PHA, COUNTR INC, COUNTR LDA,
  WSYNC STA, COLBAK STA,
  SEC, RESET SBC,
  # 79 CMP,
   EQ IF, RESET LDA, COUNTR STA,
   ENDIF,
  PLA, RTI, C;

 : SPECTRUM
     DLIMOD
     RESET @ COUNTR !
     RAINBOW ON DLI ;
                               -->
Scr #25
 ( CYCLE THE COLORS IN VBLANK    )
 1 VARIALBLE MVFLG
 SUBROUTINE CYCLE
  PHA, MVFLG LDA,
   EQ IF, COUNTR INC,
   ENDIF,
  PLA, JVB JMP, C;

 1 CONSTANT UP
 0 CONSTANT DOWN

 : MOVECOLORS ( UP or DOWN -- )
     MVFLG !
     CYCLE ON VBLANK
     SPECTRUM ;                -->


Back to previous page