serial debugging fail
[retrocrawl] / src / amiga / main.c
index 83d86d9..46c777a 100644 (file)
@@ -3,8 +3,9 @@
 #include "copper.h"
 #include "gfx.h"
 #include "game.h"
+#include "serial.h"
 
-static uint32_t coplist[32];
+static uint32_t coplist[128];
 
 int main(void)
 {
@@ -13,6 +14,9 @@ int main(void)
        REG_INTENA = SETBITS(INTEN_VERTB | INTEN_MASTER);
        REG_DMACON = CLRBITS(DMA_ALL);
 
+       ser_init(38400);
+       ser_print("retrocrawl amiga starting up...\n");
+
        init_gfx();
 
        REG_COLOR0 = 0x111;
@@ -23,21 +27,20 @@ int main(void)
 
        wait_vblank();
 
-       uint32_t *copptr = coplist;
+       init_copper(coplist, 32, COPPER_SINGLE);
        for(i=0; i<NBPL; i++) {
                uint32_t addr = (intptr_t)bplptr[i];
                int reg = REGN_BPL1PTH + i * 4;
-               *copptr++ = COPPER_MOVE(reg, addr >> 16);
-               *copptr++ = COPPER_MOVE(reg + 2, addr);
+               add_copper(COPPER_MOVE(reg, addr >> 16));
+               add_copper(COPPER_MOVE(reg + 2, addr));
        }
-       *copptr = COPPER_END;
-       REG32_COP1LC = (uint32_t)coplist;
-       REG_COPJMP1 = 0;
-
-       REG_DMACON = SETBITS(DMA_BPL | DMA_COPPER | DMA_MASTER);
+       *copperlist_end = COPPER_END;
 
        game_init();
 
+       wait_vblank();
+       REG_DMACON = SETBITS(DMA_BPL | DMA_COPPER | DMA_BLITTER | DMA_SPRITE | DMA_MASTER);
+
        for(;;) {
                wait_vblank();
                game_draw();