Pokitto::Display Class Reference

Static Public Member Functions

static void setColorDepth (uint8_t)
 
static uint8_t getColorDepth ()
 
static uint8_t getBitsPerPixel ()
 
static uint16_t getWidth ()
 
static uint16_t getHeight ()
 
static uint8_t getNumberOfColors ()
 
static void setColor (uint8_t)
 
static void setColor (uint8_t, uint8_t)
 
static void setInvisibleColor (uint16_t)
 
static uint8_t getColor ()
 
static uint8_t getBgColor ()
 
static uint16_t getInvisibleColor ()
 
static void begin ()
 
static void clear ()
 
static void scroll (int16_t)
 
static void fillScreen (uint16_t)
 
static void update ()
 
static void lcdRefresh (unsigned char *)
 
static void clearLCD ()
 
static void fillLCD (uint16_t)
 
static void showLogo ()
 
static void setFrameBufferTo (uint8_t *)
 
static void setDefaultPalette ()
 
static uint16_t RGBto565 (uint8_t, uint8_t, uint8_t)
 
static uint16_t interpolateColor (uint16_t, uint16_t, uint8_t)
 
static void loadRGBPalette (const unsigned char *)
 
static void load565Palette (const uint16_t *)
 
static void rotatePalette (int8_t)
 
static void tweenPalette (uint16_t *, const uint16_t *, const uint16_t *, uint8_t)
 
static void directPixel (int16_t, int16_t, uint16_t)
 
static void directRectangle (int16_t, int16_t, int16_t, int16_t, uint16_t)
 
static void setCursor (int16_t, int16_t)
 
static void directBitmap (int16_t, int16_t, const uint8_t *, uint8_t, uint8_t)
 
static void drawPixel (int16_t, int16_t)
 
static void drawPixel (int16_t x, int16_t y, uint8_t col)
 
static uint8_t getPixel (int16_t, int16_t)
 
static void drawLine (int16_t, int16_t, int16_t, int16_t)
 
static uint8_t clipLine (int16_t *, int16_t *, int16_t *, int16_t *)
 
static void drawColumn (int16_t, int16_t, int16_t)
 
static void map1BitColumn (int16_t, int16_t, int16_t, const uint8_t *, uint16_t)
 
static void drawRow (int16_t, int16_t, int16_t)
 
static void drawFastVLine (int16_t, int16_t, int16_t)
 
static void drawFastHLine (int16_t, int16_t, int16_t)
 
static void drawRectangle (int16_t, int16_t, int16_t, int16_t)
 
static void fillRectangle (int16_t, int16_t, int16_t, int16_t)
 
static void fillRect (int16_t x, int16_t y, int16_t w, int16_t h)
 
static void drawRect (int16_t x, int16_t y, int16_t w, int16_t h)
 
static void drawCircle (int16_t x0, int16_t y0, int16_t r)
 
static void drawCircleHelper (int16_t x0, int16_t y0, int16_t r, uint16_t cornername)
 
static void fillCircle (int16_t x0, int16_t y0, int16_t r)
 
static void fillCircleHelper (int16_t x0, int16_t y0, int16_t r, uint16_t cornername, int16_t delta)
 
static void drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2)
 
static void fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2)
 
static void drawRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius)
 
static void fillRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius)
 
static void drawMonoBitmap (int16_t x, int16_t y, const uint8_t *bitmap, uint8_t index)
 
static void drawBitmapData (int16_t x, int16_t y, int16_t w, int16_t h, const uint8_t *bitmap)
 
static void drawBitmap (int16_t x, int16_t y, const uint8_t *bitmap)
 
static void drawRleBitmap (int16_t x, int16_t y, const uint8_t *bitmap)
 
static void drawBitmap (int16_t x, int16_t y, const uint8_t *bitmap, uint8_t frame)
 
static void drawBitmapXFlipped (int16_t x, int16_t y, const uint8_t *bitmap)
 
static void drawBitmap (int16_t x, int16_t y, const uint8_t *bitmap, uint8_t rotation, uint8_t flip)
 
