; Double Texture Mapping code segment assume cs:code, ds:code .386 org 100h main: mov al, 13h int 10h mov ah, 4ah mov bx, 4096 ; alloc 64 Kb code segment. int 21h jc @eind mov ah, 48h int 21h ; alloc 64 kb for texture jc @eind mov Texture2Seg, ax mov ah, 48h int 21h ; alloc 64 kb for texture jc @eind mov Texture1Seg, ax mov es, ax xor di, di mov cx, 16000 mov eax, 0f0fh rep stosd mov ah, 48h int 21h ; alloc 64 kb for texture jc @eind mov ScrSeg, 0a000h mov dx, OFFSET filename mov al, 0 mov ah, 3Dh int 21h jc @eind ; error. mov Fileh, ax push ds mov bx, ax mov ds, Texture2Seg xor dx, dx mov cx, 0FFFFh mov ah, 3Fh int 21h pop ds jc @eind mov bx, Fileh mov ah, 3Eh ; close file int 21h @nokey: mov si, OFFSET pnts mov cx, 3 @LX: mov ax, ds:[si+36] add ds:[si], ax cmp word ptr ds:[si], 10 jns @nietkleiner1 neg word ptr ds:[si+36] @nietkleiner1: cmp word ptr ds:[si], 310 js @nietgroter1 neg word ptr ds:[si+36] @nietgroter1: add si, 2 dec cx jnz @LX mov cx, 3 @LY: mov ax, ds:[si+36] add ds:[si], ax cmp word ptr ds:[si], 10 jns @nietkleiner2 neg word ptr ds:[si+36] @nietkleiner2: cmp word ptr ds:[si], 190 js @nietgroter2 neg word ptr ds:[si+36] @nietgroter2: add si, 2 dec cx jnz @LY push ds pop es mov si, OFFSET pnts mov di, OFFSET X1 mov cx, 9 rep movsd ; mov ecx,10 ;@@delay: ; xchg ecx,eax ; xchg eax,ecx ; shl eax,17 ; imul eax,ebx,17 ; ; loop @@delay call textpoly ; mov ax, 0a000h ; mov es, ax ; push ds ; mov ds, ScrSeg ; xor di, di ; xor si, si ; mov cx, 16000 ; rep movsd ; pop ds in al, 60h cmp al, 1 jne @nokey @eind: mov ax, 03h int 10h ret ;------------------------------------------------------- ;------------------------------------------------------- ;------------------------------------------------------- ;------------------------------------------------------- ;------------------------------------------------------- ;------------------------------------------------------- ;------------------------------------------------------- ;------------------------------------------------------- ;------------------------------------------------------- ; ALLEEN VERANDERINGEN MAKEN HIERONDER IN TEXTPOLY.. ; DAN COMSIZE-220 = SIZE OF TEXTPOLY routine. textpoly: mov si, offset x1 mov di, offset x2 mov byte ptr cs:[@@labeltje+1],0c7h ; maak weer di mov cx, 3 @@loop: mov ax, [si+6] ; Y1 cmp ax, [di+6] ; Y2 js @NoSwap1 mov bx, 30 @@xchgloop: mov ax, [si+bx] ; x1, y1, tx1, ty1, dx1, dy1 xchg ax, [di+bx] ; x2, y2, tx2, ty2, dx2, dy2 mov [si+bx], ax ; sub bl,6 jns @@xchgloop @NoSwap1: @@labeltje: add di,2 dec byte ptr cs:[@@labeltje+1] ; maak van di si loop @@loop mov cx, y3 sub cx, y1 jz @end movsx ecx, cx mov ax, x3 ; X3r := (X3-X1)*256 DIV (Y3-Y1) sub ax, x1 movsx ebx, ax Call Imul256 mov x3r, eax mov x4r, eax mov ax, y2 ; X4 := (Y2-Y1)*(X3-X1) DIV (Y3-Y1) + X1 sub ax, y1 movsx eax, ax mov ebp, eax ; y2y1 imul eax, ebx cdq idiv ecx movzx ebx, x1 add eax, ebx mov x4 , ax mov links, 0 cmp x2, ax ; x2 if x2