xyzzy

setlines.zip 3.3

0.      Contents of setlines.zip (39 KB):
0.1     SETLINES.HTML   this text
0.2     SETLINES.TXT    text/plain
0.3     SETLINES.C      source code
0.4     SETLINES.ICO    nice OS/2 icon for SETLINES -1 (display off)
0.5     ATILINES.COM    v3.1 DOS executable for ATI Mach64 chips
0.6     SETLINES.COM    v3.1 DOS executable for VGA / VESA displays
0.7     SETLINES.EXE    v3.3 DOS executable for VGA / VESA displays
0.8     SPAWN.C         replace spawn* functions (only WATCOM C/C++)
0.9     SPAWN.H         replace spawn* declarations in <process.h>

1.      Purpose
1.1     The BIOS support for standard VGA cards doesn't support 60
        lines (text mode) and its variants (30 and 34 lines), but
        (almost) all VGA cards, and of course SVGA or VESA cards, can
        use these text modes.  For details see below.
1.2     Please note that I've never seen an ANSI.SYS clone supporting
        all possible text mode variants (80 x 12 .. 132 x 60), but at
        least some variants should work at the DOS command prompt (in
        full screen AND text window sessions).  Some DOS applications
        are generally less restricted and allow to use (almost) any
        preset text window size.  If an application refuses to work
        try more lines (e.g. SETLINES 21 instead of SETLINES 14).
1.3     ATI Mach 32 doesn't support all VESA text modes, but SETLINES
        uses a trick to force all text mode variants (see source).
        ATI Mach 64 doesn't support any VESA text mode unfortunately,
        try ATILINES.COM instead of SETLINES.COM:  ATILINES uses ATI
        mode 0x23 and 0x33 instead of the corresponding VESA modes.
1.4     An OS/2 desktop system doesn't support VESA display power off
        and has no decent "all black" screen saver.  Use SETLINES -1
        (or ATILINES -1) in a MDOS full screen session to switch the
        display power off (until any key is pressed).  If you don't
        know how to install a MDOS full screen program in OS/2 ask
        your system administrator.  CAVEAT: very old VGA displays do
        not support VESA display power management (DPMS).
1.5     Just for fun I have added text mode 1 (SETLINES 1) 40 x 25.
        You can also use SETLINES to execute a DOS program in a text
        mode subshell with a given number of lines.  If this doesn't
        work the SETLINES stack is too small for your environment -
        try to recompile setlines.c (use MS C 6.0 or Watcom C 10.0).
1.6     Usage
        SETLINES 0      Shows a terse usage message
        SETLINES -1     VESA display power off (any key: power on)
        SETLINES 1      40 x 25: text mode 1
        SETLINES 12     80 x 12: 12 < 200 / 16 (CGA, 8 x 16 font)
        SETLINES 14     80 x 14: 14 < 200 / 14 (CGA, 8 x 14 font)
        SETLINES 21     80 x 21: 21 < 350 / 16 (EGA, 8 x 16 font)
        SETLINES 25     80 x 25: 25 = 400 / 16 (VGA, 8 x 16 font)
        SETLINES 28     80 x 28: 25 = 400 / 14 (VGA, 8 x 14 font)
        SETLINES 30     80 x 30: 30 = 480 / 16 (480, 8 x 16 font)
        SETLINES 34     80 x 34: 34 < 480 / 16 (480, 8 x 14 font)
        SETLINES 43     80 x 43: 43 < 350 /  8 (EGA, 8 x  8 font)
        SETLINES 50     80 x 50: 50 = 400 /  8 (VGA, 8 x  8 font)
        SETLINES 60     80 x 60: 60 = 480 /  8 (480, 8 x  8 font)
                        80 x 60: VESA mode 108 (not used here)
        SETLINES -21    132 x 21: VESA mode 10A, 8 x 16 font
        SETLINES -25    132 x 25: VESA mode 109, 8 x 16 default
        SETLINES -28    132 x 28: VESA mode 109, 8 x 14 font
        SETLINES -30    132 x 30: VESA mode 10C, 8 x 16 font
        SETLINES -34    132 x 34: VESA mode 10C, 8 x 14 font
        SETLINES -43    132 x 43: VESA mode 10A, 8 x  8 default
        SETLINES -50    132 x 50: VESA mode 109, 8 x  8 font
                        132 x 50: VESA mode 10B (not used here)
        SETLINES -60    132 x 60: VESA mode 10C, 8 x  8 default
        SETLINES        SETLINES called without argument tries to
                        toggle 80 / 132 columns