static uint8_t * getBuffer ()
 
static uint8_t getBitmapPixel (const uint8_t *, uint16_t, uint16_t)
 
static void draw4BitColumn (int16_t x, int16_t y, uint8_t h, uint8_t *bitmap)
 
static int directChar (int16_t, int16_t, uint16_t)
 
static int bufferChar (int16_t, int16_t, uint16_t)
 
static void setFont (const unsigned char *f)
 
static void drawChar (int8_t x, int8_t y, unsigned char c, uint8_t size)
 
static void enableDirectPrinting (uint8_t m)
 
static bool isDirectPrintingEnabled ()
 
static int print_char (uint8_t x, uint8_t y, unsigned char c)
 
static void set_cursor (uint8_t, uint8_t)
 
static void write (uint8_t)
 
static void write (const char *str)
 
static void write (const uint8_t *buffer, uint8_t size)
 
static void print (const char[])
 
static void print (char, int base=0)
 
static void print (unsigned char, int base=0)
 
static void print (int, int base=10)
 
static void print (unsigned int, int base=10)
 
static void print (long, int base=10)
 
static void print (unsigned long, int base=10)
 
static void print (double, int base=2)
 
static void print (uint8_t, uint8_t, const char[])
 
static void print (uint8_t, uint8_t, char, int=0)
 
static void print (uint8_t, uint8_t, unsigned char, int=0)
 
static void print (uint8_t, uint8_t, int, int=10)
 
static void print (uint8_t, uint8_t, unsigned int, int=10)
 
static void print (uint8_t, uint8_t, long, int=10)
 
static void print (uint8_t, uint8_t, unsigned long, int=10)
 
static void print (uint8_t, uint8_t, double, int=2)
 
static void println (uint8_t, uint8_t, const char[])
 
static void println (uint8_t, uint8_t, char, int=0)
 
static void println (uint8_t, uint8_t, unsigned char, int=0)
 
static void println (uint8_t, uint8_t, int, int=10)
 
static void println (uint8_t, uint8_t, unsigned int, int=10)
 
static void println (uint8_t, uint8_t, long, int=10)
 
static void println (uint8_t, uint8_t, unsigned long, int=10)
 
static void println (uint8_t, uint8_t, double, int=2)
 
static void println (uint8_t, uint8_t)
 
static void println (const char[])
 
static void println (char, int=0)
 
static void println (unsigned char, int=0)
 
static void println (int, int=10)
 
static void println (unsigned int, int=10)
 
static void println (long, int=10)
 
static void println (unsigned long, int=10)
 
static void println (double, int=2)
 
static void println (void)
 
static void inc_txtline ()
 
static void printNumber (unsigned long, uint8_t)
 
static void printFloat (double, uint8_t)
 
static void loadTileset (const uint8_t *)
 
static void setTileBufferTo (uint8_t *)
 
static void clearTileBuffer ()
 
static void shiftTileBuffer (int8_t, int8_t)
 
static void setTile (uint16_t, uint8_t)
 
static uint8_t getTile (uint16_t)
 
static uint8_t getTile (uint8_t, uint8_t)
 

Static Public Attributes

static uint8_t width = POK_LCD_W
 
static uint8_t height = POK_LCD_H
 
static uint8_t screenbuffer []
 
static const unsigned char * font
 
static uint8_t persistence = 0
 
static uint16_t color = 1
 
static uint16_t bgcolor = 0
 
static uint16_t invisiblecolor = 17
 
static uint16_t directcolor =0xFFFF
 
static uint16_t directbgcolor =0x0
 
static uint16_t palette [PALETTE_SIZE]
 
static uint16_t * paletteptr
 
static uint8_t fontWidth
 
static uint8_t fontHeight
 
static bool textWrap =true
 
static int16_t cursorX
 
static int16_t cursorY
 
static uint8_t fontSize =1
 
static int8_t adjustCharStep = 1
 
static int8_t adjustLineStep = 1
 
static bool fixedWidthFont = false
 

Member Function Documentation

◆ begin()

