VMUPro SDK v1.0.0
Application Development SDK for the VMUPro
|
VMUPro Display and Graphics API. More...
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | vmupro_sprite_t |
Sprite structure for batch rendering. More... | |
struct | vmupro_layer_t |
Layer structure for multi-layer rendering. More... | |
Macros | |
#define | VMUPRO_MAX_LAYERS 8 |
Enumerations | |
enum | vmupro_color_t { VMUPRO_COLOR_RED = 0x00f8 , VMUPRO_COLOR_ORANGE = 0xa0fb , VMUPRO_COLOR_YELLOW = 0x80ff , VMUPRO_COLOR_YELLOWGREEN = 0x807f , VMUPRO_COLOR_GREEN = 0x0005 , VMUPRO_COLOR_BLUE = 0x5f04 , VMUPRO_COLOR_NAVY = 0x0c00 , VMUPRO_COLOR_VIOLET = 0x1f78 , VMUPRO_COLOR_MAGENTA = 0x0d78 , VMUPRO_COLOR_GREY = 0xb6b5 , VMUPRO_COLOR_BLACK = 0x0000 , VMUPRO_COLOR_WHITE = 0xffff , VMUPRO_COLOR_VMUGREEN = 0xd26c , VMUPRO_COLOR_VMUINK = 0x8a28 } |
Predefined color values for VMUPro display. More... | |
Functions | |
void | vmupro_display_clear (vmupro_color_t color) |
Clear the display with a solid color. | |
void | vmupro_display_refresh () |
Refresh the display. | |
int | vmupro_get_global_brightness (void) |
void | vmupro_set_global_brightness (int brightness) |
uint8_t * | vmupro_get_front_fb () |
Get pointer to the front framebuffer. | |
uint8_t * | vmupro_get_back_fb () |
Get pointer to the back framebuffer. | |
uint8_t * | vmupro_get_back_buffer () |
Get pointer to the back buffer. | |
void | vmupro_start_double_buffer_renderer () |
Start the double buffer renderer. | |
void | vmupro_stop_double_buffer_renderer () |
Stop the double buffer renderer. | |
void | vmupro_pause_double_buffer_renderer () |
Pause the double buffer renderer. | |
void | vmupro_resume_double_buffer_renderer () |
Resume the double buffer renderer. | |
void | vmupro_push_double_buffer_frame () |
Swap and display the current framebuffer. | |
void | vmupro_draw_rect (int x1, int y1, int x2, int y2, vmupro_color_t color) |
Draw a rectangle outline. | |
void | vmupro_draw_fill_rect (int x1, int y1, int x2, int y2, vmupro_color_t color) |
Draw a filled rectangle. | |
void | vmupro_blit_buffer_at (uint8_t *buffer, int x, int y, int width, int height) |
Blit a buffer to the display at specified coordinates. | |
void | vmupro_blit_buffer_with_palette (uint8_t *buffer, int16_t *palette) |
Blit a paletted buffer to the display. | |
void | vmupro_blit_buffer_transparent (uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t transparent_color) |
Blit a buffer with transparency support. | |
void | vmupro_blit_buffer_blended (uint8_t *buffer, int x, int y, int width, int height, uint8_t alpha_level) |
Blit a buffer with alpha blending. | |
void | vmupro_blit_buffer_dithered (uint8_t *buffer, int x, int y, int width, int height, int dither_strength) |
Blit a buffer with dithering effect. | |
void | vmupro_blit_buffer_flip_h (uint8_t *buffer, int x, int y, int width, int height) |
Blit a buffer with horizontal flipping. | |
void | vmupro_blit_buffer_flip_v (uint8_t *buffer, int x, int y, int width, int height) |
Blit a buffer with vertical flipping. | |
void | vmupro_blit_buffer_scaled (uint8_t *buffer, int buffer_width, int src_x, int src_y, int src_width, int src_height, int dest_x, int dest_y, int dest_width, int dest_height) |
Blit a buffer with scaling support. | |
void | vmupro_blit_buffer_rotated_90 (uint8_t *buffer, int x, int y, int width, int height, int rotation) |
Blit a buffer with 90-degree rotation increments. | |
void | vmupro_blit_buffer_rotated_precise (uint8_t *buffer, int x, int y, int width, int height, int rotation_degrees) |
Blit a buffer with precise rotation (1-degree increments) | |
void | vmupro_blit_tile_pattern (uint8_t *tile_buffer, int tile_width, int tile_height, int dest_x, int dest_y, int dest_width, int dest_height) |
Blit a tiled pattern to fill an area. | |
void | vmupro_blit_buffer_advanced (uint8_t *buffer, int buffer_width, int src_x, int src_y, int src_width, int src_height, int dest_x, int dest_y, int dest_width, int dest_height, int flip_h, int flip_v, int transparent_color) |
Advanced blit with multiple effects combined. | |
void | vmupro_draw_line (int x1, int y1, int x2, int y2, vmupro_color_t color) |
Draw a line between two points. | |
void | vmupro_draw_circle (int cx, int cy, int radius, vmupro_color_t color) |
Draw a circle outline. | |
void | vmupro_draw_circle_filled (int cx, int cy, int radius, vmupro_color_t color) |
Draw a filled circle. | |
void | vmupro_draw_ellipse (int cx, int cy, int rx, int ry, vmupro_color_t color) |
Draw an ellipse outline. | |
void | vmupro_draw_ellipse_filled (int cx, int cy, int rx, int ry, vmupro_color_t color) |
Draw a filled ellipse. | |
void | vmupro_draw_polygon (int *points, int num_points, vmupro_color_t color) |
Draw a polygon outline. | |
void | vmupro_draw_polygon_filled (int *points, int num_points, vmupro_color_t color) |
Draw a filled polygon. | |
void | vmupro_flood_fill (int x, int y, vmupro_color_t fill_color, vmupro_color_t boundary_color) |
Flood fill an area with color. | |
void | vmupro_flood_fill_tolerance (int x, int y, vmupro_color_t fill_color, int tolerance) |
Flood fill with color tolerance. | |
void | vmupro_blit_scrolling_background (uint8_t *bg_buffer, int bg_width, int bg_height, int scroll_x, int scroll_y, int dest_width, int dest_height) |
Blit a scrolling background. | |
void | vmupro_blit_infinite_scrolling_background (uint8_t *tile_buffer, int tile_width, int tile_height, int scroll_x, int scroll_y, int dest_width, int dest_height) |
Blit an infinitely scrolling tiled background. | |
void | vmupro_blit_parallax_background (uint8_t *bg_buffer, int bg_width, int bg_height, int scroll_x, int scroll_y, int parallax_factor_x, int parallax_factor_y) |
Blit background with parallax effect. | |
void | vmupro_blit_multi_parallax (uint8_t **bg_layers, int *layer_widths, int *layer_heights, int num_layers, int *parallax_factors_x, int *parallax_factors_y, int scroll_x, int scroll_y) |
Blit multiple parallax layers. | |
void | vmupro_blit_line_scroll_background (uint8_t *bg_buffer, int bg_width, int bg_height, int *scroll_x_per_line, int *scroll_y_per_line) |
Blit background with per-line scrolling (Mega Drive style) | |
void | vmupro_blit_column_scroll_background (uint8_t *bg_buffer, int bg_width, int bg_height, int *scroll_x_per_column, int *scroll_y_per_column) |
Blit background with per-column scrolling. | |
void | vmupro_blit_buffer_mosaic (uint8_t *buffer, int x, int y, int width, int height, int mosaic_size) |
Apply mosaic effect to buffer. | |
void | vmupro_blit_buffer_blurred (uint8_t *buffer, int x, int y, int width, int height, int blur_radius) |
Apply blur effect to buffer. | |
void | vmupro_apply_mosaic_to_screen (int x, int y, int width, int height, int mosaic_size) |
Apply mosaic effect directly to screen. | |
void | vmupro_blit_buffer_shadow_highlight (uint8_t *buffer, int x, int y, int width, int height, int mode) |
Apply shadow/highlight effect to buffer. | |
void | vmupro_blit_buffer_color_multiply (uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t color_filter) |
Apply color multiplication filter. | |
void | vmupro_blit_buffer_color_add (uint8_t *buffer, int x, int y, int width, int height, vmupro_color_t color_offset) |
Apply color addition filter. | |
int | vmupro_sprite_collision_check (int sprite1_x, int sprite1_y, int sprite1_w, int sprite1_h, int sprite2_x, int sprite2_y, int sprite2_w, int sprite2_h) |
Check rectangular sprite collision. | |
int | vmupro_sprite_pixel_collision (uint8_t *sprite1, uint8_t *sprite2, int x1, int y1, int x2, int y2, int width1, int height1, int width2, int height2) |
Check pixel-perfect sprite collision. | |
void | vmupro_blit_buffer_fixed_alpha (uint8_t *buffer, int x, int y, int width, int height, int alpha_mode) |
Apply fixed alpha blending. | |
void | vmupro_blend_layers_additive (uint8_t *layer1, uint8_t *layer2, int width, int height) |
Blend two layers additively. | |
void | vmupro_blend_layers_multiply (uint8_t *layer1, uint8_t *layer2, int width, int height) |
Blend two layers multiplicatively. | |
void | vmupro_blend_layers_screen (uint8_t *layer1, uint8_t *layer2, int width, int height) |
Blend two layers using screen mode. | |
void | vmupro_set_color_window (int x1, int y1, int x2, int y2, vmupro_color_t mask_color) |
Set a color window for masking. | |
void | vmupro_blit_buffer_masked (uint8_t *buffer, uint8_t *mask, int x, int y, int width, int height) |
Blit buffer using mask. | |
void | vmupro_clear_color_window (void) |
Clear the color window. | |
void | vmupro_blit_buffer_palette_swap (uint8_t *buffer, int x, int y, int width, int height, uint16_t *old_palette, uint16_t *new_palette, int palette_size) |
Swap palette colors in buffer. | |
void | vmupro_animate_palette_range (uint16_t *palette, int start_index, int end_index, int shift_amount) |
Animate palette color cycling. | |
void | vmupro_interpolate_palette (uint16_t *palette1, uint16_t *palette2, uint16_t *result, int size, int factor_256) |
Interpolate between two palettes. | |
void | vmupro_sprite_batch_render (vmupro_sprite_t *sprites, int num_sprites) |
Render multiple sprites in priority order. | |
void | vmupro_layer_create (int layer_id, int width, int height) |
Create a new layer. | |
void | vmupro_layer_destroy (int layer_id) |
Destroy a layer. | |
void | vmupro_layer_set_scroll (int layer_id, int scroll_x, int scroll_y) |
Set layer scroll position. | |
void | vmupro_layer_set_priority (int layer_id, int priority) |
Set layer rendering priority. | |
void | vmupro_layer_set_alpha (int layer_id, uint8_t alpha) |
Set layer alpha transparency. | |
void | vmupro_layer_blit_background (int layer_id, uint8_t *bg_buffer, int bg_width, int bg_height) |
Blit background to layer. | |
void | vmupro_render_all_layers (void) |
Render all active layers. | |
void | vmupro_blit_tile (uint8_t *buffer, int x, int y, int src_x, int src_y, int width, int height, int tilemap_width) |
Blit a single tile from a tilemap/tileset. | |
uint8_t | vmupro_get_last_blitted_fb_side () |
VMUPro Display and Graphics API.
This header provides the comprehensive display and graphics API for the VMUPro SDK. It includes a complete suite of graphics functions for professional game development, matching the capabilities of retro console systems.
All graphics operations use RGB565 format (16-bit color) for optimal performance and memory efficiency on the VMUPro hardware.
Definition in file vmupro_display.h.
#define VMUPRO_MAX_LAYERS 8 |
Definition at line 992 of file vmupro_display.h.
enum vmupro_color_t |
Predefined color values for VMUPro display.
This enumeration provides commonly used color values in RGB565 format for the VMUPro display system. Values are in big endian format.
Definition at line 53 of file vmupro_display.h.
void vmupro_animate_palette_range | ( | uint16_t * | palette, |
int | start_index, | ||
int | end_index, | ||
int | shift_amount | ||
) |
Animate palette color cycling.
Shifts colors in a palette range for animation effects.
palette | Pointer to the palette array |
start_index | Starting palette index |
end_index | Ending palette index |
shift_amount | Number of positions to shift |
void vmupro_apply_mosaic_to_screen | ( | int | x, |
int | y, | ||
int | width, | ||
int | height, | ||
int | mosaic_size | ||
) |
Apply mosaic effect directly to screen.
Applies mosaic effect to a region of the current framebuffer.
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
mosaic_size | Size of mosaic blocks |
void vmupro_blend_layers_additive | ( | uint8_t * | layer1, |
uint8_t * | layer2, | ||
int | width, | ||
int | height | ||
) |
Blend two layers additively.
Adds color values of two layers together.
layer1 | First layer buffer |
layer2 | Second layer buffer |
width | Width of the layers |
height | Height of the layers |
void vmupro_blend_layers_multiply | ( | uint8_t * | layer1, |
uint8_t * | layer2, | ||
int | width, | ||
int | height | ||
) |
Blend two layers multiplicatively.
Multiplies color values of two layers.
layer1 | First layer buffer |
layer2 | Second layer buffer |
width | Width of the layers |
height | Height of the layers |
void vmupro_blend_layers_screen | ( | uint8_t * | layer1, |
uint8_t * | layer2, | ||
int | width, | ||
int | height | ||
) |
Blend two layers using screen mode.
Applies screen blending mode between two layers.
layer1 | First layer buffer |
layer2 | Second layer buffer |
width | Width of the layers |
height | Height of the layers |
void vmupro_blit_buffer_advanced | ( | uint8_t * | buffer, |
int | buffer_width, | ||
int | src_x, | ||
int | src_y, | ||
int | src_width, | ||
int | src_height, | ||
int | dest_x, | ||
int | dest_y, | ||
int | dest_width, | ||
int | dest_height, | ||
int | flip_h, | ||
int | flip_v, | ||
int | transparent_color | ||
) |
Advanced blit with multiple effects combined.
Copies pixel data with support for transparency, flipping, and scaling combined. This is the most flexible blitting function for complex sprite operations.
buffer | Pointer to the source pixel buffer |
buffer_width | Width of the source buffer in pixels (stride/pitch) |
src_x | Source X coordinate within the buffer |
src_y | Source Y coordinate within the buffer |
src_width | Width of the source region in pixels |
src_height | Height of the source region in pixels |
dest_x | Destination X coordinate on the display |
dest_y | Destination Y coordinate on the display |
dest_width | Destination width in pixels (for scaling) |
dest_height | Destination height in pixels (for scaling) |
flip_h | Set to 1 to flip horizontally, 0 for normal |
flip_v | Set to 1 to flip vertically, 0 for normal |
transparent_color | Color value to treat as transparent (-1 for no transparency) |
void vmupro_blit_buffer_at | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Blit a buffer to the display at specified coordinates.
Copies pixel data from a source buffer to the display framebuffer at the specified position. The buffer should contain pixel data in the display's native format.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the top-left corner where the buffer will be placed |
y | Y coordinate of the top-left corner where the buffer will be placed |
width | Width of the source buffer in pixels |
height | Height of the source buffer in pixels |
void vmupro_blit_buffer_blended | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
uint8_t | alpha_level | ||
) |
Blit a buffer with alpha blending.
Copies pixel data from a source buffer to the display framebuffer with alpha blending. Each pixel is blended with the existing framebuffer content based on the specified alpha level.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the top-left corner where the buffer will be placed |
y | Y coordinate of the top-left corner where the buffer will be placed |
width | Width of the source buffer in pixels |
height | Height of the source buffer in pixels |
alpha_level | Alpha blending level (0=fully transparent, 255=fully opaque) |
void vmupro_blit_buffer_blurred | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
int | blur_radius | ||
) |
Apply blur effect to buffer.
Applies a Gaussian blur effect to the specified region of a buffer. Creates smooth, softened edges and depth-of-field effects.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
blur_radius | Blur intensity (higher = more blurred, 0 = no blur) |
void vmupro_blit_buffer_color_add | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
vmupro_color_t | color_offset | ||
) |
Apply color addition filter.
Adds a color offset to each pixel.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
color_offset | Color offset to add (RGB565 big endian format) |
void vmupro_blit_buffer_color_multiply | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
vmupro_color_t | color_filter | ||
) |
Apply color multiplication filter.
Multiplies each pixel by a color filter value.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
color_filter | Color multiplier (RGB565 big endian format) |
void vmupro_blit_buffer_dithered | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
int | dither_strength | ||
) |
Blit a buffer with dithering effect.
Applies dithering to a buffer when blitting to the screen. Dithering creates the illusion of additional colors by using patterns of existing pixels. This is particularly useful for creating smooth gradients and reducing color banding on displays with limited color palettes.
buffer | Pointer to the source pixel buffer |
x | X coordinate where to blit the buffer |
y | Y coordinate where to blit the buffer |
width | Width of the buffer |
height | Height of the buffer |
dither_strength | Dithering intensity (0 = no dithering, higher values = more dithering) |
void vmupro_blit_buffer_fixed_alpha | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
int | alpha_mode | ||
) |
Apply fixed alpha blending.
Blends buffer with background using predefined alpha modes.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
alpha_mode | Alpha blending mode (0=25%, 1=50%, 2=75%) |
void vmupro_blit_buffer_flip_h | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Blit a buffer with horizontal flipping.
Copies pixel data from a source buffer to the display framebuffer, flipping the image horizontally during the copy operation.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the top-left corner where the buffer will be placed |
y | Y coordinate of the top-left corner where the buffer will be placed |
width | Width of the source buffer in pixels |
height | Height of the source buffer in pixels |
void vmupro_blit_buffer_flip_v | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Blit a buffer with vertical flipping.
Copies pixel data from a source buffer to the display framebuffer, flipping the image vertically during the copy operation.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the top-left corner where the buffer will be placed |
y | Y coordinate of the top-left corner where the buffer will be placed |
width | Width of the source buffer in pixels |
height | Height of the source buffer in pixels |
void vmupro_blit_buffer_masked | ( | uint8_t * | buffer, |
uint8_t * | mask, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Blit buffer using mask.
Copies pixels only where the mask allows.
buffer | Pointer to the source pixel buffer |
mask | Pointer to the mask buffer (0=block, non-zero=allow) |
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
void vmupro_blit_buffer_mosaic | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
int | mosaic_size | ||
) |
Apply mosaic effect to buffer.
Creates a mosaic/pixelation effect by averaging pixel blocks.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
mosaic_size | Size of mosaic blocks (higher = more pixelated) |
void vmupro_blit_buffer_palette_swap | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
uint16_t * | old_palette, | ||
uint16_t * | new_palette, | ||
int | palette_size | ||
) |
Swap palette colors in buffer.
Replaces colors in a buffer using palette mapping.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
old_palette | Array of original color values |
new_palette | Array of replacement color values |
palette_size | Number of colors in the palettes |
void vmupro_blit_buffer_rotated_90 | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
int | rotation | ||
) |
Blit a buffer with 90-degree rotation increments.
Copies pixel data from a source buffer to the display framebuffer with rotation in 90-degree increments. This is a fast rotation method that preserves pixel-perfect quality.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the top-left corner where the buffer will be placed |
y | Y coordinate of the top-left corner where the buffer will be placed |
width | Width of the source buffer in pixels |
height | Height of the source buffer in pixels |
rotation | Rotation steps: 0=none, 1=90°, 2=180°, 3=270° |
void vmupro_blit_buffer_rotated_precise | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
int | rotation_degrees | ||
) |
Blit a buffer with precise rotation (1-degree increments)
Copies pixel data from a source buffer to the display framebuffer with precise rotation at any angle. Uses interpolation for smooth rotation.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the center point for rotation |
y | Y coordinate of the center point for rotation |
width | Width of the source buffer in pixels |
height | Height of the source buffer in pixels |
rotation_degrees | Rotation angle in degrees (0-359, clockwise) |
void vmupro_blit_buffer_scaled | ( | uint8_t * | buffer, |
int | buffer_width, | ||
int | src_x, | ||
int | src_y, | ||
int | src_width, | ||
int | src_height, | ||
int | dest_x, | ||
int | dest_y, | ||
int | dest_width, | ||
int | dest_height | ||
) |
Blit a buffer with scaling support.
Copies pixel data from a source buffer to the display framebuffer with scaling. Supports both upscaling and downscaling using nearest-neighbor filtering.
buffer | Pointer to the source pixel buffer |
buffer_width | Width of the source buffer in pixels (stride/pitch) |
src_x | Source X coordinate within the buffer |
src_y | Source Y coordinate within the buffer |
src_width | Width of the source region in pixels |
src_height | Height of the source region in pixels |
dest_x | Destination X coordinate on the display |
dest_y | Destination Y coordinate on the display |
dest_width | Destination width in pixels (scaled size) |
dest_height | Destination height in pixels (scaled size) |
void vmupro_blit_buffer_shadow_highlight | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
int | mode | ||
) |
Apply shadow/highlight effect to buffer.
Creates shadow or highlight effects on sprites.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the region |
y | Y coordinate of the region |
width | Width of the region |
height | Height of the region |
mode | Effect mode (0=shadow, 1=highlight) |
void vmupro_blit_buffer_transparent | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
vmupro_color_t | transparent_color | ||
) |
Blit a buffer with transparency support.
Copies pixel data from a source buffer to the display framebuffer with transparency support. Pixels matching the transparent color are skipped.
buffer | Pointer to the source pixel buffer |
x | X coordinate of the top-left corner where the buffer will be placed |
y | Y coordinate of the top-left corner where the buffer will be placed |
width | Width of the source buffer in pixels |
height | Height of the source buffer in pixels |
transparent_color | Color value to treat as transparent (will not be drawn) |
void vmupro_blit_buffer_with_palette | ( | uint8_t * | buffer, |
int16_t * | palette | ||
) |
Blit a paletted buffer to the display.
Copies pixel data from a paletted source buffer to the display framebuffer. Each pixel in the buffer is used as an index into the provided palette to determine the final color value.
buffer | Pointer to the source paletted pixel buffer (indices into palette) |
palette | Pointer to the color palette array (RGB565 format values) |
void vmupro_blit_column_scroll_background | ( | uint8_t * | bg_buffer, |
int | bg_width, | ||
int | bg_height, | ||
int * | scroll_x_per_column, | ||
int * | scroll_y_per_column | ||
) |
Blit background with per-column scrolling.
Advanced scrolling where each column can have different scroll offsets.
bg_buffer | Pointer to the background image buffer |
bg_width | Width of the background image |
bg_height | Height of the background image |
scroll_x_per_column | Array of horizontal scroll offsets for each column |
scroll_y_per_column | Array of vertical scroll offsets for each column |
void vmupro_blit_infinite_scrolling_background | ( | uint8_t * | tile_buffer, |
int | tile_width, | ||
int | tile_height, | ||
int | scroll_x, | ||
int | scroll_y, | ||
int | dest_width, | ||
int | dest_height | ||
) |
Blit an infinitely scrolling tiled background.
Creates an infinite scrolling effect by tiling a background pattern.
tile_buffer | Pointer to the tile buffer |
tile_width | Width of a single tile |
tile_height | Height of a single tile |
scroll_x | Horizontal scroll offset |
scroll_y | Vertical scroll offset |
dest_width | Destination width to fill |
dest_height | Destination height to fill |
void vmupro_blit_line_scroll_background | ( | uint8_t * | bg_buffer, |
int | bg_width, | ||
int | bg_height, | ||
int * | scroll_x_per_line, | ||
int * | scroll_y_per_line | ||
) |
Blit background with per-line scrolling (Mega Drive style)
Advanced scrolling where each scanline can have different scroll offsets.
bg_buffer | Pointer to the background image buffer |
bg_width | Width of the background image |
bg_height | Height of the background image |
scroll_x_per_line | Array of horizontal scroll offsets for each line |
scroll_y_per_line | Array of vertical scroll offsets for each line |
void vmupro_blit_multi_parallax | ( | uint8_t ** | bg_layers, |
int * | layer_widths, | ||
int * | layer_heights, | ||
int | num_layers, | ||
int * | parallax_factors_x, | ||
int * | parallax_factors_y, | ||
int | scroll_x, | ||
int | scroll_y | ||
) |
Blit multiple parallax layers.
Renders multiple background layers with different parallax speeds.
bg_layers | Array of background layer buffers |
layer_widths | Array of layer widths |
layer_heights | Array of layer heights |
num_layers | Number of layers to render |
parallax_factors_x | Array of horizontal parallax factors |
parallax_factors_y | Array of vertical parallax factors |
scroll_x | Base horizontal scroll offset |
scroll_y | Base vertical scroll offset |
void vmupro_blit_parallax_background | ( | uint8_t * | bg_buffer, |
int | bg_width, | ||
int | bg_height, | ||
int | scroll_x, | ||
int | scroll_y, | ||
int | parallax_factor_x, | ||
int | parallax_factor_y | ||
) |
Blit background with parallax effect.
Creates parallax scrolling effect by applying scaling factors to scroll offsets.
bg_buffer | Pointer to the background image buffer |
bg_width | Width of the background image |
bg_height | Height of the background image |
scroll_x | Base horizontal scroll offset |
scroll_y | Base vertical scroll offset |
parallax_factor_x | Horizontal parallax multiplier (256 = 1.0x speed) |
parallax_factor_y | Vertical parallax multiplier (256 = 1.0x speed) |
void vmupro_blit_scrolling_background | ( | uint8_t * | bg_buffer, |
int | bg_width, | ||
int | bg_height, | ||
int | scroll_x, | ||
int | scroll_y, | ||
int | dest_width, | ||
int | dest_height | ||
) |
Blit a scrolling background.
Copies a background image with scrolling offset support.
bg_buffer | Pointer to the background image buffer |
bg_width | Width of the background image |
bg_height | Height of the background image |
scroll_x | Horizontal scroll offset |
scroll_y | Vertical scroll offset |
dest_width | Destination width to fill |
dest_height | Destination height to fill |
void vmupro_blit_tile | ( | uint8_t * | buffer, |
int | x, | ||
int | y, | ||
int | src_x, | ||
int | src_y, | ||
int | width, | ||
int | height, | ||
int | tilemap_width | ||
) |
Blit a single tile from a tilemap/tileset.
Copies a rectangular region from a source tilemap buffer to the display. Optimized for tile-based graphics rendering common in 2D games.
buffer | Pointer to the source tilemap buffer |
x | Destination X coordinate on the display |
y | Destination Y coordinate on the display |
src_x | Source X coordinate within the tilemap (in pixels) |
src_y | Source Y coordinate within the tilemap (in pixels) |
width | Width of the tile in pixels |
height | Height of the tile in pixels |
tilemap_width | Width of the source tilemap in pixels (stride/pitch) |
void vmupro_blit_tile_pattern | ( | uint8_t * | tile_buffer, |
int | tile_width, | ||
int | tile_height, | ||
int | dest_x, | ||
int | dest_y, | ||
int | dest_width, | ||
int | dest_height | ||
) |
Blit a tiled pattern to fill an area.
Copies a small tile buffer repeatedly to fill the specified rectangular area. Commonly used for backgrounds and texture patterns.
tile_buffer | Pointer to the tile pixel buffer |
tile_width | Width of the tile in pixels |
tile_height | Height of the tile in pixels |
dest_x | Destination X coordinate on the display |
dest_y | Destination Y coordinate on the display |
dest_width | Width of the area to fill in pixels |
dest_height | Height of the area to fill in pixels |
void vmupro_clear_color_window | ( | void | ) |
Clear the color window.
Removes any active color window masking.
void vmupro_display_clear | ( | vmupro_color_t | color | ) |
Clear the display with a solid color.
Fills the entire display with the specified color.
color | The color to fill the display with |
void vmupro_display_refresh | ( | ) |
Refresh the display.
Updates the physical display with the current framebuffer contents. This function should be called after drawing operations to make changes visible on the screen.
void vmupro_draw_circle | ( | int | cx, |
int | cy, | ||
int | radius, | ||
vmupro_color_t | color | ||
) |
Draw a circle outline.
Draws a circle outline centered at (cx,cy) with the specified radius and color.
cx | Center X coordinate |
cy | Center Y coordinate |
radius | Radius of the circle in pixels |
color | Color of the circle outline |
void vmupro_draw_circle_filled | ( | int | cx, |
int | cy, | ||
int | radius, | ||
vmupro_color_t | color | ||
) |
Draw a filled circle.
Draws a filled circle centered at (cx,cy) with the specified radius and color.
cx | Center X coordinate |
cy | Center Y coordinate |
radius | Radius of the circle in pixels |
color | Fill color of the circle |
void vmupro_draw_ellipse | ( | int | cx, |
int | cy, | ||
int | rx, | ||
int | ry, | ||
vmupro_color_t | color | ||
) |
Draw an ellipse outline.
Draws an ellipse outline centered at (cx,cy) with specified radii and color.
cx | Center X coordinate |
cy | Center Y coordinate |
rx | Horizontal radius |
ry | Vertical radius |
color | Color of the ellipse outline |
void vmupro_draw_ellipse_filled | ( | int | cx, |
int | cy, | ||
int | rx, | ||
int | ry, | ||
vmupro_color_t | color | ||
) |
Draw a filled ellipse.
Draws a filled ellipse centered at (cx,cy) with specified radii and color.
cx | Center X coordinate |
cy | Center Y coordinate |
rx | Horizontal radius |
ry | Vertical radius |
color | Fill color of the ellipse |
void vmupro_draw_fill_rect | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
vmupro_color_t | color | ||
) |
Draw a filled rectangle.
Draws a filled rectangle with the specified coordinates and color. The rectangle is drawn from (x1,y1) to (x2,y2).
x1 | Left coordinate of the rectangle |
y1 | Top coordinate of the rectangle |
x2 | Right coordinate of the rectangle |
y2 | Bottom coordinate of the rectangle |
color | Fill color of the rectangle |
void vmupro_draw_line | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
vmupro_color_t | color | ||
) |
Draw a line between two points.
Draws a line from point (x1,y1) to point (x2,y2) using the specified color.
x1 | Starting X coordinate |
y1 | Starting Y coordinate |
x2 | Ending X coordinate |
y2 | Ending Y coordinate |
color | Color of the line |
void vmupro_draw_polygon | ( | int * | points, |
int | num_points, | ||
vmupro_color_t | color | ||
) |
Draw a polygon outline.
Draws a polygon outline connecting the specified points.
points | Array of x,y coordinates (x1,y1,x2,y2,...) |
num_points | Number of points in the polygon |
color | Color of the polygon outline |
void vmupro_draw_polygon_filled | ( | int * | points, |
int | num_points, | ||
vmupro_color_t | color | ||
) |
Draw a filled polygon.
Draws a filled polygon using the specified points and color.
points | Array of x,y coordinates (x1,y1,x2,y2,...) |
num_points | Number of points in the polygon |
color | Fill color of the polygon |
void vmupro_draw_rect | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
vmupro_color_t | color | ||
) |
Draw a rectangle outline.
Draws a rectangle outline with the specified coordinates and color. The rectangle is drawn from (x1,y1) to (x2,y2).
x1 | Left coordinate of the rectangle |
y1 | Top coordinate of the rectangle |
x2 | Right coordinate of the rectangle |
y2 | Bottom coordinate of the rectangle |
color | Color of the rectangle outline |
void vmupro_flood_fill | ( | int | x, |
int | y, | ||
vmupro_color_t | fill_color, | ||
vmupro_color_t | boundary_color | ||
) |
Flood fill an area with color.
Fills a connected area starting from (x,y) with the specified color. The fill spreads to all connected pixels of the same color as the starting pixel.
x | Starting X coordinate |
y | Starting Y coordinate |
fill_color | Color to fill with |
boundary_color | Color that acts as boundary for the fill |
void vmupro_flood_fill_tolerance | ( | int | x, |
int | y, | ||
vmupro_color_t | fill_color, | ||
int | tolerance | ||
) |
Flood fill with color tolerance.
Fills a connected area with tolerance for color matching. Colors within the tolerance range are considered the same.
x | Starting X coordinate |
y | Starting Y coordinate |
fill_color | Color to fill with |
tolerance | Color difference tolerance (0-255) |
uint8_t * vmupro_get_back_buffer | ( | ) |
Get pointer to the back buffer.
Returns a pointer to the back buffer used in double buffering. This is an alias or alternative function for accessing the back framebuffer, maintaining compatibility with different naming conventions.
uint8_t * vmupro_get_back_fb | ( | ) |
Get pointer to the back framebuffer.
Returns a pointer to one of the alternating framebuffers used in double buffering. The front/back designation alternates with each buffer swap operation.
uint8_t * vmupro_get_front_fb | ( | ) |
Get pointer to the front framebuffer.
Returns a pointer to one of the alternating framebuffers used in double buffering. The front/back designation alternates with each buffer swap operation.
int vmupro_get_global_brightness | ( | void | ) |
uint8_t vmupro_get_last_blitted_fb_side | ( | ) |
void vmupro_interpolate_palette | ( | uint16_t * | palette1, |
uint16_t * | palette2, | ||
uint16_t * | result, | ||
int | size, | ||
int | factor_256 | ||
) |
Interpolate between two palettes.
Creates smooth color transitions between palettes.
palette1 | First palette |
palette2 | Second palette |
result | Output palette buffer |
size | Number of colors in palettes |
factor_256 | Interpolation factor (0-256, where 256 = full palette2) |
void vmupro_layer_blit_background | ( | int | layer_id, |
uint8_t * | bg_buffer, | ||
int | bg_width, | ||
int | bg_height | ||
) |
Blit background to layer.
Copies background image data to a specific layer.
layer_id | Target layer ID |
bg_buffer | Background image buffer |
bg_width | Width of background image |
bg_height | Height of background image |
void vmupro_layer_create | ( | int | layer_id, |
int | width, | ||
int | height | ||
) |
Create a new layer.
Allocates and initializes a rendering layer.
layer_id | Layer ID (0 to VMUPRO_MAX_LAYERS-1) |
width | Width of the layer in pixels |
height | Height of the layer in pixels |
void vmupro_layer_destroy | ( | int | layer_id | ) |
Destroy a layer.
Deallocates a rendering layer and frees its memory.
layer_id | Layer ID to destroy |
void vmupro_layer_set_alpha | ( | int | layer_id, |
uint8_t | alpha | ||
) |
Set layer alpha transparency.
Controls the transparency level of a layer.
layer_id | Layer ID |
alpha | Alpha value (0=transparent, 255=opaque) |
void vmupro_layer_set_priority | ( | int | layer_id, |
int | priority | ||
) |
Set layer rendering priority.
Controls the draw order of layers.
layer_id | Layer ID |
priority | Priority value (higher = drawn last) |
void vmupro_layer_set_scroll | ( | int | layer_id, |
int | scroll_x, | ||
int | scroll_y | ||
) |
Set layer scroll position.
Updates the scroll offset for a layer.
layer_id | Layer ID |
scroll_x | Horizontal scroll offset |
scroll_y | Vertical scroll offset |
void vmupro_pause_double_buffer_renderer | ( | ) |
Pause the double buffer renderer.
Temporarily pauses the double buffering system without stopping it completely. This allows you to suspend automatic buffer swapping while maintaining the double buffer state. Useful for pause menus, loading screens, or when you need to temporarily halt rendering updates.
void vmupro_push_double_buffer_frame | ( | ) |
Swap and display the current framebuffer.
Swaps the front and back framebuffers and displays the newly swapped front buffer. This alternates which buffer is used for drawing and which is displayed, enabling smooth double-buffered rendering.
void vmupro_render_all_layers | ( | void | ) |
Render all active layers.
Composites all active layers to the framebuffer in priority order.
void vmupro_resume_double_buffer_renderer | ( | ) |
Resume the double buffer renderer.
Resumes the double buffering system after it has been paused. This restores automatic buffer swapping and rendering operations.
void vmupro_set_color_window | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
vmupro_color_t | mask_color | ||
) |
Set a color window for masking.
Defines a rectangular region where only specific colors are drawn.
x1 | Left coordinate of the window |
y1 | Top coordinate of the window |
x2 | Right coordinate of the window |
y2 | Bottom coordinate of the window |
mask_color | Color that passes through the mask |
void vmupro_set_global_brightness | ( | int | brightness | ) |
void vmupro_sprite_batch_render | ( | vmupro_sprite_t * | sprites, |
int | num_sprites | ||
) |
Render multiple sprites in priority order.
Efficiently renders multiple sprites with proper priority sorting.
sprites | Array of sprite structures |
num_sprites | Number of sprites to render |
int vmupro_sprite_collision_check | ( | int | sprite1_x, |
int | sprite1_y, | ||
int | sprite1_w, | ||
int | sprite1_h, | ||
int | sprite2_x, | ||
int | sprite2_y, | ||
int | sprite2_w, | ||
int | sprite2_h | ||
) |
Check rectangular sprite collision.
Tests if two rectangular sprites overlap.
sprite1_x | First sprite X position |
sprite1_y | First sprite Y position |
sprite1_w | First sprite width |
sprite1_h | First sprite height |
sprite2_x | Second sprite X position |
sprite2_y | Second sprite Y position |
sprite2_w | Second sprite width |
sprite2_h | Second sprite height |
int vmupro_sprite_pixel_collision | ( | uint8_t * | sprite1, |
uint8_t * | sprite2, | ||
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | width1, | ||
int | height1, | ||
int | width2, | ||
int | height2 | ||
) |
Check pixel-perfect sprite collision.
Tests collision at the pixel level between two sprites.
sprite1 | First sprite buffer |
sprite2 | Second sprite buffer |
x1 | First sprite X position |
y1 | First sprite Y position |
x2 | Second sprite X position |
y2 | Second sprite Y position |
width1 | First sprite width |
height1 | First sprite height |
width2 | Second sprite width |
height2 | Second sprite height |
void vmupro_start_double_buffer_renderer | ( | ) |
Start the double buffer renderer.
Initializes and starts the double buffering system, allowing for smooth animation and flicker-free updates by alternating between two framebuffers.
void vmupro_stop_double_buffer_renderer | ( | ) |
Stop the double buffer renderer.
Stops the double buffering system and returns to single buffer mode.