Fast Line Drawing
void FastDrawLine(unsigned char* plane,short x1,short y1,short x2,short y2,short mode) __attribute__((__stkparm__));
void FastDrawLine_R(register unsigned char* plane asm("%a0"),register short x1 asm("%d0"),register short y1 asm("%d1"),register short x2 asm("%d2"),register short y2 asm("%d3"),short mode) __attribute__((__stkparm__));
FastDrawLine() is a replacement for the AMS DrawLine function.
It's almost 500 percent faster (see demo2), faster than that of graphlib too (ask me for
the kernel-based bench if you want it). Valid modes are A_REVERSE, A_NORMAL, A_XOR,
A_REPLACE, A_OR (A_NORMAL = A_REPLACE = A_OR is assumed if mode is neither A_REVERSE nor
A_XOR).FastDrawLine draws a line from (x1, y1) to
(x2, y2) on a video plane of size 240x128 pixels using attribute
mode.
void FastDrawHLine(unsigned char* plane,short x1,short x2,short y,short mode) __attribute__((__stkparm__));
void FastDrawHLine_R(register unsigned char* plane asm("a0"), register short x1 asm("d0"), register short x2 asm("d1"), register short y asm("d2"),short mode) __attribute__((__stkparm__));
FastDrawHLine() draws a horizontal line from point (x1, y) to
(x2, y) on a video plane of size 240x128 pixels using attribute mode.
Valid modes are A_REVERSE, A_NORMAL, A_XOR, A_REPLACE, A_OR (A_NORMAL = A_REPLACE = A_OR is
assumed if mode is neither A_REVERSE nor A_XOR).
If the specified mode is not one of these nothing will be drawn.
NOTE: This function is even more optimized than FastDrawLine and tries to write blocks of
16 points at each loop.
void FastDrawVLine(unsigned char* plane,short x,short y1,short y2,short mode) __attribute__((__stkparm__));
void FastDrawVLine_R(register unsigned char* plane asm("%a0"),register short x asm("%d0"),register short y1 asm("%d1"),register short y2 asm("%d2"),short mode) __attribute__((__stkparm__));
FastDrawVLine() draws a vertical line from point (x, y1) to
(x, y2) on a video plane of size 240x128 pixels using attribute mode.
Valid modes are A_REVERSE, A_NORMAL, A_XOR, A_REPLACE, A_OR (A_NORMAL = A_REPLACE = A_OR is
assumed if mode is neither A_REVERSE nor A_XOR).
void FastLine_Draw_R(void *plane asm("%a0"),short x1 asm("%d0"),short y1 asm("%d1"),short x2 asm("%d2"),short y2 asm("%d3")) __attribute__((__regparm__));
void FastLine_Erase_R(void *plane asm("%a0"),short x1 asm("%d0"),short y1 asm("%d1"),short x2 asm("%d2"),short y2 asm("%d3")) __attribute__((__regparm__));
void FastLine_Invert_R(void *plane asm("%a0"),short x1 asm("%d0"),short y1 asm("%d1"),short x2 asm("%d2"),short y2 asm("%d3")) __attribute__((__regparm__));
These routines are replacements for the AMS DrawLine function.
They're almost 500 percent faster (same speed as FastDrawLine()).
The drawing mode is hard-coded into them: A_NORMAL = A_REPLACE = A_OR for FastLine_Draw_R,
A_REVERSE for FastLine_Erase_R, A_XOR for FastLine_Invert_R.
These routines draw a line from (x1, y1) to
(x2, y2)
on a video plane of size 240x128 pixels using hard-coded attribute.