home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / Programme_zum_Heft / Programmieren / Kurztests / PascalPCQ / Include / Resources / Disk.i < prev    next >
Text File  |  1990-08-28  |  3KB  |  105 lines

  1. {
  2.     Disk.i for PCQ Pascal
  3.  
  4.     external declarations for disc resources
  5. }
  6.  
  7. {$I "Include:Exec/Lists.i"}
  8. {$I "Include:Exec/Ports.i"}
  9. {$I "Include:Exec/Interrupts.i"}
  10. {$I "Include:Exec/Libraries.i"}
  11.  
  12.  
  13. {********************************************************************
  14. *
  15. * Resource structures
  16. *
  17. ********************************************************************}
  18.  
  19. Type
  20.  
  21.     DiscResourceUnit = record
  22.     dru_Message    : Message;
  23.     dru_DiscBlock    : Interrupt;
  24.     dru_DiscSync    : Interrupt;
  25.     dru_Index    : Interrupt;
  26.     end;
  27.     DiscResourceUnitPtr = ^DiscResourceUnit;
  28.  
  29.     DiscResource = record
  30.     dr_Library    : Library;
  31.     dr_Current    : DiscResourceUnitPtr;
  32.     dr_Flags    : Byte;
  33.     dr_pad        : Byte;
  34.     dr_SysLib    : LibraryPtr;
  35.     dr_CiaResource    : LibraryPtr;
  36.     dr_UnitID    : Array [0..3] of Integer;
  37.     dr_Waiting    : List;
  38.     dr_DiscBlock    : Interrupt;
  39.     dr_DiscSync    : Interrupt;
  40.     dr_Index    : Interrupt;
  41.     end;
  42.     DiscResourcePtr = ^DiscResource;
  43.  
  44. Const
  45.  
  46. { dr_Flags entries }
  47.  
  48.     DRB_ALLOC0        = 0;    { unit zero is allocated }
  49.     DRB_ALLOC1        = 1;    { unit one is allocated }
  50.     DRB_ALLOC2        = 2;    { unit two is allocated }
  51.     DRB_ALLOC3        = 3;    { unit three is allocated }
  52.     DRB_ACTIVE        = 7;    { is the disc currently busy? }
  53.  
  54.     DRF_ALLOC0        = 1;    { unit zero is allocated }
  55.     DRF_ALLOC1        = 2;    { unit one is allocated }
  56.     DRF_ALLOC2        = 4;    { unit two is allocated }
  57.     DRF_ALLOC3        = 8;    { unit three is allocated }
  58.     DRF_ACTIVE        = 128;    { is the disc currently busy? }
  59.  
  60.  
  61.  
  62. {*******************************************************************
  63. *
  64. * Hardware Magic
  65. *
  66. *******************************************************************}
  67.  
  68.  
  69.     DSKDMAOFF        = $4000;    { idle command for dsklen register }
  70.  
  71.  
  72. {*******************************************************************
  73. *
  74. * Resource specific commands
  75. *
  76. *******************************************************************}
  77.  
  78. {
  79.  * DISKNAME is a generic macro to get the name of the resource.
  80.  * This way if the name is ever changed you will pick up the
  81.  *  change automatically.
  82.  }
  83.  
  84.     DISKNAME        = "disk.resource";
  85.  
  86.  
  87.     DR_ALLOCUNIT    = LIB_BASE - 0 * LIB_VECTSIZE;
  88.     DR_FREEUNIT        = LIB_BASE - 1 * LIB_VECTSIZE;
  89.     DR_GETUNIT        = LIB_BASE - 2 * LIB_VECTSIZE;
  90.     DR_GIVEUNIT        = LIB_BASE - 3 * LIB_VECTSIZE;
  91.     DR_GETUNITID    = LIB_BASE - 4 * LIB_VECTSIZE;
  92.  
  93.  
  94.     DR_LASTCOMM        = DR_GIVEUNIT;
  95.  
  96. {*******************************************************************
  97. *
  98. * drive types
  99. *
  100. *******************************************************************}
  101.  
  102.     DRT_AMIGA        = $00000000;
  103.     DRT_37422D2S    = $55555555;
  104.     DRT_EMPTY        = $FFFFFFFF;
  105.