X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=retrocrawl;a=blobdiff_plain;f=src%2Famiga%2Fmain.c;h=83d86d9b8100f8364c1caa73f6a3d661d32e9e46;hp=e3cfcd5e5e7b52cb7211822a91e6713df4a3e335;hb=cab072d239d772d1c3445612d2599da36b087b25;hpb=03ec5d69f5f53b61e8b6aefbcd23b0b258c6b60a diff --git a/src/amiga/main.c b/src/amiga/main.c index e3cfcd5..83d86d9 100644 --- a/src/amiga/main.c +++ b/src/amiga/main.c @@ -1,19 +1,46 @@ +#include #include "hwregs.h" +#include "copper.h" +#include "gfx.h" +#include "game.h" + +static uint32_t coplist[32]; int main(void) { - REG_INTENA = SETBITS(INTEN_VERTB | INTEN_MASTER); + int i; + REG_INTENA = SETBITS(INTEN_VERTB | INTEN_MASTER); REG_DMACON = CLRBITS(DMA_ALL); - REG_BPLCON0 = BPLCON0_COLOR; - REG_BPLCON1 = 0; - REG_DIWSTART = 0x2c81; - REG_DIWSTOP = 0x2cc1; - REG_DDFSTART = 0x38; - REG_DDFSTOP = 0xd0; - REG_COLOR0 = 0x237; + init_gfx(); + + REG_COLOR0 = 0x111; + REG_COLOR1 = 0x23c; + REG_COLOR2 = 0xc32; + REG_COLOR3 = 0x22c; + REG_COLOR4 = 0xcc2; + + wait_vblank(); + + uint32_t *copptr = coplist; + for(i=0; i> 16); + *copptr++ = 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); + + game_init(); - for(;;); + for(;;) { + wait_vblank(); + game_draw(); + } return 0; }