PutPixel in PMODE 
Author Message
 PutPixel in PMODE

I use NASM, and WDosX and while trying to convert some code to PMODE, i got
completely stumped with a simple PPixel routine. I would have thought that
the screen was at 0xA0000, notice the extra 0, but this doesn't work. How do
i do it?

Cheers, James



Sun, 02 Jun 2002 03:00:00 GMT  
 PutPixel in PMODE
Quote:
>I use NASM, and WDosX and while trying to convert some code to PMODE, i got
>completely stumped with a simple PPixel routine. I would have thought that
>the screen was at 0xA0000, notice the extra 0, but this doesn't work. How
do
>i do it?

Check the WDosX documentation about how to access physical addresses.
The 0xA0000 address is a physical address. Protected mode environments
often use some sort of virtual memory management, where physical, linear
and logical have little in common, except the memory management mechanisms.

Herman



Sun, 02 Jun 2002 03:00:00 GMT  
 PutPixel in PMODE

Quote:

> I use NASM, and WDosX and while trying to convert some code to PMODE, i got
> completely stumped with a simple PPixel routine. I would have thought that
> the screen was at 0xA0000, notice the extra 0, but this doesn't work. How do
> i do it?

If you're using RDOFF the graphics screen will indeed be at 0xA0000
(true flat memory model).

Not so if you're assembling to plain binary output (for whatever
reason). In the latter case you first would have to obtain a selector
suitable for addressing the video RAM using DPMI services. Yet there is
another way, "negative offsets", which essentially gives you a near
pointer to the video RAM through subtracting the DS segment base address
(get it with INT 0x31 fn. 6) from 0xA0000 and use the result as a
pointer. Works as long as you do not resize your application segment
afterwards (INT 0x21/AX=0xFFFF, another deprecated function -
<bwwrrrrr!>) and as long as you don't run the thing under Windows NT,
which silently alters segment limits to disallow access to linear
addresses above 2G.

Well, better use RDOFF! If, OTOH, you already do, the problem lies
somewhere else in your code.

Regards,

Michael Tippach



Mon, 03 Jun 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Pmode switching - pmode.asm (0/1)

2. Pmode switching - pmode.asm (0/1)

3. putpixel

4. putpixel

5. PutPixel 320*200: how can i do it?

6. vesa Putpixel proc?

7. PutPixel Optimisation

8. putpixel

9. MSVC CHOKES on this ASM putpixel routine!

10. help with true color putpixel - Targa_co.cpp

11. PutPixel Routine

12. need a FAST putpixel routine

 

 
Powered by phpBB® Forum Software