08/07/96  M13SPEED by Royce Liao (liaor@uci.edu)
------------------------------------------------

What's New in This Release...a new and improved M13SPEED

Remember, M13SPEED is not compatible with all applications or video cards.
Please read on.

	M13SPEED.EXE
	------------
	 All new version using VESA 0x100 (640x400x256) to emulate MCGA 13h

	 Requires: VESA support of mode 0x100 (either in resident video-BIOS or
		manufacturer's TSR)

	M13SP101.EXE
	------------
	 Functionally identical to M13SPEED, except uses VESA 0x101 (640x480)
	 to emulate MCGA 13h.  Unfortunately, the emulated-MCGA display will
	 appear squashed.  But if you're desperate for an MCGA performance-
	 boost, you'll have to live with it.

	 Requires: VESA support of mode 0x101 (either in resident video-BIOS or
		manufacturer's TSR)

	OLDM13  .EXE
	------------
	 My original attempt to hack a new MCGA 320x200 display.  OLDM13
	 substitutes MCGA 0x0013 with VESA 0x163, which corresponds to
	 Scitechsoft's 320x200x256.

	 Requires: Scitechsoft's Display Doctor 5.2 (SDD52)


--------------------------------------------------------
	HOW TO USE M13SPEED
--------------------------------------------------------
To load m13speed:

	C:\> m13speed 
	>M13SPEED : TSR loaded! Using VESA 100h as MCGA 320x200 substitute!"

To unload m13speed:
	C:\ m13speed
	>M13SPEED : Now unloaded!

Note, if you load a TSR on top of m13speed (i.e., you load UNIVBE after
loading m13speed), you must unload the last TSR first, before unloading
m13speed.
---------------------------------------------------------


M13SPEED -- WHAT IS IT FOR?

A: Some SVGA chipsets may have excellent bus-thruput in SVGA display modes,
   but only mediocre bus-thruput in MCGA/VGA compatible modes.

   M13SPEED emulates the popular MCGA 320x200 mode13h by calling the video
   BIOS to first setup a SVGA video mode (VESA 0x100, 640x400x256) and
   adjusting the CRTC timing values to recreate a 320x200 display area.

   For compatible video cards, m13speed will accelerate MCGA mode13h
   applications by exploiting the SVGA operational-mode of the host video 
   adapter.  In plain English...that means :
   
        Benchmark your video card's DOS performance (use VIDSPEED4)
        If VIDSPEED shows your SVGA (640x400x8) thruput to be
        greater than your MCGA (320x200x8) performance, give m13speed a try.
        
        Otherwise, m13speed won't help you.

   I should also mention m13speed's "non-scalability."  M13SPEED was  
   conceived to improve frame-rates on MCGA games.  Today's 320x200 games
   typically require high-performance (Pentium) processors to run at a
   decent speed.  For such games, the bulk of the CPU's time is spent
   calculating/updating the game environment, not refreshing the display.
   Even if you were to, say, "double" your MCGA performance with m13speed,
   the game might not appear to run much faster.  In such games like "Quake!",
   the bottleneck is the CPU, not the video-bus.

   Older computer systems, DX2/66 DX4/100, may benefit more from m13speed.
   If we were to run a comparison between two machines running the same
   game, the system with the slower-CPU would appear to benefit more from
   m13speed than the faster-CPU system.  That's what I mean by 
   "non-scalability."  You're more likely to detect a shift from 10fps->15fps 
   than from 20fps->25fps.

   Please understand the previous discussion is on speculation.  Well it's
   also based on my own field-testing of m13speed.  

Q: What is "MCGA 320x200" ?  Is there a difference between MCGA and VGA? 
   Back in the days of the IBM PS/2, video display engineers realized that
   the human eye could, in fact, distinguish more than the 16 colors of
   prevailing EGA displays...

   To make a long story short, the low-end PS/2 models carried an MCGA
   display subsystem...what was basically "CGA + a-special-256-color-mode."
   That's right, MCGA was not even backward compatible with EGA.  It was
   fairly cheap (implemented with 64k display memory.)

   The high-end PS/2 models carried the VGA display subsystem, IBM's
   premier display technology (actually, the 8514/A was even more elite, but
   never became mainstream.)  VGA architecture is essentially identical to
   EGA, in the sense that VGA inherits EGA's planar 4-bit addressing.
   Fortunately, IBM included the "special-256-color-mode" (320x200x256) 
   in VGA's architecture, so all VGA displays were in fact CGA/EGA/MCGA
   compatible.

   Anyway, contemporary DOS games use either one of two 320x200 display
   modes:
        1) MCGA 
           MCGA allows but one display resolution, 320x200
        2) VGA "ModeX" ( horizontal 320 or 360, vertical 200, 400, 240, 480)
           many display resolutions are possible
           common ones include 320x200, 320x240
           lesser known modes are, 360x200, 360x240, 320x400,
                                320x480, 360x400, 360x480

   MCGA is much easier to prorgam.  It's a 64k linear-flat buffer.  All
   dots are addressible by a row/column address.

   VGA "ModeX" is an "undocumented" display mode.  All ModeX resolutions
   use EGA's planar-addressing.  Whereas MCGA offers a flat-linear
   framebuffer, ModeX offers a complex chain-4 framebuffer.  ModeX is
   popular with flight simulators, because it allows page-flipping for
   seamless animation...something MCGA can't do.

        M13SPEED IS ONLY COMPATIBLE WITH MCGA 320x200x256!!!
   
