home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / msdos / programm / 41 < prev    next >
Encoding:
Internet Message Format  |  1992-08-20  |  3.1 KB

  1. Xref: sparky comp.msdos.programmer:41 comp.graphics:9028 comp.sys.ibm.pc.programmer:346
  2. Newsgroups: comp.msdos.programmer,comp.graphics,comp.sys.ibm.pc.programmer
  3. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zelator!leo
  4. From: leo@zelator.in-berlin.de (Stefan Hartmann)
  5. Subject: Re: Direct SVGA memory access
  6. Organization: Puplic-Access-Xenix-System
  7. Date: Thu, 20 Aug 92 20:02:29 GMT
  8. Message-ID: <FU952LI@zelator.in-berlin.de>
  9. References: <1992Aug20.141357.20611@alw.nih.gov>
  10. Lines: 97
  11.  
  12. In <1992Aug20.141357.20611@alw.nih.gov> gregh@alw.nih.gov (Gregory Humphreys) writes:
  13.  
  14. >Okay.  I want to write to SVGA memory without using BIOS calls on my 486.  I can do it great with int 10, but it's slow as all hell.  What is happening is after I calculate the address for the VRAM, everything is getting modded into the top 64k of VRAM (one display pages worth, I guess).  Imagine the 1024x768x256 screen sectioned into 12 horizontal bars, and anything that you write is put into the TOP one.  ANyhow, I think this is because I'm not changing display pages.  So I tried Three things:
  15.  
  16. >1)
  17.  
  18. >void Plot(x,y,Color)
  19. >int x,y,Color
  20. >{
  21.  
  22. >    int Page
  23. >    long offset;
  24. >    char far *address;
  25.  
  26. >    Page = y/64;
  27. >    outport(0x3CD,Page);
  28.  
  29. >    offset = 1024*y + x;
  30. >    address = (0xA0000000L + offset);
  31. >    *address = Color;
  32. >}
  33.  
  34.  
  35. >2) 
  36.  
  37.  
  38. >void Plot(x,y,Color)
  39. >int x,y,Color
  40. >{
  41.  
  42. >    int Page
  43. >    long offset;
  44. >    char far *address;
  45. >    char far *PageAddress;
  46.  
  47. >    Page = y/64;
  48. >    PageAddress = MK_FP(0000,0x462); /* The Low Memory address of the current
  49. >                        Page Number */
  50.  
  51. >    *PageAddress = Page;    
  52.  
  53. >    offset = 1024*y + x;
  54. >    address = (0xA0000000L + offset);
  55. >    *address = Color;
  56. >}
  57.  
  58. >3)
  59.  
  60. >void Plot(x,y,Color)
  61. >int x,y,Color
  62. >{
  63.  
  64. >    int Page
  65. >    long offset;
  66. >    char far *address;
  67. >    
  68. >    Page = y/64;
  69. >    
  70. >    _AH = 5;
  71. >    _AL = Page;
  72.  
  73. >    geninterrupt(0x10);
  74.  
  75. >    offset = 1024*y + x;
  76. >    address = (0xA0000000L + offset);
  77. >    *address = Color;
  78. >}
  79. >    
  80. >The Third one at least gave me some results - everything I had drawn got moved to the bottom half of the screen and above it was about 300 horizontal blue bars that flickered a lot.  Any ideas?  This is a Trident 8900 card w/ 1 meg VRAM on a 486/33 using Borland C++ 3.0.  HELP ME DAMMIT!  Can you tell I'm frustrated? YES!!!!
  81.  
  82.  
  83. >-- 
  84. >Greg Humphreys    |  "Playing not to win is like sleeping with your 
  85. >gregh@alw.nih.gov |  sister - sure, she's a great piece of tail, 
  86. >                  |  and she's got a bag full of goodies, but it's 
  87. >(301) 402-1817    |  just plain illegal."  -Charlie Sheen, "Hotshots"
  88.  
  89. Hi,
  90. get yourself VGAKIT41.ZIP  ! it is a driver library for all SVGA cards
  91. in 256 color modes.
  92. So if you includes these drivers into your program, it will work on
  93. the most standard SVGA cards..
  94.  
  95. It is available on some FTP-servers. Just ask archie. It is ASM and
  96. C-Source-code. Also there is VESAVGA.ZIP a vesa driver library.
  97.  
  98. Best regards Stefan Hartmann.
  99. email to: leo@zelator.in-berlin.de
  100.  
  101.  
  102. -- 
  103.  
  104. *************************************************************
  105. *  Stefan Hartmann       This is how to contact me:         *
  106. *  EMAIL: leo@zelator.in-berlin.de                          *
  107. *  Phone : ++ 49 30 344 23 66      FAX : ++ 49 30 344 92 79 *
  108. *************************************************************
  109.