home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / rec / games / programm / 4739 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  3.8 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!usc!chaph.usc.edu!aludra.usc.edu!not-for-mail
  2. From: mduffy@aludra.usc.edu (Michael Duffy)
  3. Newsgroups: rec.games.programmer
  4. Subject: Re: vga mode 13
  5. Date: 18 Nov 1992 16:58:23 -0800
  6. Organization: University of Southern California, Los Angeles, CA
  7. Lines: 66
  8. Message-ID: <1eeorfINNorv@aludra.usc.edu>
  9. References: <1992Nov13.152904.1806@ms.uky.edu> <1992Nov17.121513.11999@bsu-ucs>
  10. NNTP-Posting-Host: aludra.usc.edu
  11.  
  12. In article <1992Nov17.121513.11999@bsu-ucs> 00rbspelman@leo.bsuvc.bsu.edu writes:
  13. >In article <1992Nov13.152904.1806@ms.uky.edu>, carld@ms.uky.edu (Carl Lafferty) writes:
  14. [....]
  15. >> Anyway.  I was wondering if anyone can tell me how to page flip using
  16. >> mode $13 on the IBM vga compatibles.  Any help will be appreciated.  
  17. [....]
  18. >> Carl Lafferty
  19. >
  20. >    Well, there is ALWAYS a way around this one, only I don't quite know
  21. >what it is at the moment.  Officially, you cannot flip pages while in mode 13.
  22. >It is not supported by the chip?  If you are using some form of basic which
  23. >supports mode 13, you can dimension an array, and assuming that your pictures
  24. >will be similar in backround, you might use GET/PUT and a few DRAW statements
  25. >to manipulate things to your liking.  Otherwise I would say try to set aside 
  26. >enough memory to hold an image in mode 13, then direct the VGA card to get
  27. >the picture information from there instead of from its own memory.  
  28. >
  29. >    The major problem this causes is with memory.  I don't remember offhand
  30. >how much memory mode 13 takes up, but I am sure it is at least 256k, probably
  31. >substantially more due to the higher resolution and color options.  Good luck..
  32. >
  33. >Robert B. Spelman
  34. >Ball State University
  35. >Muncie, IN
  36. >00RBSPELMAN@LEO.BSUVC.BSU.EDU
  37. Bzzztt.  Wrong. Thank you for playing........  Hmmm... If only I had a FAQ for
  38. this group to throw around.....
  39.  
  40. Mode 13 is arranged so that it takes up 64,000 bytes (just short of 64k) in 
  41. display memory.  The way the VGA card flips pages is to set a new address for
  42. it's first pixel (the upper left hand corner of the screen).  As a cruel joke,
  43. the designers of the VGA card only allow this address to be in the first 64k
  44. of display memory.  Hence, Mode 13 takes up too much of the first 64k to have
  45. a second page.  Also, VGA cards can only display stuff that is in display 
  46. memory; you can't direct it to get info from regular memory.
  47.  
  48. You do have a few options though:
  49.  1) Use an array in standard memory the size of your screen and write screen
  50.     data to that instead.  Of course you'll have to write all of your own 
  51.     graphic primitives to write to the array instead of display memory.  Once
  52.     all your info for the frame is in the array, wait for a verticle retrace
  53.     and throw the buffer into display memory with nothing short of assembly 
  54.     language (I SUPPOSE a higher level language could work, but it depends on
  55.     how well your compiler writes code.)
  56.  
  57.  2) Use a 16 color mode which allows more than one page of display memory.
  58.     Since on a VGA the registers that mimic the EGA's palette are transparent
  59.     to the VGA's 256 color registers, you can have a palette of 16 colors
  60.     out of 256Kcolors.  (On an EGA, you still have 16 out of 64, though.) 
  61.     Write your info to an undisplayed page, wait for a vertical retrace, and 
  62.     flip pages.  
  63.  
  64.  3) Use a tweaked 256 color mode that allows multiple pages.  I won't go into
  65.     the tweaked modes now, since I would only be repeating info that has been
  66.     on this group for the past year or so.  Observant people will know what 
  67.     I'm talking about.  No tweaked mode libraries exist for BASIC as far as I
  68.     know.  Move up to C or Pascal (boy I'm mean!).
  69.  
  70.  4) Which you should do anyway.  Buy a book on EGA/VGA.  Read it, study it,
  71.     come here if you have questions about it.
  72.  
  73. Later all,
  74. Mike Duffy (mduffy@aludra.usc.edu)
  75.  
  76.  
  77.