Mail Archives: djgpp/2000/10/12/08:30:38
"Graham Reeds" <grahamr AT dtn DOT ntl DOT com> wrote in message
news:6v%E5.29784$L12 DOT 598411 AT news2-win DOT server DOT ntlworld DOT com...
> Hi. I'm having problems with my code (why else would I be posting
here..:-)
>
<snip>
> /* FLIPS THE SCREEN */
> void frameendlfb()
> {
> /* wait for retrace */
> vsync();
>
> /* copy to lfb */
> _dosmemputl(primarysurface->dsimage, remainder, videomemory);
The dosmem*() functions are for moving data between memory in the real mode
address space and your program. You can't use those functions for moving
data outside of your program to some location outside of the real mode
address space.
<snip>
> meminfo.address = (unsigned long)modeinfoblock.physbaseptr;
> __dpmi_physical_address_mapping(&meminfo);
> // __dpmi_lock_linear_region(&meminfo);
> videomemory = meminfo.address;
Ok now you need to create a segment descriptor that spans that linear
address and use the selector returned by the system to access it. You should
be using functions such as movedata() and _far*(). The address you pass to
dosmem*() is the offset within the _dos_ds selector which doesn't include
the memory you want.
>
> /* try selectors */
> // videoselector = __dpmi_allocate_ldt_descriptors(1);
> // __dpmi_set_segment_base_address(videoselector, videomemory);
> // __dpmi_set_segment_limit(videoselector,
> modeinfoblock.bytesperscanline * modeinfoblock.yresolution + 1);
Ok you have it, but why is it commented out?? Even so, you still didn't use
the correct functions to access it.
Hope this helps.
Marp
<snip>
- Raw text -