- Fixed: The SafeDivScales used a signed shift for their if test. This fails

when a == 0x80000000, because the result of abs will still be negative as
  long as we use signed math.
- Fixed: SafeDivScale31 performed DivScale32 instead.
- Fixed: R_DrawSpanP_ASM had a short jump into a different section.


SVN r472 (trunk)
This commit is contained in:
Randy Heit 2007-02-02 23:41:51 +00:00
parent 0b7b527ac2
commit bac407c543
4 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,10 @@
February 2, 2007
- Fixed: The SafeDivScales used a signed shift for their if test. This fails
when a == 0x80000000, because the result of abs will still be negative as
long as we use signed math.
- Fixed: SafeDivScale31 performed DivScale32 instead.
- Fixed: R_DrawSpanP_ASM had a short jump into a different section.
January 30, 2007 January 30, 2007
- Fixed: When quiting from fullscreen mode, RestoreConView() did not ungrab - Fixed: When quiting from fullscreen mode, RestoreConView() did not ungrab
the mouse. the mouse.

View file

@ -23,7 +23,7 @@
#define MAKESAFEDIVSCALE(x) \ #define MAKESAFEDIVSCALE(x) \
inline SDWORD SafeDivScale##x (SDWORD a, SDWORD b) \ inline SDWORD SafeDivScale##x (SDWORD a, SDWORD b) \
{ \ { \
if (abs(a) >> (31-x) >= abs (b)) \ if ((DWORD)abs(a) >> (31-x) >= (DWORD)abs (b)) \
return (a^b)<0 ? FIXED_MIN : FIXED_MAX; \ return (a^b)<0 ? FIXED_MIN : FIXED_MAX; \
return DivScale##x (a, b); \ return DivScale##x (a, b); \
} }
@ -62,14 +62,14 @@ MAKESAFEDIVSCALE(30)
inline SDWORD SafeDivScale31 (SDWORD a, SDWORD b) inline SDWORD SafeDivScale31 (SDWORD a, SDWORD b)
{ {
if (abs(a) >= abs (b)) if ((DWORD)abs(a) >= (DWORD)abs (b))
return (a^b)<0 ? FIXED_MIN : FIXED_MAX; return (a^b)<0 ? FIXED_MIN : FIXED_MAX;
return DivScale32 (a, b); return DivScale31 (a, b);
} }
inline SDWORD SafeDivScale32 (SDWORD a, SDWORD b) inline SDWORD SafeDivScale32 (SDWORD a, SDWORD b)
{ {
if (abs(a) >= abs (b) >> 1) if ((DWORD)abs(a) >= (DWORD)abs (b) >> 1)
return (a^b)<0 ? FIXED_MIN : FIXED_MAX; return (a^b)<0 ? FIXED_MIN : FIXED_MAX;
return DivScale32 (a, b); return DivScale32 (a, b);
} }

View file

@ -321,7 +321,7 @@ R_DrawSpanP_ASM:
mov eax,[ds_x2] mov eax,[ds_x2]
mov ecx,[ds_x1] mov ecx,[ds_x1]
sub eax,ecx sub eax,ecx
jl aret ; count < 0: nothing to do, so leave jl near rdspret ; count < 0: nothing to do, so leave
push ebx push ebx
push edi push edi

View file

@ -4774,7 +4774,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputPath)..." Description="Assembling $(InputPath)..."
CommandLine="nasmw -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw -g -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="$(IntDir)/$(InputName).obj" Outputs="$(IntDir)/$(InputName).obj"
/> />
</FileConfiguration> </FileConfiguration>
@ -4818,7 +4818,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputPath)..." Description="Assembling $(InputPath)..."
CommandLine="nasmw -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw -g -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="$(IntDir)/$(InputName).obj" Outputs="$(IntDir)/$(InputName).obj"
/> />
</FileConfiguration> </FileConfiguration>
@ -4862,7 +4862,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputPath)..." Description="Assembling $(InputPath)..."
CommandLine="nasmw -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw -g -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj" Outputs="$(IntDir)\$(InputName).obj"
/> />
</FileConfiguration> </FileConfiguration>
@ -4906,7 +4906,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputPath)..." Description="Assembling $(InputPath)..."
CommandLine="nasmw -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw -g -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj" Outputs="$(IntDir)\$(InputName).obj"
/> />
</FileConfiguration> </FileConfiguration>
@ -4950,7 +4950,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputPath)..." Description="Assembling $(InputPath)..."
CommandLine="nasmw -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw -g -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj" Outputs="$(IntDir)\$(InputName).obj"
/> />
</FileConfiguration> </FileConfiguration>
@ -5376,7 +5376,7 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Assembling $(InputPath)..." Description="Assembling $(InputPath)..."
CommandLine="nasmw -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;" CommandLine="nasmw -g -o &quot;$(IntDir)\$(InputName).obj&quot; -d OBJ_FORMAT_win32 -f win32 &quot;$(InputPath)&quot;&#x0D;&#x0A;"
Outputs="$(IntDir)\$(InputName).obj" Outputs="$(IntDir)\$(InputName).obj"
/> />
</FileConfiguration> </FileConfiguration>