Пример #1
0
void setscreen(void)
	{
#ifndef WINCIT
	int mode;
	union REGS REG;
	static uchar heightmode = 0;
	static uchar scanlines = 0;
	char mono = 0;
	char far *CrtHite = (char far *) 0x00400085L;

	if (!cfg.restore_mode)
		{
		heightmode = 0;
		scanlines = 0;
		}

	if (gmode() == 7)
		{
		mono = TRUE;
		}

	if (!heightmode)
		{
		if (*CrtHite == 8)
			{
			heightmode = 0x012;
			}
		else if (*CrtHite == 14)
			{
			heightmode = 0x011;
			}
		else if (*CrtHite == 16)
			{
			heightmode = 0x014;
			}
		}

	if (scanlines)
		{
		REG.h.ah = 0x12;			// Video function:
		REG.h.bl = 0x30;			// Set scan lines
		REG.h.al = scanlines;		// Num scan lines
		int86(0x10, &REG, &REG);
		}

	if (heightmode && conMode != -1)	// make sure heightmode is set
		{
		// conMode 1000 --> EGA 43 line, or VGA 50 line

		REG.h.ah = 0x00;
		REG.h.al = (uchar) ((conMode >= 1000) ? 3 : conMode);
		int86(0x10, &REG, &REG);

		// Set to character set 18, (EGA 43 line, or VGA 50 line)
		if (conMode == 1000)
			{
			REG.h.ah = 0x11;
			REG.h.al = 18;
			REG.h.bl = 0x00;
			int86(0x10, &REG, &REG);
			}
		else
			{
			REG.h.ah = 0x11;
			REG.h.al = heightmode;
			REG.h.bl = 0x00;
			int86(0x10, &REG, &REG);
			}
		}

	if (!scanlines)
		{
		getScreenSize(&conCols, &conRows);

		if (!mono)
			{
			if (conRows == 24)
				{
				if (*CrtHite == 14) scanlines = 1;	// Old char set
				if (*CrtHite == 16) scanlines = 2;	// Vga char set
				}

			if (conRows == 42) scanlines = 1;
			if (conRows == 49) scanlines = 2;
			}
		else
			{
			if (conRows == 24) scanlines = 1;
			if (conRows == 27) scanlines = 2;		// herc only
			if (conRows == 42) scanlines = 1;
			}
		}

	mode = gmode();
	conMode = (mode == 3 && conMode >= 1000) ? conMode : mode;

	if (mode == 7)
		{
		physScreen = (char far *) 0xB0000000L;		// mono
		logiScreen = saveBuffer ? saveBuffer : physScreen;
		}
	else
		{
		physScreen = (char far *) 0xB8000000L;		// cga
		logiScreen = saveBuffer ? saveBuffer : physScreen;
		setborder(cfg.battr);
		}

	dgLogiScreen = logiScreen;

	getScreenSize(&conCols, &conRows);

	scrollpos = conRows - StatusLine.Height();

	if (cfg.bios)
		{
		charattr = bioschar;
		stringattr = biosstring;
		}
	else
		{
		charattr = directchar;
		stringattr = directstring;
		}

	OC.ansiattr = cfg.attr;
#endif
	}
Пример #2
0
void ogmode()  /* return to it */
{
    gmode(oldgmode);
}