9 #include "hwregs.h" /* XXX */
14 void draw_tile(int tid, int x, int y, int light);
16 static uint16_t *sprdata[NUM_HWSPRITES];
18 /* hardcoded test sprite */
19 static struct sprite test_sprite;
25 printf("hello world\n");
37 REG_COLOR_PTR[i + 16] = sprpal[i];
47 test_sprite.width = test_sprite.height = 48;
48 test_sprite.origx = 24;
49 test_sprite.origy = 24;
50 test_sprite.img = test_sprite.mask = 0;
51 test_sprite.hwslices = 3;
53 test_sprite.hwspr[i] = i < 6 ? sprdata[i] : 0;
64 int i, j, xoffs, yoffs, ntiles;
67 for(i=0; i<YTILES; i++) {
68 xoffs = i & 1 ? TILE_W / 2 : 0;
69 ntiles = i & 1 ? XTILES - 1 : XTILES;
70 for(j=0; j<ntiles; j++) {
71 draw_tile(0, xoffs, yoffs, 0);
78 draw_sprite(&test_sprite, 160, 100);
83 void draw_tile(int tid, int x, int y, int light)
85 unsigned char *dest = bplptr[0] + (y * SCANSZ * NBPL) + x / 8;
86 unsigned char *src = test_tile;
90 REG32_BLTCON = BLTCON_USEA | BLTCON_USEB | BLTCON_USEC | BLTCON_USED |
92 REG32_BLTAFLWM = 0xffffffff;
95 REG_BLTCMOD = SCANSZ - TILE_W / 8;
96 REG_BLTDMOD = SCANSZ - TILE_W / 8;
97 REG32_BLTAPT = (intptr_t)test_tile_mask;
98 REG32_BLTBPT = (intptr_t)src;
99 REG32_BLTCPT = (intptr_t)dest;
100 REG32_BLTDPT = (intptr_t)dest;
101 REG_BLTSIZE = BLTSIZE(TILE_W, TILE_H * NBPL);