home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / t / timwin.zip / TIMWIN2.EXE / pak / TESTCFG.CMD < prev    next >
OS/2 REXX Batch file  |  1992-08-05  |  2KB  |  82 lines

  1. ;testcfg  --  test frame grabber configuration
  2. ;
  3. ;  FG_PRESENT       IO_OK     image fg == DIS        conclusion
  4. ;--------------------------------------------------------------------------
  5. ;       0              0            0          0     no framegrabber
  6. ;       0              0            1          1        -
  7. ;       0              1            0          2        -
  8. ;       0              1            1          3        -
  9. ;       1              0            0          4     FG not OK
  10. ;       1              0            1          5     FG not OK 
  11. ;       1              1            0          6     FG OK, but not used
  12. ;       1              1            1          7     FG OK, installed OK
  13. ;
  14. ;Memory tests are only performed if result == 7  (MEM_OK adds 8)
  15. ;Therefore: 7 means: memory write error
  16. ;                15: all OK
  17. ;
  18. ;
  19. ;
  20. #define MEM_OK     8
  21. #define FG_PRESENT 4
  22. #define IO_OK      2
  23. #define DISP       1
  24.  
  25. #define DIS_IM  0x10
  26.  
  27. parms 
  28.   int report
  29. endparms
  30.  
  31. int sysprop = 0
  32. int imagprop = 0
  33. int orgpix, orgdis
  34.  
  35.  
  36. if (ver 1) > 0
  37.   sysprop |= FG_PRESENT
  38.   if (testio) > 0
  39.      sysprop |= IO_OK
  40.   endif
  41. endif
  42.  
  43. imagprop = improp fg
  44. if (imagprop & DIS_IM) == DIS_IM
  45.   sysprop |= DISP
  46. endif
  47.  
  48. if sysprop == 7         ;continue only if fg is correctly installed
  49. ;   orgdis = dest fg
  50.    bgm fg               ;dummy bgm to empty uninitialized pixel buffer
  51.    orgpix = bgm fg 255  ;write a dot into the image and keep prev. value
  52.    if (bgm fg) == 255
  53.       bgm fg 0
  54.       if (bgm fg) == 0
  55.          sysprop |= MEM_OK
  56.       endif
  57.    endif
  58.    bgm fg orgpix           ;write back orig. value
  59. ;   dest orgdis          ;restore orig. destination
  60. endif
  61.  
  62. if report == 0 stop sysprop
  63.         
  64. switch sysprop
  65.   case 0
  66.     print "No frame grabber present"
  67.   case 4
  68.     print "Frame grabber error: possible wrong IO address"
  69.   case 5
  70.     print "Frame grabber error: possible wrong IO address"
  71.   case 6
  72.     print "Frame grabber is OK, but no FG images defined"
  73.   case 7
  74.     print "Frame grabber error: possible wrong memory base address"
  75.   case 15
  76.     print "Frame grabber functions correctly"
  77.   default
  78.     print sysprop, ": Illegal combination of signals"
  79. endsw
  80.  
  81. stop sysprop
  82.