mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-01-06 08:53:36 +01:00
9eb723ee53
This macro used to protect the declaration of the [vram] variable of gint. This variable was short to keep drawing functions short but could clutter the namespace. That being said, it's even better to just [#define vram gint_vram] if you need. This change renames the variable to [gint_vram], exposes it whenever <gint/display.h> is included, and removes the GINT_NEED_VRAM macro altogether.
38 lines
841 B
C
38 lines
841 B
C
#include <gint/display.h>
|
|
|
|
/* dclear() - fill the screen with a single color */
|
|
void dclear(color_t color)
|
|
{
|
|
/* SuperH only supports a single write-move addressing mode, which is
|
|
pre-decrement write; the other similar mode is post-increment
|
|
read. So we'll use pre-decrement writes to improve performance. */
|
|
|
|
if(color != C_WHITE && color != C_BLACK) return;
|
|
uint32_t fill = -(color >> 1);
|
|
|
|
uint32_t *index = gint_vram + 256;
|
|
|
|
while(index > gint_vram)
|
|
{
|
|
/* Do it by batches to avoid losing cycles on loop tests */
|
|
*--index = fill;
|
|
*--index = fill;
|
|
*--index = fill;
|
|
*--index = fill;
|
|
|
|
*--index = fill;
|
|
*--index = fill;
|
|
*--index = fill;
|
|
*--index = fill;
|
|
|
|
*--index = fill;
|
|
*--index = fill;
|
|
*--index = fill;
|
|
*--index = fill;
|
|
|
|
*--index = fill;
|
|
*--index = fill;
|
|
*--index = fill;
|
|
*--index = fill;
|
|
}
|
|
}
|