void Display::begin ( )
static

Initialize display

◆ bufferChar()

int Display::bufferChar ( int16_t  x,
int16_t  y,
uint16_t  index 
)
static

character to screenbuffer

◆ clear()

void Display::clear ( )
static

Clear display buffer

◆ clearLCD()

void Display::clearLCD ( )
static

Clear LCD hardware memory

◆ clipLine()

uint8_t Display::clipLine ( int16_t *  x0,
int16_t *  y0,
int16_t *  x1,
int16_t *  y1 
)
static

Clip line with screen boundaries, returns 0 if whole line is out of bounds

◆ directBitmap()

void Display::directBitmap ( int16_t  x,
int16_t  y,
const uint8_t *  bitmap,
uint8_t  depth,
uint8_t  scale 
)
static

direct bitmap to screen (no buffering)

◆ directChar()

int Display::directChar ( int16_t  x,
int16_t  y,
uint16_t  index 
)
static

direct character to screen (no buffering)

◆ directPixel()

void Display::directPixel ( int16_t  x,
int16_t  y,
uint16_t  color 
)
static

Direct pixel (not through display buffer)

◆ directRectangle()

void Display::directRectangle ( int16_t  x,
int16_t  y,
int16_t  x2,
int16_t  y2,
uint16_t  color 
)
static

Direct rectangle (not through display buffer)

◆ draw4BitColumn()

void Display::draw4BitColumn ( int16_t  x,
int16_t  y,
uint8_t  h,
uint8_t *  bitmap 
)
static

Optimized functions for drawing bit columns - used in raytracing

ONLY 4-bit mode for time being

EVEN pixel starting line, very simple, just copypaste

ODD pixel starting line

◆ drawBitmap() [1/3]

void Display::drawBitmap ( int16_t  x,
int16_t  y,
const uint8_t *  bitmap 
)
static

Draw bitmap

◆ drawBitmap() [2/3]

void Display::drawBitmap ( int16_t  x,
int16_t  y,
const uint8_t *  bitmap,
uint8_t  frame 
)
static

Draw animated bitmap frame

visibility check

1 bpp mode

2 bpp mode

4bpp fast version

y clipping

x clipping

ONLY 4-bit mode for time being

EVEN pixel starting line, very simple, just copypaste

last pixel is odd pixel due to clipping & odd width

ODD pixel starting line

◆ drawBitmap() [3/3]

void Display::drawBitmap ( int16_t  x,
int16_t  y,
const uint8_t *  bitmap,
uint8_t  rotation,
uint8_t  flip 
)
static

Draw bitmap with options

◆ drawBitmapData()

void Display::drawBitmapData ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
const uint8_t *  bitmap 
)
static

Draw bitmap data

visibility check

1 bpp mode

2 bpp mode

4bpp fast version

y clipping

x clipping

ONLY 4-bit mode for time being

EVEN pixel starting line, very simple, just copypaste

last pixel is odd pixel due to clipping & odd width

ODD pixel starting line

◆ drawBitmapXFlipped()

void Display::drawBitmapXFlipped ( int16_t  x,
int16_t  y,
const uint8_t *  bitmap 
)
static

Draw bitmap flipped on x-axis

visibility check

1 bpp mode

2 bpp mode

4bpp fast version

y clipping

x clipping

ONLY 4-bit mode for time being

EVEN pixel starting line, very simple, just copypaste

last pixel is odd pixel due to clipping & odd width

ODD pixel starting line

◆ drawChar()

void Display::drawChar ( int8_t  x,
int8_t  y,
unsigned char  c,
uint8_t  size 
)
static

GB compatibility drawChar

◆ drawCircle()

void Display::drawCircle ( int16_t  x0,
int16_t  y0,
int16_t  r 
)
static

Draw circle

◆ drawCircleHelper()

void Display::drawCircleHelper ( int16_t  x0,
int16_t  y0,
int16_t  r,
uint16_t  cornername 
)
static

Draw circle helper

◆ drawColumn()

void Display::drawColumn ( int16_t  x,
int16_t  sy,
int16_t  ey 
)
static

