mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2025-06-07 11:35:05 +02:00
Compare commits
No commits in common. "fa9c225c99f51425191e19f9449f439c53d34091" and "c2cc3e48f2188ca968bc038ede21cbbe4b6040f9" have entirely different histories.
fa9c225c99
...
c2cc3e48f2
1 changed files with 19 additions and 24 deletions
|
@ -15,19 +15,14 @@ void gint_dhline(int x1, int x2, int y, int color)
|
|||
int offset = DWIDTH * y;
|
||||
|
||||
/* Use longwords to do the copy, but first paint the endpoints to heed
|
||||
for odd x1 and x2. Checking the parity may be a waste of time for
|
||||
"real" color, but must be checked when C_INVERT in involved to
|
||||
avoid "cancelling" invert effect with potential overdraw of the
|
||||
next operation. */
|
||||
if (color != C_INVERT) {
|
||||
gint_vram[offset + x1] = color;
|
||||
gint_vram[offset + x2] = color;
|
||||
} else {
|
||||
if (x1 & 1)
|
||||
gint_vram[offset + x1] ^= 0xffff;
|
||||
if (x2 & 1)
|
||||
gint_vram[offset + x2] ^= 0xffff;
|
||||
}
|
||||
for odd x1 and x2. Checking the parity may be a waste of time. */
|
||||
if (color != C_INVERT) {
|
||||
gint_vram[offset + x1] = color;
|
||||
gint_vram[offset + x2] = color;
|
||||
} else {
|
||||
gint_vram[offset + x1] ^= 0xffff;
|
||||
gint_vram[offset + x2] ^= 0xffff;
|
||||
}
|
||||
|
||||
/* Now round to longword boundaries and copy everything in-between with
|
||||
longwords */
|
||||
|
@ -37,12 +32,12 @@ void gint_dhline(int x1, int x2, int y, int color)
|
|||
uint32_t *start = (void *)(gint_vram + offset + x1);
|
||||
uint32_t *end = (void *)(gint_vram + offset + x2);
|
||||
|
||||
if (color != C_INVERT) {
|
||||
uint32_t op = (color << 16) | color;
|
||||
while(end > start) *--end = op;
|
||||
} else {
|
||||
while(end > start) *--end ^= 0xffffffff;
|
||||
}
|
||||
if (color != C_INVERT) {
|
||||
uint32_t op = (color << 16) | color;
|
||||
while(end > start) *--end = op;
|
||||
} else {
|
||||
while(end > start) *--end ^= 0xffffffff;
|
||||
}
|
||||
}
|
||||
|
||||
/* gint_dvline(): Optimized vertical line */
|
||||
|
@ -56,11 +51,11 @@ void gint_dvline(int y1, int y2, int x, int color)
|
|||
uint16_t *v = gint_vram + DWIDTH * y1 + x;
|
||||
int height = y2 - y1 + 1;
|
||||
|
||||
if (color != C_INVERT) {
|
||||
while(height-- > 0) *v = color, v += DWIDTH;
|
||||
} else {
|
||||
while(height-- > 0) *v ^= 0xffff, v += DWIDTH;
|
||||
}
|
||||
if (color != C_INVERT) {
|
||||
while(height-- > 0) *v = color, v += DWIDTH;
|
||||
} else {
|
||||
while(height-- > 0) *v ^= 0xffff, v += DWIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue