6 #define DRAWMETHOD_NORMAL(adr,col) {*(adr) = (col);}
11 #define DRAWMETHOD_PLUS(_out,_backbuf,_col) \
13 movd_m2r (_backbuf, mm0); \
14 paddusb_m2r (_col, mm0); \
15 movd_r2m (mm0, _out); \
19 #define DRAWMETHOD_PLUS(_out,_backbuf,_col) \
22 unsigned char *bra = (unsigned char*)&(_backbuf);\
23 unsigned char *dra = (unsigned char*)&(_out);\
24 unsigned char *cra = (unsigned char*)&(_col);\
28 if (tra>255) tra=255;\
35 #define DRAWMETHOD_OR(adr,col) {*(adr)|=(col);}
38 #define DRAWMETHOD_DONE() {__asm__ __volatile__ ("emms");}
40 #define DRAWMETHOD_DONE() {}
44 #define DRAWMETHOD DRAWMETHOD_PLUS(*p,*p,col)
46 static void draw_line (
int *data,
int x1,
int y1,
int x2,
int y2,
int col,
int screenx,
int screeny) {
54 if ((y1 < 0) || (y2 < 0) || (
x1 < 0) || (
x2 < 0) || (y1 >= screeny) || (y2 >= screeny) || (
x1 >= screenx) || (
x2 >= screenx))
73 p = &(data[(screenx * y1) +
x1]);
74 for (y = y1; y <= y2; y++) {
80 p = &(data[(screenx * y2) +
x1]);
81 for (y = y2; y <= y1; y++) {
91 p = &(data[(screenx * y1) +
x1]);
92 for (x =
x1; x <=
x2; x++) {
98 p = &(data[(screenx * y1) +
x2]);
99 for (x =
x2; x <=
x1; x++) {
111 dx = ((dx << 16) / dy);
113 for (y = y1; y <= y2; y++) {
115 p = &(data[(screenx * y) + xx]);
118 if (xx < (screenx - 1)) {
127 dy = ((dy << 16) / dx);
129 for (x =
x1; x <=
x2; x++) {
131 p = &(data[(screenx * yy) + x]);
142 dx = ((dx << 16) / -dy);
144 for (y = y1; y >= y2; y--) {
146 p = &(data[(screenx * y) + xx]);
149 if (xx < (screenx - 1)) {
158 dy = ((dy << 16) / dx);
160 for (x =
x1; x <=
x2; x++) {
162 p = &(data[(screenx * yy) + x]);
171 #endif // DRAWMETHODS_H