Draw a column real fast

◆ drawFastHLine()

void Display::drawFastHLine ( int16_t  x,
int16_t  y,
int16_t  w 
)
static

Legacy drawRow name, for compatibility - macros are not OK because of scope problems

◆ drawFastVLine()

void Display::drawFastVLine ( int16_t  x,
int16_t  y,
int16_t  h 
)
static

Legacy drawColumn name, for compatibility - macros are not OK because of scope problems

◆ drawLine()

void Display::drawLine ( int16_t  x0,
int16_t  y0,
int16_t  x1,
int16_t  y1 
)
static

Draw line

◆ drawMonoBitmap()

void Display::drawMonoBitmap ( int16_t  x,
int16_t  y,
const uint8_t *  bitmap,
uint8_t  index 
)
static

Draw monochromatic bitmap. Used in font rendering

not gamebuino

EVEN pixel starting line

ODD pixel starting line

◆ drawPixel() [1/2]

void Display::drawPixel ( int16_t  x,
int16_t  y 
)
static

Draw pixel at various bit depths

NOT Gamebuino

◆ drawPixel() [2/2]

void Display::drawPixel ( int16_t  x,
int16_t  y,
uint8_t  col 
)
static

Draw pixel with specific color index at various bit depths

◆ drawRect()

void Display::drawRect ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h 
)
static

GB compatibility drawRect

◆ drawRectangle()

void Display::drawRectangle ( int16_t  x0,
int16_t  y0,
int16_t  w,
int16_t  h 
)
static

Draw rectangle (edges only)

◆ drawRleBitmap()

void Display::drawRleBitmap ( int16_t  x,
int16_t  y,
const uint8_t *  bitmap 
)
static

Draw RLE bitmap

Escape or absolute mode

Absolute mode. Copy pixels from the source bitmap to the target screen.

Encoded mode. Duplicate one pixel pair to the all required pixels on the target screen

◆ drawRoundRect()

void Display::drawRoundRect ( int16_t  x0,
int16_t  y0,
int16_t  w,
int16_t  h,
int16_t  radius 
)
static

Draw rounded rectangle

◆ drawRow()

void Display::drawRow ( int16_t  x0,
int16_t  x1,
int16_t  y 
)
static

Draw a row real fast

◆ drawTriangle()

void Display::drawTriangle ( int16_t  x0,
int16_t  y0,
int16_t  x1,
int16_t  y1,
int16_t  x2,
int16_t  y2 
)
static

draw triangle

◆ fillCircle()

void Display::fillCircle ( int16_t  x0,
int16_t  y0,
int16_t  r 
)
static

Fill circle

◆ fillCircleHelper()

void Display::fillCircleHelper ( int16_t  x0,
int16_t  y0,
int16_t  r,
uint16_t  cornername,
int16_t  delta 
)
static

Fill circle helper

◆ fillLCD()

void Display::fillLCD ( uint16_t  c)
static

Fill LCD hardware memory

◆ fillRect()

void Display::fillRect ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h 
)
static

GB compatibility fillRect

◆ fillRectangle()

void Display::fillRectangle ( int16_t  x0,
int16_t  y0,
int16_t  w,
int16_t  h 
)
static

Fill rectangle

◆ fillRoundRect()

void Display::fillRoundRect ( int16_t  x0,
int16_t  y0,
int16_t  w,
int16_t  h,
int16_t  radius 
)
static

Fill rounded rectangle

◆ fillScreen()

void Display::fillScreen ( uint16_t  c)
static

Fill display buffer

◆ fillTriangle()

void Display::fillTriangle ( int16_t  x0,
int16_t  y0,
int16_t  x1,
int16_t  y1,
int16_t  x2,
int16_t  y2 
)
static

Fill triangle

◆ getBgColor()

uint8_t Display::getBgColor ( )
static

get background color

◆ getBitmapPixel()

uint8_t Display::getBitmapPixel ( const uint8_t *  bitmap,
uint16_t  x,
uint16_t  y 
)
static

