brought the code over from the amiga test
[lugburz] / src / amiga / copper.h
1 #ifndef COPPER_H_
2 #define COPPER_H_
3
4 #include "inttypes.h"
5
6 #define COPPER_MOVE(reg, data)  (((uint32_t)(reg) << 16) | ((uint32_t)(data) & 0xffff))
7 #define COPPER_WAIT(x, y) \
8         (0x0001fffe | ((uint32_t)((x) + 0x81) << 16) | ((uint32_t)((y) + 0x2c) << 24))
9 #define COPPER_WAIT_OVERSCAN(x, y) \
10         (0x0001fffe | ((uint32_t)(x) << 16) | ((uint32_t)(y) << 24))
11 #define COPPER_VWAIT(s)                 (0x0001ff00 | ((uint32_t)((s) + 0x2c) << 24))
12 #define COPPER_VWAIT_OVERSCAN(s) \
13         (0x0001ff00 | ((uint32_t)(s) << 24))
14 #define COPPER_OVERFLOW                 0xffdffffe
15 #define COPPER_END                              0xfffffffe
16
17 extern uint32_t *copperlist, *copperlist_end;
18
19 enum {
20         COPPER_SINGLE = 1,
21         COPPER_DOUBLE = 2
22 };
23
24 int init_copper(uint32_t *cmem, int maxlist, int nlists);
25 void cleanup_copper(void);
26
27 /* enables copper DMA */
28 void enable_copper(void);
29 /* disables copper DMA */
30 void disable_copper(void);
31
32 void clear_copper(void);
33 void add_copper(uint32_t cmd);
34 void sort_copper(void); /* TODO */
35
36 void swap_copper(void);
37
38
39 #endif  /* COPPER_H_ */