home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / jËzyki_programowania / amigae / e_v3.2a / rkrmsrc / expansion / findboards.e < prev   
Text File  |  1977-12-31  |  2KB  |  81 lines

  1. -> findboards.e
  2.  
  3. ->>> Header (globals)
  4. OPT PREPROCESS
  5.  
  6. MODULE 'expansion',
  7.        'libraries/configregs',
  8.        'libraries/configvars'
  9.  
  10. ENUM ERR_NONE, ERR_LIB
  11.  
  12. RAISE ERR_LIB IF OpenLibrary()=NIL
  13.  
  14. -> E-Note: used to convert an INT to unsigned
  15. #define UNSIGNED(x) ((x) AND $FFFF)
  16. -> E-Note: used to convert a LONG to unsigned CHAR
  17. #define UNSIGNEDCHAR(x) ((x) AND $FF)
  18. ->>>
  19.  
  20. ->>> PROC main()
  21. PROC main() HANDLE
  22.   DEF myCD:PTR TO configdev, m, i, p, f, t
  23.   expansionbase:=OpenLibrary('expansion.library', 0)
  24.   
  25.   -> FindConfigDev(oldConfigDev,manufacturer,product)
  26.   -> oldConfigDev = NIL for the top of the list
  27.   -> manufacturer = -1 for any manufacturer
  28.   -> product      = -1 for any product
  29.   myCD:=NIL
  30.   WHILE myCD:=FindConfigDev(myCD, -1, -1)  -> Search for all ConfigDevs
  31.     WriteF('\n---ConfigDev structure found at location $\h---\n', myCD)
  32.  
  33.     -> These values were read directly from the board at expansion time
  34.     WriteF('Board ID (ExpansionRom) information:\n')
  35.  
  36.     t:=myCD.rom.type
  37.     m:=UNSIGNED(myCD.rom.manufacturer)
  38.     p:=myCD.rom.product
  39.     f:=myCD.rom.flags
  40.     i:=UNSIGNED(myCD.rom.initdiagvec)
  41.  
  42.     WriteF('er_Manufacturer         =\d=$\z\h[4]=(~$\h[4])\n',
  43.            m, m, UNSIGNED(Not(m)))
  44.     WriteF('er_Product              =\d=$\z\h[2]=(~$\h[2])\n',
  45.            p, p, UNSIGNEDCHAR(Not(p)))
  46.  
  47.     WriteF('er_Type                 =$\z\h[2]', myCD.rom.type)
  48.     IF myCD.rom.type AND ERTF_MEMLIST
  49.       WriteF('  (Adds memory to free list)\n')
  50.     ELSE
  51.       WriteF('\n')
  52.     ENDIF
  53.  
  54.     WriteF('er_Flags                =$\z\h[2]=(~$\h[2])\n',
  55.            f, UNSIGNEDCHAR(Not(f)))
  56.     WriteF('er_InitDiagVec          =$\z\h[4]=(~$\h[4])\n',
  57.            i, UNSIGNED(Not(i)))
  58.  
  59.     -> These values are generated when the AUTOCONFIG(tm) software relocates
  60.     -> the board
  61.     WriteF('Configuration (ConfigDev) information:\n')
  62.     WriteF('cd_BoardAddr            =$\h\n', myCD.boardaddr)
  63.     WriteF('cd_BoardSize            =$\h (\dK)\n',
  64.                myCD.boardsize, myCD.boardsize/1024)
  65.  
  66.     WriteF('cd_Flags                =$\h', myCD.flags)
  67.     IF myCD.flags AND CDF_CONFIGME
  68.       WriteF('\n')
  69.     ELSE
  70.       WriteF('  (driver clears CONFIGME bit)\n')
  71.     ENDIF
  72.   ENDWHILE
  73. EXCEPT DO
  74.   IF expansionbase THEN CloseLibrary(expansionbase)
  75.   SELECT exception
  76.   CASE ERR_LIB;  WriteF('Error: could not open expansion library\n')
  77.   ENDSELECT
  78. ENDPROC
  79. ->>>
  80.  
  81.