Get pixel in a monochromatic bitmap - GB compatibility

◆ getBuffer()

uint8_t * Display::getBuffer ( )
static

Get pointer to the screen buffer - GB compatibility

◆ getColor()

uint8_t Display::getColor ( )
static

get color

◆ getInvisibleColor()

uint16_t Display::getInvisibleColor ( )
static

get invisible color

◆ getPixel()

uint8_t Display::getPixel ( int16_t  x,
int16_t  y 
)
static

Get pixel at various bit depths

not gamebuino

◆ interpolateColor()

uint16_t Display::interpolateColor ( uint16_t  c1,
uint16_t  c2,
uint8_t  factor 
)
static

linear interpolation between colors

◆ lcdRefresh()

void Display::lcdRefresh ( unsigned char *  scr)
static

Forced update of LCD display memory with a given pixel buffer

◆ load565Palette()

void Display::load565Palette ( const uint16_t *  p)
static

load a ready-made 565 palette

◆ loadRGBPalette()

void Display::loadRGBPalette ( const unsigned char *  p)
static

load an R,G,B triplet palette

◆ loadTileset()

void Display::loadTileset ( const uint8_t *  ts)
static

Tiled mode functions

◆ map1BitColumn()

void Display::map1BitColumn ( int16_t  x,
int16_t  sy,
int16_t  ey,
const uint8_t *  bitmap,
uint16_t  column 
)
static

Map a 1-bit column real fast

◆ RGBto565()

uint16_t Display::RGBto565 ( uint8_t  R,
uint8_t  G,
uint8_t  B 
)
static

convert RGB to 565 color value

◆ rotatePalette()

void Display::rotatePalette ( int8_t  step)
static

rotate palette by step

◆ scroll()

void Display::scroll ( int16_t  pixelrows)
static

Scroll by x lines

◆ setColor() [1/2]

void Display::setColor ( uint8_t  c)
static

set color with a command

◆ setColor() [2/2]

void Display::setColor ( uint8_t  c,
uint8_t  bgc 
)
static

set color and bgcolor with a command

◆ setCursor()

void Display::setCursor ( int16_t  x,
int16_t  y 
)
static

Set the cursor for printing to a certain screen position

◆ setDefaultPalette()

void Display::setDefaultPalette ( )
static

set default palette

◆ setFont()

void Display::setFont ( const unsigned char *  f)
static

set the active font

◆ setFrameBufferTo()

void Display::setFrameBufferTo ( uint8_t *  sb)
static

Point to another screenbuffer instead of the default one

◆ setInvisibleColor()

void Display::setInvisibleColor ( uint16_t  c)
static

set invisiblecolor with a command

◆ showLogo()

static void Pokitto::Display::showLogo ( )
static

Show Pokitto logo at startup

◆ tweenPalette()

void Display::tweenPalette ( uint16_t *  ram_pal,
const uint16_t *  pal_1,
const uint16_t *  pal_2,
uint8_t  factor 
)
static

tween between two palettes

◆ update()

void Display::update ( )
static

Send display buffer to display hardware

draw volume bar if visible

Member Data Documentation

◆ bgcolor

uint16_t Display::bgcolor = 0
static

Selected background color

◆ color

uint16_t Display::color = 1
static

Selected drawing color

◆ directbgcolor

uint16_t Display::directbgcolor =0x0
static

Direct unbuffered background color

◆ directcolor

uint16_t Display::directcolor =0xFFFF
static

Direct unbuffered color

◆ font

const unsigned char * Display::font
static

Selected font

◆ fontWidth

uint8_t Display::fontWidth
static

font dimensions

◆ invisiblecolor

uint16_t Display::invisiblecolor = 17
static

Selected invisible color

◆ palette

uint16_t Display::palette
static

master palette

◆ paletteptr

uint16_t * Display::paletteptr
static

runtime palette pointer

◆ persistence

uint8_t Display::persistence = 0
static

Set if screen is cleared between updates or not

◆ textWrap

bool Display::textWrap =true
static

text wrapping


The documentation for this class was generated from the following files: