mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-01-06 08:53:36 +01:00
4df3d69d8c
Mono text rendering is a bad hack and probably not that fast, but meh. We can optimize it the day it becomes a bottleneck, if ever...
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
#include <gint/display.h>
|
|
#include "render-fx.h"
|
|
|
|
/* dclear() - fill the screen with a single color */
|
|
void dclear(color_t color)
|
|
{
|
|
if(dwindow.left != 0 || dwindow.right != DWIDTH) {
|
|
drect(dwindow.left, dwindow.top, dwindow.right - 1,
|
|
dwindow.bottom - 1, color);
|
|
return;
|
|
}
|
|
|
|
DMODE_OVERRIDE(dclear, 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 *start = gint_vram + 4 * dwindow.top;
|
|
uint32_t *index = gint_vram + 4 * dwindow.bottom;
|
|
|
|
while(index > start)
|
|
{
|
|
/* 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;
|
|
}
|
|
}
|