#ifndef RENDERER_H #define RENDERER_H #include "gba/gba.h" // Draws a pixel to the given (x, y) position on the framebuffer. All drawing // functions use paletted colors (clr: 0-15). void draw_pixel(size_t x, size_t y, u8 clr); // Draw a line between (x0, y0) and (x1, y1). void draw_line(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); // Draw a rectangle between (x0, y0) and (x1, y1) (x0 <= x1 && y0 <= y1). void draw_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); // Draw a filled rectangle between (x0, y0) and (x1, y1) (x0 <= x1 and y0 <= y1). void draw_filled_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr); // Fills the framebuffer with the given color. void screen_fill(u8 clr); // Draws a chr sprite (16 * u8). The first 8 bytes correspond to ch0 and the // last 8 to ch1. If clr is 0 the regular 4bit color will be used, from clr 1-14 // the given color will overwrite the existing one. Color 15 will "clear" the // sprite instead. void draw_chr(size_t x, size_t y, u8 *sprite, u8 clr, u8 flip_x, u8 flip_y); // Draws a 1bpp icn sprite in the given color. void draw_icn(size_t x, size_t y, u8 *sprite, u8 clr, u8 flip_x, u8 flip_y); // Copies data and performs page flipping if needed. // To be called exactly once at the beginning of the VBlank. void flip_buffer(void); // Initializes the renderer. void renderer_init(void); #endif // RENDERER__H