Added some clearing routines

This commit is contained in:
jeffman 2017-04-16 19:14:02 -04:00
parent 1264803232
commit 6f448b8f2c
2 changed files with 13 additions and 0 deletions

View File

@ -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,

View File

@ -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);