Diff for /xmil/io/vramio.c between versions 1.1 and 1.5

version 1.1, 2004/08/04 15:18:26 version 1.5, 2004/08/08 16:39:03
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "pccore.h"  #include        "pccore.h"
 #include        "iocore.h"  #include        "iocore.h"
 #include        "x1_io.h"  
 #include        "x1_crtc.h"  
 #include        "vram.h"  #include        "vram.h"
 #include        "draw.h"  #include        "makescrn.h"
   
   
                 BYTE    *curvram;  
                 BYTE    curupdt;  
                 DWORD   updatemsk = 0x7ff;  
   
   
 // ---- text  // ---- text
Line 23  void IOOUTCALL tram_o(UINT port, REG8 va Line 16  void IOOUTCALL tram_o(UINT port, REG8 va
                 if (tram[TRAM_ATR + addr] == value) {                  if (tram[TRAM_ATR + addr] == value) {
                         return;                          return;
                 }                  }
                 if ((tram[TRAM_ATR + addr] ^ value) & (X1ATR_Yx2 | X1ATR_Xx2)) {                  if ((tram[TRAM_ATR + addr] ^ value) & (TRAMATR_Yx2 | TRAMATR_Xx2)) {
                         doubleatrchange = 1;                          makescrn.remakeattr = 1;
                 }                  }
                 if (value & X1ATR_BLINK) {                  if (value & TRAMATR_BLINK) {
                         blinkflag = 1;                          makescrn.existblink = 1;
                 }                  }
                 tram[TRAM_ATR + addr] = value;                  tram[TRAM_ATR + addr] = value;
         }          }
Line 43  void IOOUTCALL tram_o(UINT port, REG8 va Line 36  void IOOUTCALL tram_o(UINT port, REG8 va
                 }                  }
                 tram[TRAM_ANK + addr] = value;                  tram[TRAM_ANK + addr] = value;
         }          }
         scrnflash = 1;          makescrn.scrnflash = 1;
         if (tram[TRAM_ATR + addr] & X1ATR_Xx2) {          if (tram[TRAM_ATR + addr] & TRAMATR_Xx2) {
                 updatetmp[addr + 1] |= UPDATE_TVRAM;                  updatetmp[LOW11(addr + 1)] |= UPDATE_TVRAM;
         }          }
         updatetmp[addr] |= UPDATE_TVRAM;          updatetmp[addr] |= UPDATE_TVRAM;
 }  }
Line 69  REG8 IOINPCALL tram_i(UINT port) { Line 62  REG8 IOINPCALL tram_i(UINT port) {
   
 void IOOUTCALL gram_o(UINT port, REG8 value) {  void IOOUTCALL gram_o(UINT port, REG8 value) {
   
         UINT    addr;          UINT8   *p;
   
         addr = (LOW11(port) << 5) + (port >> 11);          p = crtc.e.gram + (LOW11(port) << 5) + (port >> 11);
         if (curvram[addr] == value) {          if (*p == value) {
                 return;                  return;
         }          }
         curvram[addr] = value;          *p = value;
         updatetmp[port & updatemsk] |= curupdt;          updatetmp[port & crtc.e.updatemask] |= crtc.e.updatebit;
         scrnflash = 1;          makescrn.scrnflash = 1;
 }  }
   
 REG8 IOINPCALL gram_i(UINT port) {  REG8 IOINPCALL gram_i(UINT port) {
   
         return(curvram[(LOW11(port) << 5) + (port >> 11)]);          return(crtc.e.gram[(LOW11(port) << 5) + (port >> 11)]);
 }  }
   
 void IOOUTCALL gram2_o(UINT port, REG8 value) {  void IOOUTCALL gram2_o(UINT port, REG8 value) {
   
         UINT8   *p;          UINT8   *p;
   
         p = curvram + (((port << 5) | (port >> 11)) & 0xffe7);          p = crtc.e.gram + (((port << 5) + (port >> 11)) & 0xffe7);
         switch(port & 0xc000) {          switch((port >> 14) & 3) {
                 case 0x0000:                  case 0:
                         p[PLANE_B] = value;                          p[GRAM_B] = value;
                         p[PLANE_R] = value;                          p[GRAM_R] = value;
                         p[PLANE_G] = value;                          p[GRAM_G] = value;
                         break;                          break;
   
                 case 0x4000:                  case 1:
                         p[PLANE_R] = value;                          p[GRAM_R] = value;
                         p[PLANE_G] = value;                          p[GRAM_G] = value;
                         break;                          break;
   
                 case 0x8000:                  case 2:
                         p[PLANE_B] = value;                          p[GRAM_B] = value;
                         p[PLANE_G] = value;                          p[GRAM_G] = value;
                         break;                          break;
   
                 case 0xc000:                  case 3:
                         p[PLANE_B] = value;                          p[GRAM_B] = value;
                         p[PLANE_R] = value;                          p[GRAM_R] = value;
                         break;                          break;
         }          }
           updatetmp[port & crtc.e.updatemask] |= crtc.e.updatebit;
         updatetmp[port & updatemsk] |= curupdt;          makescrn.scrnflash = 1;
         scrnflash = 1;  
 }  }
   
   
Line 127  void vramio_reset(void) { Line 119  void vramio_reset(void) {
         memset(tram + TRAM_ATR, 0x07, 0x800);          memset(tram + TRAM_ATR, 0x07, 0x800);
         memset(tram + TRAM_ANK, 0x20, 0x800);          memset(tram + TRAM_ANK, 0x20, 0x800);
         ZeroMemory(updatetmp, sizeof(updatetmp));          ZeroMemory(updatetmp, sizeof(updatetmp));
         curvram = &GRP_RAM[GRAM_BANK0];  
         curupdt = UPDATE_VRAM0;  
 }  }
   

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


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