home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 8993 < prev    next >
Encoding:
Text File  |  1992-09-02  |  3.1 KB  |  69 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!convex!darwin.sura.net!uvaarpa!concert!rock!taco!dspascha
  3. From: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
  4. Subject: Re: Changing and restoring Video Mode
  5. Message-ID: <1992Sep2.154857.1270@ncsu.edu>
  6. Originator: dspascha@c00015-118dan.eos.ncsu.edu
  7. Lines: 54
  8. Sender: news@ncsu.edu (USENET News System)
  9. Reply-To: dspascha@eos.ncsu.edu (DAVID SCOTT PASCHAL)
  10. Organization: North Carolina State University, Project Eos
  11. References:  <HENRIK.JOHANSSON.92Sep2140043@ariel.nexus.comm.se>
  12. Distribution: comp
  13. Date: Wed, 2 Sep 1992 15:48:57 GMT
  14.  
  15.  
  16. In article <HENRIK.JOHANSSON.92Sep2140043@ariel.nexus.comm.se>, Henrik.Johansson@nexus.comm.se (Henrik Johansson) writes:
  17. |> Newsgroups: comp.os.msdos.programmer
  18. |> Path: taco!rock!stanford.edu!agate!ames!sun-barr!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sunic!seunet!comm!newshost!Henrik.Johansson
  19. |> From: Henrik.Johansson@nexus.comm.se (Henrik Johansson)
  20. |> Subject: Changing and restoring Video Mode
  21. |> Message-ID: <HENRIK.JOHANSSON.92Sep2140043@ariel.nexus.comm.se>
  22. |> Sender: news@c3consult.comm.se
  23. |> Organization: Communicator NEXUS AB, Uppsala, Sweden
  24. |> Distribution: comp
  25. |> Date: Wed, 2 Sep 92 09:00:43 GMT+5:00
  26. |> Lines: 18
  27. |> 
  28. |> 
  29. |> How do I save _all_ relevant information about current video mode so
  30. |> that I can restore it afterwards exactly as it was?
  31. |> 
  32. |> This problem comes from a Device Driver that is triggered and needs
  33. |> some input from the user.  Therefore the screen gets blanked, user
  34. |> input requested, some action taken, and afterwards the driver must
  35. |> return to wherever the pc was running with the video mode completely
  36. |> intact.
  37. |> 
  38. |> Anyone?
  39. |> 
  40. |> /hj
  41. |> --
  42. |> Real life:   Henrik Johansson            Email:  Henrik.Johansson@Nexus.Comm.SE
  43. |> Snailmail:   Communicator Nexus          Phone:  +46 18 171811
  44. |>              Box 857                     Fax:    +46 18 696516
  45. |>              S - 751 08 Uppsala, Sweden
  46. |> 
  47.  
  48. Hi.  You need to save the video-relevant variables in the ROM-BIOS data area
  49. (at segment 40h), all the VGA registers (you can't do this on an EGA since
  50. most of them are write-only), and the entire video buffer (which can be
  51. anything between 256K to 4 megabytes depending on the adapter).
  52.  
  53. Then set the mode you want and do anything you like.
  54.  
  55. Then use the ROM-BIOS to put the mode back to what it was before (which is one
  56. of the variables in the saved copy of the ROM-BIOS data area but you could have
  57. also just gotten it with INT 10h function 0Fh), copy the ROM-BIOS data back,
  58. copy the registers back, and copy the video buffer back (and be sure to restore
  59. the registers you used to traverse the video buffer).
  60.  
  61. I know it's complicated (and possibly memory-comsuming) to be able to swap
  62. over any text or graphics mode on any adapter, but you would need to code your
  63. (interrupt?) handler to refuse to swap over any mode you don't recognize.  And
  64. you could make it a whole lot simpler just by refusing to swap over any graphics
  65. mode (i.e. you'd only have to swap 80x25x2 bytes rather than 256K or more).
  66.  
  67. Tschuess,
  68. David Paschal
  69.