cool-bun-demo/system/copper.h

33 lines
789 B
C
Raw Permalink Normal View History

2024-05-02 16:52:06 +00:00
#ifndef __COPPER_H__
#define __COPPER_H__
2024-05-27 18:58:13 +00:00
#include "../types.h"
2024-05-02 16:52:06 +00:00
2024-09-19 17:03:46 +00:00
/**
* 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);
2024-09-19 12:09:10 +00:00
uint16_t * prepareNewCopperlist(uint16_t size_b);
2024-05-02 16:52:06 +00:00
void setCopperlist(uint16_t *copperlist);
void freeCopperlist(uint16_t *copperlist);
#endif