putting a pixel on

Hey...

How do i put on a pixel, and tells it what color i want it to have.



Ren


Comments

  • Generally by writing to mapped video memory... but that's not

    very helpful... what video mode do you want to write it in?


    URL:http://acheronx.ml.org/home/

  • : Generally by writing to mapped video memory... but that's not

    : very helpful... what video mode do you want to write it in?




    I want to write in mode 640 x 480 or 800 x 600.

    Replay if you need more info.






  • : : Generally by writing to mapped video memory... but that's not

    : : very helpful... what video mode do you want to write it in?


    :

    : I want to write in mode 640 x 480 or 800 x 600.

    : Replay if you need more info.


    What's the bit depth? (how many colors?)




  • : : : Generally by writing to mapped video memory... but that's not

    : : : very helpful... what video mode do you want to write it in?


    : :

    : : I want to write in mode 640 x 480 or 800 x 600.

    : : Replay if you need more info.


    : What's the bit depth? (how many colors?)


    Well, it doesn't really matter, but 256 colors would be fine.





  • : : : : Generally by writing to mapped video memory... but that's not

    : : : : very helpful... what video mode do you want to write it in?


    : : :

    : : : I want to write in mode 640 x 480 or 800 x 600.

    : : : Replay if you need more info.


    : : What's the bit depth? (how many colors?)


    : Well, it doesn't really matter, but 256 colors would be fine.


    Hey Let me in on this pixel-story. Me to I'm curious about graphics

    in assembly or machine-code


  • : : : : Generally by writing to mapped video memory... but that's not

    : : : : very helpful... what video mode do you want to write it in?


    : : :

    : : : I want to write in mode 640 x 480 or 800 x 600.

    : : : Replay if you need more info.


    : : What's the bit depth? (how many colors?)


    : Well, it doesn't really matter, but 256 colors would be fine.


    Actually, it really does matter what the bit-depth is. But it's only a small caveat.


    If you have VESA installed then you just use VESA to set the video mode. If you have VESA 2.0 then your jobs a bit easier 'cuz you MIGHT get a linear frame buffer for your video card. Otherwise you have to use bank switching to access the each 64K segment of video memory (it's really a pain but workable).


    Oh - I just found a link to a good intro on VESA programming while writing this.


    URL:http://www.sdf.se/~der/programming/vesatutor.html



  • I have source code for plotting pixels in 640x480x256

    (VESA) mode. mail me or reply if yer interested..


    laterz


    : : : I want to write in mode 640 x 480 or 800 x 600.

    : : : Replay if you need more info.


    : : What's the bit depth? (how many colors?)


    : Well, it doesn't really matter, but 256 colors would be fine.







  • : Actually, it really does matter what the bit-depth is. But it's only a small caveat.


    : If you have VESA installed then you just use VESA to set the video mode. If you have VESA 2.0 then your jobs a bit easier 'cuz you MIGHT get a linear frame buffer for your video card. Otherwise you have to use bank switching to access the each 64K segment of video memory (it's really a pain but workable).


    : Oh - I just found a link to a good intro on VESA programming while writing this.


    Here's teh VESA standard


    URL:http://www.cs.monash.edu.au/~powell/pc_docs/pcgpe/vesasp12.txt

  • : Hey...

    : How do i put on a pixel, and tells it what color i want it to have.

    :

    : Ren


    Well, is we use VESA standard, i think it should be:


    Procedure SetBank(Bank : Word); Assembler;

    Asm

    Mov Ax, $4F05

    Xor Bx, Bx

    Mov Dx, [Bank]

    Int 10h

    End;

    Procedure PutPixel(X, Y : Word; Color : Byte);

    Var L : Longint;

    Bk : Word;

    Begin

    L:=(Y * Width)+X; {Like: 640*Y+X}

    Bk:=L shr 16; {BK=L / 65536}

    SetBank(Bk);

    L:=L - (Bk shl 16);

    Mem[SegA000:L]:=Color;

    End;

    This should be fast enough..

    Faster it would be if Setbank - procedure

    would be "in hardware", like setting it trough

    VGA registers. Cirrus, Ati, S3, Tseng lab,

    Matrox are often used, and there migth found

    source to do this. otherwise, putpixel is

    fastest possible.




    URL:mailto:masterillusion@hotmail.com&subject=putpixel

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories