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
- Import this library to online compiler (see button "import" on the right hand side
- DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
- Change My_settings.h according to your project
- Start coding!
Diff: POKITTO_CORE/PokittoDisplay.cpp
- Revision:
- 60:8b6a110feeea
- Parent:
- 52:c04087025cab
- Child:
- 64:1d52d8287c39
--- a/POKITTO_CORE/PokittoDisplay.cpp Sun Oct 07 10:10:24 2018 +0000 +++ b/POKITTO_CORE/PokittoDisplay.cpp Sun Oct 07 10:19:52 2018 +0000 @@ -532,10 +532,10 @@ uint16_t j = POK_BITFRAME; if (bgcolor & 0x1) memset((void*)m_scrbuf,0xFF,j);// R else memset((void*)m_scrbuf,0x00,j);// R - if ((bgcolor>>1) & 0x1) memset((void*)m_scrbuf+POK_BITFRAME,0xFF,j);// G - else memset((void*)m_scrbuf+POK_BITFRAME,0x00,j);// G - if ((bgcolor>>2) & 0x1) memset((void*)m_scrbuf+POK_BITFRAME*2,0xFF,j);// B - else memset((void*)m_scrbuf+POK_BITFRAME*2,0x00,j);// B + if ((bgcolor>>1) & 0x1) memset((void*)((uint8_t*)m_scrbuf+POK_BITFRAME),0xFF,j);// G + else memset((void*)((uint8_t*)m_scrbuf+POK_BITFRAME),0x00,j);// G + if ((bgcolor>>2) & 0x1) memset((void*)((uint8_t*)m_scrbuf+POK_BITFRAME*2),0xFF,j);// B + else memset((void*)((uint8_t*)m_scrbuf+POK_BITFRAME*2),0x00,j);// B setCursor(0,0); return; } else { @@ -1492,11 +1492,10 @@ /** 3 bpp mode */ else if (m_colordepth==3) { - int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3; + int16_t i, j, byteNum, byteWidth = (w + 7) >> 3; int16_t bitFrame = w * h / 8; for (i = 0; i < w; i++) { byteNum = i / 8; - bitNum = i % 8; uint8_t bitcount=0; for (j = 0; j <= h/8; j++) { @@ -1592,15 +1591,14 @@ /** 4bpp fast version */ if (m_colordepth==8) { - int16_t scrx,scry,xclip,xjump,scrxjump; - xclip=xjump=scrxjump=0; + int16_t scrx,scry,xjump,scrxjump; + xjump=scrxjump=0; /** y clipping */ if (y<0) { h+=y; bitmap -= y*w; y=0;} else if (y+h>height) { h -=(y-height);} /** x clipping */ - if (x<0) { xclip=x; w+=x; xjump = (-x); bitmap += xjump; x=0;} + if (x<0) { w+=x; xjump = (-x); bitmap += xjump; x=0;} else if (x+w>width) { - xclip = x; scrxjump = x; xjump=(x+w-width)+scrxjump; w = width-x;}