Melee Gecko Codes + Guide and Discussion

Achilles1515

Moderator
Moderator
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Hitstun

Formula:
Hitstun (hitlag counts as 1) = Knockback * 0.4
(From Magus, source)

Function start @: 0x8008dce0
- Formulates and stores hitstun from an attack.



Modifiable Hitstun Code
-inject @ 8008dd5c
- default: lwz r3,-0x514c(r13)
- loads PlCo.dat offset 0x9fe0
- 0x154 + the value that gets put into r3 = 0.4, used in the hitstun calculation.

Code premise: instead of loading 0.4, load whatever value you want to use as hitstun multiplier.
Code:
lwz r3,-0x514c(r13) //default code line
lis r15,0xYYYY
ori r15,r15,0xZZZZ // r15 (arbitrary available register) now equals custom 32-bit floating point number
stw r15,0x154(r3) // stores the float into 0x154+r3, because a few code lines down (code line: 8008dd68), the game loads the hitsun multiplier from this location

where your 32-bit floating point number = 0xYYYYZZZZ

Gecko Code:
C208DD5C 00000003
806DAEB4 3DE0YYYY
61EFZZZZ 91E30154
60000000 00000000
Use this website to convert a normal decimal into a 32-bit floating point.

In terms of the SSBM memory spreadsheet, the data offset for frames of hitstun left is +0x23A0, which gets decremented by one every frame of the game until it reaches zero.
 
Last edited:

Achilles1515

Moderator
Moderator
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Wobbling Kills Nana

Code:
Wobbling Kills Nana (1.02) [Achilles]
C20DB8E0 00000007
3C80C248 909F1A4C
C03F1A4C FC000840
4080001C 3C804400
81FF1A58 81EF0008
2C0F0000 41820008
908F00EC D01F1A4C
60000000 00000000
Injected @ 800db8e0
- default code line = stfs f0,0x1a4c(r31)
- Part of function that decrements the grab breakout counter while pummeling.

Code Notes:
Wobbling disables the game from ever reaching a point of code that compares the grab breakout counter to 0, which would then execute the breakout if the counter is less than or equal to this value.

Nonetheless, the grab breakout counter STILL gets decremented every time the character is hit/pummeled (so after wobbling for a bit, this value is just a big negative number).

The code below is injected when the game decrements the grab breakout counter from a pummel. It compares the breakout counter to -50 (arbitrary negative number, adjustable), and if it is equal to or less than this number, 512 is loaded into Nana's horizontal velocity which kills her instantly.

[COLLAPSE="ASM"]
lis r4,0xc248
stw r4,0x1a4c(r31)
lfs f1,0x1a4c(r31)
fcmpo cr0,f0,f1
bge- END

KILL_NANA:
lis r4,0x4400
lwz r15,0x1a58(r31)
lwz r15,0x8(r15)
cmpwi r15,0
beq- END
stw r4,0xec(r15)

END:
stfs f0,0x1a4c(r31)
[/COLLAPSE]
@Juggleguy
 
Joined
Oct 10, 2011
Messages
1,126
Location
Boise, ID
NNID
dansalvato
Code:
Lagless FoD [Dan Salvato]
041cbbd4 60000000
041cbefc 48000028
041cbf54 60000000
041cbf84 60000000



Note that I haven't yet tested this on a Gamecube, but there's no reason it should lag at this point. I've removed background assets, the pool reflection, and all of the stars (each star was its own point in 3D space).

Also, thanks to Zauron for some useful notes on initializing stages, which I used as a starting point.
 
Last edited:
Joined
Oct 10, 2011
Messages
1,126
Location
Boise, ID
NNID
dansalvato
Code:
Set Menu Music in Sound Test [Dan Salvato]
C224B4D8 00000007
7C7C002E 2C030000
40820008 3860FFFF
808D8840 98641851
3C808046 60849D40
9064005C 2C030000
40800008 38600000
60000000 00000000
C222E934 00000008
3C808046 60849D40
8084005C 2C040000
41820018 41810008
38800000 80AD8840
98851851 7C832378
3D808002 618C3F28
7D8903A6 4E800421
60000000 00000000
The last song you played in Sound Test will become your new menu music. Your choice is saved to the memory card as well, so it will be preserved between boots.
 
Last edited:

