Advance programmers! Help me!
Now I coded an SVGA graphics stuff, and I found out that byte by byte storing is too slow. Hope you guyz can tell me how to move a block of bits and bytes to another location of memory
(No Interrupt calls, please!)
Printable View
Advance programmers! Help me!
Now I coded an SVGA graphics stuff, and I found out that byte by byte storing is too slow. Hope you guyz can tell me how to move a block of bits and bytes to another location of memory
(No Interrupt calls, please!)
If your using lodsb or movsb, use lodsd or movsd. Then you can do less loops.
Even using dwords seems to be too slow. On the equivalent of a 800*600*16 screen you would get a little under 60fps and that's just drawing the screen. This also raises a problem: since it takes a little over 1/60 sec to draw a frame, you can get tearing down the bottom of the picture.
loop i used to see how many 64k pages could be filled per second:
This takes 92 seconds = 712 pages/sec = 11.8 pages/refresh on both a 133w/1meg card and 400w/nividia 32meg card. 800*600*16 mode has 14.6 pages. Maybe it could be unrolled, but I think that the bottleneck is the bus speed.Code:;mode=13h,es=0a000h
mov ax,0ffffh ;#iterations
L1:
mov cx,04000h ;10000h/4
xor di,di
rep stosd
dec ax
jnz L1
Well, besides putting the bytes, since 800x600x16bit needs more than 64k, you need to change the bank after this 64k.***Please refer to my previous post***.I've wrote a complete program including 8,16,24,32 bit with any screen resolution and you just pass the x,y,r,g,b to it and it will do it for you. But it seems to be very slow. So I code another routine which uses 32 bit memory access and it's fast, but will plot two pixels at a time. Please tell me how can I do as perfect as Windows?
Well, besides putting the bytes, since 800x600x16bit needs more than 64k, you need to change the bank after this 64k.***Please refer to my previous post***.I've wrote a complete program including 8,16,24,32 bit with any screen resolution and you just pass the x,y,r,g,b to it and it will do it for you. But it seems to be very slow. So I code another routine which uses 32 bit memory access and it's fast, but will plot two pixels at a time. Please tell me how can I do as fast as Windows' DVA?