• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

X/Y-Axis Pause Camera Translation with C-Stick

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
X/Y-Axis Pause Camera Translation with C-Stick (1.02) [Achilles]
Code:
C202CB34 0000000C
7C040774 3E00804C
62101FD4 1DE00044
7E107A14 C022C3D8
FE200850 C1F00000
FC0F0840 4081000C
FC0F8840 41800010
C21F0314 FE0F802A
D21F0314 C1F00004
FC0F0840 4081000C
FC0F8840 41800010
C21F0318 FE0F802A
D21F0318 00000000
First attempt (bad injection point, no dead zone).

This new rewrite does not freeze on console and contains a dead zone so resting offsets from the origin position do not cause constant camera movement.


Code:
************************************************
* X/Y Axis Pause Screen Translation w/ C-Stick *
************************************************

PAUSE Camera Offsets:
80452f2c - [8bit] player the camera is focused on
80452f2d - [8bit] player who paused the game.

80452f7c = x pause camera translation
80452f80 = y pause camera translation
80452f84 = z pause camera translation

(p1)
4c1fd4 = x c-stick axis
4c1fd8 = y c-stick axis

(p3)
4c2060 = y axis

...so each player's c-stick axis is 0x44 away from one another!

-0x3C28(rtoc) = -0.200
      - good c-stick dead zone value

inject @ 8002cb34
- function for storing pause camera offsets
-r30 = 80452C68

#default code line
extsb r4,r0

#player number who paused game is in r0
#get to this player's c-stick values (-1.00 to 1.00)
lis r16,0x804c
ori r16,r16,0x1fd4
mulli r15,r0,0x44
add r16,r16,r15

#load dead zone (-0.2)
lfs f1,-0x3c28(rtoc)
fneg f17,f1

C_STICK_X:
#load c-stick x axis
lfs f15,0(r16)
#check if in dead zone. If so, skip to y c-stick
fcmpo cr0,f15,f1
ble- C_STICK_X_GO
fcmpo cr0,f15,f17
blt- C_STICK_Y

C_STICK_X_GO:
#load current x translation
lfs f16,0x314(r31)
#add x c-stick value to x-translation
fadd f16,f15,f16
#store back
stfs f16,0x314(r31)

C_STICK_Y:
#load c-stick y axis
lfs f15,0x4(r16)
#check if in dead zone. If so, skip to end
fcmpo cr0,f15,f1
ble- C_STICK_Y_GO
fcmpo cr0,f15,f17
blt- END

C_STICK_Y_GO:
#load current y translation
lfs f16,0x318(r31)
#add y c-stick value to y-translation
fadd f16,f15,f16
#store back
stfs f16,0x318(r31)
END:
 
Last edited:

MeleePlayer5

Smash Rookie
Joined
Nov 25, 2015
Messages
2
Here is a DOL mod I made for this code (version 1.2):

@29714
7c040774 -> 4BFD6A98

@5CC
7C040774 3E00804C
62101FD4 1DE00044
7E107A14 C022C3D8
FE200850 C1F00000
FC0F0840 4081000C
FC0F8840 41800010
C21F0314 FE0F802A
D21F0314 C1F00004
FC0F0840 4081000C
FC0F8840 41800010
C21F0318 FE0F802A
D21F0318 48029510
 
Top Bottom