mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +03:00
Committed fix for bug at29456
This commit is contained in:
parent
9a34213992
commit
d8c8e72745
@ -1473,11 +1473,23 @@ OP_FLOAT_ROUND:
|
||||
mov [ebp], eax
|
||||
fldcw [ebp]
|
||||
;calculate
|
||||
push 0
|
||||
sub esp,4
|
||||
fld dword [edi+ecx+4]
|
||||
test edx,edx
|
||||
jz .correct
|
||||
jmp .skip_correct
|
||||
.correct:
|
||||
fadd st0
|
||||
fadd dword [g_round_nearest]
|
||||
fistp dword [esp]
|
||||
pop eax
|
||||
sar eax,1
|
||||
jmp .done
|
||||
.skip_correct:
|
||||
frndint
|
||||
fistp dword [esp]
|
||||
pop eax
|
||||
.done:
|
||||
pop edx
|
||||
;restore bits
|
||||
pop ebp
|
||||
@ -1593,6 +1605,8 @@ Start_DATA
|
||||
|
||||
lodb_and DD 0ffh, 0ffffh, 0, 0ffffffffh
|
||||
|
||||
g_round_nearest DD 0.5
|
||||
|
||||
GLOBAL g_flags
|
||||
g_flags:
|
||||
DD -1
|
||||
|
@ -1962,11 +1962,23 @@ OP_FLOAT_ROUND:
|
||||
mov [ebp], eax
|
||||
fldcw [ebp]
|
||||
;calculate
|
||||
push 0
|
||||
sub esp,4
|
||||
fld dword [esi+4]
|
||||
test edx,edx
|
||||
jz .correct
|
||||
jmp .skip_correct
|
||||
.correct:
|
||||
fadd st0
|
||||
fadd dword [g_round_nearest]
|
||||
fistp dword [esp]
|
||||
pop eax
|
||||
sar eax,1
|
||||
jmp .done
|
||||
.skip_correct:
|
||||
frndint
|
||||
fistp dword [esp]
|
||||
pop eax
|
||||
.done:
|
||||
pop edx
|
||||
;restore bits
|
||||
pop ebp
|
||||
@ -2423,6 +2435,10 @@ g_flagsjit:
|
||||
DD 0
|
||||
DD 1
|
||||
|
||||
global g_round_nearest
|
||||
g_round_nearest:
|
||||
DD 0.5
|
||||
|
||||
global amx_opcodelist_jit, _amx_opcodelist_jit
|
||||
|
||||
amx_opcodelist_jit:
|
||||
|
Loading…
Reference in New Issue
Block a user