Mail Archives: djgpp/1998/01/08/22:32:03
David Eberhard wrote:
>
> Thanks for all the help. It solved my problem, but now I have
> another. Here's the code:
>
> video_selector = __dpmi_allocate_ldt_descriptors(1);
> __dpmi_set_segment_base_address(video_selector, linear_address);
> //Set limit to around 2 Meg
> __dpmi_set_segment_limit(video_selector, 2000000UL);
>
> Here I am setting up a selector so I can access the linear buffer of
> my video card. I wanted to set the segment limit to around 2 meg, but
> it crashes my program and gives about the same error that I got with
> my last problem. It crashes when I try to write to video memory using
> the selector I made above. If I trim down 2000000 to 200000, then my
> program works fine. Anyone know why?
Yup, DPMI is failing your set limit call. Segments over 1M in lengt
must be a multiple of 4k. This means you must use a segment limit of
2002944 (unless you want to go the other way). Anyway, wouldn't you
want to go to 2097152 (2M exactly)?
Bill
--
Leave others their otherness
- Raw text -