TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: FERNANDO ARIEL GONT
from: JASEN BETTS
date: 1998-03-10 16:50:00
subject: putsprit.asm

FA> putrow:
FA>         push cx
FA>         lodsb
FA>         inc di
FA>         cmp al, 00h
FA>         jz nextrow
FA>         dec di
FA>         stosb
FA> nextrow:
FA>         pop cx
FA>         loop putrow
FA>
This loop looks inefficient, try this instead....
 putrow:
         lodsb
         and al,al   ; this is faster on 8086/286 :)
         jz pixlskip
         stosb
         loop putrow
         jmp endrow
 pixlskip:
         inc di
         loop putrow
 endrow:
I've taken out PUSH CX/POP CX because I couldn't see what they did.
lodsb/stosb/movsb don't modify CX, it takes REP to modify CX.
and I've split the end of the loop to save the inc/dec/stosb
you could probably gain even more speed by storing the sprites in a format
that allowed you to write the "solid" bits with "rep movsb" and skip the 
lank
bits with "add di,cx", but this would make them harder to edit.
Bye.
                        
--- EzyQwk V1.20 01fa018d
---------------
* Origin: CSS Brisbane, Qld, Australia. (61-7-3367-3890) (3:640/350)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.