Loading bitmaps from SD

Understanding the language, error messages, etc.

Loading bitmaps from SD

Postby Duhjoker » Thu Nov 24, 2016 7:26 am

Ok so I've been looking around at alternative methods of storing bitmaps. 256k Progmem is a lot but won't let you use the full power of the 32-bit processor since storage for bitmaps is so limited.

So I was looking around at and found this here at Gamebuino......

viewtopic.php?f=13&t=3260

I'm not really understanding how it works but my main question is can I store and display full color bitmaps or would I have to stack them like you would normally do for grey scale or RGB.
User avatar
Duhjoker
 
Posts: 446
Joined: Sat Jul 02, 2016 4:57 am
Location: Where Palm trees grow

Re: Loading bitmaps from SD

Postby wuuff » Thu Nov 24, 2016 11:18 am

I was just considering how to load tilesets from the SD card. I should have figured somebody on the forums had already done it. I somehow missed that thread.

My guess is that you can store the bitmaps however you like on the SD card as long as the encoding you choose can be read efficiently enough for your needs. You can probably store them in a file in the same byte encoding you store them in memory now, and it will work if you just load the data into memory. I don't know the details of how you store them though.

By the way, do you have a demo of color sprites working on real hardware? Your project to use a color screen sounds like it was quite an undertaking. It would be cool to see the result.
wuuff
 
Posts: 61
Joined: Sun Aug 28, 2016 6:05 am

Re: Loading bitmaps from SD

Postby Duhjoker » Fri Nov 25, 2016 1:11 am

I. Trying to figure out how to integrate it into my library but I'm not understanding how to use it with the current display files since both mine and the OG Gamebuino has the SPI stuff in the display.cpp files. And I don't see a reference to any display.h file or .cpp.
User avatar
Duhjoker
 
Posts: 446
Joined: Sat Jul 02, 2016 4:57 am
Location: Where Palm trees grow

Re: Loading bitmaps from SD

Postby Duhjoker » Thu Dec 01, 2016 3:42 am

Ok I've been looking at the sd library for arduino. And it looks like I can open a file on the sd and read it.

So I think what would be easiest for now would be store a spritesheet in text form on the SD then open the file and read the bitmap binaries straight from the SD instead of Progmem.

Or do a #include file open SD and read SD then write the code as normal
User avatar
Duhjoker
 
Posts: 446
Joined: Sat Jul 02, 2016 4:57 am
Location: Where Palm trees grow

Re: Loading bitmaps from SD

Postby STUDIOCRAFTapps » Thu Dec 01, 2016 4:28 pm

Duhjoker wrote:Ok I've been looking at the sd library for arduino. And it looks like I can open a file on the sd and read it.

So I think what would be easiest for now would be store a spritesheet in text form on the SD then open the file and read the bitmap binaries straight from the SD instead of Progmem.

Or do a #include file open SD and read SD then write the code as normal


That's sure the easiest way to do it is the first way but about the performance, it may slow down your game... If you can, try both and see what's the best or seek out in the code of other games.
User avatar
STUDIOCRAFTapps
 
Posts: 86
Joined: Sun Oct 02, 2016 11:58 pm
Location: Deep in the web

Re: Loading bitmaps from SD

Postby Duhjoker » Thu Dec 01, 2016 9:33 pm

we should have a button like karma or thank you on the forum so we can thank people without having to making post. fortunately I have a few questions.

really have to start doing more searches on the forum too.

ok so I did a search on the forum for sd cards and it pulled up 76 pages of post and while I didn't go through all 76 pages I did find a post by mouguino on a topic by nead for sd card raeding. I downloaded the file and im trying to decipher how to use it. And that means questions. I labeled the code with comments at the parts im asking about

Link to post
viewtopic.php?f=12&t=787&hilit=read+from+sd&start=10#p10556

question # 1 why are we dumping the bitmaps to progmem if we are reading them from the sd?

question # 2 there wasn't a .h or .cpp file included, am I to understand that everything that's needed is included in the file?

also my regular drawbitmap commands use a color variable to print the monochrome bitmaps in a color. for the .h its like.......

drawBitmap(size_x,size_y,pos_x,pos_y,bitmap_name ,color_name) or

drawBitmap(16,16,70,70,green_square,green)

how do I add the color argument to the drawbitmapfromsd function. I had to change both my .cpp and .h file in my library to do this.

Code: Select all
#include <SPI.h>
#include <Gamebuino.h>
#include <petit_fatfs.h>

//#define debug // Comment for live conditions (Gamebuino+SD). Uncomment for demo conditions (simulator)

PROGMEM const unsigned char title[] = { 32,32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x7F,0xF8,0x00,0x00,0xE0,0x1E,0x00,0x03,0x00,0x83,0x80,0x06,0x01,0xC0,0xC0,0x0C,0x03,0xE0,0x60,0x08,0x03,0xE0,0x20,0x18,0xE1,0xC0,0x30,0x19,0xF0,0x02,0x10,0x19,0xF0,0x07,0x98,0x38,0xE0,0x08,0xD8,0x30,0x40,0x08,0x58,0x30,0x00,0x08,0x58,0x30,0x00,0x0C,0xD8,0x30,0x00,0x07,0x18,0x30,0x40,0x00,0x18,0x38,0xE0,0xF8,0x30,0x19,0xF0,0xCC,0x60,0x19,0xF1,0x83,0xC0,0x18,0xE1,0x80,0x00,0x0C,0x03,0x00,0x00,0x0E,0x07,0x00,0x00,0x07,0x1E,0x00,0x00,0x01,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };

