fix: correction de bogue et optimisation des fonctions

This commit is contained in:
Nicolas Hordé 2005-12-05 08:02:33 +00:00
parent b552531179
commit 84a816919f
1 changed files with 15 additions and 9 deletions

View File

@ -28,15 +28,22 @@ showbmp PROC FAR
ARG pointer:word, x:word, y:word=taille ARG pointer:word, x:word, y:word=taille
push bp push bp
mov bp,sp mov bp,sp
push ax bx cx si di push ax bx cx dx si di
mov si,[pointer] mov si,[pointer]
cmp word ptr [si+BMP_file.BMP_FileType],"MB" cmp word ptr [si+BMP_file.BMP_FileType],"MB"
jne @@errorshowing jne @@errorshowing
mov di,si mov edi,[si+BMP_BitMapOffset]
add di,436h add di,si
mov ah,8 mov ah,8
xor bx,bx xor ebx,ebx
mov cx,[si+offset BMP_File.BMP_height] mov ecx,[si+offset BMP_File.BMP_height]
mov edx,[si+offset BMP_File.BMP_width]
and dx,11111100b
cmp edx,[si+offset BMP_File.BMP_width]
jae @@noadjust
add dx,4
@@noadjust:
sub dx,[si+offset BMP_File.BMP_width]
@@bouclette: @@bouclette:
mov al,[di] mov al,[di]
push bx cx push bx cx
@ -46,14 +53,15 @@ showbmp PROC FAR
pop cx bx pop cx bx
inc bx inc bx
inc di inc di
cmp bx,[si+offset BMP_File.BMP_width] cmp ebx,[si+offset BMP_File.BMP_width]
jb @@bouclette jb @@bouclette
xor bx,bx xor bx,bx
add di,dx
dec cx dec cx
cmp cx,0 cmp cx,0
jne @@bouclette jne @@bouclette
clc clc
pop di si cx bx ax pop di si dx cx bx ax
pop bp pop bp
retf taille retf taille
@ -63,8 +71,6 @@ showbmp PROC FAR
pop bp pop bp
retf taille retf taille
xc dw 0
yc dw 0
showbmp ENDP showbmp ENDP