2.      Details (copied from source setlines.c)
2.1     ROM font 8 x 8, 14, 16
        scanlines ------------
             200 | (25) 14  12
             350 |  43 (25) 21
             400 |  50  28  25
             480 |  60  34  30
2.2     Restrictions
        - Some old VGA support only 50, 28, 25 lines
        - Some old ATI report mode 5Bh for 30 x  80
        - Some old ATI report mode 23h for 25 x 132
        - Some old ATI don't support VESA 108h, 10Ch
        - Some old VGA don't support VESA text modes
        - ANSI.SYS confused by NNx132, use VANSI.SYS
        - Setlines -1 requires VESA power management
        - Setlines +1 is a 2nd special case: 25 x 40
        - With 60 x 132 there is only ONE video page
2.3     History
        1.0     Support 12, 14, 21, 25, 28, 43, and 50 lines (EGA: 25, 43).
        1.1     Toggle screen height (25x80 and 28x80) as default,
                replaced stdio.h fprintf() by smaller conio.h cputs().
        1.2     Replaced int86x() by Watcom's smaller intr().
        1.3     Support 30, 34, 60 lines based on 480 scan lines, uses the
                standard VGA function INT 10 AX 1C02 "restore video state".
        2.0     Support 132 columns, specified as -21, -25, ..., -50, -60:
                based on VESA modes 109, 10A, 10C.  Use VESA mode 108 for
                60x80 if available.  But my ATI Mach32 is a bit stupid :-)
        2.1     Toggle screen width (NNx80 and NNx132) as default.
        2.2     Save current screen contents if width is the same, does not
                work as expected with PC DOS 7 ANSI.SYS, but VANSI.SYS or
                no ANSI-driver are okay, and then even DOS accepts 60x132.
        2.3     Patch BIOS data for get video mode result 3 instead of 83h,
                this prevents NC.EXE from clearing the saved screen because
                it did not understand the "keep video memory" bit 7 in 83h.
        2.4     Special argument: setlines -1 to switch VESA display power
                OFF, awaits any key pressed before exit switching power ON.
        2.5     setlines 0 or setlines ? usage() return code == getlines().
                setlines 1 supports 25x40 text mode 1 as 2nd special case.
        2.6     Switch screen off during setlines() setting and scrolling.
                Save current screen contents even if screen width changed.
        3.0     Support ATI Rage Pro (missing VESA text modes replaced by
                proprietary ATI modes 23 and 33 #ifdef ATI).
        3.1     Manual added, <URL:http://purl.net/xyzzy/dos/setlines.zip>
        3.2     Bypass "load font" problems for VESA modes 10A (43x132) and
                109 (25x132) with INTEL810 chips by explicitly setting 350
                and 400 scan lines before.
                Added 22x80 and 22x132 modes.  The code supporting real EGA
                monitors was stripped, and for a VGA 16 * 22 = 352 > 350 is
                no serious problem.  Added 15 and 17 lines modes based on
                the simple "double scan" logic implicitly used for 12 and
                14 lines.  Added 14x132 also based on "double scan", please
                note that 12x132 is still not supported.  14x132 requires a
                video card supporting VESA mode 109h (at least indirectly),
                likewise 15x132 and 17x132 need VESA mode 10C (60x132).
        3.3     Open Watcom spawnvp() replaced by smaller spawn.c variant.
2.4     Option
        Use MS C 6.0 and the tiny startup library CRTINY.LIB to create the
        small SETLINES.COM binary. Copied from MS C makefile, no guarantee:
        LINK = link /INF/MAP/NOI/NOE/NOL/NON/CP:1/W
        cl -AS -W4 -Olaszer -nologo -c setlines.c
        $(LINK) /TIN crtiny.lib setlines.obj,setlines.com,setlines.map;
2.5     Source
        setlines.c (c) 1998, 2002, 2010 by Frank Ellermann, version 3.3
        Option : http://purl.net/xyzzy/dos/tinylibs.htm
        Manual : http://purl.net/xyzzy/dos/setlines.htm
        Archive: http://purl.net/xyzzy/dos/setlines.zip

W3 validator Last update: 10 May 2010 5:00 by F.Ellermann