cool-bun-demo/system/copper.c

35 lines
612 B
C
Raw Permalink Normal View History

2024-05-02 16:52:06 +00:00
#include "copper.h"
#include "system.h"
#include <clib/exec_protos.h>
#include <exec/memory.h>
#include <hardware/custom.h>
extern struct Custom far custom;
2024-09-19 12:09:10 +00:00
uint16_t copperlistSize;
uint16_t * prepareNewCopperlist(uint16_t size_b) {
uint16_t *copperlist;
copperlistSize = size_b;
copperlist = AllocMem(
copperlistSize,
2024-05-02 16:52:06 +00:00
MEMF_CHIP | MEMF_CLEAR
);
initializeCopperlist(copperlist);
return copperlist;
}
void setCopperlist(uint16_t *copperlist) {
custom.cop1lc = copperlist;
2024-06-02 20:03:16 +00:00
custom.copjmp1 = 1;
2024-05-02 16:52:06 +00:00
}
void freeCopperlist(uint16_t *copperlist) {
2024-09-19 12:09:10 +00:00
FreeMem(copperlist, copperlistSize);
2024-05-02 16:52:06 +00:00
}