Diff for /xmil/vram/palettes.c between versions 1.13 and 1.16

version 1.13, 2004/08/17 13:04:11 version 1.16, 2004/08/18 10:44:48
Line 7 Line 7
 #include        "makescrn.h"  #include        "makescrn.h"
   
   
         UINT    xmil_palettes;          UINT            xmil_palettes;
         RGB32   xmil_pal32[XMILPAL_MAX];                        // xm_palette          RGB32           xmil_pal32[XMILPAL_MAX];                        // xm_palette
 #if defined(SUPPORT_16BPP)  #if defined(SUPPORT_16BPP)
         RGB16   xmil_pal16[XMILPAL_MAX];          RGB16           xmil_pal16[XMILPAL_MAX];
   #endif
   #if defined(SUPPORT_PALEVENT)
           PALEVENT        palevent;
 #endif  #endif
   
   #if defined(SUPPORT_TURBOZ)
 static const UINT16 pal4096banktbl[2][64] = {  static const UINT16 pal4096banktbl[2][64] = {
                         {       0x000, 0x008, 0x080, 0x088, 0x800, 0x808, 0x880, 0x888,                          {       0x000, 0x008, 0x080, 0x088, 0x800, 0x808, 0x880, 0x888,
                                 0x004, 0x00C, 0x084, 0x08C, 0x804, 0x80C, 0x884, 0x88C,                                  0x004, 0x00C, 0x084, 0x08C, 0x804, 0x80C, 0x884, 0x88C,
Line 33  static const UINT16 pal4096banktbl[2][64 Line 36  static const UINT16 pal4096banktbl[2][64
                                 0x110, 0x112, 0x130, 0x132, 0x310, 0x312, 0x330, 0x332,                                  0x110, 0x112, 0x130, 0x132, 0x310, 0x312, 0x330, 0x332,
                                 0x111, 0x113, 0x131, 0x133, 0x311, 0x313, 0x331, 0x333}};                                  0x111, 0x113, 0x131, 0x133, 0x311, 0x313, 0x331, 0x333}};
   
   static void pal4096to64(RGB32 *pal, const UINT16 *map) {
   
           UINT    r;
   
           r = 64;
           do {
                   pal->d = xmil_pal32[XMILPAL_4096G + (*map++)].d;
                   pal++;
           } while(--r);
   }
   #endif
   
   
   // ----
   
 void pal_makegrad(RGB32 *pal, int pals, UINT32 bg, UINT32 fg) {  void pal_makegrad(RGB32 *pal, int pals, UINT32 bg, UINT32 fg) {
   
         int             i;          int             i;
Line 212  void pal_setgrph4096(UINT num) { Line 227  void pal_setgrph4096(UINT num) {
   
 // ----  // ----
   
 #if defined(SUPPORT_TURBOZ)  
 static void pal4096to64(RGB32 *pal, const UINT16 *map) {  
   
         UINT    r;  
   
         r = 64;  
         do {  
                 pal->d = xmil_pal32[XMILPAL_4096G + (*map++)].d;  
                 pal++;  
         } while(--r);  
 }  
 #endif  
   
   
 void pal_update1(const UINT8 *rgbp) {  void pal_update1(const UINT8 *rgbp) {
   
         UINT    i;          UINT    i;
Line 273  void pal_update1(const UINT8 *rgbp) { Line 274  void pal_update1(const UINT8 *rgbp) {
                         }                          }
                 }                  }
                 else {                  else {
                         bcnt = (crtc.s.BLACKPAL & 15) - 8;                          bcnt = (rgbp[CRTC_BLACK] & 15) - 8;
                         for (j=i+8; j<64; j+=8) {                          for (j=i+8; j<64; j+=8) {
                                 bcnt--;                                  bcnt--;
                                 if (bcnt) {                                  if (bcnt) {
Line 299  void pal_update(void) { Line 300  void pal_update(void) {
         pal_update1(crtc.s.rgbp);          pal_update1(crtc.s.rgbp);
         xmil_palettes = 64 + 64;          xmil_palettes = 64 + 64;
 #else  #else
         if (crtc.e.pal_disp & PAL_4096) {          if (!(crtc.e.dispmode & SCRN64_ENABLE)) {
                   pal_update1(crtc.s.rgbp);
                   xmil_palettes = 64 + 64;
           }
           else if (crtc.e.pal_disp & PAL_4096) {
                 switch(crtc.e.pal_disp & 0xf) {                  switch(crtc.e.pal_disp & 0xf) {
                         case PAL_4096H:                          case PAL_4096H:
                                 pal4096to64(xmil_pal32, pal4096banktbl[0]);                                  pal4096to64(xmil_pal32, pal4096banktbl[0]);
Line 330  void pal_update(void) { Line 335  void pal_update(void) {
                         xmil_pal32[xmil_palettes++].d = pals.text[i].d;                          xmil_pal32[xmil_palettes++].d = pals.text[i].d;
                 }                  }
         }          }
         else if ((crtc.e.dispmode & SCRN64_MASK) == SCRN64_INVALID) {  
                 pal_update1(crtc.s.rgbp);  
                 xmil_palettes = 64 + 64;  
         }  
         else {          else {
                 for (i=0; i<64; i++) {                  for (i=0; i<64; i++) {
                         xmil_pal32[i].d = pals.grph64[crtc.e.pal_disp][i].d;                          xmil_pal32[i].d = pals.grph64[crtc.e.pal_disp][i].d;
Line 355  void pal_update(void) { Line 356  void pal_update(void) {
         scrndraw_changepalette();          scrndraw_changepalette();
 }  }
   
   #if defined(SUPPORT_PALEVENT)
   void pal_eventclear(void) {
   
           if ((!corestat.drawframe) ||
                   (!xmilcfg.RASTER) || (scrnmng_getbpp() == 8)) {
                   palevent.events = SUPPORT_PALEVENT;
           }
           else {
                   CopyMemory(palevent.rgbp, crtc.s.rgbp, CRTC_RGBPMAX);
                   palevent.events = 0;
           }
   }
   #endif
   
   
 // ----  // ----
   

Removed from v.1.13  
changed lines
  Added in v.1.16


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