//////question one
#ifdef debug // Below are the bitmaps data dumped to PROGMEM (made possible with my "FileToArray.exe" util) for debug in simulator
PROGMEM const char ff[] = { 0x42,0x4d,0x32,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x04,0x00,0x00,0x28,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0x40,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x42,0x4d,0x32,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x04,0x00,0x00,0x00,0x00,0xb0,0x48,0xac,0x00,0x24,0x05,0x00,0x00,0x34,0x04,0x00,0x00,0x0f,0x00,0x85,0x01,0x96,0x11,0x01,0x95,0x3a,0x08,0x05,0x57,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xaf,0x60,0x20,0x00,0x20,0x2f,0x14,0x00,0xdc,0x64,0xb1,0x00,0x22,0x02,0xfb,0x7f,0x26,0x00,0x00,0x00,0x78,0xae,0x14,0x00,0x30,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0xd4,0x4b,0x77,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x00,0xd8,0x64,0xb1,0x00,0x98,0xf5,0x12,0x00,0x44,0x4a,0x0e,0x77,0x34,0x60,0x5c,0x77,0xd8,0x64,0xb1,0x00,0xa0,0x7b,0x21,0x00,0x84,0xf7,0x12,0x00,0xd8,0x64,0xb1,0x00,0x80,0x00,0x00,0x00,0xac,0xf5,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0xdc,0x64,0xb1,0x00,0x40,0xf9,0x12,0x00,0x32,0xc8,0x20,0x00,0x00,0x00,0x00,0x00,0xcc,0xf5,0x12,0x00,0x3f,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0xf7,0x12,0x00,0x40,0xf9,0x12,0x00,0x9f,0x4f,0x20,0x00,0x88,0xf7,0x12,0x00,0x36,0x04,0x28,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf4,0xb3,0x14,0x00,0x5a,0x3a,0x5c,0x41,0x72,0x64,0x75,0x69,0x6e,0x6f,0x20,0x4c,0x44,0x56,0x45,0x4c,0x48,0x20,0x4d,0x61,0x6b,0x65,0x72,0x5c,0x44,0x46,0x30,0x31,0x5c,0x74,0x69,0x74,0x6c,0x65,0x2e,0x62,0x6d,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x3d,0x20,0x00,0xc0,0x12,0x3f,0x7e,0x78,0x67,0x4b,0x00,0x58,0xf9,0x12,0x00,0xa1,0x7b,0x21,0x00,0xf5,0xb3,0x14,0x00,0xcf,0x4e,0x20,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf4,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfa,0x9f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf7,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfb,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7c,0xff,0xff,0xc0,0x00,0x03,0xff,0xff,0xdf,0xbf,0xe0,0x03,0xff,0xf0,0x0f,0xff,0xff,0xe8,0x07,0xff,0x78,0xfd,0xe1,0xff,0xfb,0xf0,0x1f,0xe7,0xf9,0xf8,0xf1,0xff,0xfe,0xfc,0x03,0x63,0xff,0xf8,0xfe,0xff,0xc0,0x3f,0x07,0xe0,0x00,0x01,0xf8,0xf8,0x4f,0xcf,0xc0,0x00,0x00,0x08,0x0a,0xe2,0x3f,0xc7,0xa0,0x00,0x00,0x08,0x0e,0x03,0xe5,0xf3,0xf8,0x00,0x00,0xe8,0x1f,0x3f,0xe6,0x05,0x7e,0x00,0x01,0xd4,0x45,0x3f,0xf8,0x14,0xfb,0x00,0x06,0x68,0x23,0x07,0x00,0x03,0xaf,0xe0,0x30,0x40,0x7b,0xa7,0x00,0x00,0xbb,0xb8,0xbe,0x41,0xf7,0xdf,0x80,0x00,0x31,0xfe,0x05,0x04,0xcf,0xef,0xc0,0x00,0x34,0xe0,0x0e,0x0c,0x5f,0xf6,0x20,0x01,0x39,0xeb,0x90,0x1e,0x7f,0xfc,0x10,0x47,0x6e,0x0c,0x20,0x19,0xff,0xfe,0x7c,0x02,0xc0,0x84,0x04,0x0f,0xff,0xff,0x3e,0x10,0x80,0xec,0x03,0x1f,0xff,0xff,0xd4,0x00,0x00,0x04,0xe0,0xff,0xff,0xff,0xf2,0x70,0x00,0x9c,0x38,0x0f,0xff,0xff,0xff,0x4f,0x06,0x71,0xfe,0x07,0xff,0xff,0xff,0xef,0xbf,0x07,0xfe,0x05,0xff,0xff,0xff,0xf8,0x01,0xff,0xff,0xc6,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x95,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0xff };
PROGMEM const char d2[] = { 0x42,0x4d,0x5a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0xc4,0x0e,0x00,0x00,0xc4,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x74,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x5c,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
PROGMEM const char d4[] = { 0x42,0x4d,0x5a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0xc4,0x0e,0x00,0x00,0xc4,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x54,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x54,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
PROGMEM const char i358[] = { 0x42,0x4d,0x82,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x04,0x00,0x00,0x28,0x00,0x00,0x00,0x54,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0x54,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x42,0x4d,0x82,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x04,0x00,0x00,0x00,0x00,0x60,0x2f,0x31,0x00,0x74,0x06,0x00,0x00,0x34,0x04,0x00,0x00,0x0f,0x00,0x85,0x01,0x37,0x1c,0x01,0x8e,0x7b,0x1c,0x05,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xaf,0x60,0x20,0x00,0x00,0x3e,0xfb,0x76,0x54,0xf4,0x04,0x07,0x18,0xf4,0x13,0x00,0x1f,0x3e,0xfb,0x76,0x00,0x00,0x18,0x00,0x90,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xf4,0x13,0x00,0x3e,0x52,0x38,0x77,0x44,0x23,0x0d,0x77,0x50,0xf4,0x04,0x07,0x34,0xf6,0x13,0x00,0xa0,0x7b,0x21,0x00,0x81,0x52,0x38,0x77,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x7c,0x2e,0x72,0x1b,0x5c,0xf4,0x13,0x00,0xe7,0x51,0x38,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x85,0xae,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0xf6,0x13,0x00,0x6c,0x05,0x20,0x00,0x50,0xf4,0x13,0x00,0x00,0x00,0x00,0x00,0x3f,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0xf6,0x13,0x00,0xf0,0xf7,0x13,0x00,0x9f,0x4f,0x20,0x00,0x38,0xf6,0x13,0x00,0x6c,0x05,0x20,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x2b,0x11,0x04,0x5a,0x3a,0x5c,0x47,0x61,0x6d,0x65,0x62,0x75,0x69,0x6e,0x6f,0x20,0x4c,0x44,0x56,0x45,0x4c,0x48,0x20,0x4d,0x61,0x6b,0x65,0x72,0x5c,0x44,0x46,0x30,0x31,0x5c,0x33,0x35,0x38,0x2e,0x62,0x6d,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x3d,0x20,0x00,0x10,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xa1,0x7b,0x21,0x00,0x1d,0x2b,0x11,0x04,0xcf,0x4e,0x20,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xf6,0x80,0x75,0x7f,0x80,0x40,0x14,0x60,0x6a,0xb3,0x00,0x00,0xf3,0x00,0x33,0x7e,0x95,0x00,0x10,0x57,0x9a,0x2f,0x10,0x00,0xff,0xc0,0x07,0x5e,0xb0,0x40,0xb0,0x18,0x0b,0x3f,0x10,0x00,0xfe,0xe0,0x0e,0x98,0x84,0x41,0x20,0x91,0x07,0x0a,0x10,0x00,0x00,0xc0,0x0e,0x80,0xb0,0x00,0x20,0x93,0x30,0x06,0xa0,0x00,0xff,0x80,0x0b,0x3e,0x13,0x00,0x00,0x18,0x35,0x84,0x80,0x00,0x7f,0x1a,0x03,0x08,0xc2,0xa0,0x00,0x54,0x25,0x4d,0x90,0x00,0xbe,0x01,0x02,0xd1,0x13,0xa4,0x05,0x58,0x35,0x69,0x30,0x00,0x3c,0x00,0x02,0x7f,0xa9,0x88,0x14,0x90,0x37,0x61,0x30,0x00,0xf8,0x00,0x0a,0x9f,0x40,0x44,0x1d,0x18,0x13,0x42,0x70,0x00,0xf0,0x00,0x01,0x40,0x29,0x0e,0x1d,0x18,0xa1,0x66,0xf0,0x00,0xe0,0xc0,0x02,0x6f,0x99,0x1e,0x7f,0x88,0xd3,0x65,0xf0,0x00,0xc1,0x88,0x05,0xf5,0xf1,0x4c,0x0f,0x8a,0xc7,0xbb,0xf0,0x00,0x87,0x8c,0x0d,0xfb,0x80,0x2b,0xbf,0xd2,0x85,0x93,0xf0,0x00,0x0f,0x0f,0x0b,0xfd,0x33,0x1c,0x0e,0xc8,0x4d,0xf3,0xf0,0x00,0x3f,0x1f,0xf7,0xfe,0xc0,0x58,0x07,0xc1,0x6a,0x73,0xf0,0x00,0xf3,0x1f,0xfb,0x3f,0x01,0x5e,0x1f,0x48,0x73,0x77,0xf0,0x00,0xeb,0x3f,0xf0,0xff,0xa1,0x57,0xbf,0x68,0x18,0x17,0xf0,0x00,0xda,0x78,0xf2,0xff,0xe0,0x5f,0x36,0x60,0x1a,0xef,0xf0,0x00,0xe6,0x71,0x05,0xff,0xe6,0x78,0xc7,0x62,0x39,0x2f,0xf0,0x00,0x5a,0xed,0xf3,0xff,0xc5,0x7d,0xe5,0xe8,0x3a,0xdf,0xf0,0x00,0x92,0xed,0xff,0xff,0xf1,0x7d,0x4f,0xe8,0x38,0xdf,0xf0,0x00,0xb7,0xf6,0x7f,0xbe,0xfe,0x7f,0x7e,0xc0,0x54,0xff,0xf0,0x00,0x90,0xf5,0xff,0x07,0x82,0x5f,0xff,0x86,0x6f,0xbf,0xf0,0x00,0xfe,0xf5,0xfe,0x53,0x64,0x3f,0x7f,0xe2,0xf2,0x7f,0xf0,0x00,0xfa,0xef,0xfd,0x80,0x49,0xbb,0x77,0xea,0x1d,0xff,0xf0,0x00,0xfe,0x5f,0xe0,0x9f,0xc9,0x7f,0xdb,0xe0,0x92,0xff,0xf0,0x00,0xfe,0xcf,0xe4,0xff,0xfd,0xf9,0x49,0xe5,0xe3,0xff,0xf0,0x00,0xff,0xff,0x41,0xff,0xf2,0xe1,0x60,0x28,0x3f,0xff,0xf0,0x00,0xff,0xfe,0x67,0xff,0xf8,0xa8,0xd8,0xb1,0xff,0xff,0xf0,0x00,0xff,0xfc,0x2f,0xff,0xf8,0xc1,0x03,0x7a,0xff,0xff,0xf0,0x00,0xff,0xfc,0x2f,0xff,0xf8,0xfb,0xf8,0x60,0xff,0xff,0xf0,0x00,0xff,0xfc,0x1f,0xff,0xfa,0xd7,0xff,0xb8,0xff,0xff,0xf0,0x00,0xff,0xfe,0xdf,0xff,0xf8,0xaf,0xff,0x20,0xff,0xff,0xf0,0x00,0xff,0xfe,0x1f,0xff,0xf9,0xff,0xde,0x70,0xff,0xff,0xf0,0x00,0xff,0xff,0xcf,0xff,0xf8,0xff,0xff,0xec,0xff,0xff,0xf0,0x00,0xff,0xff,0x3f,0x03,0xf2,0xbc,0x19,0xf8,0xff,0xff,0xf0,0x00,0xff,0xff,0x38,0xbd,0xf8,0xbf,0xff,0xe1,0xff,0xff,0xf0,0x00,0xff,0xff,0x67,0x6b,0xf8,0xff,0x3f,0xe1,0xff,0xff,0xf0,0x00,0xff,0xff,0xa9,0x43,0xf8,0xf7,0x3f,0xc9,0xff,0xff,0xf0,0x00,0xff,0xff,0x94,0x42,0xfa,0xef,0x31,0xa3,0xff,0xff,0xf0,0x00,0xff,0xff,0xe5,0x4d,0xfc,0x6e,0x19,0x93,0xff,0xff,0xf0,0x00,0xff,0xff,0xf1,0xb1,0xf8,0x01,0x19,0x5b,0xff,0xff,0xf0,0x00,0xff,0xff,0xfa,0x11,0xf8,0xce,0x24,0xd7,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0x03,0xfc,0x24,0x04,0xef,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xff,0xff,0x18,0x2b,0x1f,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xff,0xff,0xc5,0x24,0xbf,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xff,0xff,0xf8,0x01,0xff,0xff,0xff,0xf0,0x00 };
PROGMEM const char i383[] = { 0x42,0x4d,0x82,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x04,0x00,0x00,0x28,0x00,0x00,0x00,0x54,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0x54,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x42,0x4d,0x82,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x04,0x00,0x00,0x00,0x00,0x60,0x2f,0x31,0x00,0x74,0x06,0x00,0x00,0x34,0x04,0x00,0x00,0x0f,0x00,0x85,0x01,0x37,0x1c,0x01,0xfd,0x05,0x1d,0x05,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xaf,0x60,0x20,0x00,0x00,0x3e,0xfb,0x76,0x14,0xee,0x04,0x07,0x18,0xf4,0x13,0x00,0x1f,0x3e,0xfb,0x76,0x00,0x00,0x18,0x00,0x30,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0xf4,0x13,0x00,0x3e,0x52,0x38,0x77,0x44,0x23,0x0d,0x77,0x10,0xee,0x04,0x07,0x34,0xf6,0x13,0x00,0xa0,0x7b,0x21,0x00,0x81,0x52,0x38,0x77,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x7c,0x2e,0x72,0x1b,0x5c,0xf4,0x13,0x00,0xe7,0x51,0x38,0x77,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc5,0x85,0xae,0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0xf6,0x13,0x00,0x6c,0x05,0x21,0x00,0x50,0xf4,0x13,0x00,0x00,0x00,0x00,0x00,0x3f,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0xf6,0x13,0x00,0xf0,0xf7,0x13,0x00,0x9f,0x4f,0x20,0x00,0x38,0xf6,0x13,0x00,0x6c,0x05,0x21,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x08,0x2f,0x00,0x5a,0x3a,0x5c,0x47,0x61,0x6d,0x65,0x62,0x75,0x69,0x6e,0x6f,0x20,0x4c,0x44,0x56,0x45,0x4c,0x48,0x20,0x4d,0x61,0x6b,0x65,0x72,0x5c,0x44,0x46,0x30,0x31,0x5c,0x33,0x38,0x33,0x2e,0x62,0x6d,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x3d,0x20,0x00,0x10,0x00,0x00,0x00,0x58,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xa1,0x7b,0x21,0x00,0x6d,0x08,0x2f,0x00,0xcf,0x4e,0x20,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0xff,0xfc,0x7b,0xff,0xe4,0x00,0x40,0x00,0x3f,0xc7,0xf0,0x00,0xe0,0x3e,0x7d,0xff,0xe0,0x20,0x60,0x04,0x3c,0x7e,0x00,0x00,0x07,0x82,0x7e,0xff,0xe0,0x1c,0x40,0x02,0x3f,0xc0,0x00,0x00,0xff,0xfe,0x7e,0x7f,0x87,0xe0,0x5c,0x04,0xb8,0xff,0xf0,0x00,0x82,0x06,0x7f,0x7f,0x90,0x02,0xe0,0x08,0x3f,0xe0,0x00,0x00,0xfe,0xfc,0x7f,0x7f,0x98,0x10,0xf0,0x04,0xbe,0x0f,0xf0,0x00,0x3f,0xe8,0x7f,0x80,0x01,0x00,0x6f,0xc0,0x3f,0xf0,0x60,0x00,0xc2,0x7c,0x40,0x00,0x09,0x00,0x40,0xf8,0x3e,0x00,0x00,0x00,0xff,0xe6,0x7e,0x7f,0xe1,0x1f,0x20,0x06,0x3b,0xff,0xf0,0x00,0xe0,0x7c,0x7f,0x7f,0xff,0x82,0xa0,0x40,0x3f,0xc0,0x00,0x00,0x1e,0x06,0x7f,0xbf,0xff,0xe0,0x00,0x00,0x3f,0x0e,0x70,0x00,0xe6,0x78,0x7f,0x9f,0xf8,0xe1,0x04,0x00,0x3b,0xff,0x30,0x00,0x06,0x0e,0x7f,0xdf,0xf6,0x00,0x10,0x03,0xbf,0xf0,0x10,0x00,0xff,0xf8,0x7f,0xe0,0x01,0x9e,0x1e,0x00,0x3e,0x1f,0xf0,0x00,0x06,0x1e,0x7f,0x00,0x61,0xdf,0x80,0x00,0x39,0xf0,0x30,0x00,0xff,0xf8,0x00,0xff,0xe8,0xe7,0xc0,0x18,0xb8,0x3f,0xf0,0x00,0x06,0xce,0x07,0xff,0xc0,0x51,0x80,0x00,0xba,0x80,0x00,0x00,0xff,0xe2,0x7f,0xff,0x81,0x5c,0x10,0xfc,0x3c,0xff,0xf0,0x00,0xc6,0x1e,0x7f,0xff,0x00,0x0e,0x01,0xff,0xb7,0x80,0x00,0x00,0x3c,0x0a,0x00,0x07,0x00,0x06,0x03,0xff,0xbe,0x0f,0xf0,0x00,0xff,0xfe,0x7e,0x40,0x30,0x06,0x00,0x7f,0xbf,0xfe,0x00,0x00,0x00,0xd6,0x7f,0xf8,0x64,0x0c,0x00,0x01,0xbc,0x00,0x20,0x00,0xff,0xfe,0x7f,0xfe,0x2d,0x04,0x47,0xe0,0x3f,0xff,0x00,0x00,0x04,0x0e,0x7f,0xfc,0x4f,0x84,0x00,0x7f,0xb8,0x07,0xf0,0x00,0xff,0xfe,0x70,0x1b,0x8f,0x8e,0x00,0x1f,0xbe,0x1f,0x40,0x00,0xfe,0x1a,0x7f,0x03,0x8f,0xce,0x1f,0x03,0xb8,0x03,0xf0,0x00,0x04,0x7e,0x00,0x01,0x9f,0xc2,0x07,0xe0,0x3f,0xff,0xf0,0x00,0xff,0xfe,0x7e,0xf0,0xb5,0xe2,0x83,0xfc,0x3f,0x00,0x00,0x00,0x04,0x0e,0x7e,0xf4,0x40,0x70,0x98,0x0f,0x3b,0x07,0xf0,0x00,0x07,0xfe,0x7f,0xf0,0x30,0x7e,0x18,0x01,0xbf,0x81,0x00,0x00,0xff,0x5e,0x7f,0x60,0xe0,0x30,0x43,0xe0,0x39,0xff,0xf0,0x00,0x00,0x1e,0x7f,0xe8,0xe0,0x24,0x03,0xf4,0x3f,0xff,0x00,0x00,0xff,0xf6,0x7f,0xaf,0xe0,0x0f,0x73,0xf3,0xbf,0xff,0xf0,0x00,0x00,0x1e,0x7f,0xaf,0xb0,0x0f,0x71,0xfb,0xbf,0xff,0xe0,0x00,0xff,0xfe,0x7f,0xa7,0xb8,0x5f,0x79,0xfb,0xb8,0x00,0x00,0x00,0xfe,0x0e,0x43,0x87,0xff,0x9f,0x71,0xfb,0xbf,0xff,0xf0,0x00,0x00,0x7e,0x00,0x07,0xff,0xbf,0xf4,0xfb,0xbf,0xff,0xc0,0x00,0xff,0xfe,0x7f,0xfb,0xff,0xbf,0xbd,0xfb,0xbf,0x80,0xf0,0x00,0xff,0xce,0x3f,0xf9,0xff,0x9f,0x8d,0xfb,0xbf,0xff,0xc0,0x00,0x00,0xfe,0x00,0x00,0xff,0xef,0x98,0x73,0xbe,0x0f,0xf0,0x00,0xff,0xfe,0x7c,0x00,0x7f,0xf0,0xf8,0x00,0xbf,0xff,0xe0,0x00,0xff,0xee,0x7f,0xff,0x3f,0xff,0xf3,0xfe,0x38,0xe0,0x00,0x00,0x03,0xfe,0x78,0x1f,0x9f,0xff,0xf0,0x0f,0xbf,0xff,0xf0,0x00,0xff,0xfe,0x7f,0xe0,0x0f,0xff,0xe0,0x01,0xb9,0xff,0x80,0x00,0xff,0xd6,0x7f,0xff,0xe3,0xff,0xc7,0xf0,0x3f,0xff,0xf0,0x00,0x00,0xde,0x70,0x00,0x18,0xff,0x8f,0xff,0x3d,0x87,0x00,0x00,0xff,0xfe,0x7f,0x00,0x00,0x7f,0x9f,0xff,0xbf,0xc1,0xb0,0x00,0xff,0x2e,0x00,0x3f,0xff,0x80,0x38,0x5b,0xbc,0x06,0x00,0x00 };
PROGMEM const char i400[] = { 0x42,0x4d,0x82,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x04,0x00,0x00,0x28,0x00,0x00,0x00,0x54,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x40,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0x54,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x42,0x4d,0x82,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x04,0x00,0x00,0x00,0x00,0xc0,0x22,0x17,0x01,0x74,0x06,0x00,0x00,0x34,0x04,0x00,0x00,0x0f,0x00,0x85,0x01,0x39,0x0e,0x01,0x0c,0x7b,0x0e,0x05,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xaf,0x60,0x20,0x00,0x00,0x3e,0x29,0x77,0xb4,0x09,0x8b,0x03,0x98,0xf6,0x13,0x00,0x1f,0x3e,0x29,0x77,0x00,0x00,0x18,0x00,0xfc,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xf6,0x13,0x00,0x3e,0x52,0x99,0x76,0x44,0x23,0x3b,0x77,0xb0,0x09,0x8b,0x03,0xb4,0xf8,0x13,0x00,0xa0,0x7b,0x21,0x00,0x81,0x52,0x99,0x76,0x00,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x54,0x9f,0x64,0xa9,0xdc,0xf6,0x13,0x00,0xe7,0x51,0x99,0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0xda,0x61,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0xf8,0x13,0x00,0x28,0x05,0x06,0x00,0xd0,0xf6,0x13,0x00,0x00,0x00,0x00,0x00,0x3f,0x13,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0xf8,0x13,0x00,0x70,0xfa,0x13,0x00,0x9f,0x4f,0x20,0x00,0xb8,0xf8,0x13,0x00,0x28,0x05,0x06,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc4,0xf8,0x1b,0x01,0x5a,0x3a,0x5c,0x47,0x61,0x6d,0x65,0x62,0x75,0x69,0x6e,0x6f,0x20,0x4c,0x44,0x56,0x45,0x4c,0x48,0x20,0x4d,0x61,0x6b,0x65,0x72,0x5c,0x44,0x46,0x30,0x31,0x5c,0x34,0x30,0x30,0x2e,0x62,0x6d,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x3d,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa1,0x7b,0x21,0x00,0xc5,0xf8,0x1b,0x01,0xcf,0x4e,0x20,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0x1f,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xff,0xfe,0x0f,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xff,0x8c,0x21,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xff,0x02,0xec,0x7f,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xff,0x76,0xec,0x3f,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xff,0x8e,0xed,0x4f,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xf8,0x7e,0xed,0x73,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xfa,0xfe,0x28,0x7c,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xfa,0x7d,0x08,0x7f,0x0f,0xff,0xff,0xf0,0x00,0xff,0xff,0xfe,0x2c,0xf8,0x81,0x3f,0xa1,0xff,0xff,0xf0,0x00,0xff,0xff,0xfe,0x9f,0x14,0xe1,0x3f,0x0d,0xff,0xff,0xf0,0x00,0xff,0xff,0xfe,0x3e,0x52,0xe1,0x3f,0x90,0xff,0xff,0xf0,0x00,0xff,0xff,0xfc,0x30,0x02,0xe1,0x3f,0x1c,0x7f,0xff,0xf0,0x00,0xff,0xff,0xfd,0xb0,0x82,0xe1,0x01,0x0d,0x0f,0xff,0xf0,0x00,0xff,0xff,0xfd,0xa3,0x82,0xe1,0x4e,0x8d,0x47,0xff,0xf0,0x00,0xff,0xff,0xfd,0xb3,0x82,0xe1,0x4e,0x0d,0x57,0xff,0xf0,0x00,0xff,0xff,0xfd,0x83,0x82,0xe1,0x4e,0x0d,0x57,0xff,0xf0,0x00,0xff,0xff,0xfd,0x83,0x02,0xe1,0x4e,0x0d,0x07,0xff,0xf0,0x00,0xff,0xff,0xfd,0x83,0x82,0xe5,0x4d,0x8d,0x03,0xff,0xf0,0x00,0xff,0xff,0xfd,0x83,0xe6,0xe5,0x4e,0x4c,0x93,0xff,0xf0,0x00,0xff,0xff,0xf5,0x83,0xe6,0x45,0x4e,0x2c,0x57,0xff,0xf0,0x00,0xff,0xff,0xf9,0x83,0xe6,0x04,0x4f,0x2c,0x57,0xff,0xf0,0x00,0xff,0xff,0xfd,0x83,0xe4,0xe4,0x47,0xe8,0x57,0xff,0xf0,0x00,0xff,0xff,0xfd,0x8f,0xe2,0x00,0x47,0xe9,0x57,0xff,0xf0,0x00,0xff,0xff,0xfc,0x9f,0x30,0x80,0x80,0x69,0x57,0xff,0xf0,0x00,0xff,0xff,0xfc,0x09,0x88,0x00,0x08,0x09,0x57,0xff,0xf0,0x00,0xff,0xff,0xfc,0x00,0x00,0x01,0x00,0x00,0xd7,0xff,0xf0,0x00,0xff,0xff,0xfe,0x20,0x40,0x00,0x00,0x00,0x47,0xff,0xf0,0x00,0xff,0xff,0xf8,0x03,0x40,0x00,0x00,0x00,0x87,0xff,0xf0,0x00,0xff,0xff,0xeb,0x80,0x10,0x00,0x00,0x00,0x3f,0xff,0xf0,0x00,0xff,0xff,0xda,0xf2,0x84,0x0a,0x00,0x0c,0xff,0xff,0xf0,0x00,0xff,0xff,0xba,0x00,0x40,0x90,0x07,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0x7c,0x06,0xc0,0x00,0x83,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0x74,0x01,0x00,0x00,0x09,0xff,0xff,0xff,0xf0,0x00,0xff,0xfe,0xf4,0x00,0x40,0x00,0x11,0xff,0xff,0xff,0xf0,0x00,0xff,0xfe,0xf4,0x00,0x0e,0x00,0x03,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xf0,0x01,0x3e,0x01,0x8f,0xff,0xff,0xff,0xf0,0x00,0xff,0xfd,0xe8,0x1f,0xbf,0x81,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xfd,0xe8,0x7f,0xff,0xc1,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xfd,0xe8,0xfb,0x1f,0xc1,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xfd,0xe9,0xfe,0x6f,0xc1,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xfd,0xf1,0xfc,0xef,0xc3,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xfd,0xd3,0xfc,0xaf,0xc3,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xd7,0xfd,0xaf,0xc3,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xfe,0xd7,0xfd,0xa0,0x03,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0x50,0x01,0xe8,0x03,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0x00,0x01,0x27,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0xff,0xff,0xff,0xf8,0x0f,0xff,0xff,0xff,0xff,0xff,0xf0,0x00 };
PGM_P bmp;
#endif

// drawBitmapFromSd() return values
#define BMP_OK       0 // ok
#define BMP_NO_FILE  1 // error: bitmap file not found on SD
#define BMP_NOT_WBM  2 // error: not a Windows Bitmap
#define BMP_NOT_1BPP 3 // error: not a monochrome bitmap
#define BMP_ERR_CMP  4 // error: compressed bitmap
#define BMP_TOO_BIG  5 // error: bitmap width > Gamebuino screen

// Various macros
#define WORD(AR,PO) (byte)AR[PO]+0x100L*(byte)AR[PO+1] // read word from char array AR at position PO
#define LONG(AR,PO) (byte)AR[PO]+0x100L*(byte)AR[PO+1]+0x10000L*(byte)AR[PO+2]+0x1000000L*(byte)AR[PO+3]

Gamebuino gb;

// Following two functions are needed by petit_fatfs
byte rx() { SPDR=0xFF; loop_until_bit_is_set(SPSR, SPIF); return SPDR; }
void tx(byte d) { SPDR=d; loop_until_bit_is_set(SPSR, SPIF); }

// Read 'n' bytes of bitmap data starting at position 'start' and put them in buffer buf[]
void readNCharsAt(byte n, word start, char *buf) {
  #ifdef debug // use PROGMEM dump of bitmap data
  for(byte i=0; i<n; i++) { buf[i]=pgm_read_byte(&(bmp[start+i])); }
  #else        // open real bitmap on SD
  WORD br; pf_lseek(start); pf_read((void*)&buf[0], n, &br);
  #endif
}

// Draw inverted-color bitmap from SRAM char array
void drawBitmap(byte x, byte y, char *bitmap) { // where bitmap[] is the char array containing bitmap data
  byte w=bitmap[0];
  byte h=bitmap[1];
  byte i,j,byteNum,bitNum,byteWidth=(w+7)>>3;
  for(i=0; i<w; i++) {
    byteNum=i/8; bitNum=i%8;
    for(j=0; j<h; j++) {
      if(!((bitmap[2+j*byteWidth+byteNum]) & (B10000000>>bitNum))) gb.display.drawPixel(x+i, y+j);
    }
  }
}

// Draw bitmap from SD at position x0, y0
int drawBitmapFromSd(byte x0, byte y0, char *bitmap) { // where bitmap[] is the name of the bitmap file on SD
  char buf[13]; // max 2 bytes for W/H + 11 bytes of data to cover the 84 pixel width of the  Gamebuino screen
  // 1. open bitmap file
  #ifdef debug // use PROGMEM dump of bitmap data
  if(bitmap=="ff.bmp") bmp=ff;
  else if(bitmap=="d2.bmp") bmp=d2;
  else if(bitmap=="d4.bmp") bmp=d4;
  else if(bitmap=="358.bmp") bmp=i358;
  else if(bitmap=="383.bmp") bmp=i383;
  else if(bitmap=="400.bmp") bmp=i400;
  else return BMP_NO_FILE;
  #else        // open real bitmap on SD
  if(pf_open(bitmap)) return BMP_NO_FILE;
  #endif
  // 2a. read information from bitmap header > identifier
  readNCharsAt(2,0,buf); // BMP.wIdentifier
  buf[2]=NULL;
  if(strcmp(buf,"BM")) return BMP_NOT_WBM;
  // 2b. read information from bitmap header > bpp, compression and data size
  readNCharsAt(10,28,buf); // BMP.wBitsPerPixel + BMP.dwCompression + BMP.dwDataSize
  if(WORD(buf,0)!=1) return BMP_NOT_1BPP; // not a 1bpp bitmap
  if(LONG(buf,2)) return BMP_ERR_CMP; // not an UNcompressed bitmap
  word datasize=WORD(buf,6);
  // 2c. read information from bitmap header > data offset
  readNCharsAt(4,10,buf); // BMP.dwDataOffset
  word offset=WORD(buf,0);
  // 2d. read information from bitmap header > dimensions
  readNCharsAt(8,18,buf); // BMP.dwWidth + BMP.dwHeight
  byte w=(byte)buf[0];
  if(w>LCDWIDTH) return BMP_TOO_BIG;
  byte h=(byte)buf[4];
  byte datalen=datasize/h;
  // 3. read and draw bitmap data
  buf[0]=w; buf[1]=1; // get bitmap data line by line
  for(byte y=0; y<h; y++) {
    readNCharsAt(datalen,offset+y*datalen,buf+2);
    drawBitmap(x0, y0+(h-1)-y, buf); // and draw it!
  }
  return BMP_OK;
}

byte slide;

void updateSlide() {
  int err;
  gb.display.clear();
  switch(slide) {
    case 0:
      err=drawBitmapFromSd(10,0,"ff.bmp");
      break;
    case 1:
      err=drawBitmapFromSd(10,5,"d2.bmp");
      err=drawBitmapFromSd(10,LCDHEIGHT-22,"d4.bmp");
      err=drawBitmapFromSd(LCDWIDTH-17,5,"d4.bmp");
      err=drawBitmapFromSd(LCDWIDTH-17,LCDHEIGHT-22,"d2.bmp");
      break;
    case 2:
      err=drawBitmapFromSd(0,0,"358.bmp");
      break;
    case 3:
      err=drawBitmapFromSd(0,0,"383.bmp");
      break;
    case 4:
      err=drawBitmapFromSd(0,0,"400.bmp");
      break;
  } // switch(slide)
  switch(err) {
    case BMP_NO_FILE: gb.display.println(F("bitmap not found")); break;
    case BMP_NOT_WBM: gb.display.println(F("not a Windows bitmap")); break;
    case BMP_NOT_1BPP: gb.display.println(F("not a monochrome bmp")); break;
    case BMP_ERR_CMP: gb.display.println(F("compressed bitmap")); break;
    case BMP_TOO_BIG: gb.display.println(F("bitmap too big")); break;
    case BMP_OK: default: break;
  } // switch(err)
  gb.display.cursorX=0; gb.display.cursorY=LCDHEIGHT-gb.display.fontHeight;
  gb.display.print(F("next bitmap \020 press \025"));
}

void setup() {
  // put your setup code here, to run once:
  gb.begin();
  #ifndef debug
  Serial.begin(9600); PFFS.begin(10, rx, tx); // initialize petit_fatfs
  #endif
  gb.titleScreen(F(" Draw bitmap from SD"), title);
  gb.setFrameRate(10);
  gb.display.persistence=true; // stop clearing screen at every gb.update()
  updateSlide();
}

void loop() {
  // put your main code here, to run repeatedly:
  if(gb.update() && gb.buttons.pressed(BTN_A)) { slide=(slide+1)%5; updateSlide(); }
} // loop()



A note on performance I'm assuming valdens code from the link in my 1st post he says the performance is faster than the gif which isn't bad. And I'm assuming he uses a standard Gamebuino hardware configuration, if so the 32 bit processor on the teensy3.2 or 3.6 should take care of the minuscule read and display time.

Edit ::::::::

Ok so say I want to do it my way by opening a txt file and reading it to get the bitmap data in hex or binary,.... If I'm reading the sad library right, I use SD.open() with the file path in the brackets then SD.read() with the name of the txt file inside it's brackets? Do I need a read txt function in it before I can call the bitmap function?
User avatar
Duhjoker
 
Posts: 446
Joined: Sat Jul 02, 2016 4:57 am
Location: Where Palm trees grow

Re: Loading bitmaps from SD

Postby naed » Thu Dec 01, 2016 11:50 pm

Been a bit busy and away from doing any actual work on my project but my next thing I'm trying to get working may interest you

viewtopic.php?f=13&t=3509#p12499

I'm going to try and see if it's possible to use the INF encoder to load some sprites from SD card, Clement says he's got an unstable version of this working and did provide us with some example code to look at

This may be an option for what you want, and as it's already built into the loader we shouldn't have to add anything to the libraries
User avatar
naed
 
Posts: 140
Joined: Tue May 31, 2016 3:18 pm

Re: Loading bitmaps from SD

Postby Duhjoker » Sat Dec 03, 2016 12:28 am

I'll be waiting with bells on my feet Naed!

In the meantime I would like to play around with mouguino's example. Since the drawbitmapfromSD should allow me use the tilemap functions and collision data too. Storing animated sprites should still be in Progmem as it will be faster but this should still be good for storing large non moving bitmaps and displaying the tilemaps.

The more I look at it the more I'm starting to understand but I'm not seeing how to open open the files for reading.

ok so im trying to integrate the code into my display files .cpp and .h. Now that I understand it a lil. Any way adding the two functions was easy enough for both files and adding the color arguments was a piece of cake but im a lil confused on how to update it to the tilemap functions. I have no idea what to do about it though.

ok look at this....

Code: Select all
//draw from SD  mouguino
// Draw bitmap from SD at position x0, y0
int drawBitmapFromSd(byte x0, byte y0, char *bitmap, uint16_t color) { // where bitmap[] is the name of the bitmap file on SD
   char buf[13]; // max 2 bytes for W/H + 11 bytes of data to cover the 84 pixel width of the  Gamebuino screen
              // 1. open bitmap file
#ifdef debug // use PROGMEM dump of bitmap data
   if (bitmap == "ff.bmp") bmp = ff;
   else if (bitmap == "d2.bmp") bmp = d2;
   else if (bitmap == "d4.bmp") bmp = d4;
   else if (bitmap == "358.bmp") bmp = i358;
   else if (bitmap == "383.bmp") bmp = i383;
   else if (bitmap == "400.bmp") bmp = i400;
   else return BMP_NO_FILE;
#else        // open real bitmap on SD
   if (pf_open(bitmap)) return BMP_NO_FILE;
#endif
   // 2a. read information from bitmap header > identifier
   readNCharsAt(2, 0, buf); // BMP.wIdentifier
   buf[2] = NULL;
   if (strcmp(buf, "BM")) return BMP_NOT_WBM;
   // 2b. read information from bitmap header > bpp, compression and data size
   readNCharsAt(10, 28, buf); // BMP.wBitsPerPixel + BMP.dwCompression + BMP.dwDataSize
   if (WORD(buf, 0) != 1) return BMP_NOT_1BPP; // not a 1bpp bitmap
   if (LONG(buf, 2)) return BMP_ERR_CMP; // not an UNcompressed bitmap
   word datasize = WORD(buf, 6);
   // 2c. read information from bitmap header > data offset
   readNCharsAt(4, 10, buf); // BMP.dwDataOffset
   word offset = WORD(buf, 0);
   // 2d. read information from bitmap header > dimensions
   readNCharsAt(8, 18, buf); // BMP.dwWidth + BMP.dwHeight
   byte w = (byte)buf[0];
   if (w>LCDWIDTH) return BMP_TOO_BIG;
   byte h = (byte)buf[4];
   byte datalen = datasize / h;
   // 3. read and draw bitmap data
   buf[0] = w; buf[1] = 1; // get bitmap data line by line
   for (byte y = 0; y<h; y++) {
      readNCharsAt(datalen, offset + y*datalen, buf + 2);
      drawBitmap(x0, y0 + (h - 1) - y, buf, color); // and draw it!
   }
   return BMP_OK;
}

byte slide;


at the bottom of the function, the drawbitmap function, the variables are listed differently than the gamebuinos and mine of course.

ok now on this tile map function.....

Code: Select all
void Display::drawTilemap(int x, int y, const uint8_t *tilemap, const uint8_t **spritesheet, uint8_t dx, uint8_t dy, uint8_t dw, uint8_t dh, uint16_t color) {
   uint8_t tilemap_width = pgm_read_byte(tilemap);
   uint8_t tilemap_height = pgm_read_byte(tilemap + 1);
   uint8_t tile_width = pgm_read_byte(tilemap + 2);
   uint8_t tile_height = pgm_read_byte(tilemap + 3);
   tilemap += 4; // now the first tiyleis at tilemap
   uint8_t ddw = dw + dx;
   uint8_t ddh = dh + dy;
   uint8_t maxDdx = (dw - x + tile_width - 1) / tile_width;
   uint8_t maxDdy = (dh - y + tile_height - 1) / tile_height;
   if (tilemap_width < maxDdx) {
      maxDdx = tilemap_width;
   }
   if (tilemap_height < maxDdy) {
      maxDdy = tilemap_height;
   }
   int8_t startDdx = (-x) / tile_width;
   int8_t startDdy = (-y) / tile_height;
   if (startDdx < 0) {
      startDdx = 0;
   }
   if (startDdy < 0) {
      startDdy = 0;
   }
   if (flagcollision)numcolision = 0;                                 //Line 735 - clear numcolision - ADD by Summoner123

   for (uint8_t ddy = startDdy; ddy < maxDdy; ddy++) {
      for (uint8_t ddx = startDdx; ddx < maxDdx; ddx++) {
         int8_t drawX = ddx*tile_width + x + dx;
         int8_t drawY = ddy*tile_height + y + dy;
         uint8_t tile = pgm_read_byte(tilemap + ddy*tilemap_width + ddx);
         if (drawX >= dx && drawY >= dy && drawX <= (ddw - tile_width) && drawY <= (ddh - tile_height)) {
//this            drawBitmap1(drawX, drawY, spritesheet[tile], tile_width, tile_height, color);

            if (flagcollision) {
               solid[numcolision].x = drawX;                     //Save X coordinate      - ADD by Summoner123
               solid[numcolision].y = drawY;                     //Save Y coordinate      - ADD by Summoner123
               solid[numcolision].spritecol = spritesheet[tile]; //Save Sprite of tile    - ADD by Summoner123
               numcolision++;                                    //Increment numcolision  - ADD by Summoner123
            }
         }
         else { // we need to draw a partial bitmap
//this            drawBitmap(drawX, drawY, tile_width, tile_height, spritesheet[tile], dx, dy, dw, dh, color);
         }
      }
   }
}


all right so if I want to use the tilemap with it I need to change these two lines

drawBitmap1(drawX, drawY, spritesheet[tile], tile_width, tile_height, color);

drawBitmap(drawX, drawY, tile_width, tile_height, spritesheet[tile], dx, dy, dw, dh, color);

ok so the first line is easy enough it uses the drawbitmap1 command I have for the color library. but I want it work with the new drawfrom sd command so do I make it read...

drawBitmapFromSD(x0, y0 + (h - 1) - y, buf, spritesheet[tile], tile_width, tile_height, color);

and the second goes like this?

drawBitmap(x0, y0 + (h - 1) - y, buf, tile_width, tile_height, spritesheet[tile], dx, dy, dw, dh, color);

Or how can I make a tilemap using the above code and how do I give them collision

Edit:::: when ever I try to compile mouguino's code I get a bunch of errors snout the petitfatfs and the declarations of byte. I could use some help please.

Edit the byte problem was coming from the teensy 3.2's print.h for some reason it had Byte in the file but I don't know how to fix it.

Other than that I guess the first part should have been getting the function to work. What is up with Int in front of the drawbitmapfromSD? Can that be void? Also the draw from SD commands use byte instead of int8_t. Can this be changed.

Edit:::::
Dec 5th 2016

I've almost got it. I had to change some stuff but I'm closer. The problem lies in the RX TX stuff at the top that says it's needed for the petitfatfs to work. It says that loop until set is not declared in this scope and points to the spif in the ().
User avatar
Duhjoker
 
Posts: 446
Joined: Sat Jul 02, 2016 4:57 am
Location: Where Palm trees grow

Re: Loading bitmaps from SD

Postby mougino » Tue Dec 06, 2016 5:35 pm

Hi Joker, it's been a long time I didn't touch this code, but from memory I made some changes to the gamebuino library to make it work.
Have you tried with my modified lib for Gamebookuino ?
https://github.com/mougino/Gamebookuino

Nicolas
User avatar
mougino
 
Posts: 75
Joined: Sat Jul 25, 2015 8:15 am
Location: Paris, France

Re: Loading bitmaps from SD

Postby Sutchig » Tue Dec 06, 2016 6:14 pm

I had to include #include <diskio.h> too, to make petitfatfs work.

Code: Select all
#include <diskio.h>
#include <integer.h>
#include <petit_fatfs.h>
#include <pff.h>
Sutchig
 
Posts: 67
Joined: Sat May 23, 2015 3:48 pm

Next

Return to Programming Questions

Who is online

Users browsing this forum: No registered users and 16 guests

cron