home *** CD-ROM | disk | FTP | other *** search
/ Executor 2.0 / executorv2.0.iso / pc / dos / extra / docs / maillist / text / archive.95 / text6831.txt < prev    next >
Encoding:
Internet Message Format  |  1996-03-31  |  9.3 KB

  1. Received: from sloth.swcp.com (sloth.swcp.com [198.59.115.25]) by nacm.com (8.6.10/8.6.9) with ESMTP id KAA10077 for <executor@nacm.com>; Fri, 17 Nov 1995 10:17:15 -0800
  2. Received: from iclone.UUCP (uucp@localhost) by sloth.swcp.com (8.6.9/8.6.9) with UUCP id LAA11364; Fri, 17 Nov 1995 11:17:13 -0700
  3. Received: from gwar.ardi.com by mailhost  with smtp
  4.     (nextstep Smail3.1.29.0 #11) id m0tGVGT-000YcHC; Fri, 17 Nov 95 11:11 MST
  5. Received: by gwar.ardi.com (linux Smail3.1.28.1 #5)
  6.     id m0tGVGS-000GOwC; Fri, 17 Nov 95 11:11 MST
  7. Message-Id: <m0tGVGS-000GOwC@gwar.ardi.com>
  8. Date: Fri, 17 Nov 95 11:11 MST
  9. From: mat@ardi.com (Mat Hostetter)
  10. To: Colin Irwin <cirwin@extro.ucc.su.OZ.AU>
  11. Cc: executor@nacm.com
  12. Subject: Re: Maelstrom
  13. In-Reply-To: <Pine.3.89.9511172350.A11873-0100000@extro.ucc.su.OZ.AU>
  14. References: <Pine.3.89.9511172350.A11873-0100000@extro.ucc.su.OZ.AU>
  15. Sender: owner-paper@nacm.com
  16. Precedence: bulk
  17.  
  18. >>>>> "Colin" == Colin Irwin <cirwin@extro.ucc.su.OZ.AU> writes:
  19.  
  20.     Colin> However, when I ran Maelstrom (I know, I'm still trying to
  21.     Colin> get it to work :-)) it started fine but was extremely
  22.     Colin> jerking in gameplay. Now my question is this: Is there
  23.     Colin> something worng with my general setup, or is it a graphics
  24.     Colin> based problem (as I don't have an accelerated graphics
  25.     Colin> card).
  26.  
  27. If you're running under DOS, the short answer is "download and install
  28. UniVBE 5.1a, and run Executor under plain DOS" for your best chance of
  29. making Maelstrom run fast.  UniVBE is widely available; you may want
  30. to download it directly from the authors at ftp.scitechsoft.com.
  31.  
  32. The rest of this letter is a detailed explanation of what's going on.
  33. It's probably far more detail than you ever wanted, but others on this
  34. list may be interested.
  35.  
  36. The problem is that Maelstrom bypasses Quickdraw and writes directly
  37. to screen memory, which can force many Executor setups to run in a
  38. slower compatibility mode.
  39.  
  40. There are two graphics modes in which Executor can run:
  41.  
  42.    1) The "screen" presented to the app being emulated (e.g. Maelstrom)
  43.       is in fact the real hardware screen.  Pixels written to this
  44.       memory will instantly appear on the screen.
  45.  
  46.    2) The "screen" presented to the app is actually just normal RAM.
  47.       Special Executor code periodically copies rectangles from this
  48.       RAM to the real display.
  49.  
  50. (1) is *MUCH* faster than (2), so of course we always try to use mode
  51. (1) when possible.  Of course, it's often not possible.  For example,
  52. under X11 we are not able to get direct access to screen memory, and
  53. instead have to use X11 calls to copy rectangles to the screen.
  54.  
  55. In your case, your machine is running Maelstrom in mode (2), so it's
  56. really slow.  To make it run in mode (1) you need a VBE 2.0-compatible
  57. video driver, such as UniVBE 5.1a.  Of course, it's possible that
  58. UniVBE doesn't support your video card, in which case you won't be
  59. able to get mode (2) until we port to Win32/DirectDraw (assuming
  60. DirectDraw does what we want).
  61.  
  62. For normal programs that use Quickdraw (i.e. make toolbox calls to
  63. draw to the screen), Executor notes what parts of the screen have
  64. changed.  When it comes time to update the "real" screen, Executor
  65. knows how what changed so it only copies some minimal "dirty
  66. rectangles" from its internal screen to the real screen.
  67.  
  68. When programs bypass Quickdraw and write directly to screen memory,
  69. Executor has no easy way of knowing which pixels on the "real" screen
  70. are outdated.  Executor switches into a slow "refresh mode" where it
  71. does one of two things:
  72.  
  73.    A) Periodically compare the current internal screen to the last one
  74.       displayed, identify the smallest rectangle that encloses all
  75.       changed pixels, and copy that rectangle to the screen.
  76.  
  77.    B) Periodically copy the entire internal screen to the real screen,
  78.       and don't bother trying to figure out which pixels have changed.
  79.  
  80. Both will be fairly slow and lurchy.
  81.  
  82. So right now you're in mode (2) and you'd really like to be in mode
  83. (1).  Maelstrom blazes when it gets to write directly to your SVGA
  84. card's VRAM.  Unfortunately, DOS makes supporting this mode extremely
  85. difficult.
  86.  
  87. Many games originally written for the Macintosh expect that screen
  88. memory is a contiguous sequence of bytes, and that they can plot
  89. pixels at any location on the screen by writing to the appropriate
  90. memory location.  Unfortunately, because of the infamous 640K
  91. limitation on the 80286, the original SVGA boards could only make a
  92. 64K "window" into screen memory available at any given time.  This
  93. window could be "repositioned" to correspond to various places on the
  94. screen, but could not be enlarged.
  95.  
  96. Of course, most 256 color screens take much more than 64K.  For
  97. example, a 640x480x256 screen takes 300K.  DOOM uses a 320x200x256
  98. screen, which takes less than 64K and thus avoids many of the
  99. headaches that Executor encounters.
  100.  
  101. Anyway, back to our story.  Some programs originally written for the
  102. Mac expect a big block of memory to correspond to the screen.  Under
  103. the old svga model, there is no such block of memory for screens that
  104. take more than 64K.
  105.  
  106. Fortunately, with the advent of the 32-bit 80386, most svga boards
  107. gained a "linear frame buffer" option, which can give programs a
  108. single contiguous block of memory for the entire screen.  Yay.  This
  109. is exactly what we want.
  110.  
  111. The specifics of how to turn on "linear mode" vary by SVGA chipset.
  112. In general, these board-specific differences are handled by the video
  113. driver, so programs need not concern themselves with the details of
  114. every board ever made.
  115.  
  116. Unfortunately, the ROMs on most boards only support the "VBE 1.2"
  117. standard (VESA BIOS Extensions 1.2), which predates the widespread use
  118. of linear frame buffers and provides no way for programs to use them.
  119. VESA addressed this with the VBE 2.0 standard, which also allows
  120. programmers to take advantage of 8-bit DACs and do certain things more
  121. quickly in protected mode programs.
  122.  
  123. VBE 2.0 isn't built in to many boards, but UniVBE 5.1a knows how to
  124. provide a VBE 2.0 driver interface for most boards.  When UniVBE is
  125. installed on a well-supported board that actually has the hardware
  126. capability for linear frame buffers, Executor can enable linear frame
  127. buffer mode for faster graphics.
  128.  
  129. You hoped my explanation was complete and this letter was coming to an
  130. end, but nay.  There's more.
  131.  
  132. I'm sure you've stayed awake nights wondering how protected mode
  133. programs allocate memory from the system, patch into hardware
  134. interrupts, etc.  These days the standard way to do it is for the
  135. program to talk to a "DPMI server" which manages those resources.
  136. Windows, Warp, and DOSEMU all provide DPMI servers.  DOS does not,
  137. although several are available.  Executor/DOS comes with cwsdpmi.exe,
  138. a free DPMI server written by Charles Sandmann.  It only gets used
  139. when no other DPMI server is present.
  140.  
  141. The original DPMI standard was DPMI 0.9.  It provided enough basic
  142. mechanisms for unsophisticated programs to run well.  However, its
  143. limitations eventually resulted in the DPMI 1.0 standard.  DPMI 1.0
  144. provides programs with powerful new ways to manipulate virtual memory.
  145.  
  146. One important thing that DPMI 1.0 lets programs do is map physical
  147. memory into their address space.  Executor uses this feature, when
  148. available, to map a linear frame buffer into our address space.
  149. Without this feature, Executor needs a "far pointer" to reference even
  150. a linear screen, and so that memory cannot be made available to the
  151. application being emulated.
  152.  
  153. However, VBE 2.0 + DPMI 0.9 is still fast for programs that don't
  154. bypass Quickdraw, since our blitter knows how to draw directly to
  155. screen that requires a far pointer (a segment override).  On this
  156. setup, we don't keep a RAM virtual screen lying around in some
  157. graphics modes.  Our blitter just draws directly to the SVGA board.
  158.  
  159. Amazingly, Windows 3.1 and Windows '95 only provide DPMI 0.9!  I'm not
  160. sure about WinNT, but I'd guess it also provides 0.9.  OS/2 Warp
  161. provides something they call DPMI "0.95", but I haven't been able to
  162. get the DPMI 1.0 features I need (mostly DPMI function 0x508) to work
  163. under Warp.
  164.  
  165. In fact, there are very few DPMI 1.0 servers out there.  Fortunately,
  166. after ARDI and Id Software begged the author we were able to get
  167. cwsdpmi.exe to provide the DPMI 1.0 features we need to map the frame
  168. buffer into our address space.  Games like Maelstrom, Apeiron,
  169. Solarian, Space Madness, etc. *blaze* under DOS + UniVBE 5.1a.  But if
  170. you run under Windows or Warp, or you don't have a VBE 2.0 compatible
  171. driver, or your svga board doesn't support linear frame buffers, these
  172. games will be slow and lurchy.
  173.  
  174. After Executor 2 comes out, we plan to port Executor to Win32.  I have
  175. not yet read the documentation for Microsoft's "DirectDraw" package,
  176. but it sounds like it may give us the best of all worlds for Windows
  177. users.  Warp has something called DIVE which may provide similar
  178. functionality.  NEXTSTEP has Interceptor.  And then there's SciTech's
  179. "WinDirect" package, which allows Windows programs to shut down the
  180. Windows GDI and take over the entire screen.  That, combined with
  181. SciTech's UniVBE 5.2 (which will support the VBE/AF hardware
  182. acceleration video driver standard on some boards) might also make for
  183. a blazing Executor.
  184.  
  185. If you've read this far, I'm impressed.  :-)
  186.  
  187. -Mat
  188.  
  189.