home *** CD-ROM | disk | FTP | other *** search
/ Fujiology Archive / fujiology_archive_v1_0.iso / !MAGS / !BONUS / COVERDSK / STFORMAT / STF35.ZIP / STF35B.MSA / RAYTRACE / SHOW512.LST < prev    next >
File List  |  1981-11-01  |  2KB  |  42 lines

  1. ' This program and the file SHOW512.OBJ are Public Domain
  2. ' It is strictly forbidden to use them in commercial programs !
  3. ' Use this routine in your GFA-BASIC 2.x/3.x programs to show
  4. ' GFA-RAYTRACE 512-Color pictures.
  5. '
  6. ' This will load a picture called demo.sul.
  7. ' This picture can be created from within GFA Raytrace by using the save
  8. ' screen option. Change to demo.sch for high res.
  9. '
  10. RESERVE FRE(0)-21000        ! reserve memory for routines & palettes
  11. base%=EXEC(3,"show512.obj","","")     ! load routines
  12. IF base% AND 1
  13.   ERROR base%
  14. ENDIF            ! continue only if routines loaded
  15. @initray         ! initialize routines and Palette-table
  16. @loadray         ! load 512-colors picture
  17. CALL init%       ! Mode ON
  18. VOID INP(2)      ! wait for a key
  19. CALL exit%       ! Mode OFF
  20. SETCOLOR 0,&H777 ! now restore colors
  21. SETCOLOR 3,0
  22. VOID GEMDOS(73,L:HIMEM)
  23. SUB base%,256
  24. VOID GEMDOS(73,L:base%)  ! free memory used by routines & palettes
  25. END
  26. '
  27. PROCEDURE loadray
  28.   OPEN "i",#1,"demo.sul"       ! open file
  29.   SEEK #1,8                    ! skip file-type (used by GFA RAYTRACE)
  30.   BGET #1,XBIOS(3),32000       ! load screen
  31.   BGET #1,palbuf%,18400        ! load palettes in buffer
  32.   CLOSE #1
  33. RETURN
  34. '
  35. PROCEDURE initray
  36.   ADD base%,256
  37.   palbuf%=base%+3000           ! palettes behind routines (see Reserve)
  38.   LPOKE base%,palbuf%          ! start palette-buffer
  39.   init%=LPEEK(base%+4)         ! 512-colors On - routine
  40.   exit%=LPEEK(base%+8)         ! 512-colors Off - routine
  41. RETURN
  42.