home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / resources / card.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  4KB  |  188 lines

  1. #ifndef    RESOURCES_CARD_H
  2. #define RESOURCES_CARD_H 1
  3.  
  4. /*
  5. **    $VER: card.h 1.11 (14.12.92)
  6. **    Includes Release 40.15
  7. **
  8. **    card.resource include file
  9. **
  10. **    (C) Copyright 1991-1993 Commodore-Amiga, Inc.
  11. **        All Rights Reserved
  12. **
  13. */
  14. #ifndef    EXEC_TYPES_H
  15. #include "exec/types.h"
  16. #endif
  17.  
  18. #ifndef    EXEC_NODES_H
  19. #include "exec/nodes.h"
  20. #endif
  21.  
  22. #ifndef    EXEC_INTERRUPTS_H
  23. #include "exec/interrupts.h"
  24. #endif
  25.  
  26. #define CARDRESNAME    "card.resource"
  27.  
  28. /* Structures used by the card.resource                */
  29.  
  30. struct    CardHandle {
  31.     struct Node cah_CardNode;
  32.     struct Interrupt *cah_CardRemoved;
  33.     struct Interrupt *cah_CardInserted;
  34.     struct Interrupt *cah_CardStatus;
  35.     UBYTE    cah_CardFlags;
  36. };
  37.  
  38. struct    DeviceTData {
  39.     ULONG    dtd_DTsize;    /* Size in bytes        */
  40.     ULONG    dtd_DTspeed;    /* Speed in nanoseconds        */
  41.     UBYTE    dtd_DTtype;    /* Type of card            */
  42.     UBYTE    dtd_DTflags;    /* Other flags            */
  43. };
  44.  
  45. struct    CardMemoryMap {
  46.     UBYTE    *cmm_CommonMemory;
  47.     UBYTE    *cmm_AttributeMemory;
  48.     UBYTE    *cmm_IOMemory;
  49.  
  50. /* Extended for V39 - These are the size of the memory spaces above */
  51.  
  52.     ULONG    cmm_CommonMemSize;
  53.     ULONG    cmm_AttributeMemSize;
  54.     ULONG    cmm_IOMemSize;
  55.  
  56. };
  57.  
  58. /* CardHandle.cah_CardFlags for OwnCard() function        */
  59.  
  60. #define    CARDB_RESETREMOVE    0
  61. #define CARDF_RESETREMOVE    (1<<CARDB_RESETREMOVE)
  62.  
  63. #define    CARDB_IFAVAILABLE    1
  64. #define    CARDF_IFAVAILABLE    (1<<CARDB_IFAVAILABLE)
  65.  
  66. #define CARDB_DELAYOWNERSHIP    2
  67. #define CARDF_DELAYOWNERSHIP    (1<<CARDB_DELAYOWNERSHIP)
  68.  
  69. #define CARDB_POSTSTATUS    3
  70. #define CARDF_POSTSTATUS    (1<<CARDB_POSTSTATUS)
  71.  
  72. /* ReleaseCreditCard() function flags                */
  73.  
  74. #define    CARDB_REMOVEHANDLE    0
  75. #define    CARDF_REMOVEHANDLE    (1<<CARDB_REMOVEHANDLE)
  76.  
  77. /* ReadStatus() return flags                    */
  78.  
  79. #define    CARD_STATUSB_CCDET        6
  80. #define CARD_STATUSF_CCDET        (1<<CARD_STATUSB_CCDET)
  81.  
  82. #define CARD_STATUSB_BVD1        5
  83. #define    CARD_STATUSF_BVD1        (1<<CARD_STATUSB_BVD1)
  84.  
  85. #define CARD_STATUSB_SC            5
  86. #define CARD_STATUSF_SC            (1<<CARD_STATUSB_SC)
  87.  
  88. #define CARD_STATUSB_BVD2        4
  89. #define    CARD_STATUSF_BVD2        (1<<CARD_STATUSB_BVD2)
  90.  
  91. #define CARD_STATUSB_DA            4
  92. #define CARD_STATUSF_DA            (1<<CARD_STATUSB_DA)
  93.  
  94. #define CARD_STATUSB_WR            3
  95. #define    CARD_STATUSF_WR            (1<<CARD_STATUSB_WR)
  96.  
  97. #define CARD_STATUSB_BSY        2
  98. #define CARD_STATUSF_BSY        (1<<CARD_STATUSB_BSY)
  99.  
  100. #define CARD_STATUSB_IRQ        2
  101. #define CARD_STATUSF_IRQ        (1<<CARD_STATUSB_IRQ)
  102.  
  103. /* CardProgramVoltage() defines */
  104.  
  105. #define CARD_VOLTAGE_0V        0    /* Set to default; may be the same as 5V */
  106. #define CARD_VOLTAGE_5V        1
  107. #define CARD_VOLTAGE_12V    2
  108.  
  109. /* CardMiscControl() defines */
  110.  
  111. #define    CARD_ENABLEB_DIGAUDIO    1
  112. #define    CARD_ENABLEF_DIGAUDIO    (1<<CARD_ENABLEB_DIGAUDIO)
  113.  
  114. #define    CARD_DISABLEB_WP    3
  115. #define    CARD_DISABLEF_WP    (1<<CARD_DISABLEB_WP)
  116.  
  117. /*
  118.  * New CardMiscControl() bits for V39 card.resource.  Use these bits to set,
  119.  * or clear status change interrupts for BVD1/SC, BVD2/DA, and BSY/IRQ.
  120.  * Write-enable/protect change interrupts are always enabled.  The defaults
  121.  * are unchanged (BVD1/SC is enabled, BVD2/DA is disabled, and BSY/IRQ is enabled).
  122.  *
  123.  * IMPORTANT -- Only set these bits for V39 card.resource or greater (check
  124.  * resource base VERSION)
  125.  *
  126.  */
  127.  
  128. #define    CARD_INTB_SETCLR    7
  129. #define    CARD_INTF_SETCLR    (1<<CARD_INTB_SETCLR)
  130.  
  131. #define    CARD_INTB_BVD1        5
  132. #define    CARD_INTF_BVD1        (1<<CARD_INTB_BVD1)
  133.  
  134. #define    CARD_INTB_SC        5
  135. #define    CARD_INTF_SC        (1<<CARD_INTB_SC)
  136.  
  137. #define    CARD_INTB_BVD2        4
  138. #define    CARD_INTF_BVD2        (1<<CARD_INTB_BVD2)
  139.  
  140. #define    CARD_INTB_DA        4
  141. #define    CARD_INTF_DA        (1<<CARD_INTB_DA)
  142.  
  143. #define    CARD_INTB_BSY        2
  144. #define    CARD_INTF_BSY        (1<<CARD_INTB_BSY)
  145.  
  146. #define    CARD_INTB_IRQ        2
  147. #define    CARD_INTF_IRQ        (1<<CARD_INTB_IRQ)
  148.  
  149.  
  150. /* CardInterface() defines */
  151.  
  152. #define    CARD_INTERFACE_AMIGA_0    0
  153.  
  154. /*
  155.  * Tuple for Amiga execute-in-place software (e.g., games, or other
  156.  * such software which wants to use execute-in-place software stored
  157.  * on a credit-card, such as a ROM card).
  158.  *
  159.  * See documentatin for IfAmigaXIP().
  160.  */
  161.  
  162. #define    CISTPL_AMIGAXIP    0x91
  163.  
  164. struct    TP_AmigaXIP {
  165.     UBYTE    TPL_CODE;
  166.     UBYTE    TPL_LINK;
  167.     UBYTE    TP_XIPLOC[4];
  168.     UBYTE    TP_XIPFLAGS;
  169.     UBYTE    TP_XIPRESRV;
  170.     };
  171. /*
  172.  
  173.     ; The XIPFLAGB_AUTORUN bit means that you want the machine
  174.     ; to perform a reset if the execute-in-place card is inserted
  175.     ; after DOS has been started.  The machine will then reset,
  176.     ; and execute your execute-in-place code the next time around.
  177.     ;
  178.     ; NOTE -- this flag may be ignored on some machines, in which
  179.     ; case the user will have to manually reset the machine in the
  180.     ; usual way.
  181.  
  182. */
  183.  
  184. #define    XIPFLAGSB_AUTORUN    0
  185. #define XIPFLAGSF_AUTORUN    (1<<XIPFLAGSB_AUTORUN)
  186.  
  187. #endif    /* RESOURCES_CARD_H */
  188.