delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/07/12/22:04:02

Xref: news-dnh.mv.net comp.os.msdos.djgpp:892
Path: news-dnh.mv.net!mv!news.sprintlink.net!uunet!in1.uu.net!nwfocus.wa.com!news.omnigroup.com!news.omnigroup.com!not-for-mail
From: bungi AT gaea DOT titan DOT org (Timothy J. Wood)
Newsgroups: comp.os.msdos.djgpp
Subject: Calling VESA paging function w/o DPMI
Date: 11 Jul 1995 21:55:24 -0700
Organization: Omni Development, Inc.
Lines: 53
Nntp-Posting-Host: gaea
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

  I'm in the process of writing my own VESA library.  I have everything
working, but right now it is calling the VESA window positioning function
with _go32_dpmi_simulate_fcall.  This works fine, except that my frame
rate is abysmal.  In 320x200, on a 486/33 I can blit something like 170 fps
(w/o vertical synch on of course), since I don't have to do any paging. 
But in 640x480, my fps drops to about 12.  Since I'm only copying 4.8
times as much data, the best I could expect would be 35 or so.  Obviously,
there is a very high amount of overhead in calling a dpmi function.

  How can I go about calling this function w/o going through DPMI?  I've
searched the FAQ and libgrx and found only one example and no
documentation that I thought addressed this problem.  Unfortunately, the
example didn't help much as it was written in Turbo C. 

  The approach I'm playing with now is as follows.  Yes, this is blechy,
but I was unable to convince the assembler to let me use a segment
override (gas doesn't understand this, I'm guessing), nor was I able to
get the version of 'call' in which you pass a pointer to a 48 bit
selector/offset to work.

    "pushw %%es\n"

    /* Call the window positioning function */
    "movl  $0x4f05, %%eax\n"
    "xor   %%ebx, %%ebx\n"
    "movl  %0,    %%edx\n"

    /* Push stuff for the return from the guy we are going to call */
    "pushl %%cs\n"
    "pushl L_Return\n"

    /* Push the guy we want to call */
    "pushl _dos_sel\n"
    "pushl %1\n"

    /* Return to the guy we want to call -- he will return below when done */
    "ret\n"

    /* Return to here after setting the VESA window */
    "L_Return:\n"

	... get on with the data copying...


  _dos_sel is set above this to be the conventional memory selector.  When
this is run, %1 is the segment/offset of the VESA window positioning
function (c000:215b in my case).

  Any suggestions would be most helpful.

-tim

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019