• 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 Taunt input during hitlag to play SFX

rmn

Smash Rookie
Joined
Feb 15, 2016
Messages
15
Location
Alabama
Similar in effect to the various attack taunt inputs in PM. If you are the attacker, input taunt during hitlag to play whatever sound effect you have set up to play for that move.

The sound can only play if the soundbank it's in is loaded, so you will only be able to access SFX for characters that are in the current game.

I'm not sure if there's a full SFX ID list for Melee. If not, you can find a sound effect's ID by putting a breakpoint at 8038cff4 and making the sound effect play. R3 will contain its ID.

C206A26C NNNNNNNN
8003065C 54000739
418200A8 480000BD
7C8802A6 80A40000
7CA903A6 1CA50002
38A50001 1CA50004
7C842A14 80C30004
80E30010 C0A303E8
FCA0281E D8A1FFF8
8101FFFC 3884FFF8
88040000 7C003000
40820030 80040000
5400C43E 7C003800
40820020 88040003
7C080000 41800014
88040004 7C080000
41810008 4800000C
4200FFC4 4800002C
80640004 5463023E
388000FE 38A00080
38C00020 38E00007
3C008038 6000CFF4
7C0803A6 4E800021
3C008006 6000A270
7C0803A6 C0028870
4E800020 60000000
4E800021 PPPPPPPP
UUVVVVXX YYZZZZZZ
60000000 00000000



NNNNNNNN: Number of lines in the code minus the top line, in hex.
PPPPPPPP: Number of UUVVVVXX YYZZZZZZ option sets.

UUVVVVXX YYZZZZZZ: Add a hitlag taunt SFX to one action state.
UU: Character internal ID
VVVV: Action State ID
XX: Frame Window Start (use the frame window to only play the sound for a strong hit or only for a weak hit)
YY: Frame Window End
ZZZZZZ: SFX ID to play

An arbitrary number of UUVVVVXX YYZZZZZZ entries can be added, as long as N and P are updated appropriately.

This example uses the options shown in the source given below.
  • Input taunt during Falcon's strong knee hit to HYES
  • Input taunt during grounded raptor boost hit to eagle screech
  • Input taunt during Game and Watch's 9 hammer hit to ring the bell
C206A26C 0000001E
8003065C 54000739
418200A8 480000BD
7C8802A6 80A40000
7CA903A6 1CA50002
38A50001 1CA50004
7C842A14 80C30004
80E30010 C0A303E8
FCA0281E D8A1FFF8
8101FFFC 3884FFF8
88040000 7C003000
40820030 80040000
5400C43E 7C003800
40820020 88040003
7C080000 41800014
88040004 7C080000
41810008 4800000C
4200FFC4 4800002C
80640004 5463023E
388000FE 38A00080
38C00020 38E00007
3C008038 6000CFF4
7C0803A6 4E800021
3C008006 6000A270
7C0803A6 C0028870
4E800020 60000000
4E800021 00000003
0200420E 1000EAA6
02015E00 FF00EAAF
18016B00 FF046CD6
60000000 00000000

Code:
# Input taunt while your attack connects to play a sound effect [rmn]
# Inject at 8006a26c
#
# Allows configuring any attack to play a chosen sound effect if
#  taunt is input during hitlag.
#
# Usage examples are included in the data section - replace as needed.

# Exaluated every frame of hitlag
# r3 = player data pointer
lwz  r0, 0x65c(r3)  # button inputs
rlwinm. r0, r0, 0, 28, 28 # check dpad up
beq  done

bl  get_data
mflr  r4  # data pointer
lwz  r5, 0(r4)
mtctr  r5
mulli  r5, r5, 2
addi  r5, r5, 1
mulli  r5, r5, 0x4
add  r4, r4, r5

lwz   r6, 0x4(r3)  # character ID
lwz  r7, 0x10(r3)  # action state
lfs  f5, 0x3e8(r3)  # frame (float)
fctiwz  f5, f5
stfd  f5, -8(r1)
lwz  r8, -4(r1)  # frame (int)

loop_start:
subi  r4, r4, 0x8
lbz  r0, 0(r4)
cmpw  r0, r6  # check character ID
bne  continue
lwz  r0, 0(r4)
rlwinm  r0, r0, 24, 16, 31
cmpw  r0, r7  # check action state
bne  continue
lbz  r0, 3(r4)
cmpw  r8, r0  # check frame
blt  continue
lbz  r0, 4(r4)
cmpw  r8, r0
bgt  continue
b  play_sfx

continue:
bdnz  loop_start
b  done

play_sfx:
lwz  r3, 4(r4)  # SFX ID
rlwinm  r3, r3, 0, 8, 31
li   r4, 0xfe  # volume
li  r5, 0x80
li   r6, 0x20
li   r7, 0x7
lis   r0, 0x8038
ori   r0, r0, 0xcff4
mtlr   r0
blrl  # play sfx

done:
lis  r0, 0x8006  # done like this so changing data section in gecko code
ori  r0, r0, 0xa270  # form doesn't require recalculating branches
mtlr  r0
lfs   f0, -0x7790(r2)
blr
nop  # just to put the 2 input fields on the same line as each other

get_data:
blrl

#### Options: Modify this section to choose what action states will be affected
.long  3  # Number of fields in the list below.
  # This will equal the number of taunt sfx added

# Attacks to add a taunt SFX to:
# Each entry is composed of two 32 bit fields:
# UUVVVVXX YYZZZZZZ
#  UU:  Character ID
#  VVVV:  Action State ID
#  XX:  Frame Window Start
#  YY:  Frame Window End
#  ZZZZZZ: SFX ID   
.long  0x0200420e  # Falcon strong knee taunt = HYES
.long  0x1000eaa6

.long  0x02015e00  # Falcon grounded raptor boost taunt = eagle screech
.long  0xff00eaaf

.long  0x18016b00  # G&W 9 hammer taunt = bell ring
.long  0xff046cd6
 
Top Bottom