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

Request Make every move trigger a light shield before activating

Punkline

Dr. Frankenstack
Joined
May 15, 2015
Messages
423
This would go great with Punklines The Impossible Cancel
I'm assuming you just want to be able to use the Impossible Cancel with A and B button presses instead of light shield.

Try pasting this into a text file in your Mods Library for Melee Code Manager. I can make it a gecko code if necessary:

Code:
    -==-

MASTERCODE - Impossible Cancel v0.20
Allows other codes to implement the ICNCv020_softCancel function
Gecko codes can call this function from -0x3060(rtoc) (804DC980)
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code

1.02 ----- 0x802884A0 --- C822CFA0 -> C8228000  # lfd -0x3060(rtoc) becomes lfd -0x8000(rtoc) -- both use 4330000000000000.
1.02 ----- 0x802882C4 --- C822CFA0 -> C8228000  # lfd -0x3060(rtoc) becomes lfd -0x8000(rtoc) -- both use 4330000000000000.
1.02 ----- 0x80287FA8 --- C822CFA0 -> C8228000  # lfd -0x3060(rtoc) becomes lfd -0x8000(rtoc) -- both use 4330000000000000.
1.02 ----- 0x804DC980 --- 43300000 -> Branch
b <ICNCv020_softCancel>  # redirects calls to standalone function 'SoftCancel'
.long 0  # prevents branch from being compiled incorrectly as a return branch

<ICNCv020_softCancel> 1.02
#r3= external player data offset
#experimental
7C0802A6 90010004
9421FF30 D8210008
BC610010 83E3002C
83DF0004 8BBF2073
3B800000 3B600000
3B400000 48000041
7C6802A6 A0830000
5480067F 41820068
7C00E800 40820020
5480C6BE 7C00F000
40820014 549C8FFE
549B97FE 549ACFFE
48000044 A4830002
4BFFFFD0 4E800021
01910194 81138493
0496049C 04A204A9
05948713 47940991
0C948C13 0E940F91
90139313 53941691
16949613 17949713
00000000 807F1A58
2C030000 41820014
8063002C 38000000
90031A4C 480000F8
833F0010 2C190011
408100B0 2C190018
4182004C 2C190027
41820044 2C190029
4180002C 2C19002B
40810034 2C190046
4180001C 2C19004A
40810024 2C1900E9
4180000C 2C1900EC
40810014 2C1D0000
41820068 2C1D0058
41820060 887F221E
60600080 981F221E
807F0000
bl <ICNCv020_animationSpeedCancel>
807F0010 7C03C800
41820010 2C1A0000
4082FED8 48000034
2C1B0000 4082002C
807F0004 2C030007
40820018 807F0010
2C03015E 41820014
2C030161 4182000C
807F0000
bl <ICNCv020_abortActionState>
807F0010 2C03001D
41800034 2C030026
4181002C 2C1C0000
41820024 807F0000
38800001 38A00001
80CDAEB4 C0260340
C0460344 38C00000
bl 0x80096900
8B5F221E 735A007F
9B5F221E B8610010
C8210008 382100D0
80010004 7C0803A6
4E800020


<ICNCv020_animationSpeedCancel> 1.02
#r3= external player data offset
#--sets animation speed to x1000
#--updates player frame stuff, which uses animation speed to create frame unit size
#--updates player article stuff (mask out bit 0x80 of player.0x2270 if you want to avoid projectiles)
#--attempts player animation interrupt check (cancels action state)
#--sets animation speed back to old speed if still == x1000 (cases where cancel fails)
7C0802A6 90010004
9421FFE8 BFC10010
83E3002C C03F089C
D021FFF8 C022E864
807F0000
bl 0x8006f190
807F0000
bl 0x8006eba4
807F0000
bl 0x8006C80C
807F0000
bl 0x8006A360
C002E864 C03F089C
FC010000 40820010
C021FFF8 807F0000
bl 0x8006f190
BBC10010 38210018
80010004 7C0803A6
4E800020


<ICNCv020_abortActionState> 1.02
#r3= external player data offset
#--if player is in air, set animation interrupt to transition into falling
#--else, set animation interrupt to transition into standing
#--set 0x904 to a non-0 value (bypasses frame logic check for next call)
#--attempt player animation interrupt check (cancels action state)
7C0802A6 90010004
9421FFF0 93E10008
83E3002C 887F2073
2C030000 4182003C
807F00E0 2C030000
41820014 3C60800C
6063B2F8 907F21A0
48000010 3C608009
60639E80 907F21A0
38600001 907F08A4
807F0000
bl 0x8006A360
83E10008 38210010
80010004 7C0803A6
4E800020

    -==-

Impossible Cancel v0.20 - on Light Shield
Uses Mastercode
Stable recreation of "Melee Impossible"
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x8006b090--- C03F0650 -> Branch
C03F0650 C0028874
FC000800 4182002C
C03F0654 FC000800
40820020 9061FFF8
7FC3F378 83C1FFF8
bl <ICNCv020_softCancel>
9061FFF8 7FC3F378
83C1FFF8 C0228874
00000000

Impossible Cancel v0.20 - on A and B button presses
Uses Mastercode
Cancel attacks with other attacks that use the A and B buttons
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x8006ad2c --- 93a10064 -> Branch
93A10064 8083002C
88A4000C 1CA50044
3FA0804C 63BD1FB4
7FBD282E 73BD0300
41A20008
bl <ICNCv020_softCancel>
00000000
    -==-
!
ASM - Impossible Cancel v0.20 - on A and B button presses
Uses Mastercode
Cancel attacks with other attacks that use the A and B buttons
[Punkline]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x8006ad2c --- 93a10064 -> Branch
# 8006ad2c : stw r29, 0x0064 (sp)
# beginning of player entity button data update (internal data tables)
# before new frame's buttons are recorded, we look at player's up to date frames
# r3 is in use, other GPRs are free.
# r30 has been backed up
# r29 is backed up after original instruction
.set addr_controller0_instant, 0x804C1FB4
.set controllerStructSize,     0x44
.set AorB_bits,                0x0300
.set playerControllerID,       0xC  # offset is of a byte value

stw   r29, 0x0064 (sp) # original instruction

lwz   r4, 0x2C(r3)     # r4 = player data start
lbz   r5, 0xC(r4)      # load controller ID (player slot)
mulli r5, r5, controllerStructSize
lis   r29, addr_controller0_instant @h
ori   r29, r29, addr_controller0_instant @l

lwzx  r29, r29, r5
# r29 = global controller instant button flags
# these have already been updated, but the player entity has not registered them yet

andi. r29, r29, AorB_bits
beq+ return

# if both A or B button flags are not present, then return without cancelling action state
# else, if either are flagged, then cancel

bl <ICNCv020_softCancel>

return:
.long 0
This will add 3 codes to MCM:
http://i.imgur.com/Hal2RWZ.png


- The first code is a Mastercode that includes the impossible cancel, but does not use it.

- The second code is the old impossible cancel code, using the master code.

- The third code is a new code I just wrote that also uses the master code.
It seems to work well enough -- adding the cancel effect to A and B button presses just before the player entities recognize the buttons.

Note to developers: You can call the impossible cancel effect from -0x3060(rtoc) as though it were a standalone function.
Code:
addi r3, rtoc, -0x3060
mtctr
mr r3, r30  # r3 = player entity start address
bctrl
This enables it for use in gecko codes. I've made this possible by including the static overwrites used for disabled Mytoc block 275.

ASM for the third code is included at the end of the mod in the form of a disabled code. Only lightly tested, so let me know if there are any problems (and perhaps expect them.)
 
Last edited:
Top Bottom