2007-03-28 17:54:19 +02:00
|
|
|
|
model tiny,stdcall
|
|
|
|
|
p586N
|
2004-11-30 20:28:32 +01:00
|
|
|
|
locals
|
2007-03-28 17:54:19 +02:00
|
|
|
|
jumps
|
|
|
|
|
codeseg
|
|
|
|
|
option procalign:byte
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|
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:
|
|
|
|
|
header exe <"CE",1,0,0,offset exports,offset imports,,>
|
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
|
|
|
|
|
;->
|
|
|
|
|
;==========================
|
2007-03-28 17:54:19 +02:00
|
|
|
|
PROC showbmp FAR
|
|
|
|
|
ARG @pointer:word, @x:word, @y:word
|
|
|
|
|
USES ax,bx,cx,dx,si,di
|
|
|
|
|
mov si,[@pointer]
|
|
|
|
|
cmp [word ptr (bmp_file si).bmp_filetype],"MB"
|
2004-11-30 20:28:32 +01:00
|
|
|
|
jne @@errorshowing
|
2007-03-28 17:54:19 +02:00
|
|
|
|
mov edi,[(bmp_file si).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
|
2007-03-28 17:54:19 +02:00
|
|
|
|
mov ecx,[(bmp_file si).bmp_height]
|
|
|
|
|
mov edx,[(bmp_file si).bmp_width]
|
2007-03-28 23:23:55 +02:00
|
|
|
|
;and dx,11111100b
|
2007-03-28 17:54:19 +02:00
|
|
|
|
cmp edx,[(bmp_file si).bmp_width]
|
2007-03-28 23:23:55 +02:00
|
|
|
|
;jae @@noadjust
|
|
|
|
|
;add dx,4
|
2005-12-05 09:02:33 +01:00
|
|
|
|
@@noadjust:
|
2007-03-28 17:54:19 +02:00
|
|
|
|
sub edx,[(bmp_file si).bmp_width]
|
2004-11-30 20:28:32 +01:00
|
|
|
|
@@bouclette:
|
|
|
|
|
push bx cx
|
2007-03-28 17:54:19 +02:00
|
|
|
|
add bx,[@x]
|
|
|
|
|
add cx,[@y]
|
2007-03-28 23:23:55 +02:00
|
|
|
|
call [cs:showpixel],bx,cx,[word ptr di]
|
2004-11-30 20:28:32 +01:00
|
|
|
|
pop cx bx
|
|
|
|
|
inc bx
|
|
|
|
|
inc di
|
2007-03-28 17:54:19 +02:00
|
|
|
|
cmp ebx,[(bmp_file si).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
|
|
|
|
|
jne @@bouclette
|
|
|
|
|
clc
|
2007-03-28 17:54:19 +02:00
|
|
|
|
ret
|
2004-11-30 20:28:32 +01:00
|
|
|
|
@@errorshowing:
|
|
|
|
|
stc
|
2007-03-28 17:54:19 +02:00
|
|
|
|
ret
|
|
|
|
|
ENDP showbmp
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;==========LOADBMPPALET=========
|
|
|
|
|
;Charge la palette du BMP point<6E>e par DS:%0
|
|
|
|
|
;-> DS:%0 BMP
|
|
|
|
|
;<-
|
|
|
|
|
;===============================
|
2007-03-28 17:54:19 +02:00
|
|
|
|
PROC loadbmppalet FAR
|
|
|
|
|
ARG @pointer:word
|
|
|
|
|
USES ax,bx,cx,dx,si
|
|
|
|
|
mov si,[@pointer]
|
2004-11-30 20:28:32 +01:00
|
|
|
|
mov bx,0400h+36h-4
|
|
|
|
|
mov cx,100h
|
|
|
|
|
mov dx, 3c8h
|
2007-03-28 17:54:19 +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
|
2007-03-28 17:54:19 +02:00
|
|
|
|
jnz @@paletteload
|
|
|
|
|
ret
|
|
|
|
|
ENDP loadbmppalet
|
|
|
|
|
|
2004-11-30 20:28:32 +01:00
|
|
|
|
|