X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=retrocrawl;a=blobdiff_plain;f=src%2Fgame.c;fp=src%2Fgame.c;h=97c1895be7f7647790e37fbbba43332d541b3a0b;hp=a4dc4c70067e142ae6a54c94db54a7f3068600f0;hb=87c45ef8c82a3925719cbf2024e5932208b244ce;hpb=bba694e9bc50fb24ffe4b3c8f7b5d33f01b3ea4d diff --git a/src/game.c b/src/game.c index a4dc4c7..97c1895 100644 --- a/src/game.c +++ b/src/game.c @@ -1,40 +1,54 @@ #include #include "game.h" -#include "data_test.h" #include "gfx.h" +#include "data.h" #include "hwregs.h" /* XXX */ -#define TILE_W 32 -#define TILE_H 16 +#define TILE_W 64 +#define TILE_H 32 void draw_tile(int tid, int x, int y, int light); -void convert_tile_data(unsigned char *dest, const char *src); -static unsigned char test_tiles[2][TILE_W * TILE_H / 8 * NBPL]; -static unsigned char tile_mask[TILE_W * TILE_H / 8 * NBPL]; int game_init(void) { - int i; + REG_COLOR0 = 0x221; + REG_COLOR1 = 0x222; + REG_COLOR2 = 0x332; + REG_COLOR3 = 0x433; + REG_COLOR4 = 0x543; + REG_COLOR5 = 0x554; + REG_COLOR6 = 0x654; + REG_COLOR7 = 0x765; - for(i=0; i<2; i++) { - convert_tile_data(test_tiles[i], test_tiles_cpix[i][0]); - } - convert_tile_data(tile_mask, tile_mask_cpix[0]); return 0; } +#define XTILES 5 +#define YTILES 13 + void game_draw(void) { - draw_tile(0, 32, 16, 0); + int i, j, xoffs, yoffs, ntiles; + + yoffs = 0; + for(i=0; i>= 1; - - if((j & 7) == 7) { - bptr[k]++; - } - } - } - - for(j=0; j