home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / at-inc-bin.lha / os-include / resources / card.i < prev    next >
Text File  |  1993-10-15  |  6KB  |  225 lines

  1.     IFND    RESOURCES_CARD_I
  2. RESOURCES_CARD_I    SET    1
  3.  
  4. **
  5. **    $VER: card.i 1.8 (30.11.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. **
  15.  
  16.     IFND    EXEC_TYPES_I
  17.     INCLUDE    "exec/types.i"
  18.     ENDC
  19.  
  20.  
  21.     IFND    EXEC_NODES_I
  22.     INCLUDE    "exec/nodes.i"
  23.     ENDC
  24.  
  25.  
  26. * Macro - card resource name
  27.  
  28. CARDRESNAME    MACRO
  29.         dc.b    'card.resource',0
  30.         ds.w    0
  31.         ENDM
  32.  
  33. * Structures used by the card.resource
  34.  
  35.  STRUCTURE    CardHandle,0
  36.     STRUCT    cah_CardNode,LN_SIZE
  37.     APTR    cah_CardRemoved
  38.     APTR    cah_CardInserted
  39.     APTR    cah_CardStatus
  40.     UBYTE    cah_CardFlags
  41.     ALIGNWORD
  42.     LABEL    CardHandle_SIZEOF
  43.  
  44.  STRUCTURE    DeviceTData,0
  45.     ULONG    dtd_DTsize            ;Size of card (bytes)
  46.     ULONG    dtd_DTspeed            ;Speed of card in nanoseconds
  47.     UBYTE    dtd_DTtype            ;Type of card
  48.     UBYTE    dtd_DTflags            ;other flags
  49.     ALIGNWORD
  50.     LABEL    DeviceTData_SIZEOF
  51.  
  52.  
  53.  STRUCTURE    CardMemoryMap,0
  54.     APTR    cmm_CommonMemory
  55.     APTR    cmm_AttributeMemory
  56.     APTR    cmm_IOMemory
  57.  
  58. * Extended for V39 - These are the size of the memory spaces above
  59.  
  60.     ULONG    cmm_CommonMemSize;
  61.     ULONG    cmm_AttributeMemSize;
  62.     ULONG    cmm_IOMemSize;
  63.  
  64.     LABEL    CardMemoryMap_SIZEOF
  65.  
  66. * CardHandle.cah_CardFlags for OwnCard() function
  67.  
  68.     ; The CARDB_RESETREMOVE flag means you want the machine to
  69.     ; perform a HARDWARE RESET if the card in the credit-card slot is
  70.     ; removed while you own the CardSemaphore.
  71.  
  72.     BITDEF    CARD,RESETREMOVE,0    ;Hardware reset on card remove
  73.  
  74.     ; The CARDB_IFAVAILABLE flag means you only want your CardHandle
  75.     ; structure enqueued IF the credit card can be owned immediately.
  76.  
  77.     BITDEF    CARD,IFAVAILABLE,1
  78.  
  79.     ; The CARDB_DELAYOWNERSHIP flag means you never want a successful
  80.     ; return from OwnCard() even if the credit-card is available.  Rather
  81.     ; you will be notified of ownership via your cah_CardInserted
  82.     ; interrupt vector.
  83.  
  84.     BITDEF    CARD,DELAYOWNERSHIP,2
  85.  
  86.     ; The CARDB_POSTSTATUS flag is new for card.resource V39 (check
  87.     ; VERSION in resource base before using).  It tells the resource
  88.     ; that you want your Status Change Interrupt (if provided) to
  89.     ; be called twice in a row.  See OwnCard() for details.
  90.     ;
  91.  
  92.     BITDEF    CARD,POSTSTATUS,3
  93.  
  94. * ReleaseCard() function flags
  95.  
  96.     ; The CARDB_REMOVEHANDLE flag means you want to remove your
  97.     ; CardHandle structure from the list of CardHandle structures
  98.     ; whether or not you own the credit-card in the slot.
  99.  
  100.     BITDEF    CARD,REMOVEHANDLE,0
  101.  
  102. * ReadStatus() return flags
  103.  
  104.     BITDEF    CARD_STATUS,CCDET,6    ; Credit CARD_STATUS detect (1 == detected)
  105.     BITDEF    CARD_STATUS,BVD1,5    ; Battery Voltage Detect 1
  106.     BITDEF    CARD_STATUS,SC,5    ; Credit-CARD_STATUS (internal) status change
  107.     BITDEF    CARD_STATUS,BVD2,4    ; Battery Voltage Detect 2
  108.     BITDEF    CARD_STATUS,DA,4    ; Digital audio
  109.     BITDEF    CARD_STATUS,WR,3    ; Write enable (1 == enabled)
  110.     BITDEF    CARD_STATUS,BSY,2    ; Credit CARD_STATUS Busy
  111.     BITDEF    CARD_STATUS,IRQ,2    ; Interrupt request
  112.  
  113. * CardProgramVoltage() defines
  114.  
  115. CARD_VOLTAGE_0V        EQU    0    ; Set to default; maybe the same as 5V
  116. CARD_VOLTAGE_5V        EQU    1
  117. CARD_VOLTAGE_12V    EQU    2
  118.  
  119. * CardMiscControl() defines
  120.  
  121.     BITDEF    CARD_ENABLE,DIGAUDIO,1
  122.     BITDEF    CARD_DISABLE,WP,3
  123.  
  124. * New CardMiscControl() bits for V39 card.resource.  Use these bits to set,
  125. * or clear status change interrupts for BVD1/SC, BVD2/DA, and BSY/IRQ.
  126. * Write-enable/protect change interrupts are always enabled.  The defaults
  127. * are unchanged (BVD1/SC is enabled, BVD2/DA is disabled, and BSY/IRQ is enabled)
  128. *
  129. * IMPORTANT -- Only set these bits for V39 card.resource or greater (check
  130. * resource base VERSION)
  131. *
  132.     BITDEF    CARD_INT,SETCLR,7
  133.  
  134.     BITDEF    CARD_INT,BVD1,5
  135.     BITDEF    CARD_INT,SC,5
  136.  
  137.     BITDEF    CARD_INT,BVD2,4
  138.     BITDEF    CARD_INT,DA,4
  139.  
  140.     BITDEF    CARD_INT,BSY,2
  141.     BITDEF    CARD_INT,IRQ,2
  142.  
  143.  
  144. * CardInterface() defines
  145.  
  146. CARD_INTERFACE_AMIGA_0    EQU    0
  147.  
  148. * Tuple for Amiga execute-in-place software (e.g., games, or other
  149. * such software which want to use execute-in-place software stored
  150. * on a credit-card, such as a ROM card).
  151. *
  152. * See documentation for IfAmigaXIP().
  153.  
  154. CISTPL_AMIGAXIP    EQU    $91    ;Tuple code
  155.  
  156.  STRUCTURE    TP_AmigaXIP,0
  157.     STRUCT    tp_AmigaXIP,2
  158.     STRUCT    TP_XIPLOC,4
  159.     STRUCT    TP_XIPFLAGS,1
  160.     STRUCT    TP_XIPRESRV,1
  161.  
  162.     LABEL    TP_AmigaXIP_SIZEOF
  163.  
  164. *------ TP_BOOTFLAGS --------------------------------------------
  165.  
  166.     ; The XIPFLAGF_AUTORUN bit means that you want the machine
  167.     ; to perform a reset if the execute-in-place card is inserted
  168.     ; after DOS has been started.  The machine will then reset,
  169.     ; and execute your execute-in-place code the next time around.
  170.     ;
  171.     ; NOTE -- this flag may be ignored on some machines, in which
  172.     ; case the user will have to manually reset the machine in the
  173.     ; usual way.
  174.  
  175.     BITDEF    XIPFLAG,AUTORUN,0
  176.  
  177. *------- For assembly modules to use if amiga.lib has not been updated
  178.  
  179.     IFD    CARD_INTERNAL_LVOS
  180.  
  181. *
  182. * Resource Vector Offsets
  183. *
  184.  
  185. RES_RESERVED    EQU    0
  186. RES_USERDEF    EQU    LIB_BASE-(RES_RESERVED*LIB_VECTSIZE)
  187. RES_NONSTD    EQU    RES_USERDEF
  188.  
  189. RESINIT        MACRO    ; [baseOffset ]
  190.         IFC    '\1',''
  191. COUNT_RES    SET    RES_USERDEF
  192.         ENDC
  193.         IFNC    '\1',''
  194. COUNT_RES    SET    \1
  195.         ENDC
  196.         ENDM
  197.  
  198.  
  199. RESDEF        MACRO    ; library Function Symbol
  200. \1        EQU    COUNT_RES
  201. COUNT_RES    SET    COUNT_RES-LIB_VECTSIZE
  202.         ENDM
  203.  
  204.     RESINIT
  205.     RESDEF    _LVOOwnCard
  206.     RESDEF    _LVOReleaseCard
  207.     RESDEF    _LVOGetCardMap
  208.     RESDEF    _LVOBeginCardAccess
  209.     RESDEF    _LVOEndCardAccess
  210.     RESDEF    _LVOReadCardStatus
  211.     RESDEF    _LVOCardResetRemove
  212.     RESDEF    _LVOCardMiscControl
  213.     RESDEF    _LVOCardAccessSpeed
  214.     RESDEF    _LVOCardProgramVoltage
  215.     RESDEF    _LVOCardResetCard
  216.     RESDEF    _LVOCopyTuple
  217.     RESDEF    _LVODeviceTuple
  218.     RESDEF    _LVOIfAmigaXIP
  219.     RESDEF    _LVOCardForceChange
  220.     RESDEF    _LVOCardChangeCount
  221.     RESDEF    _LVOCardInterface
  222.  
  223.     ENDC    ; CARD_INTERNAL_LVOS
  224.     ENDC    ; RESOURCES_CARD_I
  225.