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;
|
int offset = DWIDTH * y;
|
||||||
|
|
||||||
/* Use longwords to do the copy, but first paint the endpoints to heed
|
/* 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
|
for odd x1 and x2. Checking the parity may be a waste of time. */
|
||||||
"real" color, but must be checked when C_INVERT in involved to
|
if (color != C_INVERT) {
|
||||||
avoid "cancelling" invert effect with potential overdraw of the
|
gint_vram[offset + x1] = color;
|
||||||
next operation. */
|
gint_vram[offset + x2] = color;
|
||||||
if (color != C_INVERT) {
|
} else {
|
||||||
gint_vram[offset + x1] = color;
|
gint_vram[offset + x1] ^= 0xffff;
|
||||||
gint_vram[offset + x2] = color;
|
gint_vram[offset + x2] ^= 0xffff;
|
||||||
} else {
|
}
|
||||||
if (x1 & 1)
|
|
||||||
gint_vram[offset + x1] ^= 0xffff;
|
|
||||||
if (x2 & 1)
|
|
||||||
gint_vram[offset + x2] ^= 0xffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now round to longword boundaries and copy everything in-between with
|
/* Now round to longword boundaries and copy everything in-between with
|
||||||
longwords */
|
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 *start = (void *)(gint_vram + offset + x1);
|
||||||
uint32_t *end = (void *)(gint_vram + offset + x2);
|
uint32_t *end = (void *)(gint_vram + offset + x2);
|
||||||
|
|
||||||
if (color != C_INVERT) {
|
if (color != C_INVERT) {
|
||||||
uint32_t op = (color << 16) | color;
|
uint32_t op = (color << 16) | color;
|
||||||
while(end > start) *--end = op;
|
while(end > start) *--end = op;
|
||||||
} else {
|
} else {
|
||||||
while(end > start) *--end ^= 0xffffffff;
|
while(end > start) *--end ^= 0xffffffff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* gint_dvline(): Optimized vertical line */
|
/* 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;
|
uint16_t *v = gint_vram + DWIDTH * y1 + x;
|
||||||
int height = y2 - y1 + 1;
|
int height = y2 - y1 + 1;
|
||||||
|
|
||||||
if (color != C_INVERT) {
|
if (color != C_INVERT) {
|
||||||
while(height-- > 0) *v = color, v += DWIDTH;
|
while(height-- > 0) *v = color, v += DWIDTH;
|
||||||
} else {
|
} else {
|
||||||
while(height-- > 0) *v ^= 0xffff, v += DWIDTH;
|
while(height-- > 0) *v ^= 0xffff, v += DWIDTH;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue