Updated linux video code to windows version

This commit is contained in:
pagefault
2003-03-16 22:05:08 +00:00
parent fc373239e9
commit 7df4d4257b
2 changed files with 165 additions and 105 deletions

View File

@@ -15,8 +15,6 @@
;along with this program; if not, write to the Free Software ;along with this program; if not, write to the Free Software
;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
ALIGN 32
%include "macros.mac" %include "macros.mac"
EXTSYM vesa2selec,vidbuffer,GUIOn,MMXSupport,resolutn,En2xSaI,antienab,scanlines EXTSYM vesa2selec,vidbuffer,GUIOn,MMXSupport,resolutn,En2xSaI,antienab,scanlines
@@ -30,7 +28,6 @@ EXTSYM HalfTransB,HalfTransC
NEWSYM CopyVWinAsmStart NEWSYM CopyVWinAsmStart
SECTION .bss SECTION .bss
NEWSYM AddEndBytes, resd 1 ; Number of bytes between each line NEWSYM AddEndBytes, resd 1 ; Number of bytes between each line
NEWSYM NumBytesPerLine, resd 1 ; Total number of bytes per line (1024+AddEndBytes) NEWSYM NumBytesPerLine, resd 1 ; Total number of bytes per line (1024+AddEndBytes)
@@ -41,17 +38,14 @@ NEWSYM copy640x480x16bwin
cmp byte[curblank],40h cmp byte[curblank],40h
jne .startcopy jne .startcopy
ret ret
ALIGN4
.startcopy .startcopy
pushad push es
mov ax,ds
mov es,ax
mov esi,[vidbuffer] mov esi,[vidbuffer]
mov edi,[WinVidMemStart] mov edi,[WinVidMemStart]
add esi,16*2+256*2+32*2 add esi,16*2+256*2+32*2
cmp byte[GUIOn],1
je .not239
cmp byte[resolutn],239
jne .not239
add esi,8*288*2
.not239
xor eax,eax xor eax,eax
; Check if interpolation mode ; Check if interpolation mode
cmp byte[FilteredGUI],0 cmp byte[FilteredGUI],0
@@ -62,36 +56,36 @@ NEWSYM copy640x480x16bwin
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
jne .nommx jne .nommx
cmp byte[En2xSaI],0 cmp byte[En2xSaI],0
jne near Process2xSaIwin jne Process2xSaIwin
.nommx .nommx
cmp byte[antienab],1 cmp byte[antienab],1
je near interpolate640x480x16bwin je interpolate640x480x16bwin
.nointerp .nointerp
mov dl,224 mov dl,[resolutn]
dec dl sub dl,2
dec dl
cmp byte[scanlines],1 cmp byte[scanlines],1
je near .scanlines je .scanlines
cmp byte[scanlines],3 cmp byte[scanlines],3
je near .halfscanlines je .halfscanlines
cmp byte[scanlines],2 cmp byte[scanlines],2
je near .quartscanlines je .quartscanlines
mov ebx,hirestiledat+1 mov ebx,hirestiledat+1
cmp byte[newengen],0 cmp byte[newengen],0
je .loopa je .loopa
mov ebx,SpecialLine+1 mov ebx,SpecialLine+1
ALIGN4
.loopa .loopa
mov ecx,256 mov ecx,256
cmp byte[ebx],1 cmp byte[ebx],1
je near .yeshires je .yeshires
cmp byte[GUIOn],1 cmp byte[GUIOn],1
je .ignorehr je .ignorehr
cmp byte[ebx],1 cmp byte[ebx],1
ja near .yeshiresng ja .yeshiresng
.ignorehr .ignorehr
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmx je .mmx
.a .a
mov ax,[esi] mov ax,[esi]
shl eax,16 shl eax,16
@@ -118,15 +112,17 @@ NEWSYM copy640x480x16bwin
add edi,[AddEndBytes] add edi,[AddEndBytes]
inc ebx inc ebx
dec dl dec dl
jnz near .loopa jnz .loopa
popad pop es
xor byte[res512switch],1 xor byte[res512switch],1
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je .mmx2 je .mmx2
ret ret
ALIGN4
.mmx2 .mmx2
emms emms
ret ret
ALIGN4
.yeshires .yeshires
mov byte[ebx],0 mov byte[ebx],0
test byte[res512switch],1 test byte[res512switch],1
@@ -144,6 +140,7 @@ NEWSYM copy640x480x16bwin
pop ebx pop ebx
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
jmp .return jmp .return
ALIGN4
.rightside .rightside
push ebx push ebx
mov ebx,[NumBytesPerLine] mov ebx,[NumBytesPerLine]
@@ -158,6 +155,7 @@ NEWSYM copy640x480x16bwin
pop ebx pop ebx
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
jmp .return jmp .return
ALIGN4
.mmx .mmx
mov eax,[spritetablea] mov eax,[spritetablea]
mov ecx,64 mov ecx,64
@@ -194,10 +192,12 @@ NEWSYM copy640x480x16bwin
dec ecx dec ecx
jnz .mmxr2 jnz .mmxr2
jmp .return jmp .return
ALIGN4
.yeshiresng .yeshiresng
call HighResProc call HighResProc
jmp .return jmp .return
ALIGN4
.bng .bng
mov eax,[esi+75036*4-2] mov eax,[esi+75036*4-2]
mov ax,[esi] mov ax,[esi]
@@ -219,6 +219,7 @@ NEWSYM copy640x480x16bwin
jnz .bngb jnz .bngb
jmp .return jmp .return
ALIGN4
.scanlines .scanlines
mov ebx,hirestiledat+1 mov ebx,hirestiledat+1
cmp byte[GUIOn],1 cmp byte[GUIOn],1
@@ -226,17 +227,19 @@ NEWSYM copy640x480x16bwin
cmp byte[newengen],0 cmp byte[newengen],0
je .loopab je .loopab
mov ebx,SpecialLine+1 mov ebx,SpecialLine+1
ALIGN4
.loopab .loopab
mov ecx,256 mov ecx,256
cmp byte[ebx],1 cmp byte[ebx],1
je near .yeshiresb je .yeshiresb
cmp byte[ebx],1 cmp byte[ebx],1
jbe .ignorehrb jbe .ignorehrb
call HighResProc call HighResProc
jmp .returnb jmp .returnb
ALIGN4
.ignorehrb .ignorehrb
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmxsl je .mmxsl
.ab .ab
mov ax,[esi] mov ax,[esi]
shl eax,16 shl eax,16
@@ -250,6 +253,7 @@ NEWSYM copy640x480x16bwin
add esi,64 add esi,64
add edi,[AddEndBytes] add edi,[AddEndBytes]
mov ecx,256 mov ecx,256
ALIGN4
.fslloop .fslloop
mov dword[edi],0 mov dword[edi],0
add edi,4 add edi,4
@@ -259,11 +263,12 @@ NEWSYM copy640x480x16bwin
inc ebx inc ebx
dec dl dec dl
jnz .loopab jnz .loopab
popad pop es
xor byte[res512switch],1 xor byte[res512switch],1
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmx2 je .mmx2
ret ret
ALIGN4
.yeshiresb .yeshiresb
mov byte[ebx],0 mov byte[ebx],0
test byte[res512switch],1 test byte[res512switch],1
@@ -276,6 +281,7 @@ NEWSYM copy640x480x16bwin
dec ecx dec ecx
jnz .bb jnz .bb
jmp .returnb jmp .returnb
ALIGN4
.rightsideb .rightsideb
.cb .cb
mov ax,[esi] mov ax,[esi]
@@ -285,6 +291,7 @@ NEWSYM copy640x480x16bwin
dec ecx dec ecx
jnz .cb jnz .cb
jmp .returnb jmp .returnb
ALIGN4
.mmxsl .mmxsl
mov ecx,64 mov ecx,64
.mmxrsl .mmxrsl
@@ -301,6 +308,7 @@ NEWSYM copy640x480x16bwin
jnz .mmxrsl jnz .mmxrsl
jmp .returnb jmp .returnb
ALIGN4
.halfscanlines .halfscanlines
mov ebx,hirestiledat+1 mov ebx,hirestiledat+1
cmp byte[GUIOn],1 cmp byte[GUIOn],1
@@ -308,14 +316,16 @@ NEWSYM copy640x480x16bwin
cmp byte[newengen],0 cmp byte[newengen],0
je .loopabh je .loopabh
mov ebx,SpecialLine+1 mov ebx,SpecialLine+1
ALIGN4
.loopabh .loopabh
cmp byte[ebx],1 cmp byte[ebx],1
jbe .ignorehrbh jbe .ignorehrbh
call HighResProc call HighResProc
jmp .returnbh jmp .returnbh
ALIGN4
.ignorehrbh .ignorehrbh
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmxslh je .mmxslh
mov ecx,256 mov ecx,256
.abh .abh
mov ax,[esi] mov ax,[esi]
@@ -345,11 +355,12 @@ NEWSYM copy640x480x16bwin
add edi,[AddEndBytes] add edi,[AddEndBytes]
inc ebx inc ebx
dec dl dec dl
jnz near .loopabh jnz .loopabh
popad pop es
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmx2 je .mmx2
ret ret
ALIGN4
.mmxslh .mmxslh
mov eax,[spritetablea] mov eax,[spritetablea]
mov ecx,64 mov ecx,64
@@ -396,6 +407,7 @@ NEWSYM copy640x480x16bwin
jnz .mmxr2h jnz .mmxr2h
jmp .returnbh jmp .returnbh
ALIGN4
.quartscanlines .quartscanlines
mov [lineleft],dl mov [lineleft],dl
mov ebx,hirestiledat+1 mov ebx,hirestiledat+1
@@ -404,14 +416,16 @@ NEWSYM copy640x480x16bwin
cmp byte[newengen],0 cmp byte[newengen],0
je .loopabh2 je .loopabh2
mov ebx,SpecialLine+1 mov ebx,SpecialLine+1
ALIGN4
.loopabh2 .loopabh2
cmp byte[ebx],1 cmp byte[ebx],1
jbe .ignorehrbh2 jbe .ignorehrbh2
call HighResProc call HighResProc
jmp .returnbh2 jmp .returnbh2
ALIGN4
.ignorehrbh2 .ignorehrbh2
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmxslh2 je .mmxslh2
mov ecx,256 mov ecx,256
.abh2 .abh2
mov ax,[esi] mov ax,[esi]
@@ -445,11 +459,12 @@ NEWSYM copy640x480x16bwin
add edi,[AddEndBytes] add edi,[AddEndBytes]
inc ebx inc ebx
dec byte[lineleft] dec byte[lineleft]
jnz near .loopabh2 jnz .loopabh2
popad pop es
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmx2 je .mmx2
ret ret
ALIGN4
.mmxslh2 .mmxslh2
mov eax,[spritetablea] mov eax,[spritetablea]
mov ecx,64 mov ecx,64
@@ -496,12 +511,13 @@ NEWSYM copy640x480x16bwin
jnz .mmxr2h2 jnz .mmxr2h2
jmp .returnbh2 jmp .returnbh2
ALIGN4
HighResProc: HighResProc:
mov ecx,256 mov ecx,256
cmp byte[ebx],3 cmp byte[ebx],3
je near .hiresmode7 je .hiresmode7
cmp byte[ebx],7 cmp byte[ebx],7
je near .hiresmode7 je .hiresmode7
test byte[ebx],4 test byte[ebx],4
jz .nofield jz .nofield
cmp byte[scanlines],0 cmp byte[scanlines],0
@@ -511,7 +527,7 @@ HighResProc:
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
.nofield .nofield
test byte[ebx],3 test byte[ebx],3
jnz near .hires jnz .hires
.a .a
mov ax,[esi] mov ax,[esi]
shl eax,16 shl eax,16
@@ -528,6 +544,7 @@ HighResProc:
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
.nofielde .nofielde
ret ret
ALIGN4
.hiresmode7 .hiresmode7
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je .yeshiresngmmxmode7 je .yeshiresngmmxmode7
@@ -555,6 +572,7 @@ HighResProc:
jnz .a2b jnz .a2b
sub esi,75036*4 sub esi,75036*4
ret ret
ALIGN4
.yeshiresngmmxmode7 .yeshiresngmmxmode7
mov ecx,64 mov ecx,64
.mmxr .mmxr
@@ -587,9 +605,10 @@ HighResProc:
jnz .mmxrb jnz .mmxrb
sub esi,75036*4 sub esi,75036*4
ret ret
ALIGN4
.hires .hires
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .yeshiresngmmx je .yeshiresngmmx
.bng .bng
mov eax,[esi+75036*4-2] mov eax,[esi+75036*4-2]
mov ax,[esi] mov ax,[esi]
@@ -607,13 +626,14 @@ HighResProc:
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
.lowerfield .lowerfield
ret ret
ALIGN4
.nofieldb .nofieldb
cmp byte[scanlines],1 cmp byte[scanlines],1
je near .scanlines je .scanlines
cmp byte[scanlines],3 cmp byte[scanlines],3
je near .halfscanlines je .halfscanlines
cmp byte[scanlines],2 cmp byte[scanlines],2
je near .quartscanlines je .quartscanlines
add edi,[AddEndBytes] add edi,[AddEndBytes]
sub esi,256*2 sub esi,256*2
mov ecx,256 mov ecx,256
@@ -626,8 +646,10 @@ HighResProc:
dec ecx dec ecx
jnz .bngb jnz .bngb
ret ret
ALIGN4
.scanlines .scanlines
ret ret
ALIGN4
.yeshiresngmmx .yeshiresngmmx
mov eax,[spritetablea] mov eax,[spritetablea]
mov ecx,64 mov ecx,64
@@ -656,19 +678,20 @@ HighResProc:
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
.lowerfieldb .lowerfieldb
ret ret
ALIGN4
.nofieldc .nofieldc
cmp byte[scanlines],1 cmp byte[scanlines],1
je near .scanlines je .scanlines
cmp byte[scanlines],3 cmp byte[scanlines],3
je near .halfscanlinesmmx je .halfscanlinesmmx
cmp byte[scanlines],2 cmp byte[scanlines],2
je near .quartscanlinesmmx je .quartscanlinesmmx
test byte[ebx+1],3 test byte[ebx+1],3
jz .noaa jz .noaa
cmp byte[En2xSaI],0 cmp byte[En2xSaI],0
jne near .antialias jne .antialias
cmp byte[antienab],0 cmp byte[antienab],0
jne near .antialias jne .antialias
.noaa .noaa
add edi,[AddEndBytes] add edi,[AddEndBytes]
mov eax,[spritetablea] mov eax,[spritetablea]
@@ -688,6 +711,7 @@ HighResProc:
dec ecx dec ecx
jnz .mmxr2 jnz .mmxr2
ret ret
ALIGN4
.antialias .antialias
add edi,[AddEndBytes] add edi,[AddEndBytes]
mov eax,[spritetablea] mov eax,[spritetablea]
@@ -721,6 +745,7 @@ HighResProc:
dec ecx dec ecx
jnz .mmxr2aa jnz .mmxr2aa
ret ret
ALIGN4
.halfscanlines .halfscanlines
add edi,[AddEndBytes] add edi,[AddEndBytes]
sub esi,256*2 sub esi,256*2
@@ -737,6 +762,7 @@ HighResProc:
dec ecx dec ecx
jnz .abhs jnz .abhs
ret ret
ALIGN4
.quartscanlines .quartscanlines
add edi,[AddEndBytes] add edi,[AddEndBytes]
sub esi,256*2 sub esi,256*2
@@ -756,6 +782,7 @@ HighResProc:
dec ecx dec ecx
jnz .abhs2 jnz .abhs2
ret ret
ALIGN4
.halfscanlinesmmx .halfscanlinesmmx
mov eax,[spritetablea] mov eax,[spritetablea]
mov ecx,32 mov ecx,32
@@ -784,6 +811,7 @@ HighResProc:
dec ecx dec ecx
jnz .mmxr2h jnz .mmxr2h
ret ret
ALIGN4
.quartscanlinesmmx .quartscanlinesmmx
mov eax,[spritetablea] mov eax,[spritetablea]
mov ecx,64 mov ecx,64
@@ -811,9 +839,9 @@ HighResProc:
add edi,16 add edi,16
dec ecx dec ecx
jnz .mmxr2h2 jnz .mmxr2h2
popad
ret ret
ALIGN4
Process2xSaIwin: Process2xSaIwin:
mov ebx,hirestiledat+1 mov ebx,hirestiledat+1
cmp byte[GUIOn],1 cmp byte[GUIOn],1
@@ -821,11 +849,12 @@ Process2xSaIwin:
cmp byte[newengen],0 cmp byte[newengen],0
je .loopabi je .loopabi
mov ebx,SpecialLine+1 mov ebx,SpecialLine+1
ALIGN4
.loopabi .loopabi
mov [InterPtr],ebx mov [InterPtr],ebx
; add edi,[VESAAddr] ; add edi,[VESAAddr]
mov dl,224 mov dl,[resolutn]
sub dl,2 ; Compensate for top/bottom line + 2 lines in 2xSaI sub dl,2 ; Compensate for top/bottom line + 2 lines in 2xSaI
mov byte[lineleft],dl mov byte[lineleft],dl
mov dword[esi+512],0 mov dword[esi+512],0
@@ -852,6 +881,7 @@ Process2xSaIwin:
jnz .nextb jnz .nextb
pop ebx pop ebx
jmp .returninterp jmp .returninterp
ALIGN4
.ignorehr .ignorehr
;srcPtr equ 8 ;srcPtr equ 8
@@ -881,9 +911,11 @@ Process2xSaIwin:
je .super2xSaI je .super2xSaI
call _2xSaILineW call _2xSaILineW
jmp .normal jmp .normal
ALIGN4
.supereagle .supereagle
call _2xSaISuperEagleLineW call _2xSaISuperEagleLineW
jmp .normal jmp .normal
ALIGN4
.super2xSaI .super2xSaI
call _2xSaISuper2xSaILineW call _2xSaISuper2xSaILineW
.normal .normal
@@ -895,28 +927,31 @@ Process2xSaIwin:
add ebx,576 add ebx,576
inc dword[InterPtr] inc dword[InterPtr]
dec dword[lineleft] dec dword[lineleft]
jnz near .next jnz .next
mov ecx,256 mov ecx,256
sub edi,[NumBytesPerLine] sub edi,[NumBytesPerLine]
ALIGN4
.loop .loop
mov dword[es:edi],0 mov dword[es:edi],0
add edi,4 add edi,4
dec ecx dec ecx
jnz .loop jnz .loop
pop es
emms emms
popad
ret ret
ALIGN4
.returninterp .returninterp
add esi,64 add esi,64
inc dword[InterPtr] inc dword[InterPtr]
add edi,[AddEndBytes] add edi,[AddEndBytes]
add ebx,576 add ebx,576
dec byte[lineleft] dec byte[lineleft]
jnz near .next jnz .next
emms emms
popad pop es
ret ret
ALIGN4
MMXInterpolwin: MMXInterpolwin:
mov ebx,hirestiledat+1 mov ebx,hirestiledat+1
cmp byte[GUIOn],1 cmp byte[GUIOn],1
@@ -924,19 +959,18 @@ MMXInterpolwin:
cmp byte[newengen],0 cmp byte[newengen],0
je .loopab je .loopab
mov ebx,SpecialLine+1 mov ebx,SpecialLine+1
ALIGN4
.loopab .loopab
mov dl,224 mov dl,[resolutn]
dec dl sub dl,3
dec dl
dec dl
movq mm2,[HalfTransC] movq mm2,[HalfTransC]
cmp byte[scanlines],1 cmp byte[scanlines],1
je near .scanlines je .scanlines
cmp byte[scanlines],2 cmp byte[scanlines],2
je near .scanlinesquart je .scanlinesquart
cmp byte[scanlines],3 cmp byte[scanlines],3
je near .scanlineshalf je .scanlineshalf
inc ebx inc ebx
mov [lineleft],dl mov [lineleft],dl
; do scanlines ; do scanlines
@@ -950,7 +984,7 @@ MMXInterpolwin:
movq mm3,mm0 movq mm3,mm0
movq mm4,mm0 movq mm4,mm0
movq mm1,[esi+2] movq mm1,[esi+2]
pand mm3,mm1 por mm3,mm1
pand mm0,mm2 pand mm0,mm2
pand mm1,mm2 pand mm1,mm2
psrlw mm0,1 psrlw mm0,1
@@ -979,6 +1013,7 @@ MMXInterpolwin:
call HighResProc call HighResProc
movq mm2,[HalfTransC] movq mm2,[HalfTransC]
jmp .returninterp jmp .returninterp
ALIGN4
.ignorehr .ignorehr
mov eax,[esi+510] mov eax,[esi+510]
mov ecx,64 mov ecx,64
@@ -991,7 +1026,7 @@ MMXInterpolwin:
movq mm3,mm0 movq mm3,mm0
movq mm4,mm0 movq mm4,mm0
movq mm1,[esi+2] movq mm1,[esi+2]
pand mm3,mm1 por mm3,mm1
pand mm0,mm2 pand mm0,mm2
pand mm1,mm2 pand mm1,mm2
psrlw mm0,1 psrlw mm0,1
@@ -1007,8 +1042,8 @@ MMXInterpolwin:
punpckhwd mm5,mm0 punpckhwd mm5,mm0
movq [edx],mm4 movq [edx],mm4
movq [edx+8],mm5 movq [edx+8],mm5
pand mm0,mm4
movq mm0,mm6 movq mm0,mm6
por mm0,mm4
pand mm4,mm2 pand mm4,mm2
pand mm6,mm2 pand mm6,mm2
psrlw mm4,1 psrlw mm4,1
@@ -1017,7 +1052,7 @@ MMXInterpolwin:
paddd mm4,mm6 paddd mm4,mm6
paddw mm4,mm0 paddw mm4,mm0
movq mm0,mm5 movq mm0,mm5
pand mm0,mm7 por mm0,mm7
pand mm5,mm2 pand mm5,mm2
pand mm7,mm2 pand mm7,mm2
psrlw mm5,1 psrlw mm5,1
@@ -1031,7 +1066,7 @@ MMXInterpolwin:
add edi,16 add edi,16
add edx,16 add edx,16
dec ecx dec ecx
jnz near .a3 jnz .a3
add edi,[AddEndBytes] add edi,[AddEndBytes]
mov edx,[spritetablea] mov edx,[spritetablea]
add edx,512 add edx,512
@@ -1050,11 +1085,12 @@ MMXInterpolwin:
add edi,[AddEndBytes] add edi,[AddEndBytes]
inc ebx inc ebx
dec byte[lineleft] dec byte[lineleft]
jnz near .a5 jnz .a5
emms emms
popad pop es
ret ret
ALIGN4
.scanlines .scanlines
inc dl inc dl
mov [lineleft],dl mov [lineleft],dl
@@ -1068,6 +1104,7 @@ MMXInterpolwin:
call HighResProc call HighResProc
movq mm2,[HalfTrans] movq mm2,[HalfTrans]
jmp .returninterps jmp .returninterps
ALIGN4
.ignorehrs .ignorehrs
.a .a
movq mm0,[esi] movq mm0,[esi]
@@ -1088,12 +1125,13 @@ MMXInterpolwin:
add edi,16 add edi,16
dec ecx dec ecx
jnz .a jnz .a
mov eax,[esi+510] ; mov eax,[esi+510]
mov [esi+512],eax ; mov [esi+512],eax
.returninterps .returninterps
add esi,64 add esi,64
add edi,[AddEndBytes] add edi,[AddEndBytes]
mov ecx,256 mov ecx,256
ALIGN4
.fslloop .fslloop
mov dword[edi],0 mov dword[edi],0
add edi,4 add edi,4
@@ -1103,11 +1141,12 @@ MMXInterpolwin:
inc ebx inc ebx
mov ecx,64 mov ecx,64
dec byte[lineleft] dec byte[lineleft]
jnz near .asl jnz .asl
emms emms
popad pop es
ret ret
ALIGN4
.scanlineshalf .scanlineshalf
inc dl inc dl
mov [lineleft],dl mov [lineleft],dl
@@ -1118,6 +1157,7 @@ MMXInterpolwin:
call HighResProc call HighResProc
movq mm2,[HalfTrans] movq mm2,[HalfTrans]
jmp .returninterphs jmp .returninterphs
ALIGN4
.ignorehrhs .ignorehrhs
mov eax,[esi+510] mov eax,[esi+510]
mov ecx,64 mov ecx,64
@@ -1167,11 +1207,12 @@ MMXInterpolwin:
add esi,64 add esi,64
inc ebx inc ebx
dec byte[lineleft] dec byte[lineleft]
jnz near .ahb jnz .ahb
emms emms
popad pop es
ret ret
ALIGN4
.scanlinesquart .scanlinesquart
inc dl inc dl
mov [lineleft],dl mov [lineleft],dl
@@ -1182,6 +1223,7 @@ MMXInterpolwin:
call HighResProc call HighResProc
movq mm2,[HalfTransC] movq mm2,[HalfTransC]
jmp .returninterpqs jmp .returninterpqs
ALIGN4
.ignorehrqs .ignorehrqs
mov eax,[esi+510] mov eax,[esi+510]
mov ecx,64 mov ecx,64
@@ -1193,7 +1235,7 @@ MMXInterpolwin:
movq mm3,mm0 movq mm3,mm0
movq mm4,mm0 movq mm4,mm0
movq mm1,[esi+2] movq mm1,[esi+2]
pand mm3,mm1 por mm3,mm1
pand mm0,mm2 pand mm0,mm2
pand mm1,mm2 pand mm1,mm2
psrlw mm0,1 psrlw mm0,1
@@ -1217,6 +1259,8 @@ MMXInterpolwin:
add edi,[AddEndBytes] add edi,[AddEndBytes]
sub edx,16*64 sub edx,16*64
mov ecx,64 mov ecx,64
movq mm3,mm2
.ahc2 .ahc2
movq mm0,[edx] movq mm0,[edx]
movq mm1,[edx+8] movq mm1,[edx+8]
@@ -1243,14 +1287,15 @@ MMXInterpolwin:
add edi,[AddEndBytes] add edi,[AddEndBytes]
inc ebx inc ebx
dec byte[lineleft] dec byte[lineleft]
jnz near .ahb2 jnz .ahb2
emms emms
popad pop es
ret ret
ALIGN4
NEWSYM interpolate640x480x16bwin NEWSYM interpolate640x480x16bwin
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near MMXInterpolwin je MMXInterpolwin
mov ebx,hirestiledat+1 mov ebx,hirestiledat+1
cmp byte[GUIOn],1 cmp byte[GUIOn],1
@@ -1258,19 +1303,18 @@ NEWSYM interpolate640x480x16bwin
cmp byte[newengen],0 cmp byte[newengen],0
je .loopabi je .loopabi
mov ebx,SpecialLine+1 mov ebx,SpecialLine+1
ALIGN4
.loopabi .loopabi
mov [InterPtr],ebx mov [InterPtr],ebx
mov dl,224 mov dl,[resolutn]
dec dl sub dl,3
dec dl
dec dl
cmp byte[scanlines],1 cmp byte[scanlines],1
je near .scanlines je .scanlines
cmp byte[scanlines],2 cmp byte[scanlines],2
je near .scanlinesquart je .scanlinesquart
cmp byte[scanlines],3 cmp byte[scanlines],3
je near .scanlineshalf je .scanlineshalf
inc dword[InterPtr] inc dword[InterPtr]
mov [lineleft],dl mov [lineleft],dl
; do first line ; do first line
@@ -1294,12 +1338,14 @@ NEWSYM interpolate640x480x16bwin
add esi,66 add esi,66
add edi,[AddEndBytes] add edi,[AddEndBytes]
add edi,4 add edi,4
ALIGN4
.loopb .loopb
mov ebx,[InterPtr] mov ebx,[InterPtr]
cmp byte[ebx],1 cmp byte[ebx],1
jbe .ignorehr jbe .ignorehr
call HighResProc call HighResProc
jmp .returninterp jmp .returninterp
ALIGN4
.ignorehr .ignorehr
mov ecx,255 mov ecx,255
mov edx,[spritetablea] mov edx,[spritetablea]
@@ -1340,18 +1386,20 @@ NEWSYM interpolate640x480x16bwin
add edi,[AddEndBytes] add edi,[AddEndBytes]
add edi,4 add edi,4
dec byte[lineleft] dec byte[lineleft]
jnz near .loopb jnz .loopb
popad pop es
ret ret
ALIGN4
.returninterp .returninterp
add esi,64 add esi,64
inc dword[InterPtr] inc dword[InterPtr]
add edi,[AddEndBytes] add edi,[AddEndBytes]
dec byte[lineleft] dec byte[lineleft]
jnz near .loopb jnz .loopb
popad pop es
ret ret
ALIGN4
.scanlines .scanlines
xor eax,eax xor eax,eax
mov ebx,hirestiledat+1 mov ebx,hirestiledat+1
@@ -1360,6 +1408,7 @@ NEWSYM interpolate640x480x16bwin
cmp byte[newengen],0 cmp byte[newengen],0
je .loopabis je .loopabis
mov ebx,SpecialLine+1 mov ebx,SpecialLine+1
ALIGN4
.loopabis .loopabis
.loopab .loopab
mov ecx,255 mov ecx,255
@@ -1367,9 +1416,10 @@ NEWSYM interpolate640x480x16bwin
jbe .ignorehrs jbe .ignorehrs
call HighResProc call HighResProc
jmp .returninterps jmp .returninterps
ALIGN4
.ignorehrs .ignorehrs
cmp byte[ebx],1 cmp byte[ebx],1
je near .yeshiresb je .yeshiresb
.ignorehrb .ignorehrb
push ebx push ebx
.ab .ab
@@ -1391,6 +1441,7 @@ NEWSYM interpolate640x480x16bwin
add edi,4 add edi,4
add edi,[AddEndBytes] add edi,[AddEndBytes]
mov ecx,256 mov ecx,256
ALIGN4
.fslloop .fslloop
mov dword[edi],0 mov dword[edi],0
add edi,4 add edi,4
@@ -1400,9 +1451,10 @@ NEWSYM interpolate640x480x16bwin
inc ebx inc ebx
dec dl dec dl
jnz .loopab jnz .loopab
pop es
xor byte[res512switch],1 xor byte[res512switch],1
popad
ret ret
ALIGN4
.yeshiresb .yeshiresb
mov byte[ebx],0 mov byte[ebx],0
test byte[res512switch],1 test byte[res512switch],1
@@ -1415,6 +1467,7 @@ NEWSYM interpolate640x480x16bwin
dec ecx dec ecx
jnz .bb jnz .bb
jmp .returnb jmp .returnb
ALIGN4
.rightsideb .rightsideb
.cb .cb
mov ax,[esi] mov ax,[esi]
@@ -1424,11 +1477,13 @@ NEWSYM interpolate640x480x16bwin
dec ecx dec ecx
jnz .cb jnz .cb
jmp .returnb jmp .returnb
ALIGN4
.returninterps .returninterps
add esi,64 add esi,64
inc dword[InterPtr] inc dword[InterPtr]
add edi,[AddEndBytes] add edi,[AddEndBytes]
mov ecx,256 mov ecx,256
ALIGN4
.fslloop2 .fslloop2
mov dword[edi],0 mov dword[edi],0
add edi,4 add edi,4
@@ -1436,19 +1491,22 @@ NEWSYM interpolate640x480x16bwin
jnz .fslloop2 jnz .fslloop2
add edi,[AddEndBytes] add edi,[AddEndBytes]
dec byte[lineleft] dec byte[lineleft]
jnz near .loopab jnz .loopab
popad pop es
ret ret
ALIGN4
.scanlineshalf .scanlineshalf
xor eax,eax xor eax,eax
mov [lineleft],dl mov [lineleft],dl
ALIGN4
.loopab2 .loopab2
mov ebx,[InterPtr] mov ebx,[InterPtr]
cmp byte[ebx],1 cmp byte[ebx],1
jbe .ignorehrhs jbe .ignorehrhs
call HighResProc call HighResProc
jmp .returninterphs jmp .returninterphs
ALIGN4
.ignorehrhs .ignorehrhs
mov ecx,255 mov ecx,255
mov edx,[spritetablea] mov edx,[spritetablea]
@@ -1487,27 +1545,31 @@ NEWSYM interpolate640x480x16bwin
add edi,4 add edi,4
add edi,[AddEndBytes] add edi,[AddEndBytes]
dec byte[lineleft] dec byte[lineleft]
jnz near .loopab2 jnz .loopab2
popad pop es
ret ret
ALIGN4
.returninterphs .returninterphs
add esi,64 add esi,64
inc dword[InterPtr] inc dword[InterPtr]
add edi,[AddEndBytes] add edi,[AddEndBytes]
dec byte[lineleft] dec byte[lineleft]
jnz near .loopab2 jnz .loopab2
popad pop es
ret ret
ALIGN4
.scanlinesquart .scanlinesquart
xor eax,eax xor eax,eax
mov [lineleft],dl mov [lineleft],dl
ALIGN4
.loopab3 .loopab3
mov ebx,[InterPtr] mov ebx,[InterPtr]
cmp byte[ebx],1 cmp byte[ebx],1
jbe .ignorehrqs jbe .ignorehrqs
call HighResProc call HighResProc
jmp .returninterpqs jmp .returninterpqs
ALIGN4
.ignorehrqs .ignorehrqs
mov ecx,255 mov ecx,255
mov edx,[spritetablea] mov edx,[spritetablea]
@@ -1550,21 +1612,23 @@ NEWSYM interpolate640x480x16bwin
add edi,4 add edi,4
add edi,[AddEndBytes] add edi,[AddEndBytes]
dec byte[lineleft] dec byte[lineleft]
jnz near .loopab3 jnz .loopab3
popad pop es
ret ret
ALIGN4
.returninterpqs .returninterpqs
add esi,64 add esi,64
inc dword[InterPtr] inc dword[InterPtr]
add edi,[AddEndBytes] add edi,[AddEndBytes]
dec byte[lineleft] dec byte[lineleft]
jnz near .loopab3 jnz .loopab3
popad pop es
ret ret
SECTION .bss SECTION .bss
;ALIGN32
InterPtr resd 1 InterPtr resd 1
SECTION .text SECTION .text
NEWSYM CopyVWinAsmEnd NEWSYM CopyVWinAsmEnd

View File

@@ -26,9 +26,7 @@ EXTSYM SpecialLine
EXTSYM vidbufferofsb EXTSYM vidbufferofsb
EXTSYM HalfTransB,HalfTransC EXTSYM HalfTransB,HalfTransC
%ifdef __MINGW__
NEWSYM CopyVWinAsmStart NEWSYM CopyVWinAsmStart
%endif
SECTION .bss SECTION .bss
NEWSYM AddEndBytes, resd 1 ; Number of bytes between each line NEWSYM AddEndBytes, resd 1 ; Number of bytes between each line
@@ -1632,7 +1630,5 @@ InterPtr resd 1
SECTION .text SECTION .text
%ifdef __MINGW__
NEWSYM CopyVWinAsmEnd NEWSYM CopyVWinAsmEnd
%endif