Then I added functions to draw blocks and boxes:
void draw_block (u8* fbAdr, int posx, int posy, int length, int width, int color, int max_width)
{
int x,y;
for (x=posx; (x < posx+length) && (x < max_width); x++)
for (y=posy; (y < posy+width) && (y < HEIGHT);y++)
{...