--- np2/vram/dispsync.c 2003/10/16 17:58:15 1.1.1.1 +++ np2/vram/dispsync.c 2004/02/26 08:44:32 1.6 @@ -10,7 +10,7 @@ DSYNC dsync; -void dispsync_init(void) { +void dispsync_initialize(void) { ZeroMemory(&dsync, sizeof(dsync)); dsync.textymax = 400; @@ -27,6 +27,20 @@ void dispsync_init(void) { BOOL dispsync_renewalmode(void) { + UINT disp; + + if (!scrnmng_haveextend()) { + return(FALSE); + } + disp = 0; + if ((!(np2cfg.LCD_MODE & 1)) && (gdc.display < 3)) { + disp = 1; + } + if (dsync.scrnxextend != disp) { + dsync.scrnxextend = disp; + scrnmng_setextend(disp); + return(1); + } return(0); } @@ -46,7 +60,8 @@ BOOL dispsync_renewalhorizontal(void) { } scrnxmax = cr + 2; if ((scrnxpos + scrnxmax) > 80) { - scrnxmax = 80 - scrnxpos; + scrnxmax = min(scrnxmax, 80); + scrnxpos = 80 - scrnxmax; } scrnxpos <<= 3; scrnxmax <<= 3; @@ -81,26 +96,23 @@ BOOL dispsync_renewalvertical(void) { } textymax = LOADINTELWORD(gdc.m.para + GDC_SYNC + 6); - textymax &= 0x3ff; - if (textymax) { - textymax += text_vbp; - if (textymax > SURFACE_HEIGHT) { - textymax = SURFACE_HEIGHT; - } - } - else { - textymax = SURFACE_HEIGHT; - } + textymax = ((textymax - 1) & 0x3ff) + 1; + textymax += text_vbp; grphymax = LOADINTELWORD(gdc.s.para + GDC_SYNC + 6); - grphymax &= 0x3ff; - if (grphymax) { - grphymax += grph_vbp; - if (grphymax > SURFACE_HEIGHT) { - grphymax = SURFACE_HEIGHT; - } + grphymax = ((grphymax - 1) & 0x3ff) + 1; + grphymax += grph_vbp; + +#if defined(SUPPORT_CRT15KHZ) + if (gdc.crt15khz & 2) { + textymax *= 2; + grphymax *= 2; } - else { +#endif + if (textymax > SURFACE_HEIGHT) { + textymax = SURFACE_HEIGHT; + } + if (grphymax > SURFACE_HEIGHT) { grphymax = SURFACE_HEIGHT; } if ((dsync.text_vbp == text_vbp) && (dsync.grph_vbp == grph_vbp) &&