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

Completed New & Updated Neutral-B Charge Loss Fixes (DK, Samus, Sheik, Kirby)

PKFreeZZy

Smash Cadet
Joined
Aug 21, 2016
Messages
60
Location
Hungary
Slippi.gg
VETR#758
Hey everyone!

I suppose this small project shall mark my entry into the coding category of mods; I was quite dissatisfied that both DK and Samus Up-B fix versions until now had a side effect I didn't want, so I decided to go ahead and fix the fixes myself. I've also fixed Kirby losing his charge upon being hit out of any of his specials and Sheik losing her needles when hit out of her Side-B. Here they are:

Code:
$DK - Preserve Giant Punch if Hit During Up-B v2 (Fixed) [PKFreeZZy]
0410FB64 38030074
0410FC44 38030074
0410FEC8 38030074
0410FF90 38030074
0411000C 38030074
While there are already three other versions of this code, they all have their twists: normally, if DK has charged his Giant Punch and is hit while still in the wind-up animation, the charge level resets. VietGeek's Up-B charge loss fix disables the line of code that removes his charge, which is also run if DK is hit while in said animation, meaning he'd keep his charge if he was hit anyway. Achilles1515 ported this code into 20XX and made it so it only applies to PAL and SD Remix DK.

UnclePunch's code fixes the wind-up issue by nop'ing a line from his Up-B that stores the address of the combined version of Giant Punch discharge and the graphics removal functions into memory for later use, but this introduces a new glitch: if DK is hit out of Up-B, the whirlwind texture animation isn't cancelled and continues to play all the way through... in the best case. Sometimes, it completely freezes, detaches from DK, and lingers until Up-B is used again, though sometimes it stays until DK gets KO'd.

Now, I fixed both of these issues in my version, however, there was still a hidden quirk left which I kept shrugging off as a stray Neutral-B input that slipped in: he also loses the charge if transitioning from Up-B's grounded state to its aerial state, and vice versa, which I've only recently come to realize. Normally, Up-B only stores the discharge + GFX removal in his action state handler function, but there is an exception: performing a ground <-> air state transition will also run the same store instruction from his collision interrupt function, therefore overwriting the one performed by the AS handler.

With the current revision, the game now loads the address of the standalone DK Graphics Removal function during all affected functions of Up-B before storing it into memory, solving all previous issues and making the move work as it does in PAL.
Code:
$Samus - Preserve Charge Shot if Hit During Up-B (Fixed) [PKFreeZZy]
0412A6AC 3C608006
0412A6B4 3803B880
0412A778 3C608006
0412A780 3803B880
The previous Samus codes have the same background as DK's, with the charge animation interrupt and texture animation glitches, except I couldn't find the fix in 20XX. This new code also loads the standalone graphics removal function into register 0 during Up-B. Fortunately, Samus does not require fixes for ground <-> air transition, because it actually never happens in her case! Samus technically never transitions to Up-B's aerial state if used on the ground and will always enter LandingFallSpecial upon landing with Up-B.
Code:
$Sheik - Preserve Needles if Hit During Side-B v2 [PKFreeZZy]
0411118C 38030E88
0411149C 38030E88
04111540 38030E88
041118A0 38030E88
041119F0 38030E88
04111D0C 38030E88
04111DB0 38030E88
04111E5C 38030E88
04111F18 38030E88
I don't know if anyone has created a code for this before, so I made one myself. In vanilla Melee, just like DK and Samus, Sheik's Side-B also runs a combined function that removes her needle charge state and chain graphics. Again, loading the standalone chain removal function into register 0 fixes the issue.
Code:
Kirby - Preserve Copy Ability Charge if Hit Out of Non-Copied Specials v2 [PKFreeZZy]
C20EE7CC 00000002
7C7E1B78 83E3002C
2C1C018E 00000000
040EE7D0 40810008
040EE7D4 480032B9
040EE7F4 48006D31
Kirby's previous charge loss fix also follows the same principle of nop'ing a line that eliminates the charge removal function entirely, enrolling Kirby into the 'charge animation immunity gang.'

Now, Kirby is a REALLY weird case: if he has a copy ability whose charge can be stored, there IS some level of charge stored, and he is hit out of ANY SPECIAL (yes, any four of them,) he loses the charge. In addition to this, if Kirby has charged one of these copy abilites and it's his first time being hit wearing this newly copied ability, he ALSO loses the charge. They really did poor Kirby like this.

This happens because Kirby has an 'OnSpecialHit' function which runs... pretty much everything at once. It includes a combined function which contains 'removal' code for all of his copy abilites.

It took me a while to figure this out since I'm new to ASM, but in the end I replaced the line at memory address 0x800EE7CC with an injection that runs the original code from this address and the one that follows, as well as a comparison that checks if register 28 is holding an action state ID less than or equal to 398 (Kirby's Aerial Down-B Exit) and skips 8 bytes ahead, across an 'if equal or less' branch. Normally, this skipped branch leads to Kirby's hammer removal function, and the final branch removes copy ability charge and despawns their effects if applicable. Swapping the order of these branches with one another makes it so that if Kirby's Action State ID is Aerial Down-B Exit or anything lower than it, the game skips the copy discharge function and runs everything else, properly despawning items, resetting rotation and removing graphics, etc. If it's greater, it runs as it normally would.

This approach also fixes Kirby's 'fresh copy dilemma' glitch, since the game now only runs the copy discharge function during copied specials, as it should.

EDIT: 8/26/2021 - Updated the code for Kirby because it overwrote two crucial instructions. Surprisingly, I couldn't get the game to crash even with them gone, but I've rewritten it anyway so the original code is also run before the game determines whether to remove Kirby's charge!

EDIT 2: 9/20/2021 - Updated DK code to account for charge loss when hit after ground <-> air transition while still in Up-B animation.

EDIT 3: 9/25/2021 - Updated Sheik code to v2; overlooked a few instances of the oversight in her callbacks.
 
Last edited:

PKFreeZZy

Smash Cadet
Joined
Aug 21, 2016
Messages
60
Location
Hungary
Slippi.gg
VETR#758
Updated the codes for DK, Sheik, and Kirby if anyone happens to be using the old ones!
 
Last edited:
Top Bottom