--- xmil/vram/sdraw.mcr 2004/08/01 05:31:31 1.1 +++ xmil/vram/sdraw.mcr 2004/08/18 08:08:13 1.3 @@ -1,32 +1,155 @@ -static void SCRNCALL SDSYM(x1)(SDRAW sdraw, int maxy) { +// ---- 200line 15khz + +static void SCRNCALL SDSYM(_32S)(SDRAW sdraw, int maxy) { + +const UINT8 *p; + UINT8 *q; + int a; + int y; + int xmax; + int x; + UINT c; + + p = sdraw->src; + q = sdraw->dst; + a = sdraw->yalign; + y = sdraw->y; + do { + if (sdraw->dirty[y]) { + xmax = sdraw->width / 2; + for (x=0; xxalign; + SDSETPIXEL(q, c); + SDSETPIXEL(q + a, c + 0x40); + q += sdraw->xalign; + } + q -= sdraw->xbytes; + } + p += SURFACE_WIDTH * 2; + q += a * 2; + y += 2; + } while(y < maxy); + + sdraw->src = p; + sdraw->dst = q; + sdraw->y = y; +} + +static void SCRNCALL SDSYM(_62S)(SDRAW sdraw, int maxy) { const UINT8 *p; UINT8 *q; + int a; int y; int x; + UINT c; p = sdraw->src; q = sdraw->dst; + a = sdraw->yalign; y = sdraw->y; do { if (sdraw->dirty[y]) { for (x=0; xwidth; x++) { - SDSETPIXEL(q, p[x]); + c = p[x]; + SDSETPIXEL(q, c); + SDSETPIXEL(q + a, c + 0x40); q += sdraw->xalign; } q -= sdraw->xbytes; } - p += SURFACE_WIDTH; - q += sdraw->yalign; - } while(++y < maxy); + p += SURFACE_WIDTH * 2; + q += a * 2; + y += 2; + } while(y < maxy); sdraw->src = p; sdraw->dst = q; sdraw->y = y; } -static void SCRNCALL SDSYM(x2)(SDRAW sdraw, int maxy) { + +// ---- 200line 24khz + +static void SCRNCALL SDSYM(_32H)(SDRAW sdraw, int maxy) { + +const UINT8 *p; + UINT8 *q; + int a; + int y; + int xmax; + int x; + UINT c; + + p = sdraw->src; + q = sdraw->dst; + a = sdraw->yalign; + y = sdraw->y; + do { + if (sdraw->dirty[y]) { + xmax = sdraw->width / 2; + for (x=0; xxalign; + SDSETPIXEL(q, c); + SDSETPIXEL(q + a, c); + q += sdraw->xalign; + } + q -= sdraw->xbytes; + } + p += SURFACE_WIDTH * 2; + q += a * 2; + y += 2; + } while(y < maxy); + + sdraw->src = p; + sdraw->dst = q; + sdraw->y = y; +} + +static void SCRNCALL SDSYM(_62H)(SDRAW sdraw, int maxy) { + +const UINT8 *p; + UINT8 *q; + int a; + int y; + int x; + UINT c; + + p = sdraw->src; + q = sdraw->dst; + a = sdraw->yalign; + y = sdraw->y; + do { + if (sdraw->dirty[y]) { + for (x=0; xwidth; x++) { + c = p[x]; + SDSETPIXEL(q, c); + SDSETPIXEL(q + a, c); + q += sdraw->xalign; + } + q -= sdraw->xbytes; + } + p += SURFACE_WIDTH * 2; + q += a * 2; + y += 2; + } while(y < maxy); + + sdraw->src = p; + sdraw->dst = q; + sdraw->y = y; +} + + +// ---- 400line 24khz + +static void SCRNCALL SDSYM(_34)(SDRAW sdraw, int maxy) { const UINT8 *p; UINT8 *q; @@ -59,7 +182,37 @@ const UINT8 *p; sdraw->y = y; } -#if defined(SDSETZPIXEL) +static void SCRNCALL SDSYM(_64)(SDRAW sdraw, int maxy) { + +const UINT8 *p; + UINT8 *q; + int y; + int x; + + p = sdraw->src; + q = sdraw->dst; + y = sdraw->y; + do { + if (sdraw->dirty[y]) { + for (x=0; xwidth; x++) { + SDSETPIXEL(q, p[x]); + q += sdraw->xalign; + } + q -= sdraw->xbytes; + } + p += SURFACE_WIDTH; + q += sdraw->yalign; + } while(++y < maxy); + + sdraw->src = p; + sdraw->dst = q; + sdraw->y = y; +} + + +// ---- + +#if defined(SUPPORT_TURBOZ) && defined(SDZMODE) static void SCRNCALL SDSYM(z)(SDRAW sdraw, int maxy) { const UINT8 *p; @@ -76,10 +229,10 @@ const UINT8 *p; if (sdraw->dirty[y]) { xmax = sdraw->width / 2; for (x=0; xxalign; - SDSETZPIXEL(q, c); + SDSETPIXEL(q, c); q += sdraw->xalign; } q -= sdraw->xbytes; @@ -97,11 +250,16 @@ const UINT8 *p; // ---- -static const SDRAWFN SDSYM(p)[3] = { -#if defined(SDSETZPIXEL) - SDSYM(x1), SDSYM(x2), SDSYM(z) +static const SDRAWFN SDSYM(p)[] = { + SDSYM(_32S), SDSYM(_62S), + SDSYM(_32H), SDSYM(_62H), + SDSYM(_34), SDSYM(_64), +#if defined(SUPPORT_TURBOZ) +#if defined(SDZMODE) + SDSYM(z) #else - SDSYM(x1), SDSYM(x2), NULL + NULL +#endif #endif };