
'*** NON-ESSENTIALS
  ON BREAK GOSUB Leave
  BREAK ON
'set up screen and window
  SCREEN 2,320,200,5,1
  WINDOW 2,,,16,2
'draw some stuff  
  FOR i=1 TO 100
    x=RND*600: y=RND*180
    x2=RND*80: y2=RND*40
    LINE(x,y)-STEP(x2,y2),RND*31.5,bf
  NEXT  
  PRINT "   Loading palette assembly code
'*** END NON-ESSENTIALS

'put this line at start
'of your program to  
'load assembly routine
    
  GOSUB InitVPalette  

'use this line when you  
'want to use palette
  
  GOSUB SubVPalette

'*** MORE NON-ESSENTIALS
  PRINT ,"PRESS ANY KEY"  
  WHILE INKEY$>"":WEND  
  WHILE INKEY$="":WEND
Leave:
  WINDOW CLOSE 2
  SCREEN CLOSE 2
 END
'*** END NON-ESSENTIALS 

'------------------- Palette routines ------------------------------       
REM -  Assembly palette routines for AmigaBasic programs 
REM -   by Charles VASSALLO  - March 88
REM - (33 route des Traouieros, 22730 Tregastel - France)

InitVPalette:
       DIM VPaletteCode%(1860)               :' array integer   
       OPEN ":VPal.code" FOR INPUT AS #1     :' this file contains the code
       i=0  
       WHILE NOT EOF(1)
        INPUT#1,VPaletteCode%(i) : i=i+1     :' loads the code
       WEND
       CLOSE #1 
       RETURN
  
SubVPalette:
       VPal&=VARPTR(VPaletteCode%(0))
       CALL VPal&
       RETURN
 
