www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/10/13:31:20

Date: Sun, 10 Oct 1999 12:29:00 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Ben Davis <ben AT vjpoole DOT freeserve DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: A choking start for DPMI
In-Reply-To: <7tj2lg$n15$1@news7.svr.pol.co.uk>
Message-ID: <Pine.SUN.3.91.991010122840.19618U-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 7 Oct 1999, Ben Davis wrote:

> I've written a rather hyperactive game using DJGPP and Allegro, in DOS.
> Naturally it uses DPMI, which involves disk-swapping.

Paging to disk is not supposed to happen unless your program used up
all the available physical memory.  How much memory do you have
installed on the machine where this happens, and how much memory do
you estimate your program needs to run?

> I would like to know if there is a way of causing all disk-swapping to
> happen before the game displays any graphics or makes any sound.

Try setting the _CRT0_FLAG_LOCK_MEMORY bit in the _crt0_startup_flags
variable (it is documented in the library reference).  This will lock
all the memory your program is using and prevent paging, unless the
target machine doesn't have enough physical memory to begin with.

> If I need
> to specify all the variables which must be in physical memory, then I can do
> it.

There's a library function __dpmi_lock_linear_region which can be used
to lock an individual variable or a function, and there are two helper
functions _go32_dpmi_lock_code and _go32_dpmi_lock_data.  Look them up
in the library docs.

Note that if you have lots of variables which need locking, locking
them one by one might be tedious.

- Raw text -


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