Kou

Smash Apprentice
Joined
Nov 22, 2011
Messages
198
Location
Japan
Kou,

I’m leaving this one up you.

Instructions:

1) Play SSBM v1.02 in Debug Dolphin.
2) In the “Memory” tab, hit “Dump MRAM” (ram.raw gets dumped to /Dolphin Emulator/Dump/raw.raw ).
3) Open ram.raw and an SSBM v1.02 DOL file in a hex editor.

Looking at Dan’s code, the RAM offset is 0x800771F0. The ram.raw file starts at 0x80000000.

4) In ram.raw opened up in hex editor, go to 0x771F0. This 32-bit word is the value that Dan is overwriting with his code. Copy that line and the next couple lines (like 10 or so).
5) Now look at the DOL file. Open up the search box (ctrl+f) and paste the copied data. It should find the DOL offset for the exact code that was in the RAM. (You might want to do another search down through the DOL to ensure that it doesn’t find anything again – so you know this is the one and only correct spot.)
6) Overwrite the default value with 0x3B000000 to that location.
7) Done. Test. Post results in the DOL Mod Topic.


Btw, great work, Dan! This is such a good one. Props on sticking it out and chasing around ASM for hours. It takes a great deal of patience, focus, and intuition to reverse engineer things like this.
Thank you Achilles.
I'll try that way!
 
Joined
Dec 19, 2014
Messages
11
Hey guys, I have a question about a video on YouTube called "Melee Impossible" I can't post a link since I'm a new member.
It's basically like PM Turbo Mode, except it's Melee, you can cancel anything into anything. I'm interested to see if this is possible to create some kind of code to do this, cause I can't find it anywhere. Is it possible to do something like this?
 

TerryJ

Smash Journeyman
Joined
Apr 12, 2010
Messages
480
Location
BEST COAST, WA
3DS FC
1337-1337-1337
NNID
1337-1337-1337
Hey guys, I have a question about a video on YouTube called "Melee Impossible" I can't post a link since I'm a new member.
It's basically like PM Turbo Mode, except it's Melee, you can cancel anything into anything. I'm interested to see if this is possible to create some kind of code to do this, cause I can't find it anywhere. Is it possible to do something like this?
The best part about Melee Impossible that PM Turbo mode doesn't have is that everything was manually cancel-able, instead of automatically. (as far as I could tell anyways) That way you can cancel ANYTHING with L/R/Z and it was sooo cool.

I looked very heavily after I first saw the vid, and I couldn't find any info about antd actually posting notes or codes about the hack.


edit:
Here's his website and the comments section! EVERYONE ASK FOR HIS NOOOOOTES
editedit:
the junk on his Twitter says you can contact him in several places, and his newest twitter is here. He's replied to a tweet about how he did it and it sounds like he changed a flag from attack to idle animation, but he did it frame by frame.

@ Achilles1515 Achilles1515 Couldn't you do this with the action state hack? If the player presses L/R/Z, put the respective player into an idle action-state. Seems simple to me but maybe I'm just a dummy. :>
 
Last edited:

Achilles1515

Moderator
Moderator
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Hey guys, I have a question about a video on YouTube called "Melee Impossible" I can't post a link since I'm a new member.
It's basically like PM Turbo Mode, except it's Melee, you can cancel anything into anything. I'm interested to see if this is possible to create some kind of code to do this, cause I can't find it anywhere. Is it possible to do something like this?
The best part about Melee Impossible that PM Turbo mode doesn't have is that everything was manually cancel-able, instead of automatically. (as far as I could tell anyways) That way you can cancel ANYTHING with L/R/Z and it was sooo cool.

I looked very heavily after I first saw the vid, and I couldn't find any info about antd actually posting notes or codes about the hack.


edit:
Here's his website and the comments section! EVERYONE ASK FOR HIS NOOOOOTES
editedit:
the junk on his Twitter says you can contact him in several places, and his newest twitter is here. He's replied to a tweet about how he did it and it sounds like he changed a flag from attack to idle animation, but he did it frame by frame.

@ Achilles1515 Achilles1515 Couldn't you do this with the action state hack? If the player presses L/R/Z, put the respective player into an idle action-state. Seems simple to me but maybe I'm just a dummy. :>
I made a post about this a couple months ago. I really don’t see a point in having a manual cancel code that doesn’t involve using it for TAS purposes. There’s a reason why antdgar’s only video of the code is with TAS and not actual gameplay…it’s just not very applicable.


Think about it. If you wanted a button to be the manual cancel, you wouldn’t want it coincide/take away buttons used in regular gameplay. This leaves you with the dpad buttons, all of which require you to remove your thumb from the main joystick to press (or your right hand all the way over…which is obnoxious), and the pad is just awkward to press with precision in general due to the nature of it being a 4-in-1 button.


And it may not even be a “real” code, because he did everything frame by frame with viewing/editing access to the RAM. So every frame, or just whenever he needed to, he would just force a value to a RAM address to do what he wants which would be easier and more precise than waiting for the game to register a button press.


Technically the action state hack could do something this, like putting a character in fall (air) or wait (ground) when a button is pressed. Obviously, the code has some stability issues with all action states, that would likely need to be addressed are probably not “easy” fixes.


I spent 20 minutes working on a “Turbo Mode” code using Dan’s action state hack, and the main functionality was working, but I needed a new injection point because the one I was using didn’t seem to get executed on every attack hit, and just a lot more work would need to be done to make it a stable game mode. I’ve haven’t done anything with the code since and have no plans to at the moment.

EDIT: Yeah, I just looked at the tweet and its not an actual code.
 
Last edited:

likiji123

Smash Journeyman
Joined
Sep 2, 2014
Messages
319
Location
Australia
3DS FC
2964-9225-5942
NNID
Likiji123
Code:
Set Menu Music in Sound Test [Dan Salvato]
C224B4D8 00000007
7C7C002E 2C030000
40820008 3860FFFF
808D8840 98641851
3C808046 60849D40
9064005C 2C030000
40800008 38600000
60000000 00000000
C222E934 00000008
3C808046 60849D40
8084005C 2C040000
41820018 41810008
38800000 80AD8840
98851851 7C832378
3D808002 618C3F28
7D8903A6 4E800421
60000000 00000000
The last song you played in Sound Test will become your new menu music. Your choice is saved to the memory card as well, so it will be preserved between boots.
This is freaking sweet :D i have all ways wanted this kind of code to come around

......The possibilities are endless
 

TerryJ

Smash Journeyman
Joined
Apr 12, 2010
Messages
480
Location
BEST COAST, WA
3DS FC
1337-1337-1337
NNID
1337-1337-1337
I made a post about this a couple months ago. I really don’t see a point in having a manual cancel code that doesn’t involve using it for TAS purposes. There’s a reason why antdgar’s only video of the code is with TAS and not actual gameplay…it’s just not very applicable.


Think about it. If you wanted a button to be the manual cancel, you wouldn’t want it coincide/take away buttons used in regular gameplay. This leaves you with the dpad buttons, all of which require you to remove your thumb from the main joystick to press (or your right hand all the way over…which is obnoxious), and the pad is just awkward to press with precision in general due to the nature of it being a 4-in-1 button.


And it may not even be a “real” code, because he did everything frame by frame with viewing/editing access to the RAM. So every frame, or just whenever he needed to, he would just force a value to a RAM address to do what he wants which would be easier and more precise than waiting for the game to register a button press.


Technically the action state hack could do something this, like putting a character in fall (air) or wait (ground) when a button is pressed. Obviously, the code has some stability issues with all action states, that would likely need to be addressed are probably not “easy” fixes.

EDIT: Yeah, I just looked at the tweet and its not an actual code.
It's for sure not an actual code, my guess was also that he just edited the value on the fly for what ever he needed, like changing Sheik/Zelda and canceling it, frame by frame.

But, wouldn't you just need to follow a kind of order of operations type thing? It might be a kinda long code but I could see it working. This way you could use L/R/Z in their normal functions.
If the player is standing, running/walking, crouching etc, force L/R to do shield. If the player enters any other state (with an exception of special-fall maybe) have them enter fall if in the air or wait if they're on the ground when L/R/Z is pressed.

I see what you're getting at though, without remapping some buttons it could cause some problems, but I feel with a large enough flowchart kind of thing you could defiantly get manual cancelling working.

I've always been fascinated with the idea of being able to juke people with an approaching Falcon Kick or Punch and then canceling it as soon as they try to shield it then abusing that. The game would be SO MUCH FUN if you could just cancel any move at any time!

