2019-07-13 20:49:22 +02:00
|
|
|
|
use16
|
|
|
|
|
align 1
|
|
|
|
|
|
2007-03-28 17:54:19 +02:00
|
|
|
|
include "..\include\mem.h"
|
|
|
|
|
include "..\include\divers.h"
|
|
|
|
|
include "..\include\bmp.h"
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|
2007-03-28 17:54:19 +02:00
|
|
|
|
org 0h
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|
2007-03-28 17:54:19 +02:00
|
|
|
|
start:
|
2019-07-09 18:30:00 +02:00
|
|
|
|
header exe 1
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|
2007-03-28 17:54:19 +02:00
|
|
|
|
exporting
|
|
|
|
|
declare showbmp
|
|
|
|
|
declare loadbmppalet
|
|
|
|
|
ende
|
|
|
|
|
|
|
|
|
|
importing
|
|
|
|
|
use VIDEO,showpixel
|
|
|
|
|
endi
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|
|
|
|
|
;==========SHOWBMP=========
|
|
|
|
|
;Affiche le BMP point<6E>e par DS:%0 en %1, %2
|
|
|
|
|
;<- DS:%0 BMP, %1 coordonn<6E>es X, %2 coordonn<6E>es Y
|
|
|
|
|
;->
|
|
|
|
|
;==========================
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc showbmp uses ax bx cx dx si di, pointer:word, x:word, y:word
|
|
|
|
|
mov si,[pointer]
|
|
|
|
|
virtual at si
|
|
|
|
|
.bmp_file bmp_file
|
|
|
|
|
end virtual
|
|
|
|
|
cmp word [.bmp_file.bmp_filetype],"MB"
|
|
|
|
|
jne .errorshowing
|
|
|
|
|
mov edi,[.bmp_file.bmp_bitmapoffset]
|
2007-03-28 23:23:55 +02:00
|
|
|
|
add di,400h
|
2005-12-05 09:02:33 +01:00
|
|
|
|
add di,si
|
|
|
|
|
xor ebx,ebx
|
2019-07-09 18:30:00 +02:00
|
|
|
|
mov ecx,[.bmp_file.bmp_height]
|
|
|
|
|
mov edx,[.bmp_file.bmp_width]
|
2007-03-28 23:23:55 +02:00
|
|
|
|
;and dx,11111100b
|
2019-07-09 18:30:00 +02:00
|
|
|
|
cmp edx,[.bmp_file.bmp_width]
|
|
|
|
|
;jae .noadjust
|
2007-03-28 23:23:55 +02:00
|
|
|
|
;add dx,4
|
2019-07-09 18:30:00 +02:00
|
|
|
|
.noadjust:
|
|
|
|
|
sub edx,[.bmp_file.bmp_width]
|
|
|
|
|
.bouclette:
|
2004-11-30 20:28:32 +01:00
|
|
|
|
push bx cx
|
2019-07-09 18:30:00 +02:00
|
|
|
|
add bx,[x]
|
|
|
|
|
add cx,[y]
|
|
|
|
|
invoke showpixel,bx,cx,word [di]
|
2004-11-30 20:28:32 +01:00
|
|
|
|
pop cx bx
|
|
|
|
|
inc bx
|
|
|
|
|
inc di
|
2019-07-09 18:30:00 +02:00
|
|
|
|
cmp ebx,[.bmp_file.bmp_width]
|
|
|
|
|
jb .bouclette
|
2004-11-30 20:28:32 +01:00
|
|
|
|
xor bx,bx
|
2007-03-28 23:23:55 +02:00
|
|
|
|
;add di,dx
|
2004-11-30 20:28:32 +01:00
|
|
|
|
dec cx
|
|
|
|
|
cmp cx,0
|
2019-07-09 18:30:00 +02:00
|
|
|
|
jne .bouclette
|
2004-11-30 20:28:32 +01:00
|
|
|
|
clc
|
2007-03-28 17:54:19 +02:00
|
|
|
|
ret
|
2019-07-09 18:30:00 +02:00
|
|
|
|
.errorshowing:
|
2004-11-30 20:28:32 +01:00
|
|
|
|
stc
|
2007-03-28 17:54:19 +02:00
|
|
|
|
ret
|
2019-07-09 18:30:00 +02:00
|
|
|
|
endp
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;==========LOADBMPPALET=========
|
|
|
|
|
;Charge la palette du BMP point<6E>e par DS:%0
|
|
|
|
|
;-> DS:%0 BMP
|
|
|
|
|
;<-
|
|
|
|
|
;===============================
|
2019-07-09 18:30:00 +02:00
|
|
|
|
proc loadbmppalet uses ax bx cx dx si, pointer:word
|
|
|
|
|
mov si,[pointer]
|
2004-11-30 20:28:32 +01:00
|
|
|
|
mov bx,0400h+36h-4
|
|
|
|
|
mov cx,100h
|
|
|
|
|
mov dx, 3c8h
|
2019-07-09 18:30:00 +02:00
|
|
|
|
.paletteload:
|
2004-11-30 20:28:32 +01:00
|
|
|
|
mov al, cl
|
|
|
|
|
dec al
|
|
|
|
|
out dx, al
|
|
|
|
|
inc dx
|
|
|
|
|
mov al,[bx+si+2]
|
|
|
|
|
shr al,2
|
|
|
|
|
out dx, al
|
|
|
|
|
mov al,[bx+si+1]
|
|
|
|
|
shr al,2
|
|
|
|
|
out dx, al
|
|
|
|
|
mov al,[bx+si]
|
|
|
|
|
shr al,2
|
|
|
|
|
out dx, al
|
|
|
|
|
sub bx,4
|
|
|
|
|
dec dx
|
|
|
|
|
dec cl
|
2019-07-09 18:30:00 +02:00
|
|
|
|
jnz .paletteload
|
2007-03-28 17:54:19 +02:00
|
|
|
|
ret
|
2019-07-09 18:30:00 +02:00
|
|
|
|
endp
|
2007-03-28 17:54:19 +02:00
|
|
|
|
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|