X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgame.c;h=8afa769917fde9acf224589baffc5c8a001aa407;hb=8329a2a86c8a3c63216450a062590909282a74d0;hp=89b4e5a0b27fd13aea363a5eb57108c310e3e006;hpb=4c23d7e521ae7ce598447792cec02cba4cf05c87;p=retrocrawl diff --git a/src/game.c b/src/game.c index 89b4e5a..8afa769 100644 --- a/src/game.c +++ b/src/game.c @@ -1,3 +1,4 @@ +#include #include #include "game.h" #include "gfx.h" @@ -13,14 +14,18 @@ void draw_tile(int tid, int x, int y, int light); static uint16_t *sprdata[NUM_HWSPRITES]; +static uint16_t *sprdata2[NUM_HWSPRITES]; /* hardcoded test sprite */ static struct sprite test_sprite; +static struct sprite test_sprite2; int game_init(void) { int i; + printf("hello world\n"); + REG_COLOR0 = 0x221; REG_COLOR1 = 0x222; REG_COLOR2 = 0x332; @@ -34,12 +39,12 @@ int game_init(void) REG_COLOR_PTR[i + 16] = sprpal[i]; } - sprdata[0] = spr0a; - sprdata[1] = spr0b; - sprdata[2] = spr1a; - sprdata[3] = spr1b; - sprdata[4] = spr2a; - sprdata[5] = spr2b; + sprdata[0] = sprdata2[0] = spr0a; + sprdata[1] = sprdata2[1] = spr0b; + sprdata[2] = sprdata2[2] = spr1a; + sprdata[3] = sprdata2[3] = spr1b; + sprdata[4] = sprdata2[4] = spr2a; + sprdata[5] = sprdata2[5] = spr2b; test_sprite.width = test_sprite.height = 48; test_sprite.origx = 24; @@ -50,6 +55,11 @@ int game_init(void) test_sprite.hwspr[i] = i < 6 ? sprdata[i] : 0; } + test_sprite2 = test_sprite; + for(i=0; i<8; i++) { + test_sprite2.hwspr[i] = i < 6 ? sprdata2[i] : 0; + } + return 0; } @@ -72,7 +82,8 @@ void game_draw(void) } begin_sprites(); - draw_sprite(&test_sprite, 160, 100); + draw_sprite(&test_sprite, 160, 80); + draw_sprite(&test_sprite2, 160, 160); end_sprites(); }