home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / msdos / programm / 11655 < prev    next >
Encoding:
Internet Message Format  |  1992-12-28  |  1.9 KB

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!ieunet!tcdcs!unix1.tcd.ie!rwallace
  2. From: rwallace@unix1.tcd.ie (russell wallace)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Fix for Zortech 386 Screen Memory Access wanted
  5. Message-ID: <rwallace.725535933@unix1.tcd.ie>
  6. Date: 28 Dec 92 09:45:33 GMT
  7. References: <rwallace.724701384@unix1.tcd.ie> <1992Dec23.190904.14515@proto.com> <rwallace.725390879@unix1.tcd.ie> <1992Dec27.000209.19554@proto.com>
  8. Sender: usenet@cs.tcd.ie (NN required at ashe.cs.tcd.ie)
  9. Organization: Trinity College, Dublin
  10. Lines: 33
  11. Nntp-Posting-Host: unix1.tcd.ie
  12.  
  13. In <1992Dec27.000209.19554@proto.com> joe@proto.com (Joe Huffman) writes:
  14.  
  15. >rwallace@unix1.tcd.ie (russell wallace) writes:
  16.  
  17. >>Basically the method of accessing screen memory I'm using is with a far
  18. >>pointer with segment = B800h and offset = row*160 + column*2, to give a
  19. >>pointer to the character+attribute at (row,column). This works fine in
  20. >>tiny, small, large etc. memory models, but does not work in extended
  21. >>(option mx) memory model - as soon as I try to write a value into the
  22.  
  23. >The following should work:
  24.  
  25. >#include <dos.h> /* For the declaration of _x386_zero_base_selector. */
  26. >         /* Also, MK_FP() is prototyped. */
  27. >int main()
  28. >{
  29. >  char _far *screen_ptr = MK_FP(_x386_zero_base_selector, 0xb800);
  30.  
  31. >  /* Now use the screen_ptr as you normally would, it points to the base
  32. >     address of the start of the screen. */
  33.  
  34. >  /* If you get the X-32VM extender (the successor to DOSX) from FlashTek,
  35. >  there is a near pointer that points to the start of memory 0000:0000 that
  36. >  you could also use for somewhat faster access.   It is called 
  37. >  _x32_zero_base_pointer (or ptr, I forget right now). */
  38. >}
  39.  
  40. Thanks, this works perfectly! (Except the typo: 0xb800 in the above
  41. should read 0xb8000. With this, there are no further problems.)
  42. --
  43. "To summarize the summary of the summary: people are a problem"
  44. Russell Wallace, Trinity College, Dublin
  45. rwallace@unix1.tcd.ie
  46.