Need help on a fast putpixel for 640x480x256 
Author Message
 Need help on a fast putpixel for 640x480x256

How do I put a pixel to the screen in 640x480x256, written in the inline
asm?

Here is one that works for 320x200x256.. how do I make it work for
640x480x256?

Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);
BEGIN
  Asm
    mov     ax,[where]
    mov     es,[where]
    mov     bx,[X]
    mov     dx,[Y]
    mov     di,bx
    mov     bx, dx
    shl     dx, 8
    shl     bx, 6
    add     dx, bx
    add     di, dx
    mov     al, [Col]
    stosb
  End;
END;

Please help!
well see ya!

--
Signed,    
   #   #   ##   # #### #### | Hi to:
   #  ###  ### ## ##   ##   | Best bud Peter Cooper;
## # ##  # ## # # ###  #### | Gene, Rapper, Alex, and
## # ##### ##   # ##      # | to all the programmers
#### ##  # ##   # #### #### | of the world.



Wed, 18 Jun 1902 08:00:00 GMT  
 Need help on a fast putpixel for 640x480x256

Quote:

>How do I put a pixel to the screen in 640x480x256, written in the inline
>asm?

>Here is one that works for 320x200x256.. how do I make it work for
>640x480x256?

>Procedure Putpixel (X,Y : Integer; Col : Byte; where:word);
>...

Well, I would have to know what kind of videocard it's going to be used on.
If it's Cirrus or Tseng (and maybe S3) I can help you, because you'll need
a procedure that changes banks.


Wed, 18 Jun 1902 08:00:00 GMT  
 Need help on a fast putpixel for 640x480x256

Quote:
> How do I put a pixel to the screen in 640x480x256, written in the inline
> asm?

> Here is one that works for 320x200x256.. how do I make it work for
> 640x480x256?

> [code snipped]

> Please help!
> well see ya!

This procedure is from my fractal generator (working with all *SVGA* 256
color modes if some values are set up correctly and the code is
updated if necessary). If anybody is interested in the fractal generator,
please mail me.

Note that this procedure works only on video cards where the video memory
granularity is equal to 64K - on those on which it's not equal to this,
the results will be partially overlapping areas of the screen.

procedure PutPixel(posX, posY: integer; Colour: byte); assembler;
asm
        { Set ScreenWidth to the number of bytes per scan line.
        Normally this is equal to the horiziontal resulution. }
        mov     ax, ScreenWidth
        mul     posY
        add     ax, PosX

        inc     dx
        { When setting up the video mode, CurVideoPage should be set
        either to a known value that is used by the video BIOS, too or
        to a nonsense value like 0FFFFh (in case of doubt use this


        mov     si, ax
        { if you are having the problem of "overlapping" areas on the
        screen, you should try to shift dx left some bits. The correct
        value can be achieved by experiment thus there are methods
        to find it out - sorry, too complex to explain it at the moment. }
        mov     ax, 4F05h
        xor     bx, bx
        int     10h
        mov     CurVideoPage, dx

        xchg    ax, di
        mov     es, ax
        mov     al, Colour
        stosb
end;

Quote:

> --
> Signed,
>    #   #   ##   # #### #### | Hi to:
>    #  ###  ### ## ##   ##   | Best bud Peter Cooper;
> ## # ##  # ## # # ###  #### | Gene, Rapper, Alex, and
> ## # ##### ##   # ##      # | to all the programmers
> #### ##  # ##   # #### #### | of the world.

Stephan

-------------------------------------------------------------------------

       <<< Bug is a registered trademark of Microsoft Corp. >>>
-------------------------------------------------------------------------



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. I need a fast putpixel for 640x480x16 !

2. I need FAST putpixel and bar routines

3. Need fast putpixel-sequence for TP

4. Need fast putpixel-sequence for TP

5. I need a fast Putpixel for 640x480x16

6. putpixel routine..help to make faster

7. PutPixel in VESA 640x480x256

8. 640x480x256 Putpixel?

9. Putpixel 640x480x256 colors ???

10. I need Help (fast) and i mean fast...

 

 
Powered by phpBB® Forum Software