• 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!

L+R+A+Start ends match with Pause off

ssknight7

Smash Apprentice
Joined
Oct 8, 2014
Messages
136
This would let you end the match as you can in the pause screen even if Pause is turned off.
 

Sickolas

Smash Apprentice
Joined
Feb 25, 2014
Messages
191
Location
Mobile, AL
I decided to try my hand at coding and ended up doing this because it sounded cool. I didn't find a function to branch to that ends the game but I found one that just resets it. If you use 20XX It will just boot right back to the CSS. Only bad thing is you lose character/name selection and stars.


L+R+A+Start Resets Game While Pause Is Off(1.02)[Sickolas]
Code:
C2050D68 0000000D
3E808045 6294BF18
82B40000 56B305EF
40A2004C 3AA00000
3E808046 6294B108
82740000 567201CF
4182001C 567200C7
41820014 56720253
4182000C 56720295
40820018 3AB50001
2C150004 40800010
3A94000C 4BFFFFCC
481A1BF0 7C0802A6
60000000 00000000
Here's the commented assembly

Code:
#Injection point at 80050d68. It's some function that gets executed every frame while in a game. Not sure what it does.

lis r20,0x8045
ori r20,r20,0xBF18
#Load the Additional Rules memory address into r20
lwz r21,0(r20)
#Load the actual hex for the rules into r21
rlwinm. r19,r21,0,23,23
bne+ 0x4C
#If pause is enable, skip to the end of the code
li r21,0
#clear r21 to be used as a player counter
lis r20,0x8046
ori r20,r20,0xB108  
#load the hex address for player 1's inputs into r20
lwz r19,0(r20)
#load the input data into r19
rlwinm. r18,r19,0,7,7
beq- 0x1C
#If a is not being pressed, skip to the player increment
rlwinm. r18,r19,0,3,3
beq- 0x14
#If Start is not being pressed, skip to the player increment
rlwinm. r18,r19,0,9,9
beq- 0x0C
#If L is not being pressed, skip to the player increment
rlwinm. r18,r19,0,10,10
bne- 0x18
#Finally if LRASTART are pressed, skip to reset function
addi r21,r21,1
#Increment counter by one
cmpwi r21,4
bge- 0x10
#If greater than or equal to four, skip to the end of the code
addi r20,r20,12
#Add 12 to the input address, so it loads the next player's inputs for the next loop
b 0xFFFFFFCC
#Branch back to line 9
b 0x1A1BE4
#This branches to the reset function
mflr r0
#This was the original line
I think I still have to go back and make the "b 0x1A1BE4" branch dynamically from where it's inserted into the code, because it probably won't go into the same place every time, but I'm not sure since this is my first one.

Haven't had any crashes and works for all 4 players. Let me know if something's wrong and I will fix it.
 
Last edited:
Joined
Oct 10, 2011
Messages
1,126
Location
Boise, ID
NNID
dansalvato
@ Sickolas Sickolas Congrats on writing your first code. :)
You're right that you have to change that one branch. Do this:

lis r12,0x80ab
ori r12,r12,0xcdef
mtctr r12
bctrl

That branches to 0x80abcdef. Change to your desired line, of course.
Also, note that for in-code branches, you can use labels, like this.

Code:
SOMETHING:
stb r4,0(r3)
addi r3,r3,1
cmpwi r3,8
bne SOMETHING
Much more readable and it beats calculating branch values by hand.
 

Sickolas

Smash Apprentice
Joined
Feb 25, 2014
Messages
191
Location
Mobile, AL
Wow this is so much better.

Edited Gecko code and ASM

L+R+A+Start Resets Game While Pause Is Off(1.02)[Sickolas]
Code:
C2050D68 0000000E
3E808045 6294BF18
82B40000 56B305EF
40A20058 3AA00000
3E808046 6294B108
82740000 567201CF
4182001C 567200C7
41820014 56720253
4182000C 56720295
40820018 3AB50001
2C150004 4080001C
3A94000C 4BFFFFCC
3D80801A 618C4510
7D8903A6 4E800421
7C0802A6 00000000


Code:
#Injection point at 80050d68. It's some function that gets executed every frame while in a game. Not sure what it does.

lis r20,0x8045
ori r20,r20,0xBF18
#Load the Additional Rules memory address into r20
lwz r21,0(r20)
#Load the actual hex for the rules into r21
rlwinm. r19,r21,0,23,23
bne+ EXIT
#If pause is enabled, skip to EXIT
li r21,0
#clear r21 to be used as a player counter
lis r20,0x8046
ori r20,r20,0xB108    
#load the hex address for player 1's inputs into r20
LOAD:
lwz r19,0(r20)
#load the input data into r19
rlwinm. r18,r19,0,7,7
beq- COUNTER
#If a is not being pressed, skip to COUNTER
rlwinm. r18,r19,0,3,3
beq- COUNTER
#If Start is not being pressed, skip to COUNTER
rlwinm. r18,r19,0,9,9
beq- COUNTER
#If L is not being pressed, skip to COUNTER
rlwinm. r18,r19,0,10,10
bne- RESET
#If LRASTART are all pressed, skip to RESET
COUNTER:
addi r21,r21,1
#Increment counter by one
cmpwi r21,4
bge- EXIT
#If greater than or equal to four, skip to EXIT
addi r20,r20,12
#Add 12 to the input address, so it loads the next player's inputs for the next loop
b LOAD
#Loop
RESET:
lis r12,0x801a
ori r12,r12,0x4510
mtctr r12
bctrl
#This branches to the reset function
EXIT:
mflr r0
#This was the original line
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
L+R+A+START to Pause Game when Pause is Disabled (1.02) [Achilles]
0416caa8 60000000
0416cc28 60000000
C216BDF0 00000006
89DD24CA 55CEEFFF
41820020 80030000
70031160 2C031160
4082000C 38001000
48000008 38000000
540004E6 00000000

Code:
Function:
8016ca68  Pause_IngameCheckPauseOnOff
8016bc74  Pause_CheckButtonsToPause
8016cbe8  Pause_CheckButtonsToUnpause

#enable checking for pause even with Pause: Off
0416caa8 60000000

#enable checking for unpause even with Pause: Off
0416cc28 60000000

----------------------------------------------------------

ASM injection point: 8016bdf0
-  Part of function Pause_CheckButtonsToPause.
-  Line immediately after a player’s instant button presses are placed into r0.
-  This code line checks the instant button presses for the start button.


lbz r14,0x24ca(r29)  #load current match flag that includes if pause is on/off
rlwinm. r14,r14,29,31,31  #pull out the bit (00000008) and compare to 0
beq- NORMAL  #if pause is enabled, branch down to the default code line like normal

# if pause is disabled…
lwz r0,0(r3)  # load all button presses in this frame, instead of looking at instant buttons
andi. r3,r0,0x1160  # L+R+A+START button flags = 0x1160
cmpwi r3,0x1160
bne- NO_PAUSE  #if current buttons being pressed do not consist of L+R+A+START, don’t pause
li r0,0x1000  #load 0x1000 into register for button press check --> will pass start button check
b NORMAL

NO_PAUSE:
li r0,0  # load 0 into register for button press check --> will fail start button check

NORMAL:
rlwinm r0,r0,0,19,19  # default code line, pulls out start button bit (00001000)
Let me know if there are any problems.
 
Last edited:

Sham Rock

Smash Apprentice
Joined
Feb 10, 2014
Messages
95
Location
Outside of your grab range
L+R+A+START to Pause Game when Pause is Disabled (pal) [Achilles,rice]
0416d478 60000000
0416d5f8 60000000
C216c7c0 00000006
89DD24CA 55CEEFFF
41820020 80030000
70031160 2C031160
4082000C 38001000
48000008 38000000
540004E6 00000000
 
Last edited:

Noc

Smash Journeyman
Joined
Dec 30, 2008
Messages
225
Location
Galveston, TX
L+R+A+START to Pause Game when Pause is Disabled (1.02) [Achilles]
0416caa8 60000000
0416cc28 60000000
C216BDF0 00000006
89DD24CA 55CEEFFF
41820020 80030000
70031160 2C031160
4082000C 38001000
48000008 38000000
540004E6 00000000

Let me know if there are any problems.
I tested this on console and it works but noticed a minor problem: if player 1 presses L+R+A+START after losing all his stocks in a teams or FFA match, the game freezes. Is it possible to fix this?
 
Top Bottom