mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-04-04 09:37:10 +02:00
render: use shorter color names
This commit is contained in:
parent
bfbbc440fd
commit
5a575a278f
7 changed files with 28 additions and 28 deletions
|
@ -33,12 +33,12 @@ typedef uint16_t color_t;
|
|||
|
||||
enum {
|
||||
/* Compatibility with fx9860g color names */
|
||||
color_white = 0xffff,
|
||||
color_light = 0xaaaa,
|
||||
color_dark = 0x5555,
|
||||
color_black = 0x0000,
|
||||
C_WHITE = 0xffff,
|
||||
C_LIGHT = 0xaaaa,
|
||||
C_DARK = 0x5555,
|
||||
C_BLACK = 0x0000,
|
||||
|
||||
color_none = -1,
|
||||
C_NONE = -1,
|
||||
};
|
||||
|
||||
//---
|
||||
|
|
|
@ -40,18 +40,18 @@ extern uint32_t *vram;
|
|||
typedef enum
|
||||
{
|
||||
/* Opaque colors */
|
||||
color_white = 0,
|
||||
color_light = 1,
|
||||
color_dark = 2,
|
||||
color_black = 3,
|
||||
C_WHITE = 0,
|
||||
C_LIGHT = 1,
|
||||
C_DARK = 2,
|
||||
C_BLACK = 3,
|
||||
|
||||
/* Monochrome operators */
|
||||
color_none = 4,
|
||||
color_invert = 5,
|
||||
C_NONE = 4,
|
||||
C_INVERT = 5,
|
||||
|
||||
/* Gray operators */
|
||||
color_lighten = 6,
|
||||
color_darken = 7,
|
||||
C_LIGHTEN = 6,
|
||||
C_DARKEN = 7,
|
||||
|
||||
} color_t;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static void print(int x, int y, const char *format, ...)
|
|||
vsprintf(str + 2, format, args);
|
||||
|
||||
#ifdef FX9860G
|
||||
dtext(6 * (x-1) + 1, 8 * (y-1), str + 2, color_black, color_white);
|
||||
dtext(6 * (x-1) + 1, 8 * (y-1), str + 2, C_BLACK, C_WHITE);
|
||||
#endif
|
||||
|
||||
#ifdef FXCG50
|
||||
|
@ -72,7 +72,7 @@ void bootlog_loaded(void)
|
|||
const char *names = "SH7337\0 SH7305\0 SH7355\0 SH7724";
|
||||
|
||||
/* TODO: Use a solid API for boot-time printing */
|
||||
dclear(color_white);
|
||||
dclear(C_WHITE);
|
||||
print(1, 1, "gint @%7x SLmkd", GINT_VERSION);
|
||||
|
||||
if(mpu >= 1 && mpu <= 4) print(1, 2, names + 8 * (mpu - 1));
|
||||
|
|
|
@ -8,7 +8,7 @@ void dclear(color_t color)
|
|||
pre-decrement write; the other similar mode is post-increment
|
||||
read. So we'll use pre-decrement writes to improve performance. */
|
||||
|
||||
if(color != color_white && color != color_black) return;
|
||||
if(color != C_WHITE && color != C_BLACK) return;
|
||||
uint32_t fill = -(color >> 1);
|
||||
|
||||
uint32_t *index = vram + 256;
|
||||
|
|
|
@ -15,21 +15,21 @@ void dhline(int x1, int x2, int y, color_t color)
|
|||
|
||||
uint32_t *data = vram + (y << 2);
|
||||
|
||||
if(color == color_white)
|
||||
if(color == C_WHITE)
|
||||
{
|
||||
data[0] &= ~m[0];
|
||||
data[1] &= ~m[1];
|
||||
data[2] &= ~m[2];
|
||||
data[3] &= ~m[3];
|
||||
}
|
||||
else if(color == color_black)
|
||||
else if(color == C_BLACK)
|
||||
{
|
||||
data[0] |= m[0];
|
||||
data[1] |= m[1];
|
||||
data[2] |= m[2];
|
||||
data[3] |= m[3];
|
||||
}
|
||||
else if(color == color_invert)
|
||||
else if(color == C_INVERT)
|
||||
{
|
||||
data[0] ^= m[0];
|
||||
data[1] ^= m[1];
|
||||
|
@ -48,15 +48,15 @@ void dvline(int y1, int y2, int x, color_t color)
|
|||
uint32_t *lword = base + ((y2 - y1 + 1) << 2);
|
||||
uint32_t mask = 1 << (~x & 31);
|
||||
|
||||
if(color == color_white)
|
||||
if(color == C_WHITE)
|
||||
{
|
||||
while(lword > base) lword -= 4, *lword &= ~mask;
|
||||
}
|
||||
else if(color == color_black)
|
||||
else if(color == C_BLACK)
|
||||
{
|
||||
while(lword > base) lword -= 4, *lword |= mask;
|
||||
}
|
||||
else if(color == color_invert)
|
||||
else if(color == C_INVERT)
|
||||
{
|
||||
while(lword > base) lword -= 4, *lword ^= mask;
|
||||
}
|
||||
|
|
|
@ -11,15 +11,15 @@ void dpixel(int x, int y, color_t color)
|
|||
uint32_t *lword = vram + (y << 2) + (x >> 5);
|
||||
uint32_t mask = 1 << (~x & 31);
|
||||
|
||||
if(color == color_white)
|
||||
if(color == C_WHITE)
|
||||
{
|
||||
*lword &= ~mask;
|
||||
}
|
||||
else if(color == color_black)
|
||||
else if(color == C_BLACK)
|
||||
{
|
||||
*lword |= mask;
|
||||
}
|
||||
else if(color == color_invert)
|
||||
else if(color == C_INVERT)
|
||||
{
|
||||
*lword ^= mask;
|
||||
}
|
||||
|
|
|
@ -23,21 +23,21 @@ void drect(int x1, int y1, int x2, int y2, color_t color)
|
|||
uint32_t *base = vram + (y1 << 2);
|
||||
uint32_t *lword = vram + (y2 << 2) + 4;
|
||||
|
||||
if(color == color_white) while(lword > base)
|
||||
if(color == C_WHITE) while(lword > base)
|
||||
{
|
||||
*--lword &= ~m[3];
|
||||
*--lword &= ~m[2];
|
||||
*--lword &= ~m[1];
|
||||
*--lword &= ~m[0];
|
||||
}
|
||||
else if(color == color_black) while(lword > base)
|
||||
else if(color == C_BLACK) while(lword > base)
|
||||
{
|
||||
*--lword |= m[3];
|
||||
*--lword |= m[2];
|
||||
*--lword |= m[1];
|
||||
*--lword |= m[0];
|
||||
}
|
||||
else if(color == color_invert) while(lword > base)
|
||||
else if(color == C_INVERT) while(lword > base)
|
||||
{
|
||||
*--lword ^= m[3];
|
||||
*--lword ^= m[2];
|
||||
|
|
Loading…
Add table
Reference in a new issue