• Before registering an account on PlayerSquared you must first agree that you are at least 13 years of age & have read & agree to our Terms & rules & our Privacy policy.

V PS3 CFW BLES Smooth Scroll (ASM/C)

Status
Locked.

NotYourDope

ʕ•̫͡•ʔ
VIP MEMBER
January 12, 2019
175
477
1,375
Hi PlayerSquared, today I present to you my smooth scroll code.

ASM
Code:
:SmoothScroll_ //(float destinationCoord, float currentCoord)
Function 2 5 0
getF1 0
setF1 5
getF1 1
JumpFalse @EndSmoothScroll_
getF1 0
getF1 1
JumpLT @SubFromScrollbarCoord_
getF1 0
getF1 1
JumpGT @AddToScrollbarCoord_
Jump @EndSmoothScroll_
:SubFromScrollbarCoord_
getF1 1
getF1 0
fSub
fPush 0.007
JumpLE @EndSmoothScroll_
getF1 1
getF1 1
getF1 0
fSub
fPush 1.7
fDiv
fSub
setF1 5
Jump @EndSmoothScroll_
:AddToScrollbarCoord_
getF1 0
getF1 1
fSub
fPush 0.007
JumpLE @EndSmoothScroll_
getF1 1
getF1 0
getF1 1
fSub
fPush 1.7
fDiv
fAdd
setF1 5
:EndSmoothScroll_
getF1 5
Return 2 1 //scrollbarCoord

C
Code:
float SmoothScroll(float destinationCoord, float currentCoord)
{
float newCoord = destinationCoord;
if (!(currentCoord == 0.0f))
{
if (destinationCoord < currentCoord)
{
if (!(currentCoord - destinationCoord <= 0.007f))
{
newCoord = currentCoord - (currentCoord - destinationCoord) / 1.7f;
}
}
if (destinationCoord > currentCoord)
{
if (!(destinationCoord - currentCoord <= 0.007f))
{
newCoord = currentCoord + (destinationCoord - currentCoord) / 1.7f;
}
}
}
return newCoord;
}
 
Last edited by a staff member:
Status
Locked.