Fix various crash bugs, including Secret of Mana

This commit is contained in:
theoddone33
2002-06-28 06:50:20 +00:00
parent 4dbd720033
commit 7ee189ed43

View File

@@ -38,12 +38,11 @@ NEWSYM WinVidMemStart, resd 1
SECTION .text SECTION .text
NEWSYM copy640x480x16bwin NEWSYM copy640x480x16bwin
pushad
cmp byte[curblank],40h cmp byte[curblank],40h
jne .startcopy jne .startcopy
popad
ret ret
.startcopy .startcopy
pushad
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
@@ -120,14 +119,13 @@ NEWSYM copy640x480x16bwin
inc ebx inc ebx
dec dl dec dl
jnz near .loopa jnz near .loopa
popad
xor byte[res512switch],1 xor byte[res512switch],1
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je .mmx2 je .mmx2
popad
ret ret
.mmx2 .mmx2
emms emms
popad
ret ret
.yeshires .yeshires
mov byte[ebx],0 mov byte[ebx],0
@@ -231,7 +229,7 @@ NEWSYM copy640x480x16bwin
.loopab .loopab
mov ecx,256 mov ecx,256
cmp byte[ebx],1 cmp byte[ebx],1
je .yeshiresb je near .yeshiresb
cmp byte[ebx],1 cmp byte[ebx],1
jbe .ignorehrb jbe .ignorehrb
call HighResProc call HighResProc
@@ -261,10 +259,10 @@ NEWSYM copy640x480x16bwin
inc ebx inc ebx
dec dl dec dl
jnz .loopab jnz .loopab
popad
xor byte[res512switch],1 xor byte[res512switch],1
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmx2 je near .mmx2
popad
ret ret
.yeshiresb .yeshiresb
mov byte[ebx],0 mov byte[ebx],0
@@ -348,9 +346,9 @@ NEWSYM copy640x480x16bwin
inc ebx inc ebx
dec dl dec dl
jnz near .loopabh jnz near .loopabh
popad
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmx2 je near .mmx2
popad
ret ret
.mmxslh .mmxslh
mov eax,[spritetablea] mov eax,[spritetablea]
@@ -448,9 +446,9 @@ NEWSYM copy640x480x16bwin
inc ebx inc ebx
dec byte[lineleft] dec byte[lineleft]
jnz near .loopabh2 jnz near .loopabh2
popad
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
je near .mmx2 je near .mmx2
popad
ret ret
.mmxslh2 .mmxslh2
mov eax,[spritetablea] mov eax,[spritetablea]
@@ -529,7 +527,6 @@ HighResProc:
jnz .nofielde jnz .nofielde
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
.nofielde .nofielde
popad
ret ret
.hiresmode7 .hiresmode7
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
@@ -557,7 +554,6 @@ HighResProc:
dec ecx dec ecx
jnz .a2b jnz .a2b
sub esi,75036*4 sub esi,75036*4
popad
ret ret
.yeshiresngmmxmode7 .yeshiresngmmxmode7
mov ecx,64 mov ecx,64
@@ -590,7 +586,6 @@ HighResProc:
dec ecx dec ecx
jnz .mmxrb jnz .mmxrb
sub esi,75036*4 sub esi,75036*4
popad
ret ret
.hires .hires
cmp byte[MMXSupport],1 cmp byte[MMXSupport],1
@@ -611,7 +606,6 @@ HighResProc:
jnz .lowerfield jnz .lowerfield
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
.lowerfield .lowerfield
popad
ret ret
.nofieldb .nofieldb
cmp byte[scanlines],1 cmp byte[scanlines],1
@@ -631,10 +625,8 @@ HighResProc:
add edi,4 add edi,4
dec ecx dec ecx
jnz .bngb jnz .bngb
popad
ret ret
.scanlines .scanlines
popad
ret ret
.yeshiresngmmx .yeshiresngmmx
mov eax,[spritetablea] mov eax,[spritetablea]
@@ -663,7 +655,6 @@ HighResProc:
jnz .lowerfieldb jnz .lowerfieldb
add edi,[NumBytesPerLine] add edi,[NumBytesPerLine]
.lowerfieldb .lowerfieldb
popad
ret ret
.nofieldc .nofieldc
cmp byte[scanlines],1 cmp byte[scanlines],1
@@ -696,7 +687,6 @@ HighResProc:
add edi,32 add edi,32
dec ecx dec ecx
jnz .mmxr2 jnz .mmxr2
popad
ret ret
.antialias .antialias
add edi,[AddEndBytes] add edi,[AddEndBytes]
@@ -730,7 +720,6 @@ HighResProc:
add esi,8 add esi,8
dec ecx dec ecx
jnz .mmxr2aa jnz .mmxr2aa
popad
ret ret
.halfscanlines .halfscanlines
add edi,[AddEndBytes] add edi,[AddEndBytes]
@@ -747,7 +736,6 @@ HighResProc:
add edi,4 add edi,4
dec ecx dec ecx
jnz .abhs jnz .abhs
popad
ret ret
.quartscanlines .quartscanlines
add edi,[AddEndBytes] add edi,[AddEndBytes]
@@ -767,7 +755,6 @@ HighResProc:
add edi,4 add edi,4
dec ecx dec ecx
jnz .abhs2 jnz .abhs2
popad
ret ret
.halfscanlinesmmx .halfscanlinesmmx
mov eax,[spritetablea] mov eax,[spritetablea]
@@ -796,7 +783,6 @@ HighResProc:
add edi,32 add edi,32
dec ecx dec ecx
jnz .mmxr2h jnz .mmxr2h
popad
ret ret
.quartscanlinesmmx .quartscanlinesmmx
mov eax,[spritetablea] mov eax,[spritetablea]
@@ -1383,7 +1369,7 @@ NEWSYM interpolate640x480x16bwin
jmp .returninterps jmp .returninterps
.ignorehrs .ignorehrs
cmp byte[ebx],1 cmp byte[ebx],1
je .yeshiresb je near .yeshiresb
.ignorehrb .ignorehrb
push ebx push ebx
.ab .ab