Skip to content
CShift0.32

CopperList

Struct · namespace Amiga · AmigaOS only · Since 0.20

struct CopperList

A copper list in chip memory: MOVEs to the custom chip registers and WAITs for raster lines. It always ends with the copper’s end instruction, so it can run while it grows.

Name Description
Create An empty copper list in chip memory with room for instructions MOVEs and WAITs.
static Optional<CopperList> Create(int instructions)

An empty copper list in chip memory with room for instructions MOVEs and WAITs.

Returns nothing (null) if there is not enough chip memory.

Name Description
Address The address of the list, for Hardware.StartCopper.
Count The number of instructions in the list.
Move Adds a MOVE of value to register.
Color Adds a MOVE of the color rgb (0xRGB) to the color register index (0 to 31).
MovePointer Adds the MOVEs of an address to a bitplane or sprite pointer (BPL1PTH, SPR0PTH, …
Wait WAIT until the beam reaches line y of the picture (y = 0: the first line of the standard PAL display window, raster line 44; up to 268).
Change A new value for the MOVE at index.
ChangePointer A new address for the pointer MOVEs at index (from CopperList.MovePointer).
Mark Remembers the end of the list: CopperList.Reset goes back to here.
Reset Removes the instructions after the mark (CopperList.Mark); all of them if there is none.
Free Gives the chip memory back.
void* Address()

The address of the list, for Hardware.StartCopper.

int Count()

The number of instructions in the list.

int Move(Custom register, int value)

Adds a MOVE of value to register.

Returns the index of the instruction, for CopperList.Change.

int Color(int index, int rgb)

Adds a MOVE of the color rgb (0xRGB) to the color register index (0 to 31).

Returns the index of the instruction, for CopperList.Change.

int MovePointer(Custom register, int number, void* address)

Adds the MOVEs of an address to a bitplane or sprite pointer (BPL1PTH, SPR0PTH, … + 4 * number): two instructions, the high and the low word.

Returns the index of the first instruction, for CopperList.ChangePointer.

void Wait(int y)

WAIT until the beam reaches line y of the picture (y = 0: the first line of the standard PAL display window, raster line 44; up to 268). Lines must come in order.

void Change(int index, int value)

A new value for the MOVE at index.

void ChangePointer(int index, void* address)

A new address for the pointer MOVEs at index (from CopperList.MovePointer).

void Mark()

Remembers the end of the list: CopperList.Reset goes back to here.

void Reset()

Removes the instructions after the mark (CopperList.Mark); all of them if there is none.

void Free()

Gives the chip memory back.