Edit:
Wouldn't it be possible to edit each characters .dat files to change the IASA data of each move to 1? I realize this would either take a lot of space to put into an ISO or would require an ISO of it's own but it'd be a start. This would be pretty damned easy to do if the character files are mapped out enough right? Just find the addresses in Master Hand and then edit them with any Hex Editor?

My only problem with this train of thought is that not every move is going to have an IASA data (like special moves probably) so this might only work with grounded (non-special) attacks and aerials.
 
Last edited:

Doq

Smash Lord
Joined
Dec 28, 2012
Messages
1,036
Location
The Lab, Sweet Home, OR
Last edited:

Starreaver1

Smash Apprentice
Joined
Oct 12, 2013
Messages
132
Location
Minneapolis, MN/Princeton, NJ
Does anyone know of a way to boot directly from the title screen to the CSS, and vice versa (in the latter case, via an otherwise unused button like dpad)? The closest I've gotten is getting the title screen to boot to the VS Menu with "Melee" highlighted :/
 

Cyjorg

tiny.cc/19XXTE
Premium
Joined
Nov 18, 2013
Messages
686
Location
Purdue University
Code:
Lagless FoD [Dan Salvato]
041cbbd4 60000000
041cbefc 48000028
041cbf54 60000000
041cbf84 60000000



Note that I haven't yet tested this on a Gamecube, but there's no reason it should lag at this point. I've removed background assets, the pool reflection, and all of the stars (each star was its own point in 3D space).

Also, thanks to Zauron for some useful notes on initializing stages, which I used as a starting point.
Any way you could make those notes public?

Edit: Just kidding I found them
 
Last edited:

Cyjorg

tiny.cc/19XXTE
Premium
Joined
Nov 18, 2013
Messages
686
Location
Purdue University
Does anyone know of a way to boot directly from the title screen to the CSS, and vice versa (in the latter case, via an otherwise unused button like dpad)? The closest I've gotten is getting the title screen to boot to the VS Menu with "Melee" highlighted :/
041BFA20 38600002

Always check the main page first.
 
Last edited:

Starreaver1

Smash Apprentice
Joined
Oct 12, 2013
Messages
132
Location
Minneapolis, MN/Princeton, NJ
041BFA20 38600002

Always check the main page first.
That's to CSS on boot. He wants it to boot to the title screen, then go to CSS upon pressing Start.

e~ And back again
^ I'm specifically looking for this because I have a code that toggles my custom music on/off using the dpad at the CSS, but I can't change the menu music unless the game goes through a loading cycle? So the code only works for in-match music, I've been trying to figure out a way to force a loading cycle or something but I don't quite understand how that works so I haven't been very successful. That's why I want a code to do this, it'd be a very obvious indicator that the in-game music has changed and of course then original music is fully restored when custom music is toggled off.
 

Cyjorg

