PAlib
Macros | Functions
16color pseudo-bitmap mode

Macros

#define PA_16cCustomFont(c16_slot, c16_font)
 [DEPRECATED] Add custom fonts to the 16cText system !! Font must be converted with PAGfx
 

Functions

static void PA_Init16cBg (u8 screen, u8 bg)
 Initialise 16color background on which you can paste images...
 
void PA_16cErase (u8 screen)
 Erase the 16color background. Must be used right after PA_WaitForVBL to avoid glitches.
 
static void PA_Dual16cErase (void)
 Erase the 16color background on both screens. Must be used right after PA_WaitForVBL to avoid glitches.
 
static void PA_InitComplete16c (u8 bg, void *Palette)
 Initialise a 16color background on each screen and give them a given palette.
 
s16 PA_16cText (u8 screen, s16 basex, s16 basey, s16 maxx, s16 maxy, const char *text, u8 color, u8 size, s32 limit)
 This is a variable width and variable size function to draw text on the screen.
 
void PA_Add16cFont (int slot, const PA_BgStruct *font)
 Add a custom font to the 16c font system.
 
ALWAYSINLINE void PA_16cPutPixel (u8 screen, s16 x, s16 y, u32 color)
 Plot a pixel on a 16c background.
 
ALWAYSINLINE void PA_16c8X4 (u8 screen, s16 x, s16 y, u32 *image)
 Load an 8x4 pixels image at a given position. Fastest of all pasting functions.
 
ALWAYSINLINE void PA_16c8X6 (u8 screen, s16 x, s16 y, u32 *image)
 Load an 8x6 pixels image at a given position. Second fastest of all pasting functions.
 
ALWAYSINLINE void PA_16c8X8 (u8 screen, s16 x, s16 y, u32 *image)
 Load an 8x8 pixels image at a given position.
 
ALWAYSINLINE void PA_16c8Xi (u8 screen, s16 x, s16 y, u32 *image, u8 i)
 Load an 8xi row from a 8x16 pixels image at a given position. If i>16 the image is repeated.
 
void PA_16cClearZone (u8 screen, s16 x1, s16 y1, s16 x2, s16 y2)
 Erase a 16c background zone.
 
static u8 PA_16cGetPixel (u8 screen, s16 x, s16 y)
 Returns the pixel value of a given point on a 16c background.
 

Detailed Description

Special 16color background on which you can paste images. Usefull to show shots in SHMUP !

Macro Definition Documentation

◆ PA_16cCustomFont

#define PA_16cCustomFont (   c16_slot,
  c16_font 
)
Value:
do{\
PA_DEPRECATED_MACRO;\
bittext_maps[c16_slot] = (u16*)(void*)c16_font##_Map;\
c16_tiles[c16_slot] = (u32*)(void*)c16_font##_Tiles;\
pa_bittextdefaultsize[c16_slot] = (u8*)c16_font##_Sizes;\
pa_bittextpoliceheight[c16_slot] = c16_font##_Height;\
}while(0)

[DEPRECATED] Add custom fonts to the 16cText system !! Font must be converted with PAGfx

Deprecated:
Parameters
c16_slotFont slot... 0-4 are used by the defaut PAlib fonts, 5-9 are free to use. You can freely overwrite the PAlib fonts if you want
c16_fontFont name...

Function Documentation

◆ PA_Init16cBg()

static inline void PA_Init16cBg ( u8  screen,
u8  bg 
)
inlinestatic

Initialise 16color background on which you can paste images...

Initialise 16color background on which you can paste images... Using palette 0.

Parameters
screenChoose de screen (0 or 1)
bgBackground number (0-3) Background number (0-3)

◆ PA_16cErase()

static inline void PA_16cErase ( u8  screen)

Erase the 16color background. Must be used right after PA_WaitForVBL to avoid glitches.

Parameters
screenChoose de screen (0 or 1)

◆ PA_InitComplete16c()

static inline void PA_InitComplete16c ( u8  bg,
void *  Palette 
)
inlinestatic

Initialise a 16color background on each screen and give them a given palette.

Parameters
bgBackground number
Palette16 color palette...

◆ PA_16cText()