Q: Why doesn't M13SPEED work with ModeX?

   ModeX is a planar (chain-4) display-mode.
   MCGA and all SVGA 256-color (and up) modes are linear packed-pixel.
   These two memory arrangements are entirely different.  Since M13SPEED
   emulates MCGA 320x200 by using SVGA 640x400, M13SPEED is limited to
   accelerating MCGA games.

Q: How can I tell which mode (MCGA or ModeX) a game is using?

   Load M13SPEED and see what happens.  If a program tries to setup a ModeX
   display, M13SPEED will corrupt it.  You'll know when you see it.

Q: Will m13speed work with my video card?

   A very good question, and unfortunately I don't have enough field
   experience to offer a satisfactory answer.  Of the board's I've tried so
   far...

        S3 chipsets ... absolutely does NOT work with m13speed
                        don't fret, try Dietmar's S3SPDUP

        Trident 94XX/96XX ... m13speed was developed and tested on a
                                generic Trident 9680PCI board

        Cirrus/Tseng Labs/Matrox Millenium ...
                these chipsets have excellent VGA cores, m13speed can't
                accelerated what is already fast.
                                
Q: Any benchmarks to justify M13SPEED's alledged promises?

   Test system : Am5x86-160MHz, 40MHz PCI bus
        SiS 496/497 B5 chipset, 16mb FPM DRAM, 256k L2 cache

   Trident 9680PCI, 2mb EDO DRAM

   display mode        without        with
   (## description)    m13speed       m13speed
   13h MCGA 320x200    14400          32000*
   100h SVGA 640x400   32000*         32000*

   numbers reported by VIDSPEED 4.0, in bytes/sec

   *"32000" seems to be a ceiling imposed by the PCI chipset, not
    the test video card.

Q: Any KNOWN LIMITATIONS?

   Like I said earlier...M13SPEED will emulate MCGA 320x200 by using  
   SVGA VESA mode 0x100.  Therefore, if your video card isn't VESA-compatible,
   m13speed won't function.  If your video card isn't faster in SVGA than
   in VGA, m13speed won't help.  And finally, m13speed is incompatible with
   "ModeX" games.  Incompatible, meaning the display will behave in an
   unpredictable manner.

   To summarize:
   
   On systems with tilted (SVGA faster than MCGA) performance,
       m13speed will ACCELERATE MCGA 320x200.
       m13speed will cause unpredictable behavior in VGA ModeX. 
       m13speed will not affect any other video modes.
   
   On systems with equitable performance (SVGA and MCGA comparable in speed),
       m13speed will not affect MCGA 320x200.
       m13speed will cause unpredictable behavior in VGA ModeX.
       m13speed will not affect any other video modes.

   Furthermore, I've tested M13SPEED with Mechwarrior2 (DOS v1.1),
   Destruction Derby, and Tie Fighter (not the enhanced SVGA version),
   and the Screamer demo.

   M13SPEED seems to cause some trouble with Screamer's setup-diagnostic,
   but the interactive game itself works with m13speed loaded.

Q: Can I get the source code?

   You bet.  M13SPEED was written with Borland's Turbo C++ 3.0 (DOS.)
   The core TSR-code was provided by Borland's public web-site,
	http://www.borland.com
   There is nothing proprietary about this program.  Please distribute
   it freely, before all DOS games become extinct.


--------------------
Questions, comments?
	liaor@uci.edu
	http://www.oac.uci.edu/~rliao
	http://www-personal.umich.edu/~liaor