Forked para SNOCC
Fork of RA8875 by
Diff: GraphicsDisplay.cpp
- Revision:
- 59:fb40aad4efd4
- Parent:
- 55:dfbabef7003e
- Child:
- 61:8f3153bf0baa
--- a/GraphicsDisplay.cpp Sat Jul 05 15:59:55 2014 +0000 +++ b/GraphicsDisplay.cpp Thu Jul 24 00:41:37 2014 +0000 @@ -455,13 +455,15 @@ uint8_t * lineBuffer = NULL; uint16_t BPP_t; uint32_t PixelWidth, PixelHeight; - //uint32_t start_data; unsigned int i, offset; int padd,j; + #ifdef DEBUG + uint32_t start_data; + #endif // Now, Read the bitmap info header fread(&BMP_Info, 1, sizeof(BMP_Info), Image); - //HexDump("BMP_Info", (uint8_t *)&BMP_Info, sizeof(BMP_Info)); + HexDump("BMP_Info", (uint8_t *)&BMP_Info, sizeof(BMP_Info)); BPP_t = BMP_Info.biBitCount; INFO("biBitCount %04X", BPP_t); if (BPP_t != 4 && BPP_t != 8 && BPP_t != 16 && BPP_t != 24) { // Support 4, 8, 16, 24-bits per pixel @@ -487,11 +489,11 @@ return(not_enough_ram); } fread(colorPalette, 1, paletteSize, Image); - //HexDump("Color Palette", (uint8_t *)colorPalette, paletteSize); + HexDump("Color Palette", (uint8_t *)colorPalette, paletteSize); } int lineBufSize = ((BPP_t * PixelWidth + 7)/8); - //INFO("BPP_t %d, PixelWidth %d, lineBufSize %d", BPP_t, PixelWidth, lineBufSize); + INFO("BPP_t %d, PixelWidth %d, lineBufSize %d", BPP_t, PixelWidth, lineBufSize); lineBuffer = (uint8_t *)malloc(lineBufSize); if (lineBuffer == NULL) { free(colorPalette); @@ -528,13 +530,13 @@ _StartGraphicsStream(); //start_data = BMP_Header.bfOffBits; - //HexDump("Raw Data", (uint8_t *)&start_data, 32); - //INFO("(%d,%d) (%d,%d), [%d,%d]", x,y, PixelWidth,PixelHeight, lineBufSize, padd); + HexDump("Raw Data", (uint8_t *)&start_data, 32); + INFO("(%d,%d) (%d,%d), [%d,%d]", x,y, PixelWidth,PixelHeight, lineBufSize, padd); for (j = PixelHeight - 1; j >= 0; j--) { //Lines bottom up offset = fileOffset + j * (lineBufSize + padd); // start of line fseek(Image, offset, SEEK_SET); fread(lineBuffer, 1, lineBufSize, Image); // read a line - slow ! - //INFO("offset: %6X", offset); + INFO("offset: %6X", offset); for (i = 0; i < PixelWidth; i++) { // copy pixel data to TFT if (BPP_t == 4) { uint8_t dPix = lineBuffer[i/2]; @@ -589,7 +591,7 @@ fread(&BMP_Header, 1, sizeof(BMP_Header), Image); // get the BMP Header INFO("bfType %04X", BMP_Header.bfType); - //HexDump("BMP_Header", (uint8_t *)&BMP_Header, sizeof(BMP_Header)); + HexDump("BMP_Header", (uint8_t *)&BMP_Header, sizeof(BMP_Header)); if (BMP_Header.bfType != BF_TYPE) { fclose(Image); return(not_bmp_format);