• 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.
  • Save Wizard Discord Announcement

    Our previous Save Wizard Discord server was taken over, and we no longer control it. We've opened a new server where you can reconnect with the community, get help, and keep up with announcements.

    Please use the invite below to join us, and share it with anyone who was in the old server.

    Join the new Save Wizard Discord

    Thanks for sticking with us. See you in the new server!

V PS3 CFW BLES Smooth Scroll (ASM/C)

Status
Locked.

NotYourDope

ʕ•̫͡•ʔ
VIP MEMBER
January 12, 2019
176
487
414
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.