Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Another Question About XMM Registers

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Jan 15, 2016 3:55 am    Post subject: Another Question About XMM Registers Reply with quote

How do I go about doubling up only the first two values inside the xmm0 register? The below script does what I want, except it basically NOP's the third value:

Code:
addps xmm0,xmm0
addps xmm0,xmm0
movq xmm0,xmm0


I tried shuffling the values, doing my add and then shuffling them back, but it's not working. Maybe I am doing something wrong?

Code:
addss xmm0,xmm0
shufps xmm0,xmm0,e1
addss xmm0,xmm0
shufps xmm0,xmm0,e4


Thanks.

EDIT:
I don't know if this is the best approach. What I am trying to do is increase player speed, but the game that I am working on does not have a traditional jump capability, and when you start running really fast and step on a curb or something, sometimes your player goes air-born and starts flying in the air. I have incorporated a way to cancel that when it happens, but I was hoping for something automated.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Jan 15, 2016 8:36 am    Post subject: This post has 2 review(s) Reply with quote

Use another SSE register:
Code:
movhlps xmm1,xmm0 -- move element 2 and 3 to xmm1 (as element 0 and 1)
addps xmm0,xmm0
movlhps xmm0,xmm1 -- move element 0 and 1 to xmm0 (as element 2 and 3)



Code:
before:
xmm0   |   X0  |  X1  |  X2  |  X3  |
-------------------------------------
           2      3      4      5


after:
xmm0   |   X0  |  X1  |  X2  |  X3  |
-------------------------------------
           4      6      4      5



_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Jan 15, 2016 4:47 pm    Post subject: Reply with quote

Awesome. It works. Thanks!

I have to wait to give you +rep. Mr. Green
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites