Looking for a FAST putpixel (mode 13h) 
Author Message
 Looking for a FAST putpixel (mode 13h)

I am trying to find the FASTEST way to put a pixel to the VGA screen
in mode 13h (320x200x256). The way I do it now is basically the same
as the putpixel procedure in the Asphyxia trainer series (by Grant
Smith, aka Denthor). This is the fastest one I know of...

var ScrOfs : Array [0..199] of Word; { lookup table for y*320 values }
procedure PutPixel(x,y : Word; col : Byte); assembler;
asm
  mov  ax,0a000h  { vga segment }
  mov  es,ax      { point to it }
  mov  bx,[y]     { y coordinate }
  shl  bx,1       { mul by 2 cuz 1 Word = 2 Bytes }
  mov  di,word ptr [ScrOfs + bx]  { find value on table }
  add  di,[x]     { add x coordinate }
  mov  al,[col]   { color of pixel }
  mov  es:[di],al { put the pixel }
end;

This above is pretty damn fast. I was just wondering, is there
anything faster? (Good luck!)



Wed, 18 Jun 1902 08:00:00 GMT  
 Looking for a FAST putpixel (mode 13h)

Quote:

>I am trying to find the FASTEST way to put a pixel to the VGA screen
>in mode 13h (320x200x256). The way I do it now is basically the same
>as the putpixel procedure in the Asphyxia trainer series (by Grant
>Smith, aka Denthor). This is the fastest one I know of...

Is this in the FAQ?  Shouldn't it be?

procedure putpixel(x,y:word;color:byte); assembler;
asm
        mov     es,sega000
        db 66h; xor ax,ax
        db 66h; xor bx,bx
        mov     ax,x
        mov     bx,y
        mov     cl,color
        db 67h,66h,8dh,1ch,9bh       ;{lea ebx,[ebx+ebx*4]}
        db 66h; shl bx,6
        db 26h, 67h, 88h, 0ch, 03h   ;{mov es:[ebx+eax],cl}
end;


Project WallyWorld:  He's cute, he's fast, he's on a dark planet in a distant
galaxy away from everything he's known and with no friends and he's in big
trouble fighting ancient Nordic gods.  Did I mention he's cute?



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

 Relevant Pages 

1. mode 13h dpmi putpixel

2. fonts algorithms in mode 13h

3. fonts algorithms in mode 13h

4. text in VGA mode 13h?

5. Text in 13h mode

6. How can I write text in mode 13h ??

7. Graphics Programming (Mode 13h)

8. Mode 13h writelns?

9. screen buffer not in mode 13h

10. Need Sprite Help in Mode 13h

 

 
Powered by phpBB® Forum Software