Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void drawDoomImage() {
- u16 x = 0;
- u16 y = 0;
- u16 w = 0;
- u16 h = 0;
- u16 i = 0;
- u16 j = 0;
- u8 shade = 3;
- u8 parallax = 0;
- u8 height = 8;
- u8 width = 8;
- unsigned int pixelData;
- u8 byteArr[] = {0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};
- for (i = 0; i < 5376; i+=4) {
- for (j = 0; j < 4; j++) {
- pixelData = title_screen_384x224Tiles[i+j];
- byteArr[0+j*4] = (pixelData >> 24) & 0x000000FF;
- byteArr[1+j*4] = (pixelData >> 16) & 0x000000FF;
- byteArr[2+j*4] = (pixelData >> 8) & 0x000000FF;
- byteArr[3+j*4] = (pixelData >> 0) & 0x000000FF;
- }
- x = (i*2)%384;
- y = ((i*2)/384)*8;
- for (h = 0; h < height; h++) {
- for (w = 0; w < width; w++) {
- u8 hiBit = (byteArr[h*2 + 1] >> (7-w)) & 1;
- u8 loBit = (byteArr[h*2 + 0] >> (7-w)) & 1;
- shade = (hiBit << 1) | loBit;
- // draws pixel with buffhln (more efficient than buffvln or buffln) with length of 0 (so it's only one dot)
- buffhln(x+w, y+h, 0, shade, parallax);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement