Mail Archives: djgpp/1999/07/21/07:11:49
On Tue, 20 Jul 1999, Sahab Yazdani wrote:
> In one of the functions:
> init_mixing, it calls a function called low_malloc (which is prototyped
> in a header file called lowmalloc.h) which allocates the mixing buffer
> depending on the style of the SoundBlaster (8bit or 16bit). I don't
> understand why this memory block has to be in a convensional(?) space
> rather than the upper blocks?
What's the difference? Both conventional memory and UMBs can be
accessed by real-mode code, so you shouldn't be bothered. It's really
up to DOS to decide which block it returns to you.
> If it has to be in the conventional space, then I have found the
> function: __dpmi_allocate_dos_memory (is this what I'm looking for)
Yes, it seems like this is the DJGPP equivalent.
> and
> how do I get the pointer to the memory, cause all it returns is the
> segment and a pointer to a selector, which I have no clue what to do
> with!!
The segment and the selector give you two ways of addressing the
same allocated block. Check out section 18.4 of the FAQ for a
description of how to move data between your program and conventional
memory, just disregard all the first part that tells you howe to get a
selector, since you already got one. Section 18.2 has a complete
working example of a function that moves data from a conventional
memory buffer, use that as a starting point.
- Raw text -