
				   Text Mode

			     Freeware by Jason Hood
			      jadoxa@yahoo.com.au
			    http://tm.adoxa.cjb.net/

				  11 May, 2003



    ===========
    Description
    ===========

    Text Mode (tm.com) provides control of  various  text  screen  settings:
    columns,  rows, scan lines, font height, page, and border color.  It can
    also display the current settings.

    Windowed Text Mode (wtm.com) provides control of columns  and  rows  for
    windowed DOS-boxes. It will NOT work full-screen.


    ============
    Requirements
    ============

    186+   WTM: 386+
    VGA 	Windows


    =====
    Usage
    =====

    TM <cols>[x<rows>] -m[<mode>] ,<lines>
       -c[<cols>] -r[<rows>] -f[<height|file>]
       -p[<page>] -s[<attr>] -b[<border>] -d -q
       -w[<height>]

    cols  Number of columns: 40, 80 or 90
    rows  Number of rows: see below
    -m	  BIOS/VESA mode number (in hexadecimal)
    lines Scan lines: 1 = 200, 2 = 350, 3 = 400 or 4 = 480
    -f	  Font height (6 to 16) or a font file
    -p	  Page to display (1 to, at most, 8)
    -s	  Save screen contents or clear screen to color
    -b	  Border/frame/overscan color
    -d	  Display current columns, rows and font height
    -w	  Write the font to file (or all fonts if not specified)
    -q	  Quiet

    An option without a value  will  display  the  current  setting  (unless
    quiet) and set ERRORLEVEL. Multiple settings will always be displayed in
    the same order, but ERRORLEVEL will be set to the last specified.

    The supported rows are: 12 - 16, 18, 20 - 23, 25, 26, 28 - 36, 38,
			    40, 43, 44, 48, 50, 53, 57, 58, 60, 66, 68, 80.

    In addition: 25 rows supports scan lines 1, 2 and 3;
		 26 rows supports scan lines 2 and 3;
		 28 rows supports scan lines 1 and 3;
		 30 rows supports scan lines 3 and 4;
		 33 rows supports scan lines 1 and 3;
		 36 rows supports scan lines 3 and 4;
		 40 rows supports scan lines 3 and 4;
		 43 rows supports scan lines 2 and 4;
		 50 rows supports scan lines 2 and 3.

    The default is 3, except for 43, which is 2.

    The font file must contain all 256 characters.

    Values for the border color:

	0 = Black	4 = Red
	1 = Blue	5 = Magenta
	2 = Green	6 = Brown
	3 = Cyan	7 = Grey

    Add 8 for an "intense" variation.

    The screen clearing color is the normal DOS foreground/background pair:


					FOREGROUND

	       <---------Dark---------->   P   D  <---------Light---------->
					   a   a
				   M	   l   r		   M
				   a	   e   k		   a   Y
	       B       G	   g   B	       G	   g   e   W
	       l   B   r   C	   e   r   G   G   B   r   C	   e   l   h
	       a   l   e   y   R   n   o   r   r   l   e   y   R   n   l   i
	       c   u   e   a   e   t   w   e   e   u   e   a   e   t   o   t
 B	       k   e   n   n   d   a   n   y   y   e   n   n   d   a   w   e
 A
 C   Black	   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
 K   Blue     16      18  19  20  21  22  23  24  25  26  27  28  29  30  31
 G   Green    32  33	  35  36  37  38  39  40  41  42  43  44  45  46  47
 R   Cyan     48  49  50      52  53  54  55  56  57  58  59  60  61  62  63
 O   Red      64  65  66  67	  69  70  71  72  73  74  75  76  77  78  79
 U   Magenta  80  81  82  83  84      86  87  88  89  90  91  92  93  94  95
 N   Brown    96  97  98  99 100 101	 103 104 105 106 107 108 109 110 111
 D   Grey    112 113 114 115 116 117 118     120 121 122 123 124 125 126 127


    A hexadecimal number can be used by prefixing with "0x".

    To determine an appropriate mode number, use the  "modes"  program.   It
    will  test	all the BIOS modes and query the VESA information, sending a
    report to the screen (redirect it). The format of the BIOS report is:

    Mode 21*: 100 x 25 (16) :  800 x  400 : Text

    21		hexadecimal mode number
    *		indicates it is set as Mode 03 in the BIOS
    100 x 25	columns by rows
    (16)	font size
    800 x 400	width by height (guess based on columns and rows)

    The format of the VESA report is:

    Mode 103 : 100 x 42  (8 x 14) :  800 x  600 x  8 : Graphics

    103 	hexadecimal mode number
    100 x 42	columns by rows (guessed for graphics)
    (8 x 14)	character width by height
    800 x 600	width by height (guessed for text)
    x 8 	bits per pixel


    =====
    Mode3
    =====

    I've included three other programs to further your text mode  enjoyment:
    AltMode3,  Mode3Fnt  and  Font14.  AltMode3  and  Mode3Fnt	are  similar
    programs, allowing the font and screen colors to be permanently changed.
    The difference between the two is AltMode3 uses BIOS fonts (8, 14 and 16
    lines), whereas Mode3Fnt uses a custom  font  (anything  from  6  to  16
    lines).  Run  them	with "-?" (or read the .asm files) to find out more.
    If you elect to run either of those programs with a 14- or 15-line font,
    you  might need Font14. I think it's only necessary when Windows crashes
    to the blue screen, but you may find it useful for other  programs	(eg.
    font  editors  that read the BIOS 14-line font). Just run it and it will
    tell you what it thinks.

    Note: Mode3Fnt and Font14 expect high memory. If  they  can't  find  it,
	  they'll  use  the  top end of low memory. This may cause problems,
	  I'm not sure.  If you have any difficulties, let me know.

    Note 2: AltMode3 uses high memory by default. If you'd prefer to use low
	    memory,  execute  the  debug script: "debug <altmode3.dbg". This
	    will patch "altmode3.com" to only use low memory.


    ===
    WTM
    ===

    This is a program to set the columns and/or rows of a windowed  DOS-box.
    Any even number of columns from 2 to 132 are allowed; any number of rows
    from 1 to 128 are allowed. The largest sizes  allowed  are	132x124  and
    128x128.  WTM does NOT work full-screen. You may experience trouble with
    columns greater than 126, which is apparently due  to  BIOS  limitations
    (it displayed okay, but it wouldn't scroll).


    ===============
    Acknowledgments
    ===============

    The Assembly Snippets, version 4.0 (asnip40a.zip):
      480  scan  lines	and  90-column	mode  by  Tenie  Remmel (set480.asm,
      90wide.asm); 6-line font was uncredited (font58.asm).

    Ralf Brown's Interrupt List.

    Pierre Jelenc for the color table (from TDE).

    The 12-line font is from an ATI mach64 BIOS 14-line font.

    Ed Cogburn (stm20) & Finn Thoegersen (VGADOC) for VGA register info.


    ============
    Distribution
    ============

    Only the .com file is necessary to run the program,  but  redistribution
    in	a  public place requires the original .zip file contents. A modified
    version can be distributed, on the proviso that the original (or a diff)
    is also included.
