PVH>Yo Brian McCloud,
PVH>PVH> How do I move image blocks - not with the CPU ?
PVH>PVH> With the video hardware ?
PVH> BM> Really, you can't do it without the CPU... but I think what
PVH> BM> you really mean here is without BIOS calls.
PVH> ...
PVH> BM> CX...REP MOVSW...
PVH> ...
PVH>I did it like this :
PVH>mov ax,$a000
PVH>mov es,ax
PVH>mov ds,ax
PVH>mov si,SOURCE_ADDRESS
PVH>mov di,DESTINATION_ADDRESS
PVH>mov cx,size
PVH>***WaitForVBlank***
PVH>rep movsw
PVH>On my 100Mhz computer, this works without flicker, but in school I have
PVH>to program for a 33Mhz486 and there the deplacement can't be done within
PVH>one vblank and the result is awful.
PVH>I thought there must be a coprocessor like that on PC videocards. How
lse
PVH>would they move large graphical objects in games.
PVH>e.g. I ran the game 'mortal kombat' on the 33Mhz486 and it was able to
PVH>animate the two characters of almost 3/4 of screen height without
licker.
PVH>This can't be done with REP MOVSW, I think.
If it's using 320x200x256, yes that CAN be done with REP MOVSW w/o flicker.
The trick for high-speed animations (from "Tricks of the Game Programming
Gurus" by LaMothe, Ratcliff, Seminatore, and Tyler) is to have some auxiliary
buffers where you prepare the screen (using ORs, XORs, MOVs, or whatever) and
then a REP MOVSW instruction to blast the whole screen in one shot.
Some PC videocards might have coprocessors or accelerators, but I don't think
standard VGA does, and I don't have any information on programming
coprocessors or accelerators for those that do.
PVH>I'm aware of double buffering and page swapping methods, but still it's
hard
PVH>to believe there's no other way than REP MOVSW...
On a 386+ you can do REP MOVSD, which, given the same amount of memory to
move, would work twice as fast (on all processors, the time it takes is
determined by the count ([E]CX), not the size being moved... moving 1,024
bytes with REP MOVSB takes the same amount of time as moving 1,024 words with
REP MOVSW.
((Cloud))
* OLX 2.2 * Do you want graphics? NO, and quit asking me!
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)
|