home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / BC_DICE2.DMS / in.adf / INCLUDE / hardware / cia.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-10  |  3.8 KB  |  191 lines

  1. #ifndef HARDWARE_CIA_H
  2. #define HARDWARE_CIA_H
  3. /*
  4. ** $Filename: hardware/cia.h $
  5. ** $Release: 2.04 Includes, V37.4 $
  6. ** $Revision: 36.3 $
  7. ** $Date: 90/11/05 $
  8. **
  9. ** registers and bits in the Complex Interface Adapter (CIA) chip
  10. **
  11. ** (C) Copyright 1985-1991 Commodore-Amiga, Inc.
  12. ** All Rights Reserved
  13. */
  14.  
  15.  
  16. #ifndef EXEC_TYPES_H
  17. #include "exec/types.h"
  18. #endif 
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. struct CIA {
  26.  UBYTE ciapra;
  27.  UBYTE pad0[0xff];
  28.  UBYTE ciaprb;
  29.  UBYTE pad1[0xff];
  30.  UBYTE ciaddra;
  31.  UBYTE pad2[0xff];
  32.  UBYTE ciaddrb;
  33.  UBYTE pad3[0xff];
  34.  UBYTE ciatalo;
  35.  UBYTE pad4[0xff];
  36.  UBYTE ciatahi;
  37.  UBYTE pad5[0xff];
  38.  UBYTE ciatblo;
  39.  UBYTE pad6[0xff];
  40.  UBYTE ciatbhi;
  41.  UBYTE pad7[0xff];
  42.  UBYTE ciatodlow;
  43.  UBYTE pad8[0xff];
  44.  UBYTE ciatodmid;
  45.  UBYTE pad9[0xff];
  46.  UBYTE ciatodhi;
  47.  UBYTE pad10[0xff];
  48.  UBYTE unusedreg;
  49.  UBYTE pad11[0xff];
  50.  UBYTE ciasdr;
  51.  UBYTE pad12[0xff];
  52.  UBYTE ciaicr;
  53.  UBYTE pad13[0xff];
  54.  UBYTE ciacra;
  55.  UBYTE pad14[0xff];
  56.  UBYTE ciacrb;
  57. };
  58.  
  59.  
  60.  
  61. #define CIAICRB_TA 0
  62. #define CIAICRB_TB 1
  63. #define CIAICRB_ALRM 2
  64. #define CIAICRB_SP 3
  65. #define CIAICRB_FLG 4
  66. #define CIAICRB_IR 7
  67. #define CIAICRB_SETCLR 7
  68.  
  69.  
  70. #define CIACRAB_START 0
  71. #define CIACRAB_PBON 1
  72. #define CIACRAB_OUTMODE 2
  73. #define CIACRAB_RUNMODE 3
  74. #define CIACRAB_LOAD 4
  75. #define CIACRAB_INMODE 5
  76. #define CIACRAB_SPMODE 6
  77. #define CIACRAB_TODIN 7
  78.  
  79.  
  80. #define CIACRBB_START 0
  81. #define CIACRBB_PBON 1
  82. #define CIACRBB_OUTMODE 2
  83. #define CIACRBB_RUNMODE 3
  84. #define CIACRBB_LOAD 4
  85. #define CIACRBB_INMODE0 5
  86. #define CIACRBB_INMODE1 6
  87. #define CIACRBB_ALARM 7
  88.  
  89.  
  90. #define CIAICRF_TA (1<<CIAICRB_TA)
  91. #define CIAICRF_TB (1<<CIAICRB_TB)
  92. #define CIAICRF_ALRM (1<<CIAICRB_ALRM)
  93. #define CIAICRF_SP (1<<CIAICRB_SP)
  94. #define CIAICRF_FLG (1<<CIAICRB_FLG)
  95. #define CIAICRF_IR (1<<CIAICRB_IR)
  96. #define CIAICRF_SETCLR (1<<CIAICRB_SETCLR)
  97.  
  98.  
  99. #define CIACRAF_START (1<<CIACRAB_START)
  100. #define CIACRAF_PBON (1<<CIACRAB_PBON)
  101. #define CIACRAF_OUTMODE (1<<CIACRAB_OUTMODE)
  102. #define CIACRAF_RUNMODE (1<<CIACRAB_RUNMODE)
  103. #define CIACRAF_LOAD (1<<CIACRAB_LOAD)
  104. #define CIACRAF_INMODE (1<<CIACRAB_INMODE)
  105. #define CIACRAF_SPMODE (1<<CIACRAB_SPMODE)
  106. #define CIACRAF_TODIN (1<<CIACRAB_TODIN)
  107.  
  108.  
  109. #define CIACRBF_START (1<<CIACRBB_START)
  110. #define CIACRBF_PBON (1<<CIACRBB_PBON)
  111. #define CIACRBF_OUTMODE (1<<CIACRBB_OUTMODE)
  112. #define CIACRBF_RUNMODE (1<<CIACRBB_RUNMODE)
  113. #define CIACRBF_LOAD (1<<CIACRBB_LOAD)
  114. #define CIACRBF_INMODE0 (1<<CIACRBB_INMODE0)
  115. #define CIACRBF_INMODE1 (1<<CIACRBB_INMODE1)
  116. #define CIACRBF_ALARM (1<<CIACRBB_ALARM)
  117.  
  118.  
  119. #define CIACRBF_IN_PHI2 0
  120. #define CIACRBF_IN_CNT (CIACRBF_INMODE0)
  121. #define CIACRBF_IN_TA (CIACRBF_INMODE1)
  122. #define CIACRBF_IN_CNT_TA (CIACRBF_INMODE0|CIACRBF_INMODE1)
  123.  
  124.  
  125.  
  126.  
  127. #define CIAB_GAMEPORT1 (7) 
  128. #define CIAB_GAMEPORT0 (6) 
  129. #define CIAB_DSKRDY (5) 
  130. #define CIAB_DSKTRACK0 (4) 
  131. #define CIAB_DSKPROT (3) 
  132. #define CIAB_DSKCHANGE (2) 
  133. #define CIAB_LED (1) 
  134. #define CIAB_OVERLAY (0) 
  135.  
  136.  
  137.  
  138.  
  139. #define CIAB_COMDTR (7) 
  140. #define CIAB_COMRTS (6) 
  141. #define CIAB_COMCD (5) 
  142. #define CIAB_COMCTS (4) 
  143. #define CIAB_COMDSR (3) 
  144. #define CIAB_PRTRSEL (2) 
  145. #define CIAB_PRTRPOUT (1) 
  146. #define CIAB_PRTRBUSY (0) 
  147.  
  148.  
  149. #define CIAB_DSKMOTOR (7) 
  150. #define CIAB_DSKSEL3 (6) 
  151. #define CIAB_DSKSEL2 (5) 
  152. #define CIAB_DSKSEL1 (4) 
  153. #define CIAB_DSKSEL0 (3) 
  154. #define CIAB_DSKSIDE (2) 
  155. #define CIAB_DSKDIREC (1) 
  156. #define CIAB_DSKSTEP (0) 
  157.  
  158.  
  159. #define CIAF_GAMEPORT1 (1<<7)
  160. #define CIAF_GAMEPORT0 (1<<6)
  161. #define CIAF_DSKRDY (1<<5)
  162. #define CIAF_DSKTRACK0 (1<<4)
  163. #define CIAF_DSKPROT (1<<3)
  164. #define CIAF_DSKCHANGE (1<<2)
  165. #define CIAF_LED (1<<1)
  166. #define CIAF_OVERLAY (1<<0)
  167.  
  168.  
  169.  
  170.  
  171. #define CIAF_COMDTR (1<<7)
  172. #define CIAF_COMRTS (1<<6)
  173. #define CIAF_COMCD (1<<5)
  174. #define CIAF_COMCTS (1<<4)
  175. #define CIAF_COMDSR (1<<3)
  176. #define CIAF_PRTRSEL (1<<2)
  177. #define CIAF_PRTRPOUT (1<<1)
  178. #define CIAF_PRTRBUSY (1<<0)
  179.  
  180.  
  181. #define CIAF_DSKMOTOR (1<<7)
  182. #define CIAF_DSKSEL3 (1<<6)
  183. #define CIAF_DSKSEL2 (1<<5)
  184. #define CIAF_DSKSEL1 (1<<4)
  185. #define CIAF_DSKSEL0 (1<<3)
  186. #define CIAF_DSKSIDE (1<<2)
  187. #define CIAF_DSKDIREC (1<<1)
  188. #define CIAF_DSKSTEP (1<<0)
  189.  
  190. #endif 
  191.