s16 PA_16cText ( u8  screen,
s16  basex,
s16  basey,
s16  maxx,
s16  maxy,
const char *  text,
u8  color,
u8  size,
s32  limit 
)

This is a variable width and variable size function to draw text on the screen.

Parameters
screenChose de screen (0 or 1)
basexX coordinate of the top left corner
baseyY coordinate of the top left corner
maxxX coordinate of the down right corner
maxyY coordinate of the down right corner
textText, such as "Hello World"
colorPalette color to use (0-255)
sizeSize of the text, from 0 (really small) to 4 (pretty big)
limitYou can give a maximum number of characters to output. This can be usefull to have a slowing drawing text (allow to draw 1 more character each frame...)

◆ PA_Add16cFont()

void PA_Add16cFont ( int  slot,
const PA_BgStruct font 
)

Add a custom font to the 16c font system.

Parameters
slotFont slot. 0-4 are used by the default PAlib fonts, 5-9 are free to use. You can freely overwrite the PAlib fonts if you want.
fontPointer to the font.

◆ PA_16cPutPixel()

ALWAYSINLINE PA_16cPutPixel ( u8  screen,
s16  x,
s16  y,
u32  color 
)

Plot a pixel on a 16c background.

Parameters
screenScreen...
xX position in pixels of the top left corner. Note that it ranges from -8 to 263, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
yy position in pixels of the top left corner. Note that it ranges from -8 to 199, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
colorPixel value (0-15, uses the loaded palette)

◆ PA_16c8X4()

ALWAYSINLINE void PA_16c8X4 ( u8  screen,
s16  x,
s16  y,
u32 *  image 
)

Load an 8x4 pixels image at a given position. Fastest of all pasting functions.

Parameters
screenScreen...
xX position in pixels of the top left corner. Note that it ranges from -8 to 255, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
yy position in pixels of the top left corner. Note that it ranges from -8 to 191, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
image16 color image to load. Use (u32*)ImageName if you get an error...

◆ PA_16c8X6()

ALWAYSINLINE void PA_16c8X6 ( u8  screen,
s16  x,
s16  y,
u32 *  image 
)

Load an 8x6 pixels image at a given position. Second fastest of all pasting functions.

Parameters
screenScreen...
xX position in pixels of the top left corner. Note that it ranges from -8 to 255, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
yy position in pixels of the top left corner. Note that it ranges from -8 to 191, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
image16 color image to load. Use (u32*)ImageName if you get an error...

◆ PA_16c8X8()

ALWAYSINLINE void PA_16c8X8 ( u8  screen,
s16  x,
s16  y,
u32 *  image 
)

Load an 8x8 pixels image at a given position.

Parameters
screenScreen...
xX position in pixels of the top left corner. Note that it ranges from -8 to 255, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
yy position in pixels of the top left corner. Note that it ranges from -8 to 191, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
image16 color image to load. Use (u32*)ImageName if you get an error...

◆ PA_16c8Xi()

ALWAYSINLINE void PA_16c8Xi ( u8  screen,
s16  x,
s16  y,
u32 *  image,
u8  i 
)

Load an 8xi row from a 8x16 pixels image at a given position. If i>16 the image is repeated.

Parameters
screenScreen...
xX position in pixels of the top left corner. Note that it ranges from -8 to 255, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
yy position in pixels of the top left corner. Note that it ranges from -8 to 191, in order to allow half-way offscreen images. NEVER DRAW BEYOND THESE LIMITS, or else you'll get major background glitches
image16 color image to load. Use (u32*)ImageName if you get an error...
iNumber of lines of the image drawn (if greater than 16 the image will be repeated).

◆ PA_16cClearZone()

void PA_16cClearZone ( u8  screen,
s16  x1,
s16  y1,
s16  x2,
s16  y2 
)

Erase a 16c background zone.

Parameters
screenScreen...
x1Upper left corner...
y1Upper left corner...
x2Lower right corner...
y2Lower right corner...

◆ PA_16cGetPixel()

static inline u8 PA_16cGetPixel ( u8  screen,
s16  x,
s16  y 
)
inlinestatic

Returns the pixel value of a given point on a 16c background.

Parameters
screenScreen...
xX value...
yY value...