dz dd -10.5f,-10.5f
hs dd 0,zhiguzi
fe dd 0.15f
循环调用:call dword ptr hs+4
zhiguzi:
fldz
fld DWORD ptr dz
fadd DWORD ptr fe
fcomi st,st(1)
fcmovnb st,st(1)
fst DWORD ptr dz
fsincos
fstp DWORD ptr VSC12+4
fstp DWORD ptr VSC12
fld DWORD ptr dz+4
fadd DWORD ptr fe
fcomi st,st(1)
fcmovnb st,st(1)
test ax,100000000b
jz zhiguzi@1
mov DWORD ptr fe,3D4CCCCDh;0.05f
mov eax,offset zhiguzi@2
mov DWORD ptr hs+4,eax
zhiguzi@1:
fst DWORD ptr dz+4
fsincos
fstp DWORD ptr VSC12+12d
fstp DWORD ptr VSC12+8d
ffree st(0)
d3dev9 SetVertexShaderConstantF,pd3dDevice,11,addr VSC11,2
ret
zhiguzi@2:
fld DWORD ptr dz
fadd DWORD ptr fe
fst DWORD ptr dz
fsincos
fstp DWORD ptr VSC12+4
fstp DWORD ptr VSC12
d3dev9 SetVertexShaderConstantF,pd3dDevice,11,addr VSC11,2
ret
说明:应该是先调用zhiguzi,然后调用zhiguzi@2,结果很奇怪:zhiguzi调用完后就停止了,鼠标移动到地图边界时调用了zhiguzi@2。如果把fcomi,fcmovnb改为fcom fnstsw ax test 则一切正常。不知道fcomi,fcmovnb有啥猫腻。