UnclePunch
Smash Ace
- Joined
- Nov 9, 2014
- Messages
- 673
Useful for close matches with result screen skipped, can be used with "KO Star Indicates Previous Winner".
Thanks to @Punkline , I used his code here as a base for this one. Thank you so much for having such well commented code
Thanks to @Punkline , I used his code here as a base for this one. Thank you so much for having such well commented code
Code:
$Winner's Name Said at GAME [UnclePunch,Punkline]
C22F731C 0000000D
807E000C 3C800007
6084C855 7C032000
40A20050 38800006
7C8903A6 3C808045
60843080 80040000
2C000000 41A20014
8804008E 2C000000
41A20008 48000010
38840E90 4200FFE0
48000018 88640007
3DC08016 61CE8C5C
7DC903A6 4E800421
60000000 00000000
Code:
#Character Name at GAME! [Punkline, Achilles,UnclePunch]
#@802f731c: lwz r3,0xC (r30) (Loads SFX ID of pending announcer sound effect)
#r0,r3,r4,r5, cr0, ctr are safe
#r30 = static BA of SFX ID values; baked into DOL
#--When announcer says "GAME!" each player block is checked
#--If a player has 0% and lost no stock, the SFX ID is replaced with "WOW, INCREDIBLE!"
lwz r3, 0xC(r30) #loading a SFX ID for a call that (only?) plays announcer sounds
lis r4, 0x7
ori r4, r4, 0xc855 #0x7c855 is SFX ID for "GAME!"
cmpw r3, r4 #we only want to intercept this particular ID
bne+ return
li r4, 6
mtctr r4 #there are 6 static player blocks to check
lis r4, 0x8045
ori r4, r4, 0x3080 #r4 = player block BA
#this loops once for each block
playerBlockCheck:
lwz r0, 0(r4)
cmpwi r0, 0 #an inactive player block will store "0" at offset 0x0
beq+ nextPlayerBlock #so only check active players
lbz r0, 0x8e(r4) #check number of stocks remaining
cmpwi r0, 0
beq+ nextPlayerBlock #if 0, move on to next player
b jv5 #if player has more than 0 stocks left, they are the winner
nextPlayerBlock:
addi r4, r4, 0xe90 #blocks are 0xe90 in length
bdnz+ playerBlockCheck
b return #if all players have been checked, then nobody got jv5 conditions
jv5:
lbz r3,0x7(r4) #get character ID from block and place into r3
lis r14,0x8016
ori r14,r14,0x8c5c
mtctr r14
bctrl #branch to getCharacterNameSFX function
return:
Last edited: