--- np2/io/gdc.c 2004/03/23 22:39:40 1.32 +++ np2/io/gdc.c 2005/02/16 09:31:55 1.36 @@ -117,9 +117,9 @@ void gdc_setanalogpalall(const UINT16 *p gdc.anareg[(c * 3) + 1] = (pal >> 4) & 15; gdc.anareg[(c * 3) + 2] = (pal >> 0) & 15; #endif - gdc_setanalogpal(c, offsetof(RGB32, p.g), (pal >> 8) & 15); - gdc_setanalogpal(c, offsetof(RGB32, p.r), (pal >> 4) & 15); - gdc_setanalogpal(c, offsetof(RGB32, p.b), (pal >> 0) & 15); + gdc_setanalogpal(c, offsetof(RGB32, p.g), (REG8)((pal >> 8) & 15)); + gdc_setanalogpal(c, offsetof(RGB32, p.r), (REG8)((pal >> 4) & 15)); + gdc_setanalogpal(c, offsetof(RGB32, p.b), (REG8)((pal >> 0) & 15)); } } @@ -148,11 +148,11 @@ void gdc_analogext(BOOL extend) { if (extend) { gdc.analog |= (1 << GDCANALOG_256); - vramop.operate |= 0x20; + vramop.operate |= (1 << VOPBIT_VGA); } else { gdc.analog &= ~(1 << (GDCANALOG_256)); - vramop.operate &= ~0x20; + vramop.operate &= ~(1 << VOPBIT_VGA); } gdcs.palchange = GDCSCRN_REDRAW; gdcs.grphdisp |= GDCSCRN_EXT | GDCSCRN_ALLDRAW2; @@ -417,7 +417,7 @@ const GDCCLK *clk; void gdc_restorekacmode(void) { - BYTE bit; + UINT8 bit; bit = (((!np2cfg.uPD72020) && (gdc.mode1 & 0x20))?0x00:0xff); if (gdc.bitac != bit) { @@ -490,6 +490,8 @@ static void IOOUTCALL gdc_o6a(UINT port, REG8 bit; + TRACEOUT(("port:%.4x %.2x", port, dat)); + if (!(dat & 0xf8)) { bit = (dat >> 1) & 3; dat &= 1; @@ -503,16 +505,16 @@ static void IOOUTCALL gdc_o6a(UINT port, gdc.analog &= ~(1 << GDCANALOG_16); gdc.analog |= (dat << GDCANALOG_16); gdcs.palchange = GDCSCRN_REDRAW; - vramop.operate &= VOP_ANALOGMASK; - vramop.operate |= dat << 4; + vramop.operate &= ~(1 << VOPBIT_ANALOG); + vramop.operate |= dat << VOPBIT_ANALOG; i286_vram_dispatch(vramop.operate); } break; case 2: if ((gdc.mode2 & 0x08) && (grcg.chip == 3)) { - vramop.operate &= VOP_EGCMASK; - vramop.operate |= dat << 1; + vramop.operate &= ~(1 << VOPBIT_EGC); + vramop.operate |= dat << VOPBIT_EGC; i286_vram_dispatch(vramop.operate); } break; @@ -713,10 +715,11 @@ static void IOOUTCALL gdc_oa4(UINT port, static void IOOUTCALL gdc_oa6(UINT port, REG8 dat) { - if ((gdcs.access ^ dat) & 1) { - gdcs.access = dat & 1; - vramop.operate &= VOP_ACCESSMASK; - vramop.operate |= gdcs.access; + dat = dat & 1; + if (gdcs.access != dat) { + gdcs.access = (UINT8)dat; + vramop.operate &= ~(1 << VOPBIT_ACCESS); + vramop.operate |= dat << VOPBIT_ACCESS; i286_vram_dispatch(vramop.operate); } (void)port; @@ -935,6 +938,7 @@ static REG8 IOINPCALL gdc_iae(UINT port) #if defined(SUPPORT_PC9821) static void IOOUTCALL gdc_o9a0(UINT port, REG8 dat) { + TRACEOUT(("port:%.4x,%.2x", port, dat)); gdc.ff2 = dat; (void)port; } @@ -1045,7 +1049,8 @@ static const IOINP gdcia0[8] = { void gdc_biosreset(void) { #if defined(SUPPORT_PC9821) - UINT i, j; + UINT i; + UINT j; UINT8 tmp; UINT8 *pal; #endif @@ -1085,12 +1090,12 @@ void gdc_biosreset(void) { gdcs.access = 0; gdc.analog &= ~(1 << GDCANALOG_16); gdcs.palchange = GDCSCRN_REDRAW; - vramop.operate &= VOP_ACCESSMASK; - vramop.operate &= VOP_EGCMASK; - vramop.operate &= VOP_ANALOGMASK; + vramop.operate &= ~(1 << VOPBIT_ACCESS); + vramop.operate &= ~(1 << VOPBIT_EGC); + vramop.operate &= ~(1 << VOPBIT_ANALOG); #if defined(SUPPORT_PC9821) gdc.analog &= ~(1 << (GDCANALOG_256)); - vramop.operate &= ~0x20; + vramop.operate &= ~(1 << VOPBIT_VGA); #endif i286_vram_dispatch(vramop.operate);