X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmain.c;h=261f1a5e01dc5f44314321e349ffc0c983c7fed9;hb=df239da799038254f1cc9e5d7c40ae6f331bc41c;hp=faa6b9e5d72210e37afb33b960a81e93ec4904f7;hpb=b789e37efab3baed9def2c1199d1cc5884e06ab5;p=mdlife diff --git a/src/main.c b/src/main.c index faa6b9e..261f1a5 100644 --- a/src/main.c +++ b/src/main.c @@ -2,32 +2,21 @@ #include "z80.h" #include "vdp.h" #include "sprite.h" +#include "parts.h" #include "debug.h" -#define SPRITE_BASE 0x8000 -extern uint16_t cellspr_data[], cellspr_data_end[]; - +uint32_t frameno; uint32_t dbgval[4]; int main(void) { - uint16_t *src; - int tile, i; + int i; z80_init(); vdp_init(); dbg_init(); - for(i=0; i<16; i++) { - vdp_setcolor(0, i, i, i, i); - } - - /* upload sprite tiles */ - src = cellspr_data; - vdp_setup_addr(VDP_VRAM, SPRITE_BASE); - while(src < cellspr_data_end) { - VDP_DATA = *src++; - } + dna_init(); dbg_setcursor(0, 0); printf("xyzzy"); @@ -38,25 +27,13 @@ int main(void) printf("%08x\n", (unsigned int)dbgval[i]); } spr_begin(); - tile = VDP_ADDR2TILE(SPRITE_BASE); - spr_add(160, 50, VDP_TILENAME(tile, 0, VDP_TILE_FG), SPR_SIZE(1,1)); - tile++; - spr_add(160, 60, VDP_TILENAME(tile, 0, VDP_TILE_FG), SPR_SIZE(1,1)); - tile++; - spr_add(160, 75, VDP_TILENAME(tile, 0, VDP_TILE_FG), SPR_SIZE(1,1)); - tile++; - spr_add(156, 90, VDP_TILENAME(tile, 0, VDP_TILE_FG), SPR_SIZE(1,1)); - spr_add(164, 90, VDP_TILENAME(tile, 0, VDP_TILE_FG | VDP_TILE_HFLIP), SPR_SIZE(1,1)); - spr_add(156, 98, VDP_TILENAME(tile, 0, VDP_TILE_FG | VDP_TILE_VFLIP), SPR_SIZE(1,1)); - spr_add(164, 98, VDP_TILENAME(tile, 0, VDP_TILE_FG | VDP_TILE_HVFLIP), SPR_SIZE(1,1)); - tile++; - spr_add(148, 120, VDP_TILENAME(tile, 0, VDP_TILE_FG), SPR_SIZE(2, 2)); - spr_add(164, 120, VDP_TILENAME(tile, 0, VDP_TILE_FG | VDP_TILE_HFLIP), SPR_SIZE(2, 2)); - spr_add(148, 136, VDP_TILENAME(tile, 0, VDP_TILE_FG | VDP_TILE_VFLIP), SPR_SIZE(2, 2)); - spr_add(164, 136, VDP_TILENAME(tile, 0, VDP_TILE_FG | VDP_TILE_HVFLIP), SPR_SIZE(2, 2)); + + dna_update(); vdp_wait_vblank(); spr_submit(); + + frameno++; } return 0;