home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD1.3 / Includes / resources / disk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-12  |  3.0 KB  |  122 lines

  1. #ifndef RESOURCES_DISK_H
  2. #define RESOURCES_DISK_H
  3. /*
  4. **    $Filename: resources/disk.h $
  5. **    $Release: 1.3 $
  6. **
  7. **    external declarations for disc resources 
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include "exec/types.h"
  15. #endif !EXEC_TYPES_H
  16.  
  17. #ifndef EXEC_LISTS_H
  18. #include "exec/lists.h"
  19. #endif !EXEC_LISTS_H
  20.  
  21. #ifndef EXEC_PORTS_H
  22. #include "exec/ports.h"
  23. #endif !EXEC_PORTS_H
  24.  
  25. #ifndef EXEC_INTERRUPTS_H
  26. #include "exec/interrupts.h"
  27. #endif !EXEC_INTERRUPTS_H
  28.  
  29. #ifndef EXEC_LIBRARIES_H
  30. #include "exec/libraries.h"
  31. #endif !EXEC_LIBRARIES_H
  32.  
  33.  
  34. /********************************************************************
  35. *
  36. * Resource structures
  37. *
  38. ********************************************************************/
  39.  
  40.  
  41. struct DiscResourceUnit {
  42.     struct Message dru_Message;
  43.     struct Interrupt dru_DiscBlock;
  44.     struct Interrupt dru_DiscSync;
  45.     struct Interrupt dru_Index;
  46. };
  47.  
  48. struct DiscResource {
  49.     struct Library        dr_Library;
  50.     struct DiscResourceUnit    *dr_Current;
  51.     UBYTE            dr_Flags;
  52.     UBYTE            dr_pad;
  53.     struct Library        *dr_SysLib;
  54.     struct Library        *dr_CiaResource;
  55.     ULONG            dr_UnitID[4];
  56.     struct List            dr_Waiting;
  57.     struct Interrupt        dr_DiscBlock;
  58.     struct Interrupt        dr_DiscSync;
  59.     struct Interrupt        dr_Index;
  60. };
  61.  
  62. /* dr_Flags entries */
  63. #define DRB_ALLOC0    0    /* unit zero is allocated */
  64. #define DRB_ALLOC1    1    /* unit one is allocated */
  65. #define DRB_ALLOC2    2    /* unit two is allocated */
  66. #define DRB_ALLOC3    3    /* unit three is allocated */
  67. #define DRB_ACTIVE    7    /* is the disc currently busy? */
  68.  
  69. #define DRF_ALLOC0    (1<<0)    /* unit zero is allocated */
  70. #define DRF_ALLOC1    (1<<1)    /* unit one is allocated */
  71. #define DRF_ALLOC2    (1<<2)    /* unit two is allocated */
  72. #define DRF_ALLOC3    (1<<3)    /* unit three is allocated */
  73. #define DRF_ACTIVE    (1<<7)    /* is the disc currently busy? */
  74.  
  75.  
  76.  
  77. /********************************************************************
  78. *
  79. * Hardware Magic
  80. *
  81. ********************************************************************/
  82.  
  83.  
  84. #define DSKDMAOFF    0x4000    /* idle command for dsklen register */
  85.  
  86.  
  87. /********************************************************************
  88. *
  89. * Resource specific commands
  90. *
  91. ********************************************************************/
  92.  
  93. /*
  94.  * DISKNAME is a generic macro to get the name of the resource.
  95.  * This way if the name is ever changed you will pick up the
  96.  *  change automatically.
  97.  */
  98.  
  99. #define DISKNAME    "disk.resource"
  100.  
  101.  
  102. #define DR_ALLOCUNIT    (LIB_BASE - 0*LIB_VECTSIZE)
  103. #define DR_FREEUNIT    (LIB_BASE - 1*LIB_VECTSIZE)
  104. #define DR_GETUNIT    (LIB_BASE - 2*LIB_VECTSIZE)
  105. #define DR_GIVEUNIT    (LIB_BASE - 3*LIB_VECTSIZE)
  106. #define DR_GETUNITID    (LIB_BASE - 4*LIB_VECTSIZE)
  107.  
  108.  
  109. #define DR_LASTCOMM    (DR_GIVEUNIT)
  110.  
  111. /********************************************************************
  112. *
  113. * drive types
  114. *
  115. ********************************************************************/
  116.  
  117. #define DRT_AMIGA    (0x00000000)
  118. #define DRT_37422D2S    (0x55555555)
  119. #define DRT_EMPTY    (0xFFFFFFFF)
  120.  
  121. #endif    /* RESOURCES_DISK_H */
  122.