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 


Increase XMM7 only when positive?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
jonboy999
Newbie cheater
Reputation: 0

Joined: 21 Oct 2023
Posts: 20

PostPosted: Thu Jun 27, 2024 11:26 am    Post subject: Increase XMM7 only when positive? Reply with quote

Hi all, the second value in xmm7 is my upwards velocity, so what i want to do is double this value when the value is positive and if its negative leave it alone.

Currently i can double the second value and it makes me jump higher but because all velocity is being doubled i fall to the ground like instantly, i want to keep that high jump but keep the standard falling velocity the same instead of doubling.

So basically i want to double the second space in xmm7 if its a positive number and if its negative ignore.

Can someone help me create the asm for this as everything i try to compare that second slot doesnt work

thanks
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 146

Joined: 06 Jul 2014
Posts: 4471

PostPosted: Thu Jun 27, 2024 12:28 pm    Post subject: Reply with quote

I'm guessing it's a float.
Straightforward approach:
Code:
newmem:
  sub rsp,10
  movups [rsp],xmm7
  xorps xmm7,xmm7
  ucomiss xmm7,[rsp+4]
  jae code

  movss xmm7,[rsp+4]
  addss xmm7,xmm7
  movss [rsp+4],xmm7

code:
  movups xmm7,[rsp]
  add rsp,10

  // original code
  ...
  jmp return
There's also stuff you can do with shufps, but that's kind of hard to keep track of
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
jonboy999
Newbie cheater
Reputation: 0

Joined: 21 Oct 2023
Posts: 20

PostPosted: Fri Jun 28, 2024 12:20 pm    Post subject: Reply with quote

ParkourPenguin wrote:
I'm guessing it's a float.
Straightforward approach:
Code:
newmem:
  sub rsp,10
  movups [rsp],xmm7
  xorps xmm7,xmm7
  ucomiss xmm7,[rsp+4]
  jae code

  movss xmm7,[rsp+4]
  addss xmm7,xmm7
  movss [rsp+4],xmm7

code:
  movups xmm7,[rsp]
  add rsp,10

  // original code
  ...
  jmp return
There's also stuff you can do with shufps, but that's kind of hard to keep track of


Thanks mate will give it a try
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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