amiga_cyberspace
diff src/main.c @ 1:b5d609c7161d
copper
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 26 Jul 2017 08:45:20 +0300 |
parents | e6fd57053627 |
children | b98fa9b135ea |
line diff
1.1 --- a/src/main.c Tue Jul 25 08:17:34 2017 +0300 1.2 +++ b/src/main.c Wed Jul 26 08:45:20 2017 +0300 1.3 @@ -2,6 +2,7 @@ 1.4 #include <proto/exec.h> 1.5 #include <exec/memory.h> 1.6 #include "inttypes.h" 1.7 +#include "copper.h" 1.8 #include "mouse.h" 1.9 #include "hwregs.h" 1.10 1.11 @@ -46,6 +47,11 @@ 1.12 1.13 Forbid(); 1.14 1.15 + /* initialize copper */ 1.16 + if(init_copper(0, 0) == -1) { 1.17 + return -1; 1.18 + } 1.19 + 1.20 prev_dmacon = REG_DMACONR; 1.21 REG_DMACON = CLRBITS(DMA_ALL); 1.22 1.23 @@ -71,8 +77,13 @@ 1.24 wait_vblank(); 1.25 REG32_BPL1PT = (uint32_t)&backdrop; 1.26 1.27 - REG_DMACON = SETBITS(DMA_BPL | DMA_MASTER); 1.28 + add_copper(COPPER_VWAIT(40)); 1.29 + add_copper(COPPER_MOVE(REGN_COLOR1, 0xf80)); 1.30 + add_copper(COPPER_VWAIT(45)); 1.31 + add_copper(COPPER_MOVE(REGN_COLOR1, 0xfff)); 1.32 + add_copper(COPPER_END); 1.33 1.34 + REG_DMACON = SETBITS(DMA_BPL | DMA_COPPER | DMA_MASTER); 1.35 return 0; 1.36 } 1.37 1.38 @@ -90,6 +101,7 @@ 1.39 REG_INTENA = CLRBITS(INTEN_ALL); 1.40 REG_INTENA = SETBITS(prev_intena); 1.41 1.42 + cleanup_copper(); 1.43 Permit(); 1.44 } 1.45