Diff for /xmil/vram/scrnsave.c between versions 1.1 and 1.2

version 1.1, 2004/08/17 12:30:41 version 1.2, 2004/08/18 08:08:13
Line 5 Line 5
 #include        "iocore.h"  #include        "iocore.h"
 #include        "scrndraw.h"  #include        "scrndraw.h"
 #include        "palettes.h"  #include        "palettes.h"
   #include        "makescrn.h"
 #include        "scrnsave.h"  #include        "scrnsave.h"
   
   
Line 29  typedef struct { Line 30  typedef struct {
 } SCRNDATA;  } SCRNDATA;
   
   
 static void screenmix80(PALNUM *dst, const UINT8 *src) {  static void screenmix32s(PALNUM *dst, const UINT8 *src) {
   
         int             i;          int             y;
           int             x;
           REG8    c;
   
         for (i=0; i<(SURFACE_WIDTH * SURFACE_HEIGHT); i++) {          for (y=0; y<(SURFACE_HEIGHT/2); y++) {
                 dst[i] = src[i];                  for (x=0; x<(SURFACE_WIDTH/2); x++) {
                           c = src[x];
                           dst[x*2+0] = (PALNUM)c;
                           dst[x*2+1] = (PALNUM)c;
                           dst[x*2+SURFACE_WIDTH+0] = (PALNUM)(c + 0x40);
                           dst[x*2+SURFACE_WIDTH+1] = (PALNUM)(c + 0x40);
                   }
                   dst += SURFACE_WIDTH * 2;
                   src += SURFACE_WIDTH * 2;
           }
   }
   
   static void screenmix62s(PALNUM *dst, const UINT8 *src) {
   
           int             y;
           int             x;
           REG8    c;
   
           for (y=0; y<(SURFACE_HEIGHT/2); y++) {
                   for (x=0; x<SURFACE_WIDTH; x++) {
                           c = src[x];
                           dst[x] = (PALNUM)c;
                           dst[x+SURFACE_WIDTH] = (PALNUM)(c + 0x40);
                   }
                   dst += SURFACE_WIDTH * 2;
                   src += SURFACE_WIDTH * 2;
           }
   }
   
   static void screenmix32h(PALNUM *dst, const UINT8 *src) {
   
           int             y;
           int             x;
           REG8    c;
   
           for (y=0; y<(SURFACE_HEIGHT/2); y++) {
                   for (x=0; x<(SURFACE_WIDTH/2); x++) {
                           c = src[x];
                           dst[x*2+0] = (PALNUM)c;
                           dst[x*2+1] = (PALNUM)c;
                           dst[x*2+SURFACE_WIDTH+0] = (PALNUM)c;
                           dst[x*2+SURFACE_WIDTH+1] = (PALNUM)c;
                   }
                   dst += SURFACE_WIDTH * 2;
                   src += SURFACE_WIDTH * 2;
         }          }
 }  }
   
 static void screenmix40(PALNUM *dst, const UINT8 *src) {  static void screenmix62h(PALNUM *dst, const UINT8 *src) {
   
           int             y;
           int             x;
           REG8    c;
   
           for (y=0; y<(SURFACE_HEIGHT/2); y++) {
                   for (x=0; x<SURFACE_WIDTH; x++) {
                           c = src[x];
                           dst[x] = (PALNUM)c;
                           dst[x+SURFACE_WIDTH] = (PALNUM)c;
                   }
                   dst += SURFACE_WIDTH * 2;
                   src += SURFACE_WIDTH * 2;
           }
   }
   
   static void screenmix34(PALNUM *dst, const UINT8 *src) {
   
         int             y;          int             y;
         int             x;          int             x;
Line 51  static void screenmix40(PALNUM *dst, con Line 115  static void screenmix40(PALNUM *dst, con
                         dst[x*2+1] = (PALNUM)c;                          dst[x*2+1] = (PALNUM)c;
                 }                  }
                 dst += SURFACE_WIDTH;                  dst += SURFACE_WIDTH;
                 src += (SURFACE_WIDTH / 2);                  src += SURFACE_WIDTH;
           }
   }
   
   static void screenmix64(PALNUM *dst, const UINT8 *src) {
   
           int             i;
   
           for (i=0; i<(SURFACE_WIDTH * SURFACE_HEIGHT); i++) {
                   dst[i] = src[i];
         }          }
 }  }
   
Line 64  static void screenmixz(PALNUM *dst, cons Line 137  static void screenmixz(PALNUM *dst, cons
   
         for (y=0; y<SURFACE_HEIGHT; y++) {          for (y=0; y<SURFACE_HEIGHT; y++) {
                 for (x=0; x<(SURFACE_WIDTH/2); x++) {                  for (x=0; x<(SURFACE_WIDTH/2); x++) {
                         c = ((src[320] << 8) | src[0]) + XMILPAL_4096G;                          c = ((src[x+320] << 8) | src[x]) + XMILPAL_4096G;
                         dst[x*2+0] = c;                          dst[x*2+0] = c;
                         dst[x*2+1] = c;                          dst[x*2+1] = c;
                 }                  }
                 dst += SURFACE_WIDTH;                  dst += SURFACE_WIDTH;
                 src += (SURFACE_WIDTH / 2);                  src += SURFACE_WIDTH;
         }          }
 }  }
 #endif  #endif
   
   typedef void (*SCMIX)(PALNUM *dst, const UINT8 *src);
   
   static const SCMIX scmix[] = {
                           screenmix32s,   screenmix62s,
                           screenmix32h,   screenmix62h,
                           screenmix34,    screenmix64,
   #if defined(SUPPORT_TURBOZ)
                           screenmixz,
   #endif
   };
   
   
 // ----  // ----
   
Line 84  SCRNSAVE scrnsave_get(void) { Line 168  SCRNSAVE scrnsave_get(void) {
         SCRNDATA        *sd;          SCRNDATA        *sd;
         PALNUM          *dat;          PALNUM          *dat;
         UINT            scrnsize;          UINT            scrnsize;
         void            (*mix)(PALNUM *dst, const UINT8 *src);  
         PALNUM          *s;          PALNUM          *s;
         UINT            pals;          UINT            pals;
         PALNUM          remap[XMILPAL_MAX];          PALNUM          remap[XMILPAL_MAX];
Line 108  SCRNSAVE scrnsave_get(void) { Line 191  SCRNSAVE scrnsave_get(void) {
   
         dat = sd->dat;          dat = sd->dat;
         scrnsize = SURFACE_WIDTH * SURFACE_HEIGHT;          scrnsize = SURFACE_WIDTH * SURFACE_HEIGHT;
         switch(scrn.widthmode) {          scmix[makescrn.drawmode](sd->dat, screenmap);
                 case SCRNWIDTHMODE_WIDTH80:  
                 default:  
                         mix = screenmix80;  
                         break;  
   
                 case SCRNWIDTHMODE_WIDTH40:  
                         mix = screenmix40;  
                         break;  
   
 #if defined(SUPPORT_TURBOZ)  
                 case SCRNWIDTHMODE_4096:  
                         mix = screenmixz;  
                         break;  
 #endif  
         }  
         (*mix)(sd->dat, screenmap);  
   
         // パレット最適化          // パレット最適化
         s = sd->dat;          s = sd->dat;

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


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