Diff for /np2/vram/sdraw.mcr between versions 1.1 and 1.7

version 1.1, 2003/10/16 17:58:14 version 1.7, 2004/06/19 11:06:36
Line 1 Line 1
   
 // ---- plasma display  // ---- plasma display
   
 // vram off / 32bit色  // vram off
 static void SCRNCALL SDSYM(p_0)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(p_0)(SDRAW sdraw, int maxy) {
   
         BYTE    *p;          BYTE    *p;
Line 25  static void SCRNCALL SDSYM(p_0)(SDRAW sd Line 25  static void SCRNCALL SDSYM(p_0)(SDRAW sd
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // text or grph 1プレーン / 32bit色  // text or grph 1プレーン
 static void SCRNCALL SDSYM(p_1)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(p_1)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 53  const BYTE *p; Line 53  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // text + grph / 32bit色  // text + grph
 static void SCRNCALL SDSYM(p_2)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(p_2)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 85  const BYTE *q; Line 85  const BYTE *q;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // text + (grph:interleave) / 32bit色  // text + (grph:interleave)
 static void SCRNCALL SDSYM(p_ti)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(p_ti)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 124  const BYTE *p; Line 124  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // grph:interleave / 32bit色  // grph:interleave
 static void SCRNCALL SDSYM(p_gi)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(p_gi)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 148  const BYTE *p; Line 148  const BYTE *p;
   
                 if (sdraw->dirty[y+1]) {                  if (sdraw->dirty[y+1]) {
                         for (x=0; x<sdraw->width; x++) {                          for (x=0; x<sdraw->width; x++) {
                                 *(UINT32 *)q = np2_pal32[NP2PAL_TEXT].d;                                  SDSETPIXEL(q, NP2PAL_TEXT);
                                 q += sdraw->xalign;                                  q += sdraw->xalign;
                         }                          }
                         q -= sdraw->xbytes;                          q -= sdraw->xbytes;
Line 163  const BYTE *p; Line 163  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // text + grph:interleave / 32bit色  // text + grph:interleave
 static void SCRNCALL SDSYM(p_2i)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(p_2i)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 206  const BYTE *q; Line 206  const BYTE *q;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 //      grph:interleave ex / 32bit色  //      grph:interleave ex
 static void SCRNCALL SDSYM(p_gie)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(p_gie)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 245  const BYTE *p; Line 245  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 //      text + grph:interleave ex / 32bit色  //      text + grph:interleave ex
 static void SCRNCALL SDSYM(p_2ie)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(p_2ie)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 261  const BYTE *q; Line 261  const BYTE *q;
         y = sdraw->y;          y = sdraw->y;
         do {          do {
                 if (sdraw->dirty[y]) {                  if (sdraw->dirty[y]) {
                           sdraw->dirty[y+1] |= 0xff;
                         for (x=0; x<sdraw->width; x++) {                          for (x=0; x<sdraw->width; x++) {
                                 SDSETPIXEL(r, p[x] + q[x] + NP2PAL_GRPH);                                  SDSETPIXEL(r, p[x] + q[x] + NP2PAL_GRPH);
                                 r += sdraw->xalign;                                  r += sdraw->xalign;
Line 293  const BYTE *q; Line 294  const BYTE *q;
         sdraw->y = y;          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; x<sdraw->width; 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; x<sdraw->width; 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)[] = {  static const SDRAWFN SDSYM(p)[] = {
                 SDSYM(p_0),             SDSYM(p_1),             SDSYM(p_1),             SDSYM(p_2),                  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_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  // ---- normal display
   
 #ifdef SUPPORT_NORMALDISP  #ifdef SUPPORT_NORMALDISP
   
 // vram off / 32bit色  // vram off
 static void SCRNCALL SDSYM(n_0)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_0)(SDRAW sdraw, int maxy) {
   
         BYTE    *p;          BYTE    *p;
Line 314  static void SCRNCALL SDSYM(n_0)(SDRAW sd Line 390  static void SCRNCALL SDSYM(n_0)(SDRAW sd
         y = sdraw->y;          y = sdraw->y;
         do {          do {
                 if (sdraw->dirty[y]) {                  if (sdraw->dirty[y]) {
                           SDSETPIXEL(p, NP2PAL_TEXT3);
                         for (x=0; x<sdraw->width; x++) {                          for (x=0; x<sdraw->width; x++) {
                                 SDSETPIXEL(p, NP2PAL_TEXT2);  
                                 p += sdraw->xalign;                                  p += sdraw->xalign;
                                   SDSETPIXEL(p, NP2PAL_TEXT2);
                         }                          }
                         SDSETPIXEL(p, NP2PAL_TEXT2);  
                         p -= sdraw->xbytes;                          p -= sdraw->xbytes;
                 }                  }
                 p += sdraw->yalign;                  p += sdraw->yalign;
Line 328  static void SCRNCALL SDSYM(n_0)(SDRAW sd Line 404  static void SCRNCALL SDSYM(n_0)(SDRAW sd
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // text 1プレーン / 32bit色  // text 1プレーン
 static void SCRNCALL SDSYM(n_t)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_t)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 341  const BYTE *p; Line 417  const BYTE *p;
         y = sdraw->y;          y = sdraw->y;
         do {          do {
                 if (sdraw->dirty[y]) {                  if (sdraw->dirty[y]) {
                         for (x=0; x<sdraw->width; x++) {                          SDSETPIXEL(q, p[0] + NP2PAL_TEXT3);
                           q += sdraw->xalign;
                           for (x=1; x<sdraw->width; x++) {
                                 SDSETPIXEL(q, p[x] + NP2PAL_GRPH);                                  SDSETPIXEL(q, p[x] + NP2PAL_GRPH);
                                 q += sdraw->xalign;                                  q += sdraw->xalign;
                         }                          }
Line 357  const BYTE *p; Line 435  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // grph 1プレーン / 32bit色  // grph 1プレーン
 static void SCRNCALL SDSYM(n_g)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_g)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 370  const BYTE *p; Line 448  const BYTE *p;
         y = sdraw->y;          y = sdraw->y;
         do {          do {
                 if (sdraw->dirty[y]) {                  if (sdraw->dirty[y]) {
                         SDSETPIXEL(q, NP2PAL_TEXT2);                          SDSETPIXEL(q, NP2PAL_TEXT3);
                         for (x=0; x<sdraw->width; x++) {                          for (x=0; x<sdraw->width; x++) {
                                 q += sdraw->xalign;                                  q += sdraw->xalign;
                                 SDSETPIXEL(q, p[x] + NP2PAL_GRPH);                                  SDSETPIXEL(q, p[x] + NP2PAL_GRPH);
Line 386  const BYTE *p; Line 464  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // text + grph / 32bit色  // text + grph
 static void SCRNCALL SDSYM(n_2)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_2)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 401  const BYTE *q; Line 479  const BYTE *q;
         y = sdraw->y;          y = sdraw->y;
         do {          do {
                 if (sdraw->dirty[y]) {                  if (sdraw->dirty[y]) {
                         SDSETPIXEL(r, q[0] + NP2PAL_GRPH);                          SDSETPIXEL(r, (q[0] >> 4) + NP2PAL_TEXT3);
                         r += sdraw->xalign;                          r += sdraw->xalign;
                         for (x=1; x<sdraw->width; x++) {                          for (x=1; x<sdraw->width; x++) {
                                 SDSETPIXEL(r, p[x-1] + q[x] + NP2PAL_GRPH);                                  SDSETPIXEL(r, p[x-1] + q[x] + NP2PAL_GRPH);
Line 421  const BYTE *q; Line 499  const BYTE *q;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // text + (grph:interleave) / 32bit色  // text + (grph:interleave)
 static void SCRNCALL SDSYM(n_ti)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_ti)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 466  const BYTE *p; Line 544  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // grph:interleave / 32bit色  // grph:interleave
 static void SCRNCALL SDSYM(n_gi)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_gi)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 479  const BYTE *p; Line 557  const BYTE *p;
         y = sdraw->y;          y = sdraw->y;
         do {          do {
                 if (sdraw->dirty[y]) {                  if (sdraw->dirty[y]) {
                         SDSETPIXEL(q, 0);                          SDSETPIXEL(q, NP2PAL_TEXT3);
                         for (x=0; x<sdraw->width; x++) {                          for (x=0; x<sdraw->width; x++) {
                                 q += sdraw->xalign;                                  q += sdraw->xalign;
                                 SDSETPIXEL(q, p[x] + NP2PAL_GRPH);                                  SDSETPIXEL(q, p[x] + NP2PAL_GRPH);
Line 490  const BYTE *p; Line 568  const BYTE *p;
                 q += sdraw->yalign;                  q += sdraw->yalign;
   
                 if (sdraw->dirty[y+1]) {                  if (sdraw->dirty[y+1]) {
                         SDSETPIXEL(q, NP2PAL_TEXT);                          SDSETPIXEL(q, NP2PAL_TEXT3);
                         for (x=0; x<sdraw->width; x++) {                          for (x=0; x<sdraw->width; x++) {
                                 q += sdraw->xalign;                                  q += sdraw->xalign;
                                 SDSETPIXEL(q, NP2PAL_TEXT);                                  SDSETPIXEL(q, NP2PAL_TEXT);
Line 507  const BYTE *p; Line 585  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 // text + grph:interleave / 32bit色  // text + grph:interleave
 static void SCRNCALL SDSYM(n_2i)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_2i)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 557  const BYTE *q; Line 635  const BYTE *q;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 //      grph:interleave ex / 32bit色  //      grph:interleave ex
 static void SCRNCALL SDSYM(n_gie)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_gie)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 571  const BYTE *p; Line 649  const BYTE *p;
         do {          do {
                 if (sdraw->dirty[y]) {                  if (sdraw->dirty[y]) {
                         sdraw->dirty[y+1] |= 0xff;                          sdraw->dirty[y+1] |= 0xff;
                         SDSETPIXEL(q, 0);                          SDSETPIXEL(q, NP2PAL_TEXT3);
                         for (x=0; x<sdraw->width; x++) {                          for (x=0; x<sdraw->width; x++) {
                                 q += sdraw->xalign;                                  q += sdraw->xalign;
                                 SDSETPIXEL(q, p[x] + NP2PAL_GRPH);                                  SDSETPIXEL(q, p[x] + NP2PAL_GRPH);
Line 581  const BYTE *p; Line 659  const BYTE *p;
                 q += sdraw->yalign;                  q += sdraw->yalign;
   
                 if (sdraw->dirty[y+1]) {                  if (sdraw->dirty[y+1]) {
                         SDSETPIXEL(q, 0);                          SDSETPIXEL(q, NP2PAL_TEXT3);
                         for (x=0; x<sdraw->width; x++) {                          for (x=0; x<sdraw->width; x++) {
                                 SDSETPIXEL(q, p[x] + NP2PAL_SKIP);  
                                 q += sdraw->xalign;                                  q += sdraw->xalign;
                                   SDSETPIXEL(q, p[x] + NP2PAL_SKIP);
                         }                          }
                         q -= sdraw->xbytes;                          q -= sdraw->xbytes;
                 }                  }
Line 598  const BYTE *p; Line 676  const BYTE *p;
         sdraw->y = y;          sdraw->y = y;
 }  }
   
 //      text + grph:interleave ex / 32bit色  //      text + grph:interleave ex
 static void SCRNCALL SDSYM(n_2ie)(SDRAW sdraw, int maxy) {  static void SCRNCALL SDSYM(n_2ie)(SDRAW sdraw, int maxy) {
   
 const BYTE      *p;  const BYTE      *p;
Line 653  const BYTE *q; Line 731  const BYTE *q;
         sdraw->y = y;          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; x<sdraw->width; 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; x<sdraw->width; 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; x<sdraw->width; 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)[] = {  static const SDRAWFN SDSYM(n)[] = {
                 SDSYM(n_0),             SDSYM(n_t),             SDSYM(n_g),             SDSYM(n_2),                  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_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  #endif
   

Removed from v.1.1  
changed lines
  Added in v.1.7


RetroPC.NET-CVS <cvs@retropc.net>