--- xmil/vram/makescrn.c 2004/08/12 20:09:42 1.9 +++ xmil/vram/makescrn.c 2004/08/14 12:16:18 1.12 @@ -11,9 +11,9 @@ MAKESCRN makescrn; - BYTE scrnallflash; -static BYTE lastdisp = 0; -static BYTE blinktime = 1; + UINT8 scrnallflash; +static UINT8 lastdisp = 0; +static UINT8 blinktime = 1; UINT drawtime = 0; @@ -161,15 +161,16 @@ static void changecrtc(void) { REG8 y2; UINT charcy; UINT surfcy; + UINT surfsy; UINT x; UINT y; UINT8 *p; makescrn.vramtop = crtc.e.pos; - scrnxmax = (crtc.s.reg[CRTCREG_HDISP] <= 40)?40:80; + scrnxmax = (crtc.s.width40)?40:80; scrnymax = 200; - if (crtc.s.reg[CRTCREG_HDISP] <= 40) { + if (crtc.s.width40) { if (lastdisp & SCRN_DRAW4096) { widthmode = SCRNWIDTHMODE_4096; } @@ -215,24 +216,26 @@ static void changecrtc(void) { surfcy = crtc.e.yl; } + surfsy = charcy * surfcy * 2; x = min(scrnxmax, makescrn.surfcx); if (surfcx < x) { // 小さくなった x = (x - surfcx) * 8; p = screenmap + (surfcx * 8); - y = surfcy * 2; + y = surfsy; while(y) { y--; ZeroMemory(p, x); p += SURFACE_WIDTH; } } - if (surfcy < makescrn.surfcy) { - ZeroMemory(screenmap + (SURFACE_WIDTH * surfcy * charcy * 2), - SURFACE_WIDTH * (makescrn.surfcy - surfcy) * charcy * 2); + if (surfsy < makescrn.surfsy) { + ZeroMemory(screenmap + (SURFACE_WIDTH * surfsy), + SURFACE_WIDTH * (makescrn.surfsy - surfsy)); } makescrn.surfcx = surfcx; makescrn.surfrx = textxl - surfcx; makescrn.surfcy = surfcy; + makescrn.surfsy = surfsy; makescrn.surfstep = (SURFACE_WIDTH * charcy * 2) - (surfcx * 8); makescrn.vramsize = min(0x800, surfcy * textxl); // scrnmng_setheight(0, charcy * surfcy * 2);