Diff for /np2/generic/dipswbmp.c between versions 1.1 and 1.2

version 1.1, 2003/11/21 06:51:11 version 1.2, 2005/02/07 14:46:10
Line 6 Line 6
   
 typedef struct {  typedef struct {
         BMPDATA inf;          BMPDATA inf;
         BYTE    *ptr;          UINT8   *ptr;
         int             yalign;          int             yalign;
 } DIPBMP;  } DIPBMP;
   
   
 static BYTE *getbmp(const char *dat, DIPBMP *dipbmp) {  static UINT8 *getbmp(const char *dat, DIPBMP *dipbmp) {
   
         BMPFILE *ret;          BMPFILE *ret;
   
Line 26  static BYTE *getbmp(const char *dat, DIP Line 26  static BYTE *getbmp(const char *dat, DIP
                 goto gb_err2;                  goto gb_err2;
         }          }
         dipbmp->yalign = bmpdata_getalign((BMPINFO *)(ret + 1));          dipbmp->yalign = bmpdata_getalign((BMPINFO *)(ret + 1));
         dipbmp->ptr = ((BYTE *)ret) + (LOADINTELDWORD(ret->bfOffBits));          dipbmp->ptr = ((UINT8 *)ret) + (LOADINTELDWORD(ret->bfOffBits));
         if (dipbmp->inf.height < 0) {          if (dipbmp->inf.height < 0) {
                 dipbmp->inf.height *= -1;                  dipbmp->inf.height *= -1;
         }          }
Line 34  static BYTE *getbmp(const char *dat, DIP Line 34  static BYTE *getbmp(const char *dat, DIP
                 dipbmp->ptr += (dipbmp->inf.height - 1) * dipbmp->yalign;                  dipbmp->ptr += (dipbmp->inf.height - 1) * dipbmp->yalign;
                 dipbmp->yalign *= -1;                  dipbmp->yalign *= -1;
         }          }
         return((BYTE *)ret);          return((UINT8 *)ret);
   
 gb_err2:  gb_err2:
         _MFREE(ret);          _MFREE(ret);
Line 43  gb_err1: Line 43  gb_err1:
         return(NULL);          return(NULL);
 }  }
   
 static void line4x(const DIPBMP *dipbmp, int x, int y, int l, BYTE c) {  static void line4x(const DIPBMP *dipbmp, int x, int y, int l, UINT8 c) {
   
         BYTE    *ptr;          UINT8   *ptr;
   
         ptr = dipbmp->ptr + (y * dipbmp->yalign);          ptr = dipbmp->ptr + (y * dipbmp->yalign);
         while(l--) {          while(l--) {
Line 61  static void line4x(const DIPBMP *dipbmp, Line 61  static void line4x(const DIPBMP *dipbmp,
         }          }
 }  }
   
 static void line4y(const DIPBMP *dipbmp, int x, int y, int l, BYTE c) {  static void line4y(const DIPBMP *dipbmp, int x, int y, int l, UINT8 c) {
   
         BYTE    *ptr;          UINT8   *ptr;
         BYTE    mask;          UINT8   mask;
   
         ptr = dipbmp->ptr + (x / 2) + (y * dipbmp->yalign);          ptr = dipbmp->ptr + (x / 2) + (y * dipbmp->yalign);
         if (x & 1) {          if (x & 1) {
Line 115  static void setjumpery(const DIPBMP *dip Line 115  static void setjumpery(const DIPBMP *dip
   
 // ---- pc-9861k  // ---- pc-9861k
   
 static void setdip9861(const DIPBMP *dipbmp, const DIP9861 *pos, BYTE cfg) {  static void setdip9861(const DIPBMP *dipbmp, const DIP9861 *pos, UINT8 cfg) {
   
         int             x;          int             x;
         UINT    c;          UINT    c;
Line 135  static void setdip9861(const DIPBMP *dip Line 135  static void setdip9861(const DIPBMP *dip
         } while(--c);          } while(--c);
 }  }
   
 static void setjmp9861(const DIPBMP *dipbmp, const DIP9861 *pos, BYTE cfg) {  static void setjmp9861(const DIPBMP *dipbmp, const DIP9861 *pos, UINT8 cfg) {
   
         int             x;          int             x;
         int             y;          int             y;
Line 153  static void setjmp9861(const DIPBMP *dip Line 153  static void setjmp9861(const DIPBMP *dip
         } while(--c);          } while(--c);
 }  }
   
 BYTE *dipswbmp_get9861(const BYTE *s, const BYTE *j) {  UINT8 *dipswbmp_get9861(const UINT8 *s, const UINT8 *j) {
   
         BYTE    *ret;          UINT8   *ret;
         DIPBMP  dipbmp;          DIPBMP  dipbmp;
         int             i;          int             i;
   
Line 174  BYTE *dipswbmp_get9861(const BYTE *s, co Line 174  BYTE *dipswbmp_get9861(const BYTE *s, co
   
 // ---- sound  // ---- sound
   
 static void setsnd26io(const DIPBMP *dipbmp, int px, int py, BYTE cfg) {  static void setsnd26io(const DIPBMP *dipbmp, int px, int py, UINT8 cfg) {
   
         setjumpery(dipbmp, px + ((cfg & 0x10)?1:0), py);          setjumpery(dipbmp, px + ((cfg & 0x10)?1:0), py);
 }  }
   
 static void setsnd26int(const DIPBMP *dipbmp, int px, int py, BYTE cfg) {  static void setsnd26int(const DIPBMP *dipbmp, int px, int py, UINT8 cfg) {
   
         setjumperx(dipbmp, px + ((cfg & 0x80)?0:1), py);          setjumperx(dipbmp, px + ((cfg & 0x80)?0:1), py);
         setjumperx(dipbmp, px + ((cfg & 0x40)?0:1), py + 1);          setjumperx(dipbmp, px + ((cfg & 0x40)?0:1), py + 1);
 }  }
   
 static void setsnd26rom(const DIPBMP *dipbmp, int px, int py, BYTE cfg) {  static void setsnd26rom(const DIPBMP *dipbmp, int px, int py, UINT8 cfg) {
   
         cfg &= 7;          cfg &= 7;
         if (cfg >= 4) {          if (cfg >= 4) {
Line 194  static void setsnd26rom(const DIPBMP *di Line 194  static void setsnd26rom(const DIPBMP *di
         setjumpery(dipbmp, px + cfg, py);          setjumpery(dipbmp, px + cfg, py);
 }  }
   
 BYTE *dipswbmp_getsnd26(BYTE cfg) {  UINT8 *dipswbmp_getsnd26(UINT8 cfg) {
   
         BYTE    *ret;          UINT8   *ret;
         DIPBMP  dipbmp;          DIPBMP  dipbmp;
   
         ret = getbmp(bmp26, &dipbmp);          ret = getbmp(bmp26, &dipbmp);
Line 208  BYTE *dipswbmp_getsnd26(BYTE cfg) { Line 208  BYTE *dipswbmp_getsnd26(BYTE cfg) {
         return(ret);          return(ret);
 }  }
   
 BYTE *dipswbmp_getsnd86(BYTE cfg) {  UINT8 *dipswbmp_getsnd86(UINT8 cfg) {
   
         BYTE    *ret;          UINT8   *ret;
         DIPBMP  dipbmp;          DIPBMP  dipbmp;
         int             i;          int             i;
         int             x;          int             x;
Line 231  BYTE *dipswbmp_getsnd86(BYTE cfg) { Line 231  BYTE *dipswbmp_getsnd86(BYTE cfg) {
         return(ret);          return(ret);
 }  }
   
 BYTE *dipswbmp_getsndspb(BYTE cfg, BYTE vrc) {  UINT8 *dipswbmp_getsndspb(UINT8 cfg, UINT8 vrc) {
   
         BYTE    *ret;          UINT8   *ret;
         DIPBMP  dipbmp;          DIPBMP  dipbmp;
   
         ret = getbmp(bmpspb, &dipbmp);          ret = getbmp(bmpspb, &dipbmp);
Line 250  BYTE *dipswbmp_getsndspb(BYTE cfg, BYTE  Line 250  BYTE *dipswbmp_getsndspb(BYTE cfg, BYTE 
         return(ret);          return(ret);
 }  }
   
 BYTE *dipswbmp_getmpu(BYTE cfg) {  UINT8 *dipswbmp_getmpu(UINT8 cfg) {
   
         BYTE    *ret;          UINT8   *ret;
         DIPBMP  dipbmp;          DIPBMP  dipbmp;
         int             i;          int             i;
         int             x;          int             x;

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


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