home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / oberon-a-1.4ß.lha / Oberon-A / source / amiga / Misc.mod < prev    next >
Text File  |  1994-08-08  |  3KB  |  102 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: Misc.mod $
  4.   Description: Interface to misc.resource
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 00:50:39 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. MODULE Misc;
  23.  
  24. (*
  25. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  26. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  27. ** $V- OvflChk       $Z- ZeroVars
  28. *)
  29.  
  30. IMPORT E := Exec;
  31.  
  32.  
  33. (*
  34. **      $VER: misc.h 36.13 (6.5.90)
  35. **
  36. **      Unit number definitions for "misc.resource"
  37. *)
  38.  
  39. CONST
  40.  
  41. (*
  42.  * Unit number definitions.  Ownership of a resource grants low-level
  43.  * bit access to the hardware registers.  You are still obligated to follow
  44.  * the rules for shared access of the interrupt system (see
  45.  * exec.library/SetIntVector or cia.resource as appropriate).
  46.  *)
  47.   serialPort   * = 0; (* Amiga custom chip serial port registers
  48.                          (SERDAT,SERDATR,SERPER,ADKCON, and interrupts) *)
  49.   serialBits   * = 1; (* Serial control bits (DTR,CTS, etc.) *)
  50.   parallelPort * = 2; (* The 8 bit parallel data port
  51.                          (CIAAPRA & CIAADDRA only!) *)
  52.   parallelBits * = 3; (* All other parallel bits & interrupts
  53.                          (BUSY,ACK,etc.) *)
  54.  
  55.   name * = "misc.resource";
  56.  
  57.  
  58. (*-- Resource Base variable --------------------------------------------*)
  59.  
  60. TYPE
  61.  
  62.   MiscBasePtr * = CPOINTER TO MiscBase;
  63.   MiscBase * = RECORD (E.Node) END;
  64.  
  65. VAR
  66.  
  67.   base * : MiscBasePtr;
  68.  
  69.  
  70. (*-- Resource Functions ------------------------------------------------*)
  71.  
  72. (*
  73. **      $VER: misc_protos.h 36.2 (7.11.90)
  74. *)
  75.  
  76. LIBCALL (base : MiscBasePtr) AllocMiscResource*
  77.   ( unitNum [0] : E.ULONG;
  78.     name    [9] : ARRAY OF CHAR )
  79.   : E.APTR;
  80.   -6;
  81. LIBCALL (base : MiscBasePtr) FreeMiscResource*
  82.   ( unitNum [0] : E.ULONG );
  83.   -12;
  84.  
  85.  
  86. (*-- Resource Base variable --------------------------------------------*)
  87. (* $L- Address globals through A4 *)
  88.  
  89.  
  90. (*-----------------------------------*)
  91. PROCEDURE OpenResource * (mustOpen : BOOLEAN);
  92.  
  93. BEGIN (* OpenResource *)
  94.   IF base = NIL THEN
  95.     base := E.base.OpenResource (name);
  96.     IF mustOpen & (base = NIL) THEN HALT (100) END;
  97.   END;
  98. END OpenResource;
  99.  
  100.  
  101. END Misc.
  102.