#ifndef HARDWARE_CIA_H
#define HARDWARE_CIA_H
#ifndef EXEC_TYPES_H
#include "exec/types.h"
#endif
struct CIA {
UBYTE ciapra;
UBYTE pad0[0xff];
UBYTE ciaprb;
UBYTE pad1[0xff];
UBYTE ciaddra;
UBYTE pad2[0xff];
UBYTE ciaddrb;
UBYTE pad3[0xff];
UBYTE ciatalo;
UBYTE pad4[0xff];
UBYTE ciatahi;
UBYTE pad5[0xff];
UBYTE ciatblo;
UBYTE pad6[0xff];
UBYTE ciatbhi;
UBYTE pad7[0xff];
UBYTE ciatodlow;
UBYTE pad8[0xff];
UBYTE ciatodmid;
UBYTE pad9[0xff];
UBYTE ciatodhi;
UBYTE pad10[0xff];
UBYTE unusedreg;
UBYTE pad11[0xff];
UBYTE ciasdr;
UBYTE pad12[0xff];
UBYTE ciaicr;
UBYTE pad13[0xff];
UBYTE ciacra;
UBYTE pad14[0xff];
UBYTE ciacrb;
};
#define CIAICRB_TA 0L
#define CIAICRB_TB 1L
#define CIAICRB_ALRM 2L
#define CIAICRB_SP 3L
#define CIAICRB_FLG 4L
#define CIAICRB_IR 7L
#define CIAICRB_SETCLR 7L
#define CIACRAB_START 0L
#define CIACRAB_PBON 1L
#define CIACRAB_OUTMODE 2L
#define CIACRAB_RUNMODE 3L
#define CIACRAB_LOAD 4L
#define CIACRAB_INMODE 5L
#define CIACRAB_SPMODE 6L
#define CIACRAB_TODIN 7L
#define CIACRBB_START 0L
#define CIACRBB_PBON 1L
#define CIACRBB_OUTMODE 2L
#define CIACRBB_RUNMODE 3L
#define CIACRBB_LOAD 4L
#define CIACRBB_INMODE0 5L
#define CIACRBB_INMODE1 6L
#define CIACRBB_ALARM 7L
#define CIAICRF_TA (1L<<CIAICRB_TA)
#define CIAICRF_TB (1L<<CIAICRB_TB)
#define CIAICRF_ALRM (1L<<CIAICRB_ALRM)
#define CIAICRF_SP (1L<<CIAICRB_SP)
#define CIAICRF_FLG (1L<<CIAICRB_FLG)
#define CIAICRF_IR (1L<<CIAICRB_IR)
#define CIAICRF_SETCLR (1L<<CIAICRB_SETCLR)
#define CIACRAF_START (1L<<CIACRAB_START)
#define CIACRAF_PBON (1L<<CIACRAB_PBON)
#define CIACRAF_OUTMODE (1L<<CIACRAB_OUTMODE)
#define CIACRAF_RUNMODE (1L<<CIACRAB_RUNMODE)
#define CIACRAF_LOAD (1L<<CIACRAB_LOAD)
#define CIACRAF_INMODE (1L<<CIACRAB_INMODE)
#define CIACRAF_SPMODE (1L<<CIACRAB_SPMODE)
#define CIACRAF_TODIN (1L<<CIACRAB_TODIN)
#define CIACRBF_START (1L<<CIACRBB_START)
#define CIACRBF_PBON (1L<<CIACRBB_PBON)
#define CIACRBF_OUTMODE (1L<<CIACRBB_OUTMODE)
#define CIACRBF_RUNMODE (1L<<CIACRBB_RUNMODE)
#define CIACRBF_LOAD (1L<<CIACRBB_LOAD)
#define CIACRBF_INMODE0 (1L<<CIACRBB_INMODE0)
#define CIACRBF_INMODE1 (1L<<CIACRBB_INMODE1)
#define CIACRBF_ALARM (1L<<CIACRBB_ALARM)
#define CIACRBF_IN_PHI2 0L
#define CIACRBF_IN_CNT (CIACRBF_INMODE0)
#define CIACRBF_IN_TA (CIACRBF_INMODE1)
#define CIACRBF_IN_CNT_TA (CIACRBF_INMODE0|CIACRBF_INMODE1)
#define CIAB_GAMEPORT1 (7L)
#define CIAB_GAMEPORT0 (6L)
#define CIAB_DSKRDY (5L)
#define CIAB_DSKTRACK0 (4L)
#define CIAB_DSKPROT (3L)
#define CIAB_DSKCHANGE (2L)
#define CIAB_LED (1L)
#define CIAB_OVERLAY (0L)
#define CIAB_COMDTR (7L)
#define CIAB_COMRTS (6L)
#define CIAB_COMCD (5L)
#define CIAB_COMCTS (4L)
#define CIAB_COMDSR (3L)
#define CIAB_PRTRSEL (2L)
#define CIAB_PRTRPOUT (1L)
#define CIAB_PRTRBUSY (0L)
#define CIAB_DSKMOTOR (7L)
#define CIAB_DSKSEL3 (6L)
#define CIAB_DSKSEL2 (5L)
#define CIAB_DSKSEL1 (4L)
#define CIAB_DSKSEL0 (3L)
#define CIAB_DSKSIDE (2L)
#define CIAB_DSKDIREC (1L)
#define CIAB_DSKSTEP (0L)
#define CIAF_GAMEPORT1 (1L<<7)
#define CIAF_GAMEPORT0 (1L<<6)
#define CIAF_DSKRDY (1L<<5)
#define CIAF_DSKTRACK0 (1L<<4)
#define CIAF_DSKPROT (1L<<3)
#define CIAF_DSKCHANGE (1L<<2)
#define CIAF_LED (1L<<1)
#define CIAF_OVERLAY (1L<<0)
#define CIAF_COMDTR (1L<<7)
#define CIAF_COMRTS (1L<<6)
#define CIAF_COMCD (1L<<5)
#define CIAF_COMCTS (1L<<4)
#define CIAF_COMDSR (1L<<3)
#define CIAF_PRTRSEL (1L<<2)
#define CIAF_PRTRPOUT (1L<<1)
#define CIAF_PRTRBUSY (1L<<0)
#define CIAF_DSKMOTOR (1L<<7)
#define CIAF_DSKSEL3 (1L<<6)
#define CIAF_DSKSEL2 (1L<<5)
#define CIAF_DSKSEL1 (1L<<4)
#define CIAF_DSKSEL0 (1L<<3)
#define CIAF_DSKSIDE (1L<<2)
#define CIAF_DSKDIREC (1L<<1)
#define CIAF_DSKSTEP (1L<<0)
#ifdef _LARGE_DATA
extern struct CIA ciaa;
extern struct CIA ciab;
#else
#define ciaa (*((struct CIA *)0xbfe001))
#define ciab (*((struct CIA *)0xbfd000))
#endif
#endif !HARDWARE_CIA_H
