DMA linear addr in pmode

hi everyone,

i posted a question to these groups about 15 days ago but no one

it was about using the Ofs function in TMT Pascal, for calculating the
offset at which a sample is being played: Ofs(sample^) - something
like this.

i have this other weird problem:

while programming the DMA controller for SB output, i noticed that if
i compiled the test program under TP7 the sound was OK, whereas if
compiled with the TMT Pascal Lite compiler the SB output was all
screwed up!

i think this is due to the miscalculating of the DMA's linear 20-bit
address. i have some sources here which do exactly the same, but for
DPMI in TP7 (i think) anyway, if DPMI is being used, the given buffer
pointer is recalculated with some proc. GetSelector??(). To free mem,
it's also used GlobalDOSFree(), etc etc. These are WINAPI unit
functions, right where the sound's being screwed. i'm sure that's
what's wrong.

under TMT Pascal, there's no WINAPI unit nor am i using DPMI, but
Tran's PMODE.

The question is... how to replace those GlobalDOSAlloc, GlobalDOSFree
and DPMI functions to get a proper recalc. of the buffer?

the same applies to allocating memory for the DMA buffer, but the
cases are very similar.

if anyone is really willing to help me out here, i could supply sum
code 4 better understanding the problem.

thanks in advance...

Brain Power / Darkness Unknown Force (