sprite test
[retrocrawl] / src / amiga / main.c
1 #include <string.h>
2 #include "hwregs.h"
3 #include "copper.h"
4 #include "gfx.h"
5 #include "game.h"
6
7 static uint32_t coplist[64];
8
9 int main(void)
10 {
11         int i;
12
13         REG_INTENA = SETBITS(INTEN_VERTB | INTEN_MASTER);
14         REG_DMACON = CLRBITS(DMA_ALL);
15
16         init_gfx();
17
18         REG_COLOR0 = 0x111;
19         REG_COLOR1 = 0x23c;
20         REG_COLOR2 = 0xc32;
21         REG_COLOR3 = 0x22c;
22         REG_COLOR4 = 0xcc2;
23
24         wait_vblank();
25
26         init_copper(coplist, 32, COPPER_SINGLE);
27         for(i=0; i<NBPL; i++) {
28                 uint32_t addr = (intptr_t)bplptr[i];
29                 int reg = REGN_BPL1PTH + i * 4;
30                 add_copper(COPPER_MOVE(reg, addr >> 16));
31                 add_copper(COPPER_MOVE(reg + 2, addr));
32         }
33         *copperlist_end = COPPER_END;
34
35         game_init();
36
37         wait_vblank();
38         REG_DMACON = SETBITS(DMA_BPL | DMA_COPPER | DMA_BLITTER | DMA_SPRITE | DMA_MASTER);
39
40         for(;;) {
41                 wait_vblank();
42                 game_draw();
43         }
44         return 0;
45 }