amiga_imgv

diff src/amiga/copper.h @ 0:a4788c959918

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 25 Oct 2017 19:34:53 +0300
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/amiga/copper.h	Wed Oct 25 19:34:53 2017 +0300
     1.3 @@ -0,0 +1,38 @@
     1.4 +#ifndef COPPER_H_
     1.5 +#define COPPER_H_
     1.6 +
     1.7 +#include "inttypes.h"
     1.8 +
     1.9 +#define COPPER_MOVE(reg, data)	(((uint32_t)(reg) << 16) | ((uint32_t)(data) & 0xffff))
    1.10 +#define COPPER_WAIT(x, y) \
    1.11 +	(0x0001fffe | ((uint32_t)((x) + 0x81) << 16) | ((uint32_t)((y) + 0x2c) << 24))
    1.12 +#define COPPER_WAIT_OVERSCAN(x, y) \
    1.13 +	(0x0001fffe | ((uint32_t)(x) << 16) | ((uint32_t)(y) << 24))
    1.14 +#define COPPER_VWAIT(s)			(0x0001ff00 | ((uint32_t)((s) + 0x2c) << 24))
    1.15 +#define COPPER_VWAIT_OVERSCAN(s) \
    1.16 +	(0x0001ff00 | ((uint32_t)(s) << 24))
    1.17 +#define COPPER_END				0xfffffffe
    1.18 +
    1.19 +extern uint32_t *copperlist, *copperlist_end;
    1.20 +
    1.21 +enum {
    1.22 +	COPPER_SINGLE = 1,
    1.23 +	COPPER_DOUBLE = 2
    1.24 +};
    1.25 +
    1.26 +int init_copper(int maxlist, int nlists);
    1.27 +void cleanup_copper(void);
    1.28 +
    1.29 +/* enables copper DMA */
    1.30 +void enable_copper(void);
    1.31 +/* disables copper DMA */
    1.32 +void disable_copper(void);
    1.33 +
    1.34 +void clear_copper(void);
    1.35 +void add_copper(uint32_t cmd);
    1.36 +void sort_copper(void);	/* TODO */
    1.37 +
    1.38 +void swap_copper(void);
    1.39 +
    1.40 +
    1.41 +#endif	/* COPPER_H_ */