home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / amiga / opalvisn / adprrxxw.lzh / F7.ADPro < prev    next >
Text File  |  1993-02-13  |  3KB  |  78 lines

  1. /* ADPro ARexx script to show current pic on OpalVision board without
  2.  * having to reset the save format everytime you want to see the pic.
  3.  *** Brian Wind, November 27, 1992 ***
  4.  *** adjusted for new Screen_type parameters in MorphPlus 2/12/93 ***
  5.  * Install in your REXX: directory along with the other ADPro rexx function
  6.  * key scripts.  Currently set for F6 key however, you can change the name
  7.  * to F1.ADPro through F9.ADPro depending on what you need. */
  8.  
  9. OPTIONS RESULTS
  10. ADDRESS "ADPro"   /* Gotta use ADPro */
  11.  
  12. ADPRO_TO_FRONT    /* Just in case you run this from cli or elsewhere */
  13.  
  14. SFORMAT                        /* Get current save format */
  15. currentsformat=ADPRO_RESULT    /* store it */
  16.  
  17. /* Set your desired screen type in ADPro using the Screen Controls in the
  18.  * lower right hand corner of the screen (i.e. hires, overscan etc.) and
  19.  * the OpalVision Saver will be adjusted to it or just modify this script
  20.  * to make it always display in a certain format. However, PAL, VGA and
  21.  * SuperHiRes are ignored */
  22.  
  23. SCREEN_TYPE                     /* get current screen type */
  24. cst=ADPRO_RESULT /* store current screen type */
  25.  
  26. /* This is ugly, but I tried just testing for the correct bits, however the
  27.  * number given back by ADPro is a character string (as usual with ARexx)
  28.  * and changing that to binary just gave me the ASCII value for each char.
  29.  * So I wrote this little routine to give me the correct bitmask but then I
  30.  * still couldn't test it correctly as a bitmask.  Therefore, I ended up
  31.  * just checking the string for 'bits" using SUBSTR.  If anyone has any
  32.  * better suggestions please implement them, otherwise this does work even
  33.  * though it gave me a headache doing it. :) */
  34.  
  35. bitmasktest = ""
  36. DO tst=15 TO 0 BY -1
  37.   if (cst-2**tst)<0 then bitmasktest = bitmasktest || 0
  38.                     else do
  39.                             bitmasktest = bitmasktest || 1
  40.                             cst=cst-2**tst
  41.                          end
  42. END
  43.  
  44. currentscreen_type=bitmasktest
  45.  
  46. opalst=0       /* clear opal screentype to lores default */
  47. if substr(currentscreen_type,16,1)==1 then opalst=opalst+1   /* hires */
  48. if substr(currentscreen_type,15,1)==1 then opalst=opalst+2   /* lace */
  49. if substr(currentscreen_type,13,1)==1 then opalst=opalst+8   /* horiz. oscan */
  50. if substr(currentscreen_type,12,1)==1 then opalst=opalst+16  /* vert. oscan */
  51.  
  52. /* just a debug statement for checking that i have the right mask */
  53. /* OKAY1 currentscreen_type opalst */
  54.  
  55.  
  56. SFORMAT "OpalVision"            /* set to opalvision save format */
  57.  
  58. /* Save 24 bit pic to opalvision board, if you need a rendered image shown
  59.  * then change "RAW" to "IMAGE" in the next line.  If you need both, make
  60.  * 2 scripts with different function key prefixes for RAW and IMAGE */
  61.  
  62. SAVE "X" IMAGE SCREEN_TYPE opalst
  63.  
  64. SFORMAT currentsformat /* reset save format to last used */
  65.  
  66. /*
  67. For future reference.  OpalVision saver ARexx command (as of 11/26/92):
  68.  
  69. SAVE FILENAME TYPE SCREEN_TYPE STYPE DURATION TICKS
  70.  
  71. i.e. Display Rendered image data in lores-overscan for 2 seconds.
  72. SAVE "X" IMAGE SCREEN_TYPE 8 DURATION 100
  73.  
  74. TYPE = RAW or IMAGE
  75. SCREEN_TYPE
  76. Hires=1:InterLace=2:Horizontal Overscan=8:Vertical Overscan=16
  77. */
  78.