33 lines
789 B
C
33 lines
789 B
C
#ifndef __COPPER_H__
|
|
#define __COPPER_H__
|
|
|
|
#include "../types.h"
|
|
|
|
/**
|
|
* Sets register to value over two Copper words.
|
|
* Side-effect: Advances ptr by 4.
|
|
*/
|
|
#define COPPERLIST_MOVE(ptr,register,value) \
|
|
*(ptr++) = register; \
|
|
*(ptr++) = value;
|
|
|
|
#define COPPERLIST_WAIT(ptr,x,y,mask) \
|
|
*(ptr++) = 1 + (x << 1) + (y << 8); \
|
|
*(ptr++) = mask;
|
|
|
|
/**
|
|
* Sets high/low registers to pointer value over four Copper words.
|
|
* Side-effect: Advances ptr by 8.
|
|
*/
|
|
#define COPPERLIST_MOVE_POINTER(ptr,register,pointerValue) \
|
|
*(ptr++) = register; \
|
|
*(ptr++) = (pointerValue >> 16); \
|
|
*(ptr++) = register + 2; \
|
|
*(ptr++) = (pointerValue & 0xffff);
|
|
|
|
uint16_t * prepareNewCopperlist(uint16_t size_b);
|
|
void setCopperlist(uint16_t *copperlist);
|
|
void freeCopperlist(uint16_t *copperlist);
|
|
|
|
#endif
|