home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / msdos / programm / 11631 < prev    next >
Encoding:
Text File  |  1992-12-26  |  1.9 KB  |  52 lines

  1. Path: sparky!uunet!olivea!apple!netcomsv!proto!joe
  2. From: joe@proto.com (Joe Huffman)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Fix for Zortech 386 Screen Memory Access wanted
  5. Message-ID: <1992Dec27.000209.19554@proto.com>
  6. Date: 27 Dec 92 00:02:09 GMT
  7. References: <rwallace.724701384@unix1.tcd.ie> <1992Dec23.190904.14515@proto.com> <rwallace.725390879@unix1.tcd.ie>
  8. Organization: FlashTek, Inc.
  9. Lines: 41
  10.  
  11. rwallace@unix1.tcd.ie (russell wallace) writes:
  12.  
  13. >Basically the method of accessing screen memory I'm using is with a far
  14. >pointer with segment = B800h and offset = row*160 + column*2, to give a
  15. >pointer to the character+attribute at (row,column). This works fine in
  16. >tiny, small, large etc. memory models, but does not work in extended
  17. >(option mx) memory model - as soon as I try to write a value into the
  18.  
  19. The following should work:
  20.  
  21. #include <dos.h> /* For the declaration of _x386_zero_base_selector. */
  22.          /* Also, MK_FP() is prototyped. */
  23. int main()
  24. {
  25.   char _far *screen_ptr = MK_FP(_x386_zero_base_selector, 0xb800);
  26.  
  27.   /* Now use the screen_ptr as you normally would, it points to the base
  28.      address of the start of the screen. */
  29.  
  30.   /* If you get the X-32VM extender (the successor to DOSX) from FlashTek,
  31.   there is a near pointer that points to the start of memory 0000:0000 that
  32.   you could also use for somewhat faster access.   It is called 
  33.   _x32_zero_base_pointer (or ptr, I forget right now). */
  34. }
  35.  
  36. Send me email if you still are having problems...
  37.  
  38. Joe Huffman
  39. FlashTek, Inc.                  FlashTek, Ltd.
  40. 121 Sweet Ave                   Partnership House
  41. Moscow, Idaho 83843             Grantham, Lincs
  42. U.S.A.                          NG31 9ST  England
  43.  
  44. FAX:    208-882-7275            FAX:   +44-476-61382
  45. Voice:  208-882-6893            Voice: +44-476-74108
  46. Orders: 800-397-7310
  47. Email:  flashtek@proto.com      Email: flashtek@cix.compulink.co.uk
  48. CIS:    71332,203               CIS: 100042,1673
  49. -- 
  50. netcom!proto!joe
  51. joe@proto.com
  52.