libtonc
Bitmaps

Functions

INLINE void vid_vsync (void)
 
INLINE void bg_aff_copy (BG_AFFINE *dst, const BG_AFFINE *src)
 Copy bg affine aprameters.
 

mode 3

INLINE void m3_fill (COLOR clr)
 Fill the mode 3 background with color clr.
 
INLINE void m3_plot (int x, int y, COLOR clr)
 Plot a single clr colored pixel in mode 3 at (x, y).
 
INLINE void m3_hline (int x1, int y, int x2, COLOR clr)
 Draw a clr colored horizontal line in mode 3.
 
INLINE void m3_vline (int x, int y1, int y2, COLOR clr)
 Draw a clr colored vertical line in mode 3.
 
INLINE void m3_line (int x1, int y1, int x2, int y2, COLOR clr)
 Draw a clr colored line in mode 3.
 
INLINE void m3_rect (int left, int top, int right, int bottom, COLOR clr)
 Draw a clr colored rectangle in mode 3.
 
INLINE void m3_frame (int left, int top, int right, int bottom, COLOR clr)
 Draw a clr colored frame in mode 3.
 
#define M3_CLEAR()   memset32(vid_mem, 0, M3_SIZE/4)
 Fill the mode 3 background with color clr.
 

mode 4

INLINE void m4_fill (u8 clrid)
 Fill the current mode 4 backbuffer with clrid.
 
INLINE void m4_plot (int x, int y, u8 clrid)
 Plot a clrid pixel on the current mode 4 backbuffer.
 
INLINE void m4_hline (int x1, int y, int x2, u8 clrid)
 Draw a clrid colored horizontal line in mode 4.
 
INLINE void m4_vline (int x, int y1, int y2, u8 clrid)
 Draw a clrid colored vertical line in mode 4.
 
INLINE void m4_line (int x1, int y1, int x2, int y2, u8 clrid)
 Draw a clrid colored line in mode 4.
 
INLINE void m4_rect (int left, int top, int right, int bottom, u8 clrid)
 Draw a clrid colored rectangle in mode 4.
 
INLINE void m4_frame (int left, int top, int right, int bottom, u8 clrid)
 Draw a clrid colored frame in mode 4.
 
#define M4_CLEAR()   memset32(vid_page, 0, M4_SIZE/4)
 Fill the current mode 4 backbuffer with clrid.
 

mode 5

INLINE void m5_fill (COLOR clr)
 Fill the current mode 5 backbuffer with clr.
 
INLINE void m5_plot (int x, int y, COLOR clr)
 Plot a clrid pixel on the current mode 5 backbuffer.
 
INLINE void m5_hline (int x1, int y, int x2, COLOR clr)
 Draw a clr colored horizontal line in mode 5.
 
INLINE void m5_vline (int x, int y1, int y2, COLOR clr)
 Draw a clr colored vertical line in mode 5.
 
INLINE void m5_line (int x1, int y1, int x2, int y2, COLOR clr)
 Draw a clr colored line in mode 5.
 
INLINE void m5_rect (int left, int top, int right, int bottom, COLOR clr)
 Draw a clr colored rectangle in mode 5.
 
INLINE void m5_frame (int left, int top, int right, int bottom, COLOR clr)
 Draw a clr colored frame in mode 5.
 
#define M5_CLEAR()   memset32(vid_page, 0, M5_SIZE/4)
 Fill the current mode 5 backbuffer with clr.
 

Detailed Description

Basic functions for dealing with bitmapped graphics.

Deprecated:
The bmp8/bmp16 functions have been superceded by the surface functions (sbmp8/sbmp16) for the most part. The former group has been kept mostly for reference purposes.

Function Documentation

◆ m3_frame()

INLINE void m3_frame ( int  left,
int  top,
int  right,
int  bottom,
COLOR  clr 
)

Draw a clr colored frame in mode 3.

Parameters
leftLeft side, inclusive.
topTop size, inclusive.
rightRight size, exclusive.
bottomBottom size, exclusive.
clrColor.
Note
Normalized, but not clipped.

References bmp16_frame(), and vid_mem.

◆ m3_rect()

INLINE void m3_rect ( int  left,
int  top,
int  right,
int  bottom,
COLOR  clr 
)

Draw a clr colored rectangle in mode 3.

Parameters
leftLeft side, inclusive.
topTop size, inclusive.
rightRight size, exclusive.
bottomBottom size, exclusive.
clrColor.
Note
Normalized, but not clipped.

References bmp16_rect(), and vid_mem.

◆ m4_frame()

INLINE void m4_frame ( int  left,
int  top,
int  right,
int  bottom,
u8  clrid 
)

Draw a clrid colored frame in mode 4.

Parameters
leftLeft side, inclusive.
topTop size, inclusive.
rightRight size, exclusive.
bottomBottom size, exclusive.
clridcolor index.
Note
Normalized, but not clipped.

References bmp8_frame().

◆ m4_rect()

INLINE void m4_rect ( int  left,
int  top,
int  right,
int  bottom,
u8  clrid 
)

Draw a clrid colored rectangle in mode 4.

Parameters
leftLeft side, inclusive.
topTop size, inclusive.
rightRight size, exclusive.
bottomBottom size, exclusive.
clridcolor index.
Note
Normalized, but not clipped.

References bmp8_rect().

◆ m5_frame()

INLINE void m5_frame ( int  left,
int  top,
int  right,
int  bottom,
COLOR  clr 
)

Draw a clr colored frame in mode 5.

Parameters
leftLeft side, inclusive.
topTop size, inclusive.
rightRight size, exclusive.
bottomBottom size, exclusive.
clrColor.
Note
Normalized, but not clipped.

References bmp16_frame().

◆ m5_rect()

INLINE void m5_rect ( int  left,
int  top,
int  right,
int  bottom,
COLOR  clr 
)

Draw a clr colored rectangle in mode 5.

Parameters
leftLeft side, inclusive.
topTop size, inclusive.
rightRight size, exclusive.
bottomBottom size, exclusive.
clrColor.
Note
Normalized, but not clipped.

References bmp16_rect().