summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-06-06 12:40:11 +0200
committerBad Diode <bd@badd10de.dev>2021-06-06 12:40:11 +0200
commitdc3a5260602357da1192ebc9f1f72bb436d1df00 (patch)
tree3aee0b8d9ee33dd37445103402738a60e16f309f
parentb6d5c2a326e39063977dd546690a74e8cce24143 (diff)
downloadgba-sequencer-dc3a5260602357da1192ebc9f1f72bb436d1df00.tar.gz
gba-sequencer-dc3a5260602357da1192ebc9f1f72bb436d1df00.zip
Add clear screen function to renderer
-rw-r--r--src/renderer.c5
-rw-r--r--src/renderer.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/renderer.c b/src/renderer.c
index 3072105..d587d01 100644
--- a/src/renderer.c
+++ b/src/renderer.c
@@ -346,6 +346,11 @@ draw_tile(size_t x, size_t y, Tile *tile, bool merge) {
346 } 346 }
347} 347}
348 348
349void
350clear_screen(void) {
351 dma_fill(FRONTBUF, 0, KB(20), 3);
352}
353
349IWRAM_CODE 354IWRAM_CODE
350void 355void
351flip_buffer(void) { 356flip_buffer(void) {
diff --git a/src/renderer.h b/src/renderer.h
index fd48bcf..a240b17 100644
--- a/src/renderer.h
+++ b/src/renderer.h
@@ -46,6 +46,9 @@ void draw_filled_rect(size_t x0, size_t y0, size_t x1, size_t y1, u8 clr);
46// some merging issues if we are not careful with the chosen colors. 46// some merging issues if we are not careful with the chosen colors.
47void draw_tile(size_t x, size_t y, Tile *tile, bool merge); 47void draw_tile(size_t x, size_t y, Tile *tile, bool merge);
48 48
49// Fills the framebuffer with color 0.
50void clear_screen(void);
51
49// Copies the content of dirty tiles from the backbuffer into the frontbuffer. 52// Copies the content of dirty tiles from the backbuffer into the frontbuffer.
50// To be called exactly once at the beginning of the VBlank. 53// To be called exactly once at the beginning of the VBlank.
51void flip_buffer(void); 54void flip_buffer(void);