read the vdp2 documentation. it depend on the bpp and a few other things. i'd do something like: Code: | | | unsigned short sprite_col[] = { 0x8000, 0x7FFF | 0x8000 /* color #1 */ }; unsigned char sprite_cel[] = { 0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11, 0x11,0x11,0x11,0x11 }; |
here is what i used to create 4bpp sprites: Code: | | | unsigned int i; // x unsigned int j; // y unsigned int index; unsigned int h0; unsigned int h1; unsigned int base_index; width /= 2; if (height > 8) height /= (height / 8); h0 = height; h1 = height; if (height > 8) { h0 /= 2; h1 /= 4; } index = ((y * height) * width) + (x * h1); base_index = index; for (j = 0; j < height; j++) { for(i = 0; i < width; i++) { printf("0x%02X,",buf[index]); index++; } puts(""); base_index += width; index = base_index; |
|