--- xmil/io/vramio.c 2004/08/04 15:18:26 1.1 +++ xmil/io/vramio.c 2004/08/07 10:53:01 1.4 @@ -1,15 +1,8 @@ #include "compiler.h" #include "pccore.h" #include "iocore.h" -#include "x1_io.h" -#include "x1_crtc.h" #include "vram.h" -#include "draw.h" - - - BYTE *curvram; - BYTE curupdt; - DWORD updatemsk = 0x7ff; +#include "makescrn.h" // ---- text @@ -24,10 +17,10 @@ void IOOUTCALL tram_o(UINT port, REG8 va return; } if ((tram[TRAM_ATR + addr] ^ value) & (X1ATR_Yx2 | X1ATR_Xx2)) { - doubleatrchange = 1; + makescrn.remakeattr = 1; } if (value & X1ATR_BLINK) { - blinkflag = 1; + makescrn.existblink = 1; } tram[TRAM_ATR + addr] = value; } @@ -43,9 +36,9 @@ void IOOUTCALL tram_o(UINT port, REG8 va } tram[TRAM_ANK + addr] = value; } - scrnflash = 1; + makescrn.scrnflash = 1; if (tram[TRAM_ATR + addr] & X1ATR_Xx2) { - updatetmp[addr + 1] |= UPDATE_TVRAM; + updatetmp[LOW11(addr + 1)] |= UPDATE_TVRAM; } updatetmp[addr] |= UPDATE_TVRAM; } @@ -69,27 +62,27 @@ REG8 IOINPCALL tram_i(UINT port) { void IOOUTCALL gram_o(UINT port, REG8 value) { - UINT addr; + UINT8 *p; - addr = (LOW11(port) << 5) + (port >> 11); - if (curvram[addr] == value) { + p = crtc.e.gram + (LOW11(port) << 5) + (port >> 11); + if (*p == value) { return; } - curvram[addr] = value; - updatetmp[port & updatemsk] |= curupdt; - scrnflash = 1; + *p = value; + updatetmp[port & crtc.e.updatemask] |= crtc.e.updatebit; + makescrn.scrnflash = 1; } 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) { UINT8 *p; - p = curvram + (((port << 5) | (port >> 11)) & 0xffe7); + p = crtc.e.gram + (((port << 5) + (port >> 11)) & 0xffe7); switch(port & 0xc000) { case 0x0000: p[PLANE_B] = value; @@ -112,9 +105,8 @@ void IOOUTCALL gram2_o(UINT port, REG8 v p[PLANE_R] = value; break; } - - updatetmp[port & updatemsk] |= curupdt; - scrnflash = 1; + updatetmp[port & crtc.e.updatemask] |= crtc.e.updatebit; + makescrn.scrnflash = 1; } @@ -127,7 +119,5 @@ void vramio_reset(void) { memset(tram + TRAM_ATR, 0x07, 0x800); memset(tram + TRAM_ANK, 0x20, 0x800); ZeroMemory(updatetmp, sizeof(updatetmp)); - curvram = &GRP_RAM[GRAM_BANK0]; - curupdt = UPDATE_VRAM0; }