blitter test
[retrocrawl] / src / amiga / hwregs.h
index 04385e5..ccedb57 100644 (file)
 #define REG_COPJMP1            REG(REGN_COPJMP1)
 #define REG_COPJMP2            REG(REGN_COPJMP2)
 
+#define REG_BLTCON0            REG(REGN_BLTCON0)
+#define REG_BLTCON1            REG(REGN_BLTCON1)
+#define REG32_BLTCON   *(volatile uint32_t*)(REG_BASE_ADDR | REGN_BLTCON0)
+#define REG_BLTAFWM            REG(REGN_BLTAFWM)
+#define REG_BLTALWM            REG(REGN_BLTALWM)
+#define REG32_BLTAFLWM *(volatile uint32_t*)(REG_BASE_ADDR | REGN_BLTAFWM)
+#define REG_BLTCPTH            REG(REGN_BLTCPTH)
+#define REG_BLTCPTL            REG(REGN_BLTCPTL)
+#define REG32_BLTCPT   *(volatile uint32_t*)(REG_BASE_ADDR | REGN_BLTCPTH)
+#define REG_BLTBPTH            REG(REGN_BLTBPTH)
+#define REG_BLTBPTL            REG(REGN_BLTBPTL)
+#define REG32_BLTBPT   *(volatile uint32_t*)(REG_BASE_ADDR | REGN_BLTBPTH)
+#define REG_BLTAPTH            REG(REGN_BLTAPTH)
+#define REG_BLTAPTL            REG(REGN_BLTAPTL)
+#define REG32_BLTAPT   *(volatile uint32_t*)(REG_BASE_ADDR | REGN_BLTAPTH)
+#define REG_BLTDPTH            REG(REGN_BLTDPTH)
+#define REG_BLTDPTL            REG(REGN_BLTDPTL)
+#define REG32_BLTDPT   *(volatile uint32_t*)(REG_BASE_ADDR | REGN_BLTDPTH)
+#define REG_BLTSIZE            REG(REGN_BLTSIZE)
+#define REG_BLTCMOD            REG(REGN_BLTCMOD)
+#define REG_BLTBMOD            REG(REGN_BLTBMOD)
+#define REG_BLTAMOD            REG(REGN_BLTAMOD)
+#define REG_BLTDMOD            REG(REGN_BLTDMOD)
+#define REG_BLTCDAT            REG(REGN_BLTCDAT)
+#define REG_BLTBDAT            REG(REGN_BLTBDAT)
+#define REG_BLTADAT            REG(REGN_BLTADAT)
+
 #define REG_SERPER             REG(REGN_SERPER)
 #define REG_SERDATR            REG(REGN_SERDATR)
 #define REG_SERDAT             REG(REGN_SERDAT)
@@ -426,6 +453,50 @@ enum {
 
 #define BPLCON0_COUNT(x)       ((x) << 12)
 
+/* blitter control */
+enum {
+       BLTCON0_USED    = 0x0100,
+       BLTCON0_USEC    = 0x0200,
+       BLTCON0_USEB    = 0x0400,
+       BLTCON0_USEA    = 0x0800
+};
+
+enum {
+       BLTCON1_LINE    = 0x0001,
+       BLTCON1_DECR    = 0x0002,
+       BLTCON1_FCI             = 0x0004,
+       BLTCON1_IFE             = 0x0008,
+       BLTCON1_EFE             = 0x0010,
+       BLTCON1_DOFF    = 0x0080
+};
+
+#define BLTCON0_LF(x)  (x)
+#define BLTCON0_ASH(x) ((x) << 12)
+#define BLTCON1_BSH(x) ((x) << 12)
+
+enum {
+       BLTCON_LINE             = 0x00000001,
+       BLTCON_DECR             = 0x00000002,
+       BLTCON_FCI              = 0x00000004,
+       BLTCON_IFE              = 0x00000008,
+       BLTCON_EFE              = 0x00000010,
+       BLTCON_DOFF             = 0x00000080,
+       BLTCON_USED             = 0x01000000,
+       BLTCON_USEC             = 0x02000000,
+       BLTCON_USEB             = 0x04000000,
+       BLTCON_USEA             = 0x08000000
+};
+
+#define BLTCON_LF(x)   ((uint32_t)(x) << 16)
+#define BLTCON_ASH(x)  ((uint32_t)(x) << 28)
+#define BLTCON_BSH(x)  ((uint32_t)(x) << 12)
+
+#define BLTSIZE_XWORDS(x)      ((uint16_t)(x) & 0x7f)
+#define BLTSIZE_X(x)           BLTSIZE_XWORDS((x) / 16)
+#define BLTSIZE_Y(x)           ((uint16_t)(x) << 6)
+#define BLTSIZE(x, y)          (BLTSIZE_X(x) | BLTSIZE_Y(y))
+
+
 #define CIAA_PA_FIR0   0x40
 #define CIAA_PA_FIR1   0x80