PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

PokittoLib

Library for programming Pokitto hardware

How to Use

  1. Import this library to online compiler (see button "import" on the right hand side
  2. DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
  3. Change My_settings.h according to your project
  4. Start coding!
Committer:
Pokitto
Date:
Wed Dec 25 23:59:52 2019 +0000
Revision:
71:531419862202
Parent:
58:5f58a2846a20
Changed Mode2 C++ refresh code (graphical errors)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pokitto 23:f88837b8f914 1 #include <stdio.h>
Pokitto 23:f88837b8f914 2 #include <ctype.h>
Pokitto 23:f88837b8f914 3 #include <stdlib.h>
Pokitto 23:f88837b8f914 4 #include <string.h>
Pokitto 23:f88837b8f914 5 #include <stdint.h>
Pokitto 23:f88837b8f914 6 #include "helpers.h"
Pokitto 23:f88837b8f914 7
Pokitto 23:f88837b8f914 8 #define _MAX_DRIVE 3
Pokitto 23:f88837b8f914 9 #define _MAX_DIR 256
Pokitto 23:f88837b8f914 10 #define _MAX_FNAME 256
Pokitto 23:f88837b8f914 11 #define _MAX_EXT 256
Pokitto 23:f88837b8f914 12
Pokitto 23:f88837b8f914 13 #include <ctype.h>
Pokitto 23:f88837b8f914 14
Pokitto 23:f88837b8f914 15 char* _strupr( char* s )
Pokitto 23:f88837b8f914 16 {
Pokitto 23:f88837b8f914 17 char* p = s;
Pokitto 58:5f58a2846a20 18 while (*p){ *p = toupper( *p );p++;}
Pokitto 23:f88837b8f914 19 return s;
Pokitto 23:f88837b8f914 20 }
Pokitto 23:f88837b8f914 21
Pokitto 23:f88837b8f914 22 typedef struct tagRGBQUAD {
Pokitto 23:f88837b8f914 23 uint8_t rgbBlue;
Pokitto 23:f88837b8f914 24 uint8_t rgbGreen;
Pokitto 23:f88837b8f914 25 uint8_t rgbRed;
Pokitto 23:f88837b8f914 26 uint8_t rgbReserved;
Pokitto 23:f88837b8f914 27 } RGBQUAD;
Pokitto 23:f88837b8f914 28
Pokitto 23:f88837b8f914 29 typedef struct tagBITMAPFILEHEADER {
Pokitto 23:f88837b8f914 30 int16_t bfType;
Pokitto 23:f88837b8f914 31 int32_t bfSize;
Pokitto 23:f88837b8f914 32 int16_t bfReserved1;
Pokitto 23:f88837b8f914 33 int16_t bfReserved2;
Pokitto 23:f88837b8f914 34 int32_t bfOffBits;
Pokitto 23:f88837b8f914 35 } __attribute__((packed)) BITMAPFILEHEADER, *PBITMAPFILEHEADER;
Pokitto 23:f88837b8f914 36
Pokitto 23:f88837b8f914 37 #define BI_RLE4 2
Pokitto 23:f88837b8f914 38 typedef struct tagBITMAPINFOHEADER {
Pokitto 23:f88837b8f914 39 int32_t biSize;
Pokitto 23:f88837b8f914 40 int32_t biWidth;
Pokitto 23:f88837b8f914 41 int32_t biHeight;
Pokitto 23:f88837b8f914 42 int16_t biPlanes;
Pokitto 23:f88837b8f914 43 int16_t biBitCount;
Pokitto 23:f88837b8f914 44 int32_t biCompression;
Pokitto 23:f88837b8f914 45 int32_t biSizeImage;
Pokitto 23:f88837b8f914 46 int32_t biXPelsPerMeter;
Pokitto 23:f88837b8f914 47 int32_t biYPelsPerMeter;
Pokitto 23:f88837b8f914 48 int32_t biClrUsed;
Pokitto 23:f88837b8f914 49 int32_t biClrImportant;
Pokitto 23:f88837b8f914 50 } __attribute__((packed)) BITMAPINFOHEADER, *PBITMAPINFOHEADER;
Pokitto 23:f88837b8f914 51
Pokitto 23:f88837b8f914 52 typedef struct tagBITMAPINFO {
Pokitto 23:f88837b8f914 53 BITMAPINFOHEADER bmiHeader;
Pokitto 23:f88837b8f914 54 RGBQUAD bmiColors[1];
Pokitto 23:f88837b8f914 55 } __attribute__((packed)) BITMAPINFO, *PBITMAPINFO;
Pokitto 23:f88837b8f914 56
Pokitto 23:f88837b8f914 57 RGBQUAD myColors[257];
Pokitto 23:f88837b8f914 58
Pokitto 23:f88837b8f914 59
Pokitto 23:f88837b8f914 60