home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / M2V11-1.LHA / modula / amiga / Resources.def < prev    next >
Encoding:
Text File  |  1993-11-03  |  18.1 KB  |  611 lines

  1. DEFINITION FOR AMIGALIB MODULE Resources ;
  2.  
  3. FROM SYSTEM    IMPORT ADDRESS, BADDRESS, STRING, SHORTSET, LONGSET ;
  4. FROM Exec    IMPORT Node , Message, Library, LibraryPtr, List, Interrupt,
  5.                InterruptPtr, ResidentPtr, TaskPtr, LIB_BASE,
  6.                LIB_VECTSIZE ;
  7.  
  8. FROM Dos    IMPORT BSTRING, FileLockPtr, FileSysStartupMsgPtr ;
  9.  
  10. TYPE
  11.   CardHandlePtr            = POINTER TO CardHandle ;
  12.   DeviceTDataPtr         = POINTER TO DeviceTData ;
  13.   CardMemoryMapPtr         = POINTER TO CardMemoryMap ;
  14.   TP_AmigaXIPPtr         = POINTER TO TP_AmigaXIPPtr ;
  15.   DiscResourceUnitPtr         = POINTER TO DiscResourceUnit ;
  16.   DiscResourcePtr         = POINTER TO DiscResource ;
  17.  
  18.   FileSysResourcePtr         = POINTER TO FileSysResource ;
  19.   FileSysEntryPtr         = POINTER TO FileSysEntry ;
  20.   MathIEEEResourcePtr         = POINTER TO MathIEEEResource ;
  21.  
  22. CONST
  23. (* BattClock resource name strings. *)
  24.   BATTCLOCKNAME    = "battclock.resource" ;
  25.  
  26. (* BattMem resource name strings *)
  27.   BATTMEMNAME    = "battmem.resource" ;
  28.  
  29. (* BattMem Amiga specific bit definitions *)
  30.  
  31. (* Amiga specific bits in the battery-backedup ram.    *)
  32. (* Bits 0 to 31, inclusive                *)
  33.  
  34.  
  35. (* AMIGA_AMNESIA                        *)
  36. (*                                *)
  37. (*    The battery-backedup memory has had a memory loss.    *)
  38. (*    This bit is used as a flag that the user should be    *)
  39. (*    notified that all battery-backed bit have been        *)
  40. (*    reset and that some attention is required. Zero        *)
  41. (*    indicates that a memory loss has occured.        *)
  42.  
  43.  
  44. CONST
  45.   BATTMEM_AMIGA_AMNESIA_ADDR    = 0 ;
  46.   BATTMEM_AMIGA_AMNESIA_LEN    = 1 ;
  47.  
  48.  
  49. (* SCSI_TIMEOUT                            *)
  50. (*                                *)
  51. (*    adjusts the timeout value for SCSI device selection. A  *)
  52. (*    value of 0 will produce short timeouts (128ms) while a  *)
  53. (*    value of 1 produces long timeouts (2 sec). This is used *)
  54. (*    for SeaCrate drives (and some Maxtors apparently) that    *)
  55. (*    don`t respond to selection until they are fully spun up *)
  56. (*    and intialised.                        *)
  57.  
  58.   BATTMEM_SCSI_TIMEOUT_ADDR    = 1 ;
  59.   BATTMEM_SCSI_TIMEOUT_LEN    = 1 ;
  60.  
  61.  
  62. (* SCSI_LUNS                            *)
  63. (*                                *)
  64. (*    Determines if the controller attempts to access logical *)
  65. (*    units above 0 at any given SCSI address.  This prevents *)
  66. (*    problems with drives that respond to ALL LUN addresses  *)
  67. (*    (instead of only 0 like they should).  Default value is *)
  68. (*    0 meaning don't support LUNs.                *)
  69.  
  70.   BATTMEM_SCSI_LUNS_ADDR    = 2 ;
  71.   BATTMEM_SCSI_LUNS_LEN        = 1 ;
  72.  
  73. (*    BattMem Amix specific bit definitions. *)
  74.  
  75. (*    See Amix documentation for these bit definitions    *)
  76. (*    Bits 32 to 63, inclusive                *)
  77.  
  78. (*    BattMem shared specific bit definitions. *)
  79.  
  80. (* Shared bits in the battery-backedup ram.            *)
  81. (*    Bits 64 and above                    *)
  82.  
  83. (* SHARED_AMNESIA                        *)
  84. (*                                *)
  85. (*    The battery-backedup memory has had a memory loss.    *)
  86. (*    This bit is used as a flag that the user should be    *)
  87. (*    notified that all battery-backed bit have been        *)
  88. (*    reset and that some attention is required. Zero        *)
  89. (*    indicates that a memory loss has occured.        *)
  90.  
  91.   BATTMEM_SHARED_AMNESIA_ADDR    = 64 ;
  92.   BATTMEM_SHARED_AMNESIA_LEN    = 1  ;
  93.  
  94.  
  95. (* SCSI_HOST_ID                                  *)
  96. (*                                      *)
  97. (*        a 3 bit field (0-7) that is stored in complemented form      *)
  98. (*        (this is so that default value of 0 really means 7)      *)
  99. (*        It's used to set the A3000 controllers SCSI ID (on reset) *)
  100.  
  101.   BATTMEM_SCSI_HOST_ID_ADDR    = 65 ;
  102.   BATTMEM_SCSI_HOST_ID_LEN    =  3 ;
  103.  
  104.  
  105. (* SCSI_SYNC_XFER                            *)
  106. (*                                    *)
  107. (*        determines if the driver should initiate synchronous    *)
  108. (*        transfer requests or leave it to the drive to send the    *)
  109. (*        first request.    This supports drives that crash or    *)
  110. (*        otherwise get confused when presented with a sync xfer    *)
  111. (*        message.  Default=0=sync xfer not initiated.        *)
  112.  
  113.   BATTMEM_SCSI_SYNC_XFER_ADDR    = 68 ;
  114.   BATTMEM_SCSI_SYNC_XFER_LEN    =  1 ;
  115.  
  116. (* SCSI_FAST_SYNC                                  *)
  117. (*                                          *)
  118. (*        determines if the driver should initiate fast synchronous     *)
  119. (*        transfer requests (>5MB/s) instead of older <=5MB/s requests. *)
  120. (*        Note that this has no effect if synchronous transfers are not *)
  121. (*        negotiated by either side.                      *)
  122. (*        Default=0=fast sync xfer used.                      *)
  123.  
  124.   BATTMEM_SCSI_FAST_SYNC_ADDR    = 69 ;
  125.   BATTMEM_SCSI_FAST_SYNC_LEN     =  1 ;
  126.  
  127. (* SCSI_TAG_QUEUES                               *)
  128. (*                                       *)
  129. (*        determines if the driver should use SCSI-2 tagged queuing  *)
  130. (*        which allows the drive to accept and reorder multiple read *)
  131. (*        and write requests.                       *)
  132. (*        Default=0=tagged queuing NOT enabled               *)
  133.  
  134.   BATTMEM_SCSI_TAG_QUEUES_ADDR    = 70 ;
  135.   BATTMEM_SCSI_TAG_QUEUES_LEN    =  1 ;
  136.  
  137. (* card.resource include file *)
  138.  
  139. CONST
  140.   CARDRESNAME = "card.resource" ;
  141.  
  142. (* Structures used by the card.resource    *)
  143.  
  144. TYPE
  145.   CardHandle = RECORD
  146.     cah_CardNode    : Node ;
  147.     cah_CardRemoved    : InterruptPtr ;
  148.     cah_CardInserted    : InterruptPtr ;
  149.     cah_CardStatus    : InterruptPtr ;
  150.     cah_CardFlags    : SHORTSET ;
  151.   END ;
  152.  
  153.   DeviceTData = RECORD
  154.     dtd_DTsize  : LONGINT ;    (* Size in bytes        *)
  155.     dtd_DTspeed : LONGINT ;    (* Speed in nanoseconds        *)
  156.     dtd_DTtype  : SHORTCARD ;    (* Type of card            *)
  157.     dtd_DTflags : SHORTSET ;    (* Other flags            *)
  158.   END ;
  159.  
  160.   CardMemoryMap = RECORD
  161.     cmm_CommonMemory     : ADDRESS ;
  162.     cmm_AttributeMemory  : ADDRESS ;
  163.     cmm_IOMemory     : ADDRESS ;
  164.  
  165. (* Extended for V39 - These are the size of the memory spaces above *)
  166.  
  167.     cmm_CommonMemSize     : LONGINT ;
  168.     cmm_AttributeMemSize : LONGINT ;
  169.     cmm_IOMemSize     : LONGINT ;
  170.   END ;
  171.  
  172. (* CardHandle.cah_CardFlags for OwnCard() function *)
  173.  
  174. CONST
  175.   CARDB_RESETREMOVE    = 0 ;
  176.   CARDF_RESETREMOVE    = {CARDB_RESETREMOVE} ;
  177.  
  178.   CARDB_IFAVAILABLE    = 1 ;
  179.   CARDF_IFAVAILABLE    = {CARDB_IFAVAILABLE} ;
  180.  
  181.   CARDB_DELAYOWNERSHIP    = 2 ;
  182.   CARDF_DELAYOWNERSHIP    = {CARDB_DELAYOWNERSHIP} ;
  183.  
  184.   CARDB_POSTSTATUS    = 3 ;
  185.   CARDF_POSTSTATUS    = {CARDB_POSTSTATUS} ;
  186.  
  187. (* ReleaseCreditCard() function flags *)
  188.  
  189.   CARDB_REMOVEHANDLE    = 0 ;
  190.   CARDF_REMOVEHANDLE    = {CARDB_REMOVEHANDLE} ;
  191.  
  192. (* ReadStatus() return flags *)
  193.  
  194.   CARD_STATUSB_CCDET    = 6 ;
  195.   CARD_STATUSF_CCDET    = {CARD_STATUSB_CCDET} ;
  196.  
  197.   CARD_STATUSB_BVD1    = 5 ;
  198.   CARD_STATUSF_BVD1    = {CARD_STATUSB_BVD1} ;
  199.  
  200.   CARD_STATUSB_SC    = 5 ;
  201.   CARD_STATUSF_SC    = {CARD_STATUSB_SC} ;
  202.  
  203.   CARD_STATUSB_BVD2    = 4 ;
  204.   CARD_STATUSF_BVD2    = {CARD_STATUSB_BVD2} ;
  205.  
  206.   CARD_STATUSB_DA    = 4 ;
  207.   CARD_STATUSF_DA    = {CARD_STATUSB_DA} ;
  208.  
  209.   CARD_STATUSB_WR    = 3 ;
  210.   CARD_STATUSF_WR    = {CARD_STATUSB_WR} ;
  211.  
  212.   CARD_STATUSB_BSY    = 2 ;
  213.   CARD_STATUSF_BSY    = {CARD_STATUSB_BSY} ;
  214.  
  215.   CARD_STATUSB_IRQ    = 2 ;
  216.   CARD_STATUSF_IRQ    = {CARD_STATUSB_IRQ} ;
  217.  
  218. (* CardProgramVoltage() defines *)
  219.  
  220.   CARD_VOLTAGE_0V    = 0 ;    (* Set to default; may be the same as 5V *)
  221.   CARD_VOLTAGE_5V    = 1 ;
  222.   CARD_VOLTAGE_12V    = 2 ;
  223.  
  224. (* CardMiscControl() defines *)
  225.  
  226.   CARD_ENABLEB_DIGAUDIO    = 1 ;
  227.   CARD_ENABLEF_DIGAUDIO    = {CARD_ENABLEB_DIGAUDIO} ;
  228.  
  229.   CARD_DISABLEB_WP    = 3 ;
  230.   CARD_DISABLEF_WP    = {CARD_DISABLEB_WP} ;
  231.  
  232. (* New CardMiscControl() bits for V39 card.resource.  Use these bits to set, *)
  233. (* or clear status change interrupts for BVD1/SC, BVD2/DA, and BSY/IRQ.         *)
  234. (* Write-enable/protect change interrupts are always enabled.  The defaults  *)
  235. (* are unchanged (BVD1/SC is enabled, BVD2/DA is disabled, and BSY/IRQ is    *)
  236. (*  enabled).                                     *)
  237. (*                                         *)
  238. (* IMPORTANT -- Only set these bits for V39 card.resource or greater (check  *)
  239. (* resource base VERSION)                             *)
  240.  
  241. CONST
  242.   CARD_INTB_SETCLR    = 7 ;
  243.   CARD_INTF_SETCLR    = {CARD_INTB_SETCLR} ;
  244.  
  245.   CARD_INTB_BVD1    = 5 ;
  246.   CARD_INTF_BVD1    = {CARD_INTB_BVD1} ;
  247.  
  248.   CARD_INTB_SC        = 5 ;
  249.   CARD_INTF_SC        = {CARD_INTB_SC} ;
  250.  
  251.   CARD_INTB_BVD2    = 4 ;
  252.   CARD_INTF_BVD2    = {CARD_INTB_BVD2} ;
  253.  
  254.   CARD_INTB_DA        = 4 ;
  255.   CARD_INTF_DA        = {CARD_INTB_DA} ;
  256.  
  257.   CARD_INTB_BSY        = 2 ;
  258.   CARD_INTF_BSY        = {CARD_INTB_BSY} ;
  259.  
  260.   CARD_INTB_IRQ        = 2 ;
  261.   CARD_INTF_IRQ        = {CARD_INTB_IRQ} ;
  262.  
  263.  
  264. (* CardInterface() defines *)
  265.  
  266.   CARD_INTERFACE_AMIGA_0 = 0 ;
  267.  
  268. (* Tuple for Amiga execute-in-place software (e.g., games, or other    *)
  269. (* such software which wants to use execute-in-place software stored    *)
  270. (* on a credit-card, such as a ROM card).                *)
  271. (*                                    *)
  272. (* See documentatin for IfAmigaXIP().                    *)
  273.  
  274. CONST
  275.   CISTPL_AMIGAXIP = 091H ;
  276.  
  277. TYPE
  278.   TP_AmigaXIP = RECORD
  279.     TPL_CODE    : SHORTCARD ;
  280.     TPL_LINK    : SHORTCARD ;
  281.     TP_XIPLOC    : ARRAY [0..3] OF SHORTCARD ;
  282.     TP_XIPFLAGS : SHORTSET ;
  283.     TP_XIPRESRV    : SHORTCARD ;
  284.   END ;
  285.  
  286. (*    ; The XIPFLAGB_AUTORUN bit means that you want the machine    *)
  287. (*    ; to perform a reset if the execute-in-place card is inserted    *)
  288. (*    ; after DOS has been started.  The machine will then reset,    *)
  289. (*    ; and execute your execute-in-place code the next time around.    *)
  290. (*    ;                                *)
  291. (*    ; NOTE -- this flag may be ignored on some machines, in which    *)
  292. (*    ; case the user will have to manually reset the machine in the    *)
  293. (*    ; usual way.                            *)
  294.  
  295. CONST
  296.   XIPFLAGSB_AUTORUN = 0 ;
  297.   XIPFLAGSF_AUTORUN = {XIPFLAGSB_AUTORUN} ;
  298.  
  299. (* Cia resource name strings. *)
  300.  
  301. CONST
  302.   CIAANAME = "ciaa.resource" ;
  303.   CIABNAME = "ciab.resource" ;
  304.  
  305. (* cia base definitions *)
  306.  
  307. (* There is no public information in CiaBase *)
  308.  
  309. (* disk.h -- external declarations for the disk resource *)
  310.  
  311. (*============================================================================
  312. |
  313. | Resource structures
  314. |
  315. =============================================================================*)
  316.  
  317. TYPE
  318.   DiscResourceUnit = RECORD
  319.     dru_Message        : Message   ;
  320.     dru_DiscBlock    : Interrupt ;
  321.     dru_DiscSync    : Interrupt ;
  322.     dru_Index        : Interrupt ;
  323.   END ;
  324.  
  325.   DiscResource = RECORD
  326.     dr_Library         : Library ;
  327.     dr_Current        : DiscResourceUnitPtr ;
  328.     dr_Flags        : SHORTSET ;
  329.     dr_pad        : SHORTCARD ;
  330.     dr_SysLib        : LibraryPtr ;
  331.     dr_CiaResource    : LibraryPtr ;
  332.     dr_UnitID        : ARRAY [0..3] OF LONGINT ;
  333.     dr_Waiting        : List ;
  334.     dr_DiscBlock    : Interrupt ;
  335.     dr_DiscSync        : Interrupt ;
  336.     dr_Index        : Interrupt ;
  337.     dr_CurrTask     : TaskPtr ;
  338.   END ;
  339.  
  340. CONST
  341. (* dr_Flags entries *)
  342.   DRB_ALLOC0    = 0 ;    (* unit zero is allocated    *)
  343.   DRB_ALLOC1    = 1 ;    (* unit one is allocated    *)
  344.   DRB_ALLOC2    = 2 ;    (* unit two is allocated    *)
  345.   DRB_ALLOC3    = 3 ;    (* unit three is allocated    *)
  346.   DRB_ACTIVE    = 7 ;    (* is the disc currently busy?    *)
  347.  
  348.   DRF_ALLOC0    = {0} ;    (* unit zero is allocated    *)
  349.   DRF_ALLOC1    = {1} ;    (* unit one is allocated    *)
  350.   DRF_ALLOC2    = {2} ;    (* unit two is allocated    *)
  351.   DRF_ALLOC3    = {3} ;    (* unit three is allocated    *)
  352.   DRF_ACTIVE    = {7} ;    (* is the disc currently busy?    *)
  353.  
  354. (*==========================================================================
  355. |
  356. | Hardware Magic
  357. |
  358. ===========================================================================*)
  359.  
  360.   DSKDMAOFF    = 04000H ;    (* idle command for dsklen register *)
  361.  
  362. (*=========================================================================
  363. |
  364. | Resource specific commands
  365. |
  366. =========================================================================*)
  367.  
  368. (*
  369.  * DISKNAME is a generic macro to get the name of the resource.
  370.  * This way if the name is ever changed you will pick up the
  371.  *  change automatically.
  372.  *)
  373.  
  374. CONST
  375.   DISKNAME    = "disk.resource" ;
  376.  
  377.   DR_ALLOCUNIT    = (LIB_BASE - 0*LIB_VECTSIZE) ;
  378.   DR_FREEUNIT    = (LIB_BASE - 1*LIB_VECTSIZE) ;
  379.   DR_GETUNIT    = (LIB_BASE - 2*LIB_VECTSIZE) ;
  380.   DR_GIVEUNIT    = (LIB_BASE - 3*LIB_VECTSIZE) ;
  381.   DR_GETUNITID    = (LIB_BASE - 4*LIB_VECTSIZE) ;
  382.   DR_READUNITID    = (LIB_BASE - 5*LIB_VECTSIZE) ;
  383.  
  384.   DR_LASTCOMM    = (DR_READUNITID) ;
  385.  
  386. (*=======================================================================
  387. |
  388. | drive types
  389. |
  390. ========================================================================*)
  391.  
  392. CONST
  393.   DRT_AMIGA    = 000000000H ;
  394.   DRT_37422D2S    = 055555555H ;
  395.   DRT_EMPTY    = 0FFFFFFFFH ;
  396.   DRT_150RPM    = 0AAAAAAAAH ;
  397.  
  398. (* FileSystem.resource description *)
  399.  
  400. CONST
  401.   FSRNAME = "FileSystem.resource" ;
  402.  
  403. TYPE
  404.   FileSysResource = RECORD
  405.     fsr_Node        : Node ;   (* on resource list            *)
  406.     fsr_Creator        : STRING ; (* name of creator of this resource    *)
  407.     fsr_FileSysEntries    : List ;   (* list of FileSysEntry structs    *)
  408.   END ;
  409.  
  410.   FileSysEntry = RECORD
  411.     fse_Node        : Node ;    (* on fsr_FileSysEntries list          *)
  412.                     (* ln_Name is of creator of this entry*)
  413.     fse_DosType        : LONGINT ;    (* DosType of this FileSys          *)
  414.     fse_Version        : LONGINT ;    (* Version of this FileSys          *)
  415.  
  416.     fse_PatchFlags    : LONGSET ;    (* bits set for those of the following*)
  417.                         (* that need to be substituted into a *)
  418.                         (* standard device node for this file *)
  419.                         (* system: e.g. 0x180 for substitute  *)
  420.                         (* SegList & GlobalVec              *)
  421.  
  422.     fse_Type        : LONGINT ;    (* device node type: zero          *)
  423.     fse_Task        : TaskPtr ;    (* standard dos "task" field          *)
  424.     fse_Lock        : FileLockPtr ;    (* not used for devices: zero          *)
  425.     fse_Handler        : BSTRING ;    (* filename to loadseg (if SegList=0) *)
  426.     fse_StackSize    : LONGINT ;    (* stacksize to use when starting task*)
  427.     fse_Priority    : LONGINT ;    (* task priority when starting task   *)
  428.     fse_Startup        : FileSysStartupMsgPtr ;
  429.                         (* startup msg for disks          *)
  430.     fse_SegList        : BADDRESS ;    (* code to run to start new task      *)
  431.     fse_GlobalVec    : BADDRESS ;    (* BCPL global vec. when starting task*)
  432.     (* no more entries need exist than those implied by fse_PatchFlags *)
  433.   END ;
  434.  
  435. (*    Data structure returned by OpenResource of:    *)
  436. (*    "MathIEEE.resource"                *)
  437.  
  438. (*    The 'Init' entries are only used if the corresponding        *)
  439. (*    bit is set in the Flags field.                    *)
  440. (*                                    *)
  441. (*    So if you are just a 68881, you do not need the Init stuff    *)
  442. (*     just make sure you have cleared the Flags field.        *)
  443. (*                                    *)
  444. (*    This should allow us to add Extended Precision later.        *)
  445. (*                                    *)
  446. (*    For Init users, if you need to be called whenever a task    *)
  447. (*    opens this library for use, you need to change the appropriate    *)
  448. (*    entries in MathIEEELibrary.                    *)
  449.  
  450. TYPE
  451.   MathIEEEResource = RECORD
  452.     MathIEEEResource_Node        : Node ;
  453.     MathIEEEResource_Flags        : BITSET ;
  454.     MathIEEEResource_BaseAddr        : ADDRESS ; (* ptr to 881 if exists *)
  455.     MathIEEEResource_DblBasInit        : PROC ;
  456.     MathIEEEResource_DblTransInit    : PROC ;
  457.     MathIEEEResource_SglBasInit        : PROC ;
  458.     MathIEEEResource_SglTransInit    : PROC ;
  459.     MathIEEEResource_ExtBasInit        : PROC ;
  460.     MathIEEEResource_ExtTransInit    : PROC ;
  461.   END ;
  462.  
  463. CONST
  464.   (* definations for MathIEEEResource_FLAGS *)
  465.    MATHIEEERESOURCEF_DBLBAS    = {0} ;
  466.    MATHIEEERESOURCEF_DBLTRANS    = {1} ;
  467.    MATHIEEERESOURCEF_SGLBAS    = {2} ;
  468.    MATHIEEERESOURCEF_SGLTRANS    = {3} ;
  469.    MATHIEEERESOURCEF_EXTBAS    = {4} ;
  470.    MATHIEEERESOURCEF_EXTTRANS    = {5} ;
  471.  
  472. (* Unit number definitions for "misc.resource" *)
  473.  
  474. (* Unit number definitions.  Ownership of a resource grants low-level        *)
  475. (* bit access to the hardware registers.  You are still obligated to follow *)
  476. (* the rules for shared access of the interrupt system (see            *)
  477. (* exec.library/SetIntVector or cia.resource as appropriate).            *)
  478.  
  479. CONST
  480.   MR_SERIALPORT       = 0 ; (* Amiga custom chip serial port registers        *)
  481.              (* (SERDAT,SERDATR,SERPER,ADKCON, and interrupts)  *)
  482.  
  483.   MR_SERIALBITS       = 1 ; (* Serial control bits (DTR,CTS, etc.)  *)
  484.  
  485.   MR_PARALLELPORT  = 2 ; (* The 8 bit parallel data port     *)
  486.              (* (CIAAPRA & CIAADDRA only!)         *)
  487.  
  488.   MR_PARALLELBITS  = 3 ; (* All other parallel bits & interrupts *)
  489.              (* (BUSY,ACK,etc.)             *)
  490.  
  491.   (* Library vector offset definitions *)
  492.  
  493.   MR_ALLOCMISCRESOURCE = LIB_BASE        ; (* -6  *)
  494.   MR_FREEMISCRESOURCE  = LIB_BASE-LIB_VECTSIZE    ; (* -12 *)
  495.  
  496. CONST
  497.   MISCNAME = "misc.resource" ;
  498.  
  499.   (* potgo resource name *)
  500.  
  501. CONST
  502.   POTGONAME = "potgo.resource" ;
  503.  
  504. (*===================== battclock =====================*)
  505.  
  506. VAR
  507.   BattClockBase : ADDRESS ;
  508.  
  509. PROCEDURE ResetBattClock( ) ;
  510. PROCEDURE ReadBattClock( ) : LONGINT ;
  511. PROCEDURE WriteBattClock( time : LONGINT ) ;
  512.  
  513. (*====================== battmem ======================*)
  514.  
  515. VAR
  516.   BattMemBase : ADDRESS ;
  517.  
  518. PROCEDURE ObtainBattSemaphore( ) ;
  519. PROCEDURE ReleaseBattSemaphore( ) ;
  520.  
  521. PROCEDURE ReadBattMem( buffer : ADDRESS ;
  522.                offset : LONGINT ; length : LONGINT ) : LONGINT ;
  523.  
  524. PROCEDURE WriteBattMem( buffer : ADDRESS ;
  525.             offset : LONGINT ;
  526.             length : LONGINT ) : LONGINT ;
  527.  
  528. (*===================== cardres =======================*)
  529.  
  530. VAR
  531.   CardResource : ADDRESS ;
  532.  
  533. PROCEDURE OwnCard( handle : CardHandlePtr ) : CardHandlePtr ;
  534. PROCEDURE ReleaseCard( handle : CardHandlePtr ; flags : LONGSET ) ;
  535. PROCEDURE GetCardMap( ) : CardMemoryMapPtr ;
  536. PROCEDURE BeginCardAccess( handle : CardHandlePtr) : BOOLEAN ;
  537. PROCEDURE EndCardAccess( handle : CardHandlePtr ) : BOOLEAN ;
  538. PROCEDURE ReadCardStatus( ) : SHORTSET ;
  539. PROCEDURE CardResetRemove( handle : CardHandlePtr ; flag : LONGSET ) : BOOLEAN ;
  540.  
  541. PROCEDURE CardMiscControl( handle : CardHandlePtr ;
  542.                control_bits : LONGSET ) : SHORTCARD ;
  543.  
  544. PROCEDURE CardAccessSpeed( handle : CardHandlePtr ;
  545.                nanoseconds : LONGINT ) : LONGINT ;
  546.  
  547. PROCEDURE CardProgramVoltage( handle  : CardHandlePtr ;
  548.                   voltage : LONGINT ) : LONGINT ;
  549.  
  550. PROCEDURE CardResetCard( handle : CardHandlePtr ) : BOOLEAN ;
  551.  
  552. PROCEDURE CopyTuple( handle    : CardHandlePtr ;
  553.              buffer    : ADDRESS ;
  554.              tuplecode : LONGINT ;
  555.              size      : LONGINT ) : BOOLEAN ;
  556.  
  557. PROCEDURE DeviceTuple( tuple_data : ADDRESS ;
  558.                storage    : DeviceTDataPtr ) : LONGINT;
  559.  
  560. PROCEDURE IfAmigaXIP( handle : CardHandlePtr ) : ResidentPtr ;
  561. PROCEDURE CardForceChange( ) : BOOLEAN ;
  562. PROCEDURE CardChangeCount( ) : LONGINT ;
  563. PROCEDURE CardInterface( ) : LONGINT ;
  564.  
  565. (*========================= CIA ========================*)
  566.  
  567. PROCEDURE AddICRVector( resource     : LibraryPtr ;
  568.             iCRBit         : LONGINT ;
  569.             interruptPtr : InterruptPtr ) : InterruptPtr ;
  570.  
  571. PROCEDURE RemICRVector( resource  : LibraryPtr ;
  572.             iCRBit      : LONGINT ;
  573.             interrupt : InterruptPtr ) ;
  574.  
  575. PROCEDURE AbleICR( resource : LibraryPtr ; mask : LONGSET ) : INTEGER ;
  576. PROCEDURE SetICR ( resource : LibraryPtr ; mask : LONGSET ) : INTEGER ;
  577.  
  578. (*========================= disk ======================*)
  579.  
  580. VAR
  581.   DiskBase : ADDRESS ;
  582.  
  583. PROCEDURE AllocUnit( unitNum : LONGINT ) : BOOLEAN ;
  584. PROCEDURE FreeUnit( unitNum : LONGINT ) ;
  585. PROCEDURE GetUnit( unitPointer : DiscResourceUnitPtr ) : DiscResourceUnitPtr ;
  586. PROCEDURE GiveUnit( ) ;
  587. PROCEDURE GetUnitID( unitNum : LONGINT ) : LONGINT ;
  588.  
  589. (*------ new for V37 ------*)
  590.  
  591. PROCEDURE ReadUnitID( unitNum : LONGINT ) : LONGINT ;
  592.  
  593. (*========================= misc ======================*)
  594.  
  595. VAR
  596.   MiscBase : ADDRESS ;
  597.  
  598. PROCEDURE AllocMiscResource( unitNum : LONGINT ; name : STRING ) : STRING ;
  599. PROCEDURE FreeMiscResource ( unitNum : LONGINT ) ;
  600.  
  601. (*========================= potgo =====================*)
  602.  
  603. VAR
  604.   PotgoBase : ADDRESS ;
  605.  
  606. PROCEDURE AllocPotBits( bits : LONGSET ) : CARDINAL ;
  607. PROCEDURE FreePotBits ( bits : LONGSET ) ;
  608. PROCEDURE WritePotgo  ( word : LONGSET ; mask : LONGSET ) ;
  609.  
  610. END Resources.
  611.