tiny.cc/19XXTE
Premium
Joined
Nov 18, 2013
Messages
686
Location
Purdue University
Why no love for Pidgit.
The selfish reason - Because Pidgit moves super fast and interrupts my pillaring far too often.
The real reason - I found this through disabling things at the stages init (like IE's lagless FoD) and don't quite understand what the disabled function's purpose is, yet.
 
Last edited:

Achilles1515

Moderator
Moderator
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
In an attempt to make Mushroom Kingdom II suck less...
Code:
Disable Logs, Pidgit, and Birdo on MKII (1.02)  [Jorgasms]
041fcd84 60000000

Disable Logs, Pidgit, and Birdo on MKII (1.00)  [Jorgasms]
041fbcc4 60000000
So does this make Milun's FD-like hack a legit, competitive stage now?
 
Last edited:

Cyjorg

tiny.cc/19XXTE
Premium
Joined
Nov 18, 2013
Messages
686
Location
Purdue University

Achilles1515

Moderator
Moderator
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
[COLLAPSE="Zauron's RAM Stage Hacking Notes (converted to SSBM v1.02)"]
---------------------------
Smash Melee's code keeps a linked list of objects with update functions, which it runs through and calls the update functions every game frame. This list is constantly having objects added to and deleted from it. Each stage adds several objects to the list, and the easiest way to change the stage's behaviour is to tell these functions to not do anything.

Each stage has an initialization function, and while it is possible to find out what function is run for each stage by following a series of several links in memory, the easist way is to put a breakpoint at the address 0x801C0A4C, start the stage you want to mess with, and then step once when the breakpoint is hit. This will put you at the start of that stage's initialization function.

During the initialization function several objects will be added to the update list. To find where the update functions are, starting from the initialization function you found, scroll down the code to find the return code (blr) and put a breakpoint there. Next, put a breakpoint at the address 0x8038FE04. This is part of the function that adds new objects to the list.

Now let the code run until that breakpoint is reached. When it is, look at the address in register #28. This is the address of the update function for the object being added. Keep running the code and jot down the addresses in register 28 until you hit the breakpoint at the end of the stage's initialization function. After that, more objects will be added all the time but they are not related to the stage.

There are two global update functions you will see that should be ignored - 0x801C1cd0 (which updates animations) and 0x801C1D38 (unknown purpose). The rest are likely specific to that stage. Many of those will be nothing more than a return (blr) though, as an "empty" update, so those can also be ignored.

A quick change just to see what happens is to take those update functions and tell them to just return immediately by using a code like 04XXXXXX 4E800020, where XXXXXX is the last 6 digits of the address of the update function. If that does more than you intended, you may need to step through the update functions and find things to change, often just telling it to skip a branch or something using 60000000.

You can also try to mess with the stage's init function, though I've rarely found this useful. One thing that has been useful to know though is that many objects have init functions of their own, where additional steps are taken. For example, I had to edit the init function for the main stage platform of Green Green's in order to get rid of the initial yellow blocks. You can find these in a similar way to finding the update functions - while in the stage's init function, put a breakpoint at 0x802135b0 (?) (0x802122F8 1.00 value) and step once to get into the init function of initialized objects for that stage.
[/COLLAPSE]
 

Achilles1515

Moderator
Moderator
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Metal Texture as an Alternate Costume
See this post first.
Yesterday, I decided to look into the knockback equation and found out that if a character is metal, 30 is automatically subtracted from their knockback (which then lowers hitstun as well). This check is performed in the same function that looks to see if a character is crouching (crouch canceling) or charging a smash attack which increases knockback.

So I wrote a code to disable the metal check, and I think I now have metal as a viable alternate costume! I need you guys to test and play around with this to make sure, though.

[COLLAPSE="P1 is Metal"]
Code:
0408d9f8 38000000
C216CE0C 00000004
3DE08045 81EF3130
2C0F0000 4182000C
3A000001 9A0F2283
38630001 00000000
[/COLLAPSE]
[COLLAPSE="P2 is Metal"]
Code:
0408d9f8 38000000
C216CE0C 00000004
3DE08045 81EF3FC0
2C0F0000 4182000C
3A000001 9A0F2283
38630001 00000000
[/COLLAPSE]
Note: These are just proof of concept codes.

@NME @Goatlink @ DRGN DRGN


Merry Christmas, Melee Workshop Elves!
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,014
Location
Sacramento, CA
Metal Texture as an Alternate Costume
See this post first.
Yesterday, I decided to look into the knockback equation and found out that if a character is metal, 30 is automatically subtracted from their knockback (which then lowers hitstun as well). This check is performed in the same function that looks to see if a character is crouching (crouch canceling) or charging a smash attack which increases knockback.

So I wrote a code to disable the metal check, and I think I now have metal as a viable alternate costume! I need you guys to test and play around with this to make sure, though.

[COLLAPSE="P1 is Metal"]
Code:
0408d9f8 38000000
C216CE0C 00000004
3DE08045 81EF3130
2C0F0000 4182000C
3A000001 9A0F2283
38630001 00000000
[/COLLAPSE]
[COLLAPSE="P2 is Metal"]
Code:
0408d9f8 38000000
C216CE0C 00000004
3DE08045 81EF3FC0
2C0F0000 4182000C
3A000001 9A0F2283
38630001 00000000
[/COLLAPSE]
Note: These are just proof of concept codes.

@NME @Goatlink @ DRGN DRGN


Merry Christmas, Melee Workshop Elves!
Cool! I'm not at home ATM, but I'll check this out later. Are you planning to include this as an alt in 20XX?
 
Top