Diff for /np2/vram/scrnbmp.c between versions 1.5 and 1.8

version 1.5, 2004/06/18 07:42:13 version 1.8, 2005/02/07 14:46:13
Line 15  typedef unsigned char PALNUM; Line 15  typedef unsigned char PALNUM;
   
 typedef union {  typedef union {
         UINT32  d;          UINT32  d;
         BYTE    rgb[4];          UINT8   rgb[4];
 } BMPPAL;  } BMPPAL;
   
   
 static void screenmix(PALNUM *dest, const BYTE *src1, const BYTE *src2) {  static void screenmix(PALNUM *dest, const UINT8 *src1, const UINT8 *src2) {
   
         int             i;          int             i;
   
Line 28  static void screenmix(PALNUM *dest, cons Line 28  static void screenmix(PALNUM *dest, cons
         }          }
 }  }
   
 static void screenmix2(PALNUM *dest, const BYTE *src1, const BYTE *src2) {  static void screenmix2(PALNUM *dest, const UINT8 *src1, const UINT8 *src2) {
   
         int             x, y;          int             x, y;
   
Line 48  static void screenmix2(PALNUM *dest, con Line 48  static void screenmix2(PALNUM *dest, con
         }          }
 }  }
   
 static void screenmix3(PALNUM *dest, const BYTE *src1, const BYTE *src2) {  static void screenmix3(PALNUM *dest, const UINT8 *src1, const UINT8 *src2) {
   
         PALNUM  c;          PALNUM  c;
         int             x, y;          int             x, y;
Line 70  static void screenmix3(PALNUM *dest, con Line 70  static void screenmix3(PALNUM *dest, con
 }  }
   
 #if defined(SUPPORT_PC9821)  #if defined(SUPPORT_PC9821)
 static void screenmix4(PALNUM *dest, const BYTE *src1, const BYTE *src2) {  static void screenmix4(PALNUM *dest, const UINT8 *src1, const UINT8 *src2) {
   
         int             i;          int             i;
   
Line 92  SCRNBMP scrnbmp(void) { Line 92  SCRNBMP scrnbmp(void) {
         UINT    scrnsize;          UINT    scrnsize;
         UINT    allocsize;          UINT    allocsize;
         PALNUM  *scrn;          PALNUM  *scrn;
         BYTE    *p;          UINT8   *p;
         BYTE    *q;          UINT8   *q;
         PALNUM  *s;          PALNUM  *s;
         UINT    pals;          UINT    pals;
         BMPPAL  pal[NP2PAL_TOTAL];          BMPPAL  pal[NP2PAL_TOTAL];
         UINT8   remap[NP2PAL_TOTAL];          PALNUM  remap[NP2PAL_TOTAL];
         UINT8   remapflg[NP2PAL_TOTAL];          UINT8   remapflg[NP2PAL_TOTAL];
         int             x;          int             x;
         int             y;          int             y;
Line 111  SCRNBMP scrnbmp(void) { Line 111  SCRNBMP scrnbmp(void) {
         SCRNBMP ret;          SCRNBMP ret;
         BMPFILE *bf;          BMPFILE *bf;
         int             r;          int             r;
         void    (*mix)(PALNUM *dest, const BYTE *src1, const BYTE *src2);          void    (*mix)(PALNUM *dest, const UINT8 *src1, const UINT8 *src2);
   
         bd.width = dsync.scrnxmax;          bd.width = dsync.scrnxmax;
         bd.height = dsync.scrnymax;          bd.height = dsync.scrnymax;
Line 141  SCRNBMP scrnbmp(void) { Line 141  SCRNBMP scrnbmp(void) {
         else {          else {
                 mix = screenmix3;                  mix = screenmix3;
         }          }
         q = p = ((BYTE *)scrn) + (scrnsize * (sizeof(PALNUM) - 1));          q = p = ((UINT8 *)scrn) + (scrnsize * (sizeof(PALNUM) - 1));
         if (gdcs.textdisp & 0x80) {          if (gdcs.textdisp & 0x80) {
                 p = np2_tram;                  p = np2_tram;
         }          }
Line 186  SCRNBMP scrnbmp(void) { Line 186  SCRNBMP scrnbmp(void) {
                 s += SURFACE_WIDTH;                  s += SURFACE_WIDTH;
         }          }
   
         if (pals < 2) {          if (pals <= 2) {
                 type = SCRNBMP_1BIT;                  type = SCRNBMP_1BIT;
                 bd.bpp = 1;                  bd.bpp = 1;
                 palsize = 4 << 1;                  palsize = 4 << 1;
         }          }
         else if (pals < 16) {          else if (pals <= 16) {
                 type = SCRNBMP_4BIT;                  type = SCRNBMP_4BIT;
                 bd.bpp = 4;                  bd.bpp = 4;
                 palsize = 4 << 4;                  palsize = 4 << 4;
         }          }
         else if (pals < 256) {          else if (pals <= 256) {
                 type = SCRNBMP_8BIT;                  type = SCRNBMP_8BIT;
                 bd.bpp = 8;                  bd.bpp = 8;
                 palsize = 4 << 8;                  palsize = 4 << 8;
Line 222  SCRNBMP scrnbmp(void) { Line 222  SCRNBMP scrnbmp(void) {
         bf->bfType[1] = 'M';          bf->bfType[1] = 'M';
         pos = sizeof(BMPFILE) + sizeof(BMPINFO) + palsize;          pos = sizeof(BMPFILE) + sizeof(BMPINFO) + palsize;
         STOREINTELDWORD(bf->bfOffBits, pos);          STOREINTELDWORD(bf->bfOffBits, pos);
         q = (BYTE *)(bf + 1);          q = (UINT8 *)(bf + 1);
         STOREINTELDWORD(bi.biClrImportant, pals);          STOREINTELDWORD(bi.biClrImportant, pals);
         CopyMemory(q, &bi, sizeof(bi));          CopyMemory(q, &bi, sizeof(bi));
         q += sizeof(bi);          q += sizeof(bi);
Line 236  SCRNBMP scrnbmp(void) { Line 236  SCRNBMP scrnbmp(void) {
                 switch(type) {                  switch(type) {
                         case SCRNBMP_1BIT:                          case SCRNBMP_1BIT:
                                 for (x=0; x<bd.width; x++) {                                  for (x=0; x<bd.width; x++) {
                                         if (s[x*2+0]) {                                          if (s[x]) {
                                                 q[x >> 3] |= 0x80 >> (x & 7);                                                  q[x >> 3] |= 0x80 >> (x & 7);
                                         }                                          }
                                 }                                  }
Line 271  SCRNBMP scrnbmp(void) { Line 271  SCRNBMP scrnbmp(void) {
         } while(scrn < s);          } while(scrn < s);
         _MFREE(scrn);          _MFREE(scrn);
         ret->type = type;          ret->type = type;
         ret->ptr = (BYTE *)(ret + 1);          ret->ptr = (UINT8 *)(ret + 1);
         ret->size = allocsize;          ret->size = allocsize;
         return(ret);          return(ret);
   

Removed from v.1.5  
changed lines
  Added in v.1.8


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