PAlib
Macros | Functions
Fake 16bit bitmap mode

Macros

#define PA_LoadFake16bitBitmap(screen, bitmap)
 Load a 16 bit bitmap into a fake 16 bit background.
 
#define PA_ClearFake16bitBg(screen)   dmaFillWords(0, (void*)PA_DrawFake16[screen], 256*192*2)
 Clear a fake 16 bit background.
 
#define PA_PutFake16bitPixel(screen, x, y, color)   PA_DrawFake16[screen][(x) + 256 * (y)] = color
 Plots a pixel into a fake 16 bit background.
 
#define PA_GetFake16bitPixel(screen, x, y)   PA_DrawFake16[screen][(x) + 256 * (y)]
 Gets the color of a specified pixel of a fake 16 bit background.
 
#define PA_DrawFake16bitRect(screen, x1, y1, x2, y2, color)
 Draws a rectangle on a fake 16 bit background.
 
#define PA_Fake16bitLoadBmpEx(screen, bmp, x, y)   PA_LoadBmpToBuffer(PA_DrawFake16[screen], x, y, bmp, 256)
 Load a BMP on a fake 16 bit background... Don't forget to Init the background !
 
#define PA_Fake16bitLoadBmp(screen, bmp)   PA_Fake16bitLoadBmpEx(screen, bmp, 0, 0)
 Load a BMP on a fake 16 bit background... Don't forget to Init the background !
 
#define PA_Fake16bitLoadGif(screen, gif)   PA_Fake16bitLoadGifXY(screen, gif, 0, 0)
 Load a Gif on a fake 16 bit background... Don't forget to Init the background !
 
#define PA_Fake16bitLoadJpeg(screen, jpeg)   JPEG_DecompressImage((u8*)jpeg, PA_DrawFake16[screen], 256, 192)
 Load a jpeg on a fake 16 bit background... Don't forget to Init the background !
 

Functions

void PA_InitFake16bitBg (u8 screen, u8 prio)
 Initialize a fake 16 bit background.
 
void PA_DrawFake16bitLine (u8 screen, u16 x1, u16 y1, u16 x2, u16 y2, u16 color)
 Draws a line on a fake 16 bit background.
 

Detailed Description

Functions to handle fake 16 bit backgrounds that take up less memory than real ones!

Macro Definition Documentation

◆ PA_LoadFake16bitBitmap

#define PA_LoadFake16bitBitmap (   screen,
  bitmap 
)
Value:
do{ \
DC_FlushRange(bitmap, 256 * 192 * 2); \
dmaCopy(bitmap, (void*)PA_DrawFake16[screen], 256 * 192 * 2); \
} while(0)

Load a 16 bit bitmap into a fake 16 bit background.

Parameters
screenChoose the screen (0 or 1)
bitmapBitmap name

◆ PA_ClearFake16bitBg

#define PA_ClearFake16bitBg (   screen)    dmaFillWords(0, (void*)PA_DrawFake16[screen], 256*192*2)

Clear a fake 16 bit background.

Parameters
screenChoose the screen (0 or 1)

◆ PA_PutFake16bitPixel

#define PA_PutFake16bitPixel (   screen,
  x,
  y,
  color 
)    PA_DrawFake16[screen][(x) + 256 * (y)] = color

Plots a pixel into a fake 16 bit background.

Parameters
screenChoose the screen (0 or 1)
xX position of the point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
yY position of the point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
color15 bits color. You can use the PA_RGB macro to set the RGB values...

◆ PA_GetFake16bitPixel

#define PA_GetFake16bitPixel (   screen,
  x,
 
)    PA_DrawFake16[screen][(x) + 256 * (y)]

Gets the color of a specified pixel of a fake 16 bit background.

Parameters
screenChoose the screen (0 or 1)
xX position of the point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
yY position of the point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results

◆ PA_DrawFake16bitRect

#define PA_DrawFake16bitRect (   screen,
  x1,
  y1,
  x2,
  y2,
  color 
)
Value:
do{\
PA_DrawFake16bitLine(screen, x1, y1, x2, y1, color);\
PA_DrawFake16bitLine(screen, x1, y1, x1, y2, color);\
PA_DrawFake16bitLine(screen, x2, y1, x2, y2, color);\
PA_DrawFake16bitLine(screen, x1, y2, x2, y2, color);}while(0)

Draws a rectangle on a fake 16 bit background.

Parameters
screenChoose the screen (0 or 1)
x1X position of the first point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y1Y position of the first point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
x2X position of the second point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y2Y position of the second point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
color15 bits color. You can use the PA_RGB macro to set the RGB values...

◆ PA_Fake16bitLoadBmpEx

#define PA_Fake16bitLoadBmpEx (   screen,
  bmp,
  x,
 
)    PA_LoadBmpToBuffer(PA_DrawFake16[screen], x, y, bmp, 256)

Load a BMP on a fake 16 bit background... Don't forget to Init the background !

Parameters
screenChose de screen (0 or 1)
xX position of the top left corner
yY position of the top left corner
bmpBMP image...

◆ PA_Fake16bitLoadBmp

#define PA_Fake16bitLoadBmp (   screen,
  bmp 
)    PA_Fake16bitLoadBmpEx(screen, bmp, 0, 0)

Load a BMP on a fake 16 bit background... Don't forget to Init the background !

Parameters
screenChoose the screen (0 or 1)
bmpBMP image...

◆ PA_Fake16bitLoadGif

#define PA_Fake16bitLoadGif (   screen,
  gif 
)    PA_Fake16bitLoadGifXY(screen, gif, 0, 0)

Load a Gif on a fake 16 bit background... Don't forget to Init the background !

Parameters
screenChose de screen (0 or 1)
gifGif image...

◆ PA_Fake16bitLoadJpeg

#define PA_Fake16bitLoadJpeg (   screen,
  jpeg 
)    JPEG_DecompressImage((u8*)jpeg, PA_DrawFake16[screen], 256, 192)

Load a jpeg on a fake 16 bit background... Don't forget to Init the background !

Parameters
screenChose de screen (0 or 1)
jpegjpeg image...

Function Documentation

◆ PA_InitFake16bitBg()

void PA_InitFake16bitBg ( u8  screen,
u8  prio 
)
extern

Initialize a fake 16 bit background.

Parameters
screenChoose the screen (0 or 1)
prioBackground priority (from 0 to 3, being 0 the highest)

◆ PA_DrawFake16bitLine()

void PA_DrawFake16bitLine ( u8  screen,
u16  x1,
u16  y1,
u16  x2,
u16  y2,
u16  color 
)
extern

Draws a line on a fake 16 bit background.

Parameters
screenChoose the screen (0 or 1)
x1X position of the first point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y1Y position of the first point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
x2X position of the second point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y2Y position of the second point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
color15 bits color. You can use the PA_RGB macro to set the RGB values...