--- np2/vram/dispsync.c 2003/10/18 10:28:12 1.2 +++ np2/vram/dispsync.c 2004/02/29 00:57:06 1.7 @@ -10,7 +10,7 @@ DSYNC dsync; -void dispsync_init(void) { +void dispsync_initialize(void) { ZeroMemory(&dsync, sizeof(dsync)); dsync.textymax = 400; @@ -33,7 +33,7 @@ BOOL dispsync_renewalmode(void) { return(FALSE); } disp = 0; - if ((!(np2cfg.LCD_MODE & 1)) && (gdc.display < 3)) { + if ((!(np2cfg.LCD_MODE & 1)) && ((gdc.display & 7) < 3)) { disp = 1; } if (dsync.scrnxextend != disp) { @@ -60,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; @@ -95,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) &&