Diff for /np2/embed/vrammix.c between versions 1.1 and 1.2

version 1.1, 2003/11/21 06:51:10 version 1.2, 2005/02/11 21:17:21
Line 10  enum { Line 10  enum {
 };  };
   
   
 static BOOL cpyrect(MIX_RECT *r, const VRAMHDL dst, const POINT_T *pt,   static BRESULT cpyrect(MIX_RECT *r, const VRAMHDL dst, const POINT_T *pt, 
                                                                         const VRAMHDL src, const RECT_T *rct) {                                                                          const VRAMHDL src, const RECT_T *rct) {
   
         POINT_T p;          POINT_T p;
Line 78  static BOOL cpyrect(MIX_RECT *r, const V Line 78  static BOOL cpyrect(MIX_RECT *r, const V
         return(SUCCESS);          return(SUCCESS);
 }  }
   
 static BOOL mixrect(MIX_RECT *r, const VRAMHDL dst, const RECT_T *rct,  static BRESULT mixrect(MIX_RECT *r, const VRAMHDL dst, const RECT_T *rct,
                                                                         const VRAMHDL src, const POINT_T *pt) {                                                                          const VRAMHDL src, const POINT_T *pt) {
   
         int             pos;          int             pos;
Line 156  typedef struct { Line 156  typedef struct {
         int             height;          int             height;
 } MIXRECTEX;  } MIXRECTEX;
   
 static BOOL cpyrectex(MIXRECTEX *r, const VRAMHDL dst, const POINT_T *pt,  static BRESULT cpyrectex(MIXRECTEX *r, const VRAMHDL dst, const POINT_T *pt,
                                         const VRAMHDL org, const VRAMHDL src, const RECT_T *rct) {                                          const VRAMHDL org, const VRAMHDL src, const RECT_T *rct) {
   
         POINT_T p;          POINT_T p;
Line 233  static BOOL cpyrectex(MIXRECTEX *r, cons Line 233  static BOOL cpyrectex(MIXRECTEX *r, cons
         return(SUCCESS);          return(SUCCESS);
 }  }
   
 static BOOL mixrectex(MIXRECTEX *r, const VRAMHDL dst, const VRAMHDL org,  static BRESULT mixrectex(MIXRECTEX *r, const VRAMHDL dst, const VRAMHDL org,
                                         const RECT_T *rct, const VRAMHDL src, const POINT_T *pt) {                                          const RECT_T *rct, const VRAMHDL src, const POINT_T *pt) {
   
         int             pos;          int             pos;
Line 315  static BOOL mixrectex(MIXRECTEX *r, cons Line 315  static BOOL mixrectex(MIXRECTEX *r, cons
   
 static void vramsub_cpy(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_cpy(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
   
         p = src->ptr + (mr->srcpos * src->xalign);          p = src->ptr + (mr->srcpos * src->xalign);
         q = dst->ptr + (mr->dstpos * src->xalign);          q = dst->ptr + (mr->dstpos * src->xalign);
Line 329  const BYTE *p; Line 329  const BYTE *p;
   
 static void vramsub_move(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_move(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             align;          int             align;
         int             r;          int             r;
   
Line 361  const BYTE *p; Line 361  const BYTE *p;
 }  }
 static void vramsub_cpyall(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_cpyall(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             height;          int             height;
   
         p = src->ptr + (mr->srcpos * src->xalign);          p = src->ptr + (mr->srcpos * src->xalign);
Line 387  const BYTE *p; Line 387  const BYTE *p;
 static void vramsub_cpy2(VRAMHDL dst, const VRAMHDL src, UINT alpha,  static void vramsub_cpy2(VRAMHDL dst, const VRAMHDL src, UINT alpha,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         BYTE    *r;          UINT8   *r;
   
         p = src->ptr + (mr->srcpos * src->xalign);          p = src->ptr + (mr->srcpos * src->xalign);
         q = dst->ptr + (mr->dstpos * src->xalign);          q = dst->ptr + (mr->dstpos * src->xalign);
Line 408  const BYTE *p; Line 408  const BYTE *p;
   
 #ifdef SUPPORT_16BPP  #ifdef SUPPORT_16BPP
   
 static void vramsub_cpyp16(VRAMHDL dst, const VRAMHDL src, const BYTE *pat8,  static void vramsub_cpyp16(VRAMHDL dst, const VRAMHDL src, const UINT8 *pat8,
                                                                                                         MIX_RECT *mr) {                                                                                                          MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             posx;          int             posx;
Line 448  const BYTE *p; Line 448  const BYTE *p;
 static void vramsub_cpyp16w16(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyp16w16(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT pat16, MIX_RECT *mr) {                                                                                                  UINT pat16, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             posx;          int             posx;
Line 482  const BYTE *p; Line 482  const BYTE *p;
 static void vramsub_cpyp16h16(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyp16h16(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT pat16, MIX_RECT *mr) {                                                                                                  UINT pat16, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             step;          int             step;
         int             posy;          int             posy;
   
Line 504  const BYTE *p; Line 504  const BYTE *p;
   
 static void vramsub_cpyex16(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_cpyex16(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
   
Line 531  const BYTE *p; Line 531  const BYTE *p;
   
 static void vramsub_cpyex16a(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_cpyex16a(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
   
Line 569  const BYTE *a; Line 569  const BYTE *a;
 static void vramsub_cpyex16a2(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyex16a2(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT alpha64, MIX_RECT *mr) {                                                                                                  UINT alpha64, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
   
Line 606  const BYTE *a; Line 606  const BYTE *a;
   
 static void vramsub_cpyexa16a(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_cpyexa16a(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         BYTE    *b;          UINT8   *b;
         int             x;          int             x;
         int             step;          int             step;
   
Line 649  const BYTE *a; Line 649  const BYTE *a;
 static void vramsub_cpya16(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpya16(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT alpha256, MIX_RECT *mr) {                                                                                                  UINT alpha256, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
   
Line 679  const BYTE *p; Line 679  const BYTE *p;
 static void vramsub_cpyexp16w16(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyexp16w16(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT pat16, MIX_RECT *mr) {                                                                                                  UINT pat16, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             posx;          int             posx;
Line 728  const BYTE *a; Line 728  const BYTE *a;
 static void vramsub_cpyexp16h16(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyexp16h16(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT pat16, MIX_RECT *mr) {                                                                                                  UINT pat16, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             posy;          int             posy;
Line 777  const BYTE *a; Line 777  const BYTE *a;
 static void vramsub_mix16(VRAMHDL dst, const VRAMHDL org, const VRAMHDL src,  static void vramsub_mix16(VRAMHDL dst, const VRAMHDL org, const VRAMHDL src,
                                                                                         UINT alpha64, MIXRECTEX *mr) {                                                                                          UINT alpha64, MIXRECTEX *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *q;  const UINT8     *q;
         BYTE    *r;          UINT8   *r;
         int             x;          int             x;
         int             ostep;          int             ostep;
         int             sstep;          int             sstep;
Line 815  const BYTE *q; Line 815  const BYTE *q;
 static void vramsub_mixcol16(VRAMHDL dst, const VRAMHDL src, UINT32 color,  static void vramsub_mixcol16(VRAMHDL dst, const VRAMHDL src, UINT32 color,
                                                                                                 UINT alpha64, MIX_RECT *mr) {                                                                                                  UINT alpha64, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             tmp;          int             tmp;
Line 850  const BYTE *p; Line 850  const BYTE *p;
 static void vramsub_mixalpha16(VRAMHDL dst, const VRAMHDL src, UINT32 color,  static void vramsub_mixalpha16(VRAMHDL dst, const VRAMHDL src, UINT32 color,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             tmp;          int             tmp;
Line 900  const BYTE *p; Line 900  const BYTE *p;
 static void vramsub_gray16(VRAMHDL dst, const VRAMHDL org, const VRAMHDL src,  static void vramsub_gray16(VRAMHDL dst, const VRAMHDL org, const VRAMHDL src,
                                                                 const VRAMHDL bmp, int delta, MIXRECTEX *mr) {                                                                  const VRAMHDL bmp, int delta, MIXRECTEX *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *q;  const UINT8     *q;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *r;          UINT8   *r;
         int             rm;          int             rm;
         int             x, y;          int             x, y;
         int             ostep;          int             ostep;
Line 964  const BYTE *a; Line 964  const BYTE *a;
 static void vramsub_zoom16(VRAMHDL dst, const VRAMHDL src, int dot,  static void vramsub_zoom16(VRAMHDL dst, const VRAMHDL src, int dot,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
 const BYTE      *pbase;  const UINT8     *pbase;
 const BYTE      *p;  const UINT8     *p;
         BYTE    *qbase;          UINT8   *qbase;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             dstep;          int             dstep;
         int             xstep;          int             xstep;
Line 1013  const BYTE *p; Line 1013  const BYTE *p;
 static void vramsub_mosaic16(VRAMHDL dst, const VRAMHDL src, int dot,  static void vramsub_mosaic16(VRAMHDL dst, const VRAMHDL src, int dot,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         BYTE    *r;          UINT8   *r;
         int             x;          int             x;
         int             sstep;          int             sstep;
         int             dstep;          int             dstep;
Line 1062  const BYTE *p; Line 1062  const BYTE *p;
 static void vramsub_colex16(VRAMHDL dst, const VRAMHDL src, UINT32 color,  static void vramsub_colex16(VRAMHDL dst, const VRAMHDL src, UINT32 color,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
         BYTE    *p, *q;          UINT8   *p, *q;
         int             x;          int             x;
         int             step;          int             step;
         UINT    tmp;          UINT    tmp;
Line 1105  static void vramsub_colex16(VRAMHDL dst, Line 1105  static void vramsub_colex16(VRAMHDL dst,
   
 #ifdef SUPPORT_24BPP  #ifdef SUPPORT_24BPP
   
 static void vramsub_cpyp24(VRAMHDL dst, const VRAMHDL src, const BYTE *pat8,  static void vramsub_cpyp24(VRAMHDL dst, const VRAMHDL src, const UINT8 *pat8,
                                                                                                                 MIX_RECT *mr) {                                                                                                                  MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             posx;          int             posx;
Line 1147  const BYTE *p; Line 1147  const BYTE *p;
 static void vramsub_cpyp16w24(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyp16w24(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT pat16, MIX_RECT *mr) {                                                                                                  UINT pat16, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             posx;          int             posx;
Line 1183  const BYTE *p; Line 1183  const BYTE *p;
 static void vramsub_cpyp16h24(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyp16h24(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT pat16, MIX_RECT *mr) {                                                                                                  UINT pat16, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             step;          int             step;
         int             posy;          int             posy;
   
Line 1205  const BYTE *p; Line 1205  const BYTE *p;
   
 static void vramsub_cpyex24(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_cpyex24(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
   
Line 1217  const BYTE *p; Line 1217  const BYTE *p;
         do {          do {
                 x = mr->width;                  x = mr->width;
                 do {                  do {
                         BYTE r, g, b;                          UINT8 r, g, b;
                         b = p[0];                          b = p[0];
                         g = p[1];                          g = p[1];
                         r = p[2];                          r = p[2];
Line 1236  const BYTE *p; Line 1236  const BYTE *p;
   
 static void vramsub_cpyex24a(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_cpyex24a(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
   
Line 1254  const BYTE *a; Line 1254  const BYTE *a;
                         alpha = *a++;                          alpha = *a++;
                         if (alpha) {                          if (alpha) {
                                 alpha += VRAMALPHABASE;                                  alpha += VRAMALPHABASE;
                                 q[0] = (BYTE)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT);                                  q[0] = (UINT8)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT);
                                 q[1] = (BYTE)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT);                                  q[1] = (UINT8)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT);
                                 q[2] = (BYTE)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT);                                  q[2] = (UINT8)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT);
                         }                          }
                         p += 3;                          p += 3;
                         q += 3;                          q += 3;
Line 1270  const BYTE *a; Line 1270  const BYTE *a;
 static void vramsub_cpyex24a2(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyex24a2(VRAMHDL dst, const VRAMHDL src,
                                                                                         UINT alpha64, MIX_RECT *mr) {                                                                                          UINT alpha64, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
   
Line 1288  const BYTE *a; Line 1288  const BYTE *a;
                         alpha = *a++;                          alpha = *a++;
                         if (alpha) {                          if (alpha) {
                                 alpha = (alpha + VRAMALPHABASE) * alpha64;                                  alpha = (alpha + VRAMALPHABASE) * alpha64;
                                 q[0] = (BYTE)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT+6);                                  q[0] = (UINT8)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT+6);
                                 q[1] = (BYTE)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT+6);                                  q[1] = (UINT8)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT+6);
                                 q[2] = (BYTE)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT+6);                                  q[2] = (UINT8)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT+6);
                         }                          }
                         p += 3;                          p += 3;
                         q += 3;                          q += 3;
Line 1303  const BYTE *a; Line 1303  const BYTE *a;
   
 static void vramsub_cpyexa24a(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {  static void vramsub_cpyexa24a(VRAMHDL dst, const VRAMHDL src, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         BYTE    *b;          UINT8   *b;
         int             x;          int             x;
         int             step;          int             step;
   
Line 1323  const BYTE *a; Line 1323  const BYTE *a;
                         alpha = *a++;                          alpha = *a++;
                         if (alpha) {                          if (alpha) {
                                 alpha += VRAMALPHABASE;                                  alpha += VRAMALPHABASE;
                                 q[0] = (BYTE)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT);                                  q[0] = (UINT8)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT);
                                 q[1] = (BYTE)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT);                                  q[1] = (UINT8)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT);
                                 q[2] = (BYTE)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT);                                  q[2] = (UINT8)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT);
                                 b[0] = VRAMALPHA;                                  b[0] = VRAMALPHA;
                         }                          }
                         p += 3;                          p += 3;
Line 1342  const BYTE *a; Line 1342  const BYTE *a;
 static void vramsub_cpya24(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpya24(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT alpha256, MIX_RECT *mr) {                                                                                                  UINT alpha256, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
   
Line 1354  const BYTE *p; Line 1354  const BYTE *p;
         do {          do {
                 x = mr->width;                  x = mr->width;
                 do {                  do {
                         q[0] = (BYTE)MAKEALPHA24(q[0], p[0], alpha256, 8);                          q[0] = (UINT8)MAKEALPHA24(q[0], p[0], alpha256, 8);
                         q[1] = (BYTE)MAKEALPHA24(q[1], p[1], alpha256, 8);                          q[1] = (UINT8)MAKEALPHA24(q[1], p[1], alpha256, 8);
                         q[2] = (BYTE)MAKEALPHA24(q[2], p[2], alpha256, 8);                          q[2] = (UINT8)MAKEALPHA24(q[2], p[2], alpha256, 8);
                         p += 3;                          p += 3;
                         q += 3;                          q += 3;
                 } while(--x);                  } while(--x);
Line 1368  const BYTE *p; Line 1368  const BYTE *p;
 static void vramsub_cpyexp16w24(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyexp16w24(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT pat16, MIX_RECT *mr) {                                                                                                  UINT pat16, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             posx;          int             posx;
Line 1393  const BYTE *a; Line 1393  const BYTE *a;
                                 alpha = *a;                                  alpha = *a;
                                 if (alpha) {                                  if (alpha) {
                                         alpha += VRAMALPHABASE;                                          alpha += VRAMALPHABASE;
                                         q[0] = (BYTE)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT);                                          q[0] = (UINT8)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT);
                                         q[1] = (BYTE)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT);                                          q[1] = (UINT8)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT);
                                         q[2] = (BYTE)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT);                                          q[2] = (UINT8)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT);
                                 }                                  }
                                 pat |= 0x10000;                                  pat |= 0x10000;
                         }                          }
Line 1413  const BYTE *a; Line 1413  const BYTE *a;
 static void vramsub_cpyexp16h24(VRAMHDL dst, const VRAMHDL src,  static void vramsub_cpyexp16h24(VRAMHDL dst, const VRAMHDL src,
                                                                                                 UINT pat16, MIX_RECT *mr) {                                                                                                  UINT pat16, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             posy;          int             posy;
Line 1434  const BYTE *a; Line 1434  const BYTE *a;
                                 alpha = *a;                                  alpha = *a;
                                 if (alpha) {                                  if (alpha) {
                                         alpha += VRAMALPHABASE;                                          alpha += VRAMALPHABASE;
                                         q[0] = (BYTE)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT);                                          q[0] = (UINT8)MAKEALPHA24(q[0], p[0], alpha, VRAMALPHABIT);
                                         q[1] = (BYTE)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT);                                          q[1] = (UINT8)MAKEALPHA24(q[1], p[1], alpha, VRAMALPHABIT);
                                         q[2] = (BYTE)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT);                                          q[2] = (UINT8)MAKEALPHA24(q[2], p[2], alpha, VRAMALPHABIT);
                                 }                                  }
                                 p += 3;                                  p += 3;
                                 q += 3;                                  q += 3;
Line 1458  const BYTE *a; Line 1458  const BYTE *a;
 static void vramsub_mix24(VRAMHDL dst, const VRAMHDL org, const VRAMHDL src,  static void vramsub_mix24(VRAMHDL dst, const VRAMHDL org, const VRAMHDL src,
                                                                                                 UINT alpha64, MIXRECTEX *mr) {                                                                                                  UINT alpha64, MIXRECTEX *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *q;  const UINT8     *q;
         BYTE    *r;          UINT8   *r;
         int             x;          int             x;
         int             ostep;          int             ostep;
         int             sstep;          int             sstep;
Line 1476  const BYTE *q; Line 1476  const BYTE *q;
         do {          do {
                 x = mr->width;                  x = mr->width;
                 do {                  do {
                         r[0] = (BYTE)MAKEALPHA24(p[0], q[0], alpha64, 6);                          r[0] = (UINT8)MAKEALPHA24(p[0], q[0], alpha64, 6);
                         r[1] = (BYTE)MAKEALPHA24(p[1], q[1], alpha64, 6);                          r[1] = (UINT8)MAKEALPHA24(p[1], q[1], alpha64, 6);
                         r[2] = (BYTE)MAKEALPHA24(p[2], q[2], alpha64, 6);                          r[2] = (UINT8)MAKEALPHA24(p[2], q[2], alpha64, 6);
                         p += 3;                          p += 3;
                         q += 3;                          q += 3;
                         r += 3;                          r += 3;
Line 1492  const BYTE *q; Line 1492  const BYTE *q;
 static void vramsub_mixcol24(VRAMHDL dst, const VRAMHDL src, UINT32 color,  static void vramsub_mixcol24(VRAMHDL dst, const VRAMHDL src, UINT32 color,
                                                                                                 UINT alpha64, MIX_RECT *mr) {                                                                                                  UINT alpha64, MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             c24[3];          int             c24[3];
Line 1508  const BYTE *p; Line 1508  const BYTE *p;
         do {          do {
                 x = mr->width;                  x = mr->width;
                 do {                  do {
                         q[0] = (BYTE)MAKEALPHA24(c24[0], p[0], alpha64, 6);                          q[0] = (UINT8)MAKEALPHA24(c24[0], p[0], alpha64, 6);
                         q[1] = (BYTE)MAKEALPHA24(c24[1], p[1], alpha64, 6);                          q[1] = (UINT8)MAKEALPHA24(c24[1], p[1], alpha64, 6);
                         q[2] = (BYTE)MAKEALPHA24(c24[2], p[2], alpha64, 6);                          q[2] = (UINT8)MAKEALPHA24(c24[2], p[2], alpha64, 6);
                         p += 3;                          p += 3;
                         q += 3;                          q += 3;
                 } while(--x);                  } while(--x);
Line 1522  const BYTE *p; Line 1522  const BYTE *p;
 static void vramsub_mixalpha24(VRAMHDL dst, const VRAMHDL src, UINT32 color,  static void vramsub_mixalpha24(VRAMHDL dst, const VRAMHDL src, UINT32 color,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             step;          int             step;
         int             c24[3];          int             c24[3];
Line 1543  const BYTE *p; Line 1543  const BYTE *p;
                         if (a) {                          if (a) {
                                 a++;                                  a++;
                         }                          }
                         q[0] = (BYTE)MAKEALPHA24(q[0], c24[0], a, 8);                          q[0] = (UINT8)MAKEALPHA24(q[0], c24[0], a, 8);
                         a = p[1];                          a = p[1];
                         if (a) {                          if (a) {
                                 a++;                                  a++;
                         }                          }
                         q[1] = (BYTE)MAKEALPHA24(q[1], c24[1], a, 8);                          q[1] = (UINT8)MAKEALPHA24(q[1], c24[1], a, 8);
                         a = p[2];                          a = p[2];
                         if (a) {                          if (a) {
                                 a++;                                  a++;
                         }                          }
                         q[2] = (BYTE)MAKEALPHA24(q[2], c24[2], a, 8);                          q[2] = (UINT8)MAKEALPHA24(q[2], c24[2], a, 8);
                         p += 3;                          p += 3;
                         q += 3;                          q += 3;
                 } while(--x);                  } while(--x);
Line 1565  const BYTE *p; Line 1565  const BYTE *p;
 static void vramsub_gray24(VRAMHDL dst, const VRAMHDL org, const VRAMHDL src,  static void vramsub_gray24(VRAMHDL dst, const VRAMHDL org, const VRAMHDL src,
                                                                 const VRAMHDL bmp, int delta, MIXRECTEX *mr) {                                                                  const VRAMHDL bmp, int delta, MIXRECTEX *mr) {
   
 const BYTE      *p;  const UINT8     *p;
 const BYTE      *q;  const UINT8     *q;
 const BYTE      *a;  const UINT8     *a;
         BYTE    *r;          UINT8   *r;
         int             rm;          int             rm;
         int             x, y;          int             x, y;
         int             ostep;          int             ostep;
Line 1605  const BYTE *a; Line 1605  const BYTE *a;
                                 r[2] = q[2];                                  r[2] = q[2];
                         }                          }
                         else if (alpha > 0) {                          else if (alpha > 0) {
                                 r[0] = (BYTE)MAKEALPHA24(p[0], q[0], alpha, 8);                                  r[0] = (UINT8)MAKEALPHA24(p[0], q[0], alpha, 8);
                                 r[1] = (BYTE)MAKEALPHA24(p[1], q[1], alpha, 8);                                  r[1] = (UINT8)MAKEALPHA24(p[1], q[1], alpha, 8);
                                 r[2] = (BYTE)MAKEALPHA24(p[2], q[2], alpha, 8);                                  r[2] = (UINT8)MAKEALPHA24(p[2], q[2], alpha, 8);
                         }                          }
                         else {                          else {
                                 r[0] = p[0];                                  r[0] = p[0];
Line 1629  const BYTE *a; Line 1629  const BYTE *a;
 static void vramsub_zoom24(VRAMHDL dst, const VRAMHDL src, int dot,  static void vramsub_zoom24(VRAMHDL dst, const VRAMHDL src, int dot,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
 const BYTE      *pbase;  const UINT8     *pbase;
 const BYTE      *p;  const UINT8     *p;
         BYTE    *qbase;          UINT8   *qbase;
         BYTE    *q;          UINT8   *q;
         int             x;          int             x;
         int             dstep;          int             dstep;
         int             xstep;          int             xstep;
Line 1678  const BYTE *p; Line 1678  const BYTE *p;
 static void vramsub_mosaic24(VRAMHDL dst, const VRAMHDL src, int dot,  static void vramsub_mosaic24(VRAMHDL dst, const VRAMHDL src, int dot,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
         BYTE    *r;          UINT8   *r;
         int             x;          int             x;
         int             sstep;          int             sstep;
         int             dstep;          int             dstep;
Line 1727  const BYTE *p; Line 1727  const BYTE *p;
 static void vramsub_colex24(VRAMHDL dst, const VRAMHDL src, UINT32 color,  static void vramsub_colex24(VRAMHDL dst, const VRAMHDL src, UINT32 color,
                                                                                                                         MIX_RECT *mr) {                                                                                                                          MIX_RECT *mr) {
   
         BYTE    *p, *q;          UINT8   *p, *q;
         int             x;          int             x;
         int             step;          int             step;
         int             c24[3];          int             c24[3];
Line 1747  static void vramsub_colex24(VRAMHDL dst, Line 1747  static void vramsub_colex24(VRAMHDL dst,
                         a = p[0];                          a = p[0];
                         if (a) {                          if (a) {
                                 a += VRAMALPHABASE;                                  a += VRAMALPHABASE;
                                 q[0] = (BYTE)MAKEALPHA24(q[0], c24[0], a, VRAMALPHABIT);                                  q[0] = (UINT8)MAKEALPHA24(q[0], c24[0], a, VRAMALPHABIT);
                                 q[1] = (BYTE)MAKEALPHA24(q[1], c24[1], a, VRAMALPHABIT);                                  q[1] = (UINT8)MAKEALPHA24(q[1], c24[1], a, VRAMALPHABIT);
                                 q[2] = (BYTE)MAKEALPHA24(q[2], c24[2], a, VRAMALPHABIT);                                  q[2] = (UINT8)MAKEALPHA24(q[2], c24[2], a, VRAMALPHABIT);
                         }                          }
                         p += 1;                          p += 1;
                         q += 3;                          q += 3;
Line 1804  void vramcpy_cpyall(VRAMHDL dst, const P Line 1804  void vramcpy_cpyall(VRAMHDL dst, const P
   
 void vramcpy_cpypat(VRAMHDL dst, const POINT_T *pt,  void vramcpy_cpypat(VRAMHDL dst, const POINT_T *pt,
                                                         const VRAMHDL src, const RECT_T *rct,                                                          const VRAMHDL src, const RECT_T *rct,
                                                         const BYTE *pat8) {                                                          const UINT8 *pat8) {
   
         MIX_RECT        mr;          MIX_RECT        mr;
   
Line 2047  void vrammix_cpy2(VRAMHDL dst, const REC Line 2047  void vrammix_cpy2(VRAMHDL dst, const REC
   
 void vrammix_cpypat(VRAMHDL dst, const RECT_T *rct,  void vrammix_cpypat(VRAMHDL dst, const RECT_T *rct,
                                                         const VRAMHDL src, const POINT_T *pt,                                                          const VRAMHDL src, const POINT_T *pt,
                                                         const BYTE *pat8) {                                                          const UINT8 *pat8) {
   
         MIX_RECT        mr;          MIX_RECT        mr;
   
Line 2323  void vrammix_colex(VRAMHDL dst, const RE Line 2323  void vrammix_colex(VRAMHDL dst, const RE
 static void vramsub_resize16(VRAMHDL dst, MIX_RECT *drct,  static void vramsub_resize16(VRAMHDL dst, MIX_RECT *drct,
                                                                 const VRAMHDL src, const MIX_RECT *srct) {                                                                  const VRAMHDL src, const MIX_RECT *srct) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
 const BYTE      *r;  const UINT8     *r;
 const BYTE      *s;  const UINT8     *s;
         int             dstep;          int             dstep;
         int             xstep;          int             xstep;
         int             ystep;          int             ystep;
Line 2362  const BYTE *s; Line 2362  const BYTE *s;
 static void vramsub_resize24(VRAMHDL dst, MIX_RECT *drct,  static void vramsub_resize24(VRAMHDL dst, MIX_RECT *drct,
                                                                 const VRAMHDL src, const MIX_RECT *srct) {                                                                  const VRAMHDL src, const MIX_RECT *srct) {
   
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
 const BYTE      *r;  const UINT8     *r;
 const BYTE      *s;  const UINT8     *s;
         int             dstep;          int             dstep;
         int             xstep;          int             xstep;
         int             ystep;          int             ystep;
Line 2399  const BYTE *s; Line 2399  const BYTE *s;
 }  }
 #endif  #endif
   
 static BOOL cliprect(const VRAMHDL hdl, const RECT_T *rct, MIX_RECT *r) {  static BRESULT cliprect(const VRAMHDL hdl, const RECT_T *rct, MIX_RECT *r) {
   
         RECT_T  rect;          RECT_T  rect;
   
Line 2441  void vrammix_resize(VRAMHDL dst, const R Line 2441  void vrammix_resize(VRAMHDL dst, const R
   
 // ---- font  // ---- font
   
 static BOOL txtrect(VRAMHDL dst, const FNTDAT fnt, const POINT_T *pt,  static BRESULT txtrect(VRAMHDL dst, const FNTDAT fnt, const POINT_T *pt,
                                                                                 const RECT_T *rct, MIX_RECT *r) {                                                                                  const RECT_T *rct, MIX_RECT *r) {
   
         int             pos;          int             pos;
Line 2479  static BOOL txtrect(VRAMHDL dst, const F Line 2479  static BOOL txtrect(VRAMHDL dst, const F
 static void vramsub_txt8p(VRAMHDL dst, const FNTDAT fnt,  static void vramsub_txt8p(VRAMHDL dst, const FNTDAT fnt,
                                                                                                 UINT32 color, MIX_RECT *mr) {                                                                                                  UINT32 color, MIX_RECT *mr) {
   
 const BYTE              *p;  const UINT8     *p;
         BYTE            *q;          UINT8   *q;
         UINT            alpha;          UINT    alpha;
         int                     cnt;          int             cnt;
   
         p = (BYTE *)(fnt + 1);          p = (UINT8 *)(fnt + 1);
         p += mr->srcpos;          p += mr->srcpos;
         q = dst->ptr + mr->dstpos;          q = dst->ptr + mr->dstpos;
         do {          do {
Line 2493  const BYTE  *p; Line 2493  const BYTE  *p;
                         alpha = *p++;                          alpha = *p++;
                         if (alpha) {                          if (alpha) {
                                 alpha = alpha * color / FDAT_DEPTH;                                  alpha = alpha * color / FDAT_DEPTH;
                                 q[0] = (BYTE)alpha;                                  q[0] = (UINT8)alpha;
                         }                          }
                         q += 1;                          q += 1;
                 } while(--cnt);                  } while(--cnt);
Line 2506  const BYTE  *p; Line 2506  const BYTE  *p;
 static void vramsub_txt16p(VRAMHDL dst, const FNTDAT fnt,  static void vramsub_txt16p(VRAMHDL dst, const FNTDAT fnt,
                                                                                                 UINT32 color, MIX_RECT *mr) {                                                                                                  UINT32 color, MIX_RECT *mr) {
   
 const BYTE              *p;  const UINT8     *p;
         BYTE            *q;          UINT8   *q;
         UINT            alpha;          UINT    alpha;
         int                     cnt;          int             cnt;
         UINT            col16;          UINT    col16;
         int                     c16[3];          int             c16[3];
   
         col16 = MAKE16PAL(color);          col16 = MAKE16PAL(color);
         c16[0] = col16 & B16MASK;          c16[0] = col16 & B16MASK;
         c16[1] = col16 & G16MASK;          c16[1] = col16 & G16MASK;
         c16[2] = col16 & R16MASK;          c16[2] = col16 & R16MASK;
   
         p = (BYTE *)(fnt + 1);          p = (UINT8 *)(fnt + 1);
         p += mr->srcpos;          p += mr->srcpos;
         q = dst->ptr + (mr->dstpos * 2);          q = dst->ptr + (mr->dstpos * 2);
         do {          do {
Line 2552  const BYTE  *p; Line 2552  const BYTE  *p;
 static void vramsub_txt16a(VRAMHDL dst, const FNTDAT fnt,  static void vramsub_txt16a(VRAMHDL dst, const FNTDAT fnt,
                                                                                                 UINT32 color, MIX_RECT *mr) {                                                                                                  UINT32 color, MIX_RECT *mr) {
   
 const BYTE              *p;  const UINT8     *p;
         BYTE            *q;          UINT8   *q;
         BYTE            *a;          UINT8   *a;
         UINT            alpha;          UINT    alpha;
         int                     cnt;          int             cnt;
         UINT            col16;          UINT    col16;
         int                     c16[3];          int             c16[3];
   
         col16 = MAKE16PAL(color);          col16 = MAKE16PAL(color);
         c16[0] = col16 & B16MASK;          c16[0] = col16 & B16MASK;
         c16[1] = col16 & G16MASK;          c16[1] = col16 & G16MASK;
         c16[2] = col16 & R16MASK;          c16[2] = col16 & R16MASK;
   
         p = (BYTE *)(fnt + 1);          p = (UINT8 *)(fnt + 1);
         p += mr->srcpos;          p += mr->srcpos;
         q = dst->ptr + (mr->dstpos * 2);          q = dst->ptr + (mr->dstpos * 2);
         a = dst->alpha + mr->dstpos;          a = dst->alpha + mr->dstpos;
Line 2603  const BYTE  *p; Line 2603  const BYTE  *p;
 static void vramsub_txt16e(VRAMHDL dst, const FNTDAT fnt,  static void vramsub_txt16e(VRAMHDL dst, const FNTDAT fnt,
                                                                                                 UINT32 color, MIX_RECT *mr) {                                                                                                  UINT32 color, MIX_RECT *mr) {
   
 const BYTE              *p;  const UINT8     *p;
         BYTE            *q;          UINT8   *q;
         BYTE            *a;          UINT8   *a;
         UINT            alpha;          UINT    alpha;
         int                     cnt;          int             cnt;
         UINT            col16;          UINT    col16;
         int                     c16[3];          int             c16[3];
   
         col16 = MAKE16PAL(color);          col16 = MAKE16PAL(color);
         c16[0] = col16 & B16MASK;          c16[0] = col16 & B16MASK;
         c16[1] = col16 & G16MASK;          c16[1] = col16 & G16MASK;
         c16[2] = col16 & R16MASK;          c16[2] = col16 & R16MASK;
   
         p = (BYTE *)(fnt + 1);          p = (UINT8 *)(fnt + 1);
         p += mr->srcpos;          p += mr->srcpos;
         q = dst->ptr + (mr->dstpos * 2);          q = dst->ptr + (mr->dstpos * 2);
   
Line 2627  const BYTE  *p; Line 2627  const BYTE  *p;
                         alpha = (*p++) * VRAMALPHA / FDAT_DEPTH;                          alpha = (*p++) * VRAMALPHA / FDAT_DEPTH;
                         if (alpha) {                          if (alpha) {
                                 *(UINT16 *)q = (UINT16)col16;                                  *(UINT16 *)q = (UINT16)col16;
                                 a[0] = (BYTE)alpha;                                  a[0] = (UINT8)alpha;
                         }                          }
                         q += 2;                          q += 2;
                         a += 1;                          a += 1;
Line 2643  const BYTE  *p; Line 2643  const BYTE  *p;
 static void vramsub_txt24p(VRAMHDL dst, const FNTDAT fnt,  static void vramsub_txt24p(VRAMHDL dst, const FNTDAT fnt,
                                                                                                 UINT32 color, MIX_RECT *mr) {                                                                                                  UINT32 color, MIX_RECT *mr) {
   
 const BYTE              *p;  const UINT8     *p;
         BYTE            *q;          UINT8   *q;
         UINT            alpha;          UINT    alpha;
         int                     cnt;          int             cnt;
         int                     c24[3];          int             c24[3];
   
         p = (BYTE *)(fnt + 1);          p = (UINT8 *)(fnt + 1);
         p += mr->srcpos;          p += mr->srcpos;
         q = dst->ptr + (mr->dstpos * 3);          q = dst->ptr + (mr->dstpos * 3);
         c24[0] = color & 0xff;          c24[0] = color & 0xff;
Line 2661  const BYTE  *p; Line 2661  const BYTE  *p;
                         alpha = *p++;                          alpha = *p++;
                         if (alpha) {                          if (alpha) {
                                 if (alpha == FDAT_DEPTH) {                                  if (alpha == FDAT_DEPTH) {
                                         q[0] = (BYTE)c24[0];                                          q[0] = (UINT8)c24[0];
                                         q[1] = (BYTE)c24[1];                                          q[1] = (UINT8)c24[1];
                                         q[2] = (BYTE)c24[2];                                          q[2] = (UINT8)c24[2];
                                 }                                  }
                                 else {                                  else {
                                         alpha += FDATDEPTHBASE;                                          alpha += FDATDEPTHBASE;
                                         q[0] = (BYTE)MAKEALPHA24(q[0], c24[0],                                          q[0] = (UINT8)MAKEALPHA24(q[0], c24[0],
                                                                                                                 alpha, FDAT_DEPTHBIT);                                                                                                                  alpha, FDAT_DEPTHBIT);
                                         q[1] = (BYTE)MAKEALPHA24(q[1], c24[1],                                          q[1] = (UINT8)MAKEALPHA24(q[1], c24[1],
                                                                                                                 alpha, FDAT_DEPTHBIT);                                                                                                                  alpha, FDAT_DEPTHBIT);
                                         q[2] = (BYTE)MAKEALPHA24(q[2], c24[2],                                          q[2] = (UINT8)MAKEALPHA24(q[2], c24[2],
                                                                                                                 alpha, FDAT_DEPTHBIT);                                                                                                                  alpha, FDAT_DEPTHBIT);
                                 }                                  }
                         }                          }
Line 2685  const BYTE  *p; Line 2685  const BYTE  *p;
 static void vramsub_txt24a(VRAMHDL dst, const FNTDAT fnt,  static void vramsub_txt24a(VRAMHDL dst, const FNTDAT fnt,
                                                                                                 UINT32 color, MIX_RECT *mr) {                                                                                                  UINT32 color, MIX_RECT *mr) {
   
 const BYTE              *p;  const UINT8     *p;
         BYTE            *q;          UINT8   *q;
         BYTE            *a;          UINT8   *a;
         UINT            alpha;          UINT    alpha;
         int                     cnt;          int             cnt;
         int                     c24[3];          int             c24[3];
   
         p = (BYTE *)(fnt + 1);          p = (UINT8 *)(fnt + 1);
         p += mr->srcpos;          p += mr->srcpos;
         q = dst->ptr + (mr->dstpos * 3);          q = dst->ptr + (mr->dstpos * 3);
         a = dst->alpha + mr->dstpos;          a = dst->alpha + mr->dstpos;
Line 2705  const BYTE  *p; Line 2705  const BYTE  *p;
                         alpha = *p++;                          alpha = *p++;
                         if (alpha) {                          if (alpha) {
                                 if (alpha == FDAT_DEPTH) {                                  if (alpha == FDAT_DEPTH) {
                                         q[0] = (BYTE)c24[0];                                          q[0] = (UINT8)c24[0];
                                         q[1] = (BYTE)c24[1];                                          q[1] = (UINT8)c24[1];
                                         q[2] = (BYTE)c24[2];                                          q[2] = (UINT8)c24[2];
                                 }                                  }
                                 else {                                  else {
                                         alpha += FDATDEPTHBASE;                                          alpha += FDATDEPTHBASE;
                                         q[0] = (BYTE)MAKEALPHA24(q[0], c24[0],                                          q[0] = (UINT8)MAKEALPHA24(q[0], c24[0],
                                                                                                                 alpha, FDAT_DEPTHBIT);                                                                                                                  alpha, FDAT_DEPTHBIT);
                                         q[1] = (BYTE)MAKEALPHA24(q[1], c24[1],                                          q[1] = (UINT8)MAKEALPHA24(q[1], c24[1],
                                                                                                                 alpha, FDAT_DEPTHBIT);                                                                                                                  alpha, FDAT_DEPTHBIT);
                                         q[2] = (BYTE)MAKEALPHA24(q[2], c24[2],                                          q[2] = (UINT8)MAKEALPHA24(q[2], c24[2],
                                                                                                                 alpha, FDAT_DEPTHBIT);                                                                                                                  alpha, FDAT_DEPTHBIT);
                                 }                                  }
                                 a[0] = VRAMALPHA;                                  a[0] = VRAMALPHA;
Line 2732  const BYTE  *p; Line 2732  const BYTE  *p;
 static void vramsub_txt24e(VRAMHDL dst, const FNTDAT fnt,  static void vramsub_txt24e(VRAMHDL dst, const FNTDAT fnt,
                                                                                                 UINT32 color, MIX_RECT *mr) {                                                                                                  UINT32 color, MIX_RECT *mr) {
   
 const BYTE              *p;  const UINT8     *p;
         BYTE            *q;          UINT8   *q;
         BYTE            *a;          UINT8   *a;
         UINT            alpha;          UINT    alpha;
         int                     cnt;          int             cnt;
         int                     c24[3];          int             c24[3];
   
         p = (BYTE *)(fnt + 1);          p = (UINT8 *)(fnt + 1);
         p += mr->srcpos;          p += mr->srcpos;
         q = dst->ptr + (mr->dstpos * 3);          q = dst->ptr + (mr->dstpos * 3);
         c24[0] = color & 0xff;          c24[0] = color & 0xff;
Line 2751  const BYTE  *p; Line 2751  const BYTE  *p;
                 do {                  do {
                         alpha = (*p++) * VRAMALPHA / FDAT_DEPTH;                          alpha = (*p++) * VRAMALPHA / FDAT_DEPTH;
                         if (alpha) {                          if (alpha) {
                                 q[0] = (BYTE)c24[0];                                  q[0] = (UINT8)c24[0];
                                 q[1] = (BYTE)c24[1];                                  q[1] = (UINT8)c24[1];
                                 q[2] = (BYTE)c24[2];                                  q[2] = (UINT8)c24[2];
                                 a[0] = (BYTE)alpha;                                  a[0] = (UINT8)alpha;
                         }                          }
                         q += 3;                          q += 3;
                         a += 1;                          a += 1;
Line 2766  const BYTE  *p; Line 2766  const BYTE  *p;
 }  }
 #endif  #endif
   
 static void vramsub_text(VRAMHDL dst, void *fhdl, const char *str,  static void vramsub_text(VRAMHDL dst, void *fhdl, const OEMCHAR *str,
                                                         UINT32 color, POINT_T *pt, const RECT_T *rct,                                                          UINT32 color, POINT_T *pt, const RECT_T *rct,
                                                         void (*func)(VRAMHDL dst, const FNTDAT fnt,                                                          void (*func)(VRAMHDL dst, const FNTDAT fnt,
                                                                                         UINT32 color, MIX_RECT *mr)) {                                                                                          UINT32 color, MIX_RECT *mr)) {
   
         char            buf[4];          int                     leng;
           OEMCHAR         buf[4];
         RECT_T          rect;          RECT_T          rect;
         FNTDAT          fnt;          FNTDAT          fnt;
         MIX_RECT        mr;          MIX_RECT        mr;
Line 2781  static void vramsub_text(VRAMHDL dst, vo Line 2782  static void vramsub_text(VRAMHDL dst, vo
                 goto vstxt_end;                  goto vstxt_end;
         }          }
   
         buf[2] = '\0';          while(1) {
         while(*str) {                  leng = milstr_charsize(str);
                 buf[0] = *str++;                  if (!leng) {
                 if ((((buf[0] ^ 0x20) - 0xa1) & 0xff) < 0x3c) {  
                         buf[1] = *str++;  
                         if (buf[1] == '\0') {  
                                 break;  
                         }  
                 }  
                 else if (buf[0]) {  
                         buf[1] = '\0';  
                 }  
                 else {  
                         break;                          break;
                 }                  }
                   CopyMemory(buf, str, leng * sizeof(OEMCHAR));
                   buf[leng] = '\0';
                   str += leng;
                 fnt = fontmng_get(fhdl, buf);                  fnt = fontmng_get(fhdl, buf);
                 if (fnt) {                  if (fnt) {
                         if (txtrect(dst, fnt, pt, &rect, &mr) == SUCCESS) {                          if (txtrect(dst, fnt, pt, &rect, &mr) == SUCCESS) {
Line 2809  vstxt_end: Line 2803  vstxt_end:
         return;          return;
 }  }
   
 void vrammix_text(VRAMHDL dst, void *fhdl, const char *str,  void vrammix_text(VRAMHDL dst, void *fhdl, const OEMCHAR *str,
                                                         UINT32 color, POINT_T *pt, const RECT_T *rct) {                                                          UINT32 color, POINT_T *pt, const RECT_T *rct) {
   
         void    (*func)(VRAMHDL dst, const FNTDAT fnt,          void    (*func)(VRAMHDL dst, const FNTDAT fnt,
Line 2845  void vrammix_text(VRAMHDL dst, void *fhd Line 2839  void vrammix_text(VRAMHDL dst, void *fhd
         vramsub_text(dst, fhdl, str, color, pt, rct, func);          vramsub_text(dst, fhdl, str, color, pt, rct, func);
 }  }
   
 void vrammix_textex(VRAMHDL dst, void *fhdl, const char *str,  void vrammix_textex(VRAMHDL dst, void *fhdl, const OEMCHAR *str,
                                                         UINT32 color, POINT_T *pt, const RECT_T *rct) {                                                          UINT32 color, POINT_T *pt, const RECT_T *rct) {
   
         void    (*func)(VRAMHDL dst, const FNTDAT fnt,          void    (*func)(VRAMHDL dst, const FNTDAT fnt,

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


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