--- np2/vram/sdraw.mcr 2003/10/16 17:58:14 1.1.1.1 +++ np2/vram/sdraw.mcr 2004/02/09 20:39:39 1.6 @@ -1,7 +1,7 @@ // ---- plasma display -// vram off / 32bit色 +// vram off static void SCRNCALL SDSYM(p_0)(SDRAW sdraw, int maxy) { BYTE *p; @@ -25,7 +25,7 @@ static void SCRNCALL SDSYM(p_0)(SDRAW sd sdraw->y = y; } -// text or grph 1プレーン / 32bit色 +// text or grph 1プレーン static void SCRNCALL SDSYM(p_1)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -53,7 +53,7 @@ const BYTE *p; sdraw->y = y; } -// text + grph / 32bit色 +// text + grph static void SCRNCALL SDSYM(p_2)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -85,7 +85,7 @@ const BYTE *q; sdraw->y = y; } -// text + (grph:interleave) / 32bit色 +// text + (grph:interleave) static void SCRNCALL SDSYM(p_ti)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -124,7 +124,7 @@ const BYTE *p; sdraw->y = y; } -// grph:interleave / 32bit色 +// grph:interleave static void SCRNCALL SDSYM(p_gi)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -148,7 +148,7 @@ const BYTE *p; if (sdraw->dirty[y+1]) { for (x=0; xwidth; x++) { - *(UINT32 *)q = np2_pal32[NP2PAL_TEXT].d; + SDSETPIXEL(q, NP2PAL_TEXT); q += sdraw->xalign; } q -= sdraw->xbytes; @@ -163,7 +163,7 @@ const BYTE *p; sdraw->y = y; } -// text + grph:interleave / 32bit色 +// text + grph:interleave static void SCRNCALL SDSYM(p_2i)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -206,7 +206,7 @@ const BYTE *q; sdraw->y = y; } -// grph:interleave ex / 32bit色 +// grph:interleave ex static void SCRNCALL SDSYM(p_gie)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -245,7 +245,7 @@ const BYTE *p; sdraw->y = y; } -// text + grph:interleave ex / 32bit色 +// text + grph:interleave ex static void SCRNCALL SDSYM(p_2ie)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -261,6 +261,7 @@ const BYTE *q; y = sdraw->y; do { if (sdraw->dirty[y]) { + sdraw->dirty[y+1] |= 0xff; for (x=0; xwidth; x++) { SDSETPIXEL(r, p[x] + q[x] + NP2PAL_GRPH); r += sdraw->xalign; @@ -293,17 +294,92 @@ const BYTE *q; sdraw->y = y; } +#if defined(SUPPORT_CRT15KHZ) +// text or grph 1プレーン(15kHz) +static void SCRNCALL SDSYM(p_1d)(SDRAW sdraw, int maxy) { + +const BYTE *p; + BYTE *q; + int a; + int y; + int x; + int 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] + NP2PAL_GRPH; + SDSETPIXEL(q, c); + SDSETPIXEL((q + a), c); + q += sdraw->xalign; + } + q -= sdraw->xbytes; + } + p += SURFACE_WIDTH; + q += a * 2; + } while(++y < maxy); + + sdraw->src = p; + sdraw->dst = q; + sdraw->y = y; +} + +// text + grph (15kHz) +static void SCRNCALL SDSYM(p_2d)(SDRAW sdraw, int maxy) { + +const BYTE *p; +const BYTE *q; + BYTE *r; + int a; + int y; + int x; + int c; + + p = sdraw->src; + q = sdraw->src2; + r = sdraw->dst; + a = sdraw->yalign; + y = sdraw->y; + do { + if (sdraw->dirty[y]) { + for (x=0; xwidth; x++) { + c = p[x] + q[x] + NP2PAL_GRPH; + SDSETPIXEL(r, c); + SDSETPIXEL((r + a), c); + r += sdraw->xalign; + } + r -= sdraw->xbytes; + } + p += SURFACE_WIDTH; + q += SURFACE_WIDTH; + r += a * 2; + } while(++y < maxy); + + sdraw->src = p; + sdraw->src2 = q; + sdraw->dst = r; + sdraw->y = y; +} +#endif + static const SDRAWFN SDSYM(p)[] = { SDSYM(p_0), SDSYM(p_1), SDSYM(p_1), SDSYM(p_2), SDSYM(p_0), SDSYM(p_ti), SDSYM(p_gi), SDSYM(p_2i), - SDSYM(p_0), SDSYM(p_ti), SDSYM(p_gie), SDSYM(p_2ie)}; - + SDSYM(p_0), SDSYM(p_ti), SDSYM(p_gie), SDSYM(p_2ie), +#if defined(SUPPORT_CRT15KHZ) + SDSYM(p_0), SDSYM(p_1d), SDSYM(p_1d), SDSYM(p_2d), +#endif + }; // ---- normal display #ifdef SUPPORT_NORMALDISP -// vram off / 32bit色 +// vram off static void SCRNCALL SDSYM(n_0)(SDRAW sdraw, int maxy) { BYTE *p; @@ -314,11 +390,11 @@ static void SCRNCALL SDSYM(n_0)(SDRAW sd y = sdraw->y; do { if (sdraw->dirty[y]) { + SDSETPIXEL(p, NP2PAL_TEXT3); for (x=0; xwidth; x++) { - SDSETPIXEL(p, NP2PAL_TEXT2); p += sdraw->xalign; + SDSETPIXEL(p, NP2PAL_TEXT2); } - SDSETPIXEL(p, NP2PAL_TEXT2); p -= sdraw->xbytes; } p += sdraw->yalign; @@ -328,7 +404,7 @@ static void SCRNCALL SDSYM(n_0)(SDRAW sd sdraw->y = y; } -// text 1プレーン / 32bit色 +// text 1プレーン static void SCRNCALL SDSYM(n_t)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -341,7 +417,9 @@ const BYTE *p; y = sdraw->y; do { if (sdraw->dirty[y]) { - for (x=0; xwidth; x++) { + SDSETPIXEL(q, p[0] + NP2PAL_TEXT3); + q += sdraw->xalign; + for (x=1; xwidth; x++) { SDSETPIXEL(q, p[x] + NP2PAL_GRPH); q += sdraw->xalign; } @@ -357,7 +435,7 @@ const BYTE *p; sdraw->y = y; } -// grph 1プレーン / 32bit色 +// grph 1プレーン static void SCRNCALL SDSYM(n_g)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -370,7 +448,7 @@ const BYTE *p; y = sdraw->y; do { if (sdraw->dirty[y]) { - SDSETPIXEL(q, NP2PAL_TEXT2); + SDSETPIXEL(q, NP2PAL_TEXT3); for (x=0; xwidth; x++) { q += sdraw->xalign; SDSETPIXEL(q, p[x] + NP2PAL_GRPH); @@ -386,7 +464,7 @@ const BYTE *p; sdraw->y = y; } -// text + grph / 32bit色 +// text + grph static void SCRNCALL SDSYM(n_2)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -401,7 +479,7 @@ const BYTE *q; y = sdraw->y; do { if (sdraw->dirty[y]) { - SDSETPIXEL(r, q[0] + NP2PAL_GRPH); + SDSETPIXEL(r, (q[0] >> 4) + NP2PAL_TEXT3); r += sdraw->xalign; for (x=1; xwidth; x++) { SDSETPIXEL(r, p[x-1] + q[x] + NP2PAL_GRPH); @@ -421,7 +499,7 @@ const BYTE *q; sdraw->y = y; } -// text + (grph:interleave) / 32bit色 +// text + (grph:interleave) static void SCRNCALL SDSYM(n_ti)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -466,7 +544,7 @@ const BYTE *p; sdraw->y = y; } -// grph:interleave / 32bit色 +// grph:interleave static void SCRNCALL SDSYM(n_gi)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -479,7 +557,7 @@ const BYTE *p; y = sdraw->y; do { if (sdraw->dirty[y]) { - SDSETPIXEL(q, 0); + SDSETPIXEL(q, NP2PAL_TEXT3); for (x=0; xwidth; x++) { q += sdraw->xalign; SDSETPIXEL(q, p[x] + NP2PAL_GRPH); @@ -490,7 +568,7 @@ const BYTE *p; q += sdraw->yalign; if (sdraw->dirty[y+1]) { - SDSETPIXEL(q, NP2PAL_TEXT); + SDSETPIXEL(q, NP2PAL_TEXT3); for (x=0; xwidth; x++) { q += sdraw->xalign; SDSETPIXEL(q, NP2PAL_TEXT); @@ -507,7 +585,7 @@ const BYTE *p; sdraw->y = y; } -// text + grph:interleave / 32bit色 +// text + grph:interleave static void SCRNCALL SDSYM(n_2i)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -557,7 +635,7 @@ const BYTE *q; sdraw->y = y; } -// grph:interleave ex / 32bit色 +// grph:interleave ex static void SCRNCALL SDSYM(n_gie)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -571,7 +649,7 @@ const BYTE *p; do { if (sdraw->dirty[y]) { sdraw->dirty[y+1] |= 0xff; - SDSETPIXEL(q, 0); + SDSETPIXEL(q, NP2PAL_TEXT3); for (x=0; xwidth; x++) { q += sdraw->xalign; SDSETPIXEL(q, p[x] + NP2PAL_GRPH); @@ -581,7 +659,7 @@ const BYTE *p; q += sdraw->yalign; if (sdraw->dirty[y+1]) { - SDSETPIXEL(q, 0); + SDSETPIXEL(q, NP2PAL_TEXT3); for (x=0; xwidth; x++) { SDSETPIXEL(q, p[x] + NP2PAL_SKIP); q += sdraw->xalign; @@ -598,7 +676,7 @@ const BYTE *p; sdraw->y = y; } -// text + grph:interleave ex / 32bit色 +// text + grph:interleave ex static void SCRNCALL SDSYM(n_2ie)(SDRAW sdraw, int maxy) { const BYTE *p; @@ -653,9 +731,133 @@ const BYTE *q; sdraw->y = y; } +#if defined(SUPPORT_CRT15KHZ) +// text 1プレーン (15kHz) +static void SCRNCALL SDSYM(n_td)(SDRAW sdraw, int maxy) { + +const BYTE *p; + BYTE *q; + int a; + int y; + int x; + int c; + + p = sdraw->src; + q = sdraw->dst; + a = sdraw->yalign; + y = sdraw->y; + do { + if (sdraw->dirty[y]) { + c = p[0] + NP2PAL_TEXT3; + SDSETPIXEL(q, c); + SDSETPIXEL((q + a), c); + q += sdraw->xalign; + for (x=1; xwidth; x++) { + c = p[x] + NP2PAL_GRPH; + SDSETPIXEL(q, c); + SDSETPIXEL((q + a), c); + q += sdraw->xalign; + } + SDSETPIXEL(q, NP2PAL_TEXT2); + SDSETPIXEL((q + a), NP2PAL_TEXT2); + q -= sdraw->xbytes; + } + p += SURFACE_WIDTH; + q += a * 2; + } while(++y < maxy); + + sdraw->src = p; + sdraw->dst = q; + sdraw->y = y; +} + +// grph 1プレーン (15kHz) +static void SCRNCALL SDSYM(n_gd)(SDRAW sdraw, int maxy) { + +const BYTE *p; + BYTE *q; + int a; + int y; + int x; + int c; + + p = sdraw->src; + q = sdraw->dst; + a = sdraw->yalign; + y = sdraw->y; + do { + if (sdraw->dirty[y]) { + SDSETPIXEL(q, NP2PAL_TEXT3); + SDSETPIXEL((q + a), NP2PAL_TEXT3); + for (x=0; xwidth; x++) { + q += sdraw->xalign; + c = p[x] + NP2PAL_GRPH; + SDSETPIXEL(q, c); + SDSETPIXEL((q + a), c); + } + q -= sdraw->xbytes; + } + p += SURFACE_WIDTH; + q += a * 2; + } while(++y < maxy); + + sdraw->src = p; + sdraw->dst = q; + sdraw->y = y; +} + +// text + grph (15kHz) +static void SCRNCALL SDSYM(n_2d)(SDRAW sdraw, int maxy) { + +const BYTE *p; +const BYTE *q; + BYTE *r; + int a; + int y; + int x; + int c; + + p = sdraw->src; + q = sdraw->src2; + r = sdraw->dst; + a = sdraw->yalign; + y = sdraw->y; + do { + if (sdraw->dirty[y]) { + c = (q[0] >> 4) + NP2PAL_TEXT3; + SDSETPIXEL(r, c); + SDSETPIXEL((r + a), c); + r += sdraw->xalign; + for (x=1; xwidth; x++) { + c = p[x-1] + q[x] + NP2PAL_GRPH; + SDSETPIXEL(r, c); + SDSETPIXEL((r + a), c); + r += sdraw->xalign; + } + c = p[x-1] + NP2PAL_GRPH; + SDSETPIXEL(r, c); + SDSETPIXEL((r + a), c); + r -= sdraw->xbytes; + } + p += SURFACE_WIDTH; + q += SURFACE_WIDTH; + r += a * 2; + } while(++y < maxy); + + sdraw->src = p; + sdraw->src2 = q; + sdraw->dst = r; + sdraw->y = y; +} +#endif + static const SDRAWFN SDSYM(n)[] = { SDSYM(n_0), SDSYM(n_t), SDSYM(n_g), SDSYM(n_2), SDSYM(n_0), SDSYM(n_ti), SDSYM(n_gi), SDSYM(n_2i), - SDSYM(n_0), SDSYM(n_ti), SDSYM(n_gie), SDSYM(n_2ie)}; + SDSYM(n_0), SDSYM(n_ti), SDSYM(n_gie), SDSYM(n_2ie), +#if defined(SUPPORT_CRT15KHZ) + SDSYM(n_0), SDSYM(n_td), SDSYM(n_gd), SDSYM(n_2d), +#endif + }; #endif