From 6f448b8f2c589b73b508b0a353d6dea4eb6aea40 Mon Sep 17 00:00:00 2001 From: jeffman Date: Sun, 16 Apr 2017 19:14:02 -0400 Subject: [PATCH] Added some clearing routines --- compiled/vwf.c | 11 +++++++++++ compiled/vwf.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/compiled/vwf.c b/compiled/vwf.c index 1931501..6d9accf 100644 --- a/compiled/vwf.c +++ b/compiled/vwf.c @@ -180,6 +180,12 @@ int print_window_header_string(int *dest, byte *str, int x, int y) return pixelX - (x & 7); } +void clear_window_header(int *dest) +{ + dest += (0x10 + (0x11 * 32)) * 8; + clear_rect_ram(dest, 16, 0x33333333); +} + void weld_entry(WINDOW *window, byte *str) { weld_entry_custom(window, str, 0, 0xF); @@ -234,6 +240,11 @@ void clear_rect(int x, int y, int width, int height, int pixels) } } +void clear_rect_ram(int *dest, int tileCount, int pixels) +{ + cpufastset(&pixels, dest, CPUFASTSET_FILL | (tileCount * 8)); +} + void clear_window(WINDOW *window) { clear_rect(window->window_x, window->window_y, diff --git a/compiled/vwf.h b/compiled/vwf.h index 01d4475..ad82876 100644 --- a/compiled/vwf.h +++ b/compiled/vwf.h @@ -19,10 +19,12 @@ byte print_character_with_callback(byte chr, int x, int y, int font, int foregro int *dest, int (*getTileCallback)(int, int), int useTilemap); byte print_character_to_ram(byte chr, int *dest, int xOffset, int font, int foreground); int print_window_header_string(int *dest, byte *str, int x, int y); +void clear_window_header(int *dest); void weld_entry(WINDOW *window, byte *str); void weld_entry_custom(WINDOW *window, byte *str, int font, int foreground); void clear_tile(int x, int y, int pixels); void clear_rect(int x, int y, int width, int height, int pixels); +void clear_rect_ram(int *dest, int tileCount, int pixels); void clear_window(WINDOW *window); void print_blankstr(int x, int y, int width); void copy_tile(int xSource, int ySource, int xDest, int yDest);