Completed Unique Victory Themes

Joined
Nov 9, 2014
Messages
632
#1
https://streamable.com/ihd4l

Code:
$Unique Victory Themes v1.1 [UnclePunch]
*/audio/ff_luigi.hps = Luigi Victory Theme
*/audio/ff_bowser.hps = Bowser Victory Theme
*/audio/ff_mewtwo.hps = Mewtwo Victory Theme
*/audio/ff_peach.hps = Peach Victory Theme
*/audio/ff_jiggly.hps = Jigglypuff Victory Theme
*/audio/ff_zelda.hps = Zelda/Sheik Victory Theme
*/audio/ff_falco.hps = Falco Victory Theme
*/audio/ff_ylink.hps = Young Link Victory Theme
*/audio/ff_drmario.hps = Dr. Mario Victory Theme
*/audio/ff_roy.hps = Roy Victory Theme
*/audio/ff_pichu.hps = Pichu Victory Theme
*/audio/ff_ganon.hps = Ganon Victory Theme
043d54bc 00000100 #luigi
043d54ac 00000101 #bowser
043d54d4 00000102 #mewtwo
043d54e4 00000103 #peach
043d54fc 00000104 #jiggs
043d5524 00000105 #falco
043d552c 00000106 #ylink
043d5534 00000107 #doc
043d553c 00000108 #roy
043d5544 00000109 #pichu
043d554c 0000010A #ganon
043d5514 0000010B #zelda
043d551c 0000010B #sheik
04023f54 4800000c
04023f74 4800000c
C2023F80 00000028
2C030100 41800134
7DE802A6 48000069
7DC802A6 7DE803A6
3863FF00 1C630010
7C837214 7C962378
7C832378 3DC08033
61CE796C 7DC903A6
4E800421 2C03FFFF
40820014 3DC08002
61CE4014 7DC903A6
4E800420 7EC4B378
806D8234 7C7F1A14
38630080 3DC08002
61CE3F98 7DC903A6
4E800420 4E800021
66665F6C 75696769
2E687073 00000000
66665F62 6F777365
722E6870 73000000
66665F6D 65777477
6F2E6870 73000000
66665F70 65616368
2E687073 00000000
66665F6A 6967676C
792E6870 73000000
66665F66 616C636F
2E687073 00000000
66665F79 6C696E6B
2E687073 00000000
66665F64 726D6172
696F2E68 70730000
66665F72 6F792E68
70730000 00000000
66665F70 69636875
2E687073 00000000
66665F67 616E6F6E
2E687073 00000000
66665F7A 656C6461
2E687073 00000000
5460103A 00000000
Code:
.macro branchl reg, address
lis \reg, \address @h
ori \reg,\reg,\address @l
mtctr \reg
bctrl
.endm

.macro branch reg, address
lis \reg, \address @h
ori \reg,\reg,\address @l
mtctr \reg
bctr
.endm

.macro load reg, address
lis \reg, \address @h
ori \reg, \reg, \address @l
.endm

.macro loadf regf,reg,address
lis \reg, \address @h
ori \reg, \reg, \address @l
stw \reg,-0x4(sp)
lfs \regf,-0x4(sp)
.endm

.macro backup
addi sp,sp,-0x4
mflr r0
stw r0,0(sp)
.endm

.macro restore
lwz r0,0(sp)
mtlr r0
addi sp,sp,0x4
.endm

.set ActionStateChange,0x800693ac
.set HSD_Randi,0x80380580
.set HSD_Randf,0x80380528
.set Wait,0x8008a348
.set Fall,0x800cc730

.set entity,31
.set player,31

#check if a new song ID
cmpwi r3,0x100
blt exit

#get table address
mflr r15
bl table
mflr r14
mtlr r15

subi r3,r3,0x100 #0-index song ID for new table
mulli r3,r3,0x10 #get table offset
add r4,r3,r14 #get address of string

#################################
#CHECK IF FILE EXISTS
mr r22,r4 #backup string pointer
mr r3,r4  #move to correct reg
branchl r14,0x8033796c

cmpwi r3,-1
bne continue

branch r14,0x80024014 #exit function
##################################

continue:
mr r4,r22
#get r3 setup
lwz    r3, -0x7DCC (r13)
add    r3, r31, r3
addi    r3, r3, 128

branch r14,0x80023f98

table:
blrl

#0x0 = ff_luigi.hps
.long 0x66665f6c
.long 0x75696769
.long 0x2e687073
.long 0x00000000

#0x10 = ff_bowser.hps
.long 0x66665f62
.long 0x6f777365
.long 0x722e6870
.long 0x73000000

#0x20 = ff_mewtwo.hps
.long 0x66665f6d
.long 0x65777477
.long 0x6f2e6870
.long 0x73000000

#0x30 = ff_peach.hps
.long 0x66665f70
.long 0x65616368
.long 0x2e687073
.long 0x00000000

#0x40 = ff_jiggly.hps
.long 0x66665f6a
.long 0x6967676c
.long 0x792e6870
.long 0x73000000

#0x50 = ff_falco.hps
.long 0x66665f66
.long 0x616c636f
.long 0x2e687073
.long 0x00000000

#0x60 = ff_ylink.hps
.long 0x66665f79
.long 0x6c696e6b
.long 0x2e687073
.long 0x00000000

#0x70 = ff_drmario.hps
.long 0x66665f64
.long 0x726d6172
.long 0x696f2e68
.long 0x70730000

#0x80 = ff_roy.hps
.long 0x66665f72
.long 0x6f792e68
.long 0x70730000
.long 0x00000000

#0x90 = ff_pichu.hps
.long 0x66665f70
.long 0x69636875
.long 0x2e687073
.long 0x00000000

#0xa0 = ff_ganon.hps
.long 0x66665f67
.long 0x616e6f6e
.long 0x2e687073
.long 0x00000000

#0xb0 = ff_zelda.hps
.long 0x66665f7a
.long 0x656c6461
.long 0x2e687073
.long 0x00000000

exit:
rlwinm    r0, r3, 2, 0, 29
 
Last edited:
Joined
Nov 9, 2014
Messages
632
#4
Did you actually manage to separate the victory themes for each character?
Yeah, the 04 codes change the music ID that the game selects when the character wins to unused ID's. There's an injection in the music load function that checks for custom music ID's (anything over 100). If it detects the ID is not a vanilla ID, it loads the song name string from the table located inside the injection.

B Brandondorf9999

Whoops, meant to add this onto the previous message. Anyway here's the code that loads alternate song names.

Code:
.macro branch reg, address
lis \reg, \address @h
ori \reg,\reg,\address @l
mtctr \reg
bctr
.endm

#check if a new song ID
cmpwi r3,0x100
blt exit

#get table address
mflr r15
bl table
mflr r14
mtlr r15

subi r3,r3,0x100 #0-index song ID for new table
mulli r3,r3,0x10 #get table offset
add r4,r3,r14 #get address of string

#get r3 setup
lwz    r3, -0x7DCC (r13)
add    r3, r31, r3
addi    r3, r3, 128

branch r14,0x80023f98

table:
blrl

#0x0 = ff_luigi.hps
.long 0x66665f6c
.long 0x75696769
.long 0x2e687073
.long 0x00000000

#0x10 = ff_bowser.hps
.long 0x66665f62
.long 0x6f777365
.long 0x722e6870
.long 0x73000000

#0x20 = ff_mewtwo.hps
.long 0x66665f6d
.long 0x65777477
.long 0x6f2e6870
.long 0x73000000

#0x30 = ff_peach.hps
.long 0x66665f70
.long 0x65616368
.long 0x2e687073
.long 0x00000000

#0x40 = ff_jiggly.hps
.long 0x66665f6a
.long 0x6967676c
.long 0x792e6870
.long 0x73000000

#0x50 = ff_falco.hps
.long 0x66665f66
.long 0x616c636f
.long 0x2e687073
.long 0x00000000

#0x60 = ff_ylink.hps
.long 0x66665f79
.long 0x6c696e6b
.long 0x2e687073
.long 0x00000000

#0x70 = ff_drmario.hps
.long 0x66665f64
.long 0x726d6172
.long 0x696f2e68
.long 0x70730000

#0x80 = ff_roy.hps
.long 0x66665f72
.long 0x6f792e68
.long 0x70730000
.long 0x00000000

#0x90 = ff_pichu.hps
.long 0x66665f70
.long 0x69636875
.long 0x2e687073
.long 0x00000000

#0xa0 = ff_ganon.hps
.long 0x66665f67
.long 0x616e6f6e
.long 0x2e687073
.long 0x00000000

#0xb0 = ff_zelda.hps
.long 0x66665f7a
.long 0x656c6461
.long 0x2e687073
.long 0x00000000

exit:
rlwinm    r0, r3, 2, 0, 29
 
Last edited by a moderator:
Joined
Nov 9, 2014
Messages
632
#6
Updated this code to check if the song exists on the disc. If it doesn't exist it will exit the function. Should alleviate any crashes due to not having the correct file.

Not sure if this is public knowledge but I recently noticed you can check for existing files by calling
DVDConvertPathToentryNum w/ r3 as a pointer to the ASCII of file name. It will return -1 if it doesnt exist.

Code:
$Unique Victory Themes v1.1 [UnclePunch]
*/audio/ff_luigi.hps = Luigi Victory Theme
*/audio/ff_bowser.hps = Bowser Victory Theme
*/audio/ff_mewtwo.hps = Mewtwo Victory Theme
*/audio/ff_peach.hps = Peach Victory Theme
*/audio/ff_jiggly.hps = Jigglypuff Victory Theme
*/audio/ff_zelda.hps = Zelda/Sheik Victory Theme
*/audio/ff_falco.hps = Falco Victory Theme
*/audio/ff_ylink.hps = Young Link Victory Theme
*/audio/ff_drmario.hps = Dr. Mario Victory Theme
*/audio/ff_roy.hps = Roy Victory Theme
*/audio/ff_pichu.hps = Pichu Victory Theme
*/audio/ff_ganon.hps = Ganon Victory Theme
043d54bc 00000100 #luigi
043d54ac 00000101 #bowser
043d54d4 00000102 #mewtwo
043d54e4 00000103 #peach
043d54fc 00000104 #jiggs
043d5524 00000105 #falco
043d552c 00000106 #ylink
043d5534 00000107 #doc
043d553c 00000108 #roy
043d5544 00000109 #pichu
043d554c 0000010A #ganon
043d5514 0000010B #zelda
043d551c 0000010B #sheik
04023f54 4800000c
04023f74 4800000c
C2023F80 00000028
2C030100 41800134
7DE802A6 48000069
7DC802A6 7DE803A6
3863FF00 1C630010
7C837214 7C962378
7C832378 3DC08033
61CE796C 7DC903A6
4E800421 2C03FFFF
40820014 3DC08002
61CE4014 7DC903A6
4E800420 7EC4B378
806D8234 7C7F1A14
38630080 3DC08002
61CE3F98 7DC903A6
4E800420 4E800021
66665F6C 75696769
2E687073 00000000
66665F62 6F777365
722E6870 73000000
66665F6D 65777477
6F2E6870 73000000
66665F70 65616368
2E687073 00000000
66665F6A 6967676C
792E6870 73000000
66665F66 616C636F
2E687073 00000000
66665F79 6C696E6B
2E687073 00000000
66665F64 726D6172
696F2E68 70730000
66665F72 6F792E68
70730000 00000000
66665F70 69636875
2E687073 00000000
66665F67 616E6F6E
2E687073 00000000
66665F7A 656C6461
2E687073 00000000
5460103A 00000000
Code:
.macro branchl reg, address
lis \reg, \address @h
ori \reg,\reg,\address @l
mtctr \reg
bctrl
.endm

.macro branch reg, address
lis \reg, \address @h
ori \reg,\reg,\address @l
mtctr \reg
bctr
.endm

.macro load reg, address
lis \reg, \address @h
ori \reg, \reg, \address @l
.endm

.macro loadf regf,reg,address
lis \reg, \address @h
ori \reg, \reg, \address @l
stw \reg,-0x4(sp)
lfs \regf,-0x4(sp)
.endm

.macro backup
addi sp,sp,-0x4
mflr r0
stw r0,0(sp)
.endm

.macro restore
lwz r0,0(sp)
mtlr r0
addi sp,sp,0x4
.endm

.set ActionStateChange,0x800693ac
.set HSD_Randi,0x80380580
.set HSD_Randf,0x80380528
.set Wait,0x8008a348
.set Fall,0x800cc730

.set entity,31
.set player,31

#check if a new song ID
cmpwi r3,0x100
blt exit

#get table address
mflr r15
bl table
mflr r14
mtlr r15

subi r3,r3,0x100 #0-index song ID for new table
mulli r3,r3,0x10 #get table offset
add r4,r3,r14 #get address of string

#################################
#CHECK IF FILE EXISTS
mr r22,r4 #backup string pointer
mr r3,r4  #move to correct reg
branchl r14,0x8033796c

cmpwi r3,-1
bne continue

branch r14,0x80024014 #exit function
##################################

continue:
mr r4,r22
#get r3 setup
lwz    r3, -0x7DCC (r13)
add    r3, r31, r3
addi    r3, r3, 128

branch r14,0x80023f98

table:
blrl

#0x0 = ff_luigi.hps
.long 0x66665f6c
.long 0x75696769
.long 0x2e687073
.long 0x00000000

#0x10 = ff_bowser.hps
.long 0x66665f62
.long 0x6f777365
.long 0x722e6870
.long 0x73000000

#0x20 = ff_mewtwo.hps
.long 0x66665f6d
.long 0x65777477
.long 0x6f2e6870
.long 0x73000000

#0x30 = ff_peach.hps
.long 0x66665f70
.long 0x65616368
.long 0x2e687073
.long 0x00000000

#0x40 = ff_jiggly.hps
.long 0x66665f6a
.long 0x6967676c
.long 0x792e6870
.long 0x73000000

#0x50 = ff_falco.hps
.long 0x66665f66
.long 0x616c636f
.long 0x2e687073
.long 0x00000000

#0x60 = ff_ylink.hps
.long 0x66665f79
.long 0x6c696e6b
.long 0x2e687073
.long 0x00000000

#0x70 = ff_drmario.hps
.long 0x66665f64
.long 0x726d6172
.long 0x696f2e68
.long 0x70730000

#0x80 = ff_roy.hps
.long 0x66665f72
.long 0x6f792e68
.long 0x70730000
.long 0x00000000

#0x90 = ff_pichu.hps
.long 0x66665f70
.long 0x69636875
.long 0x2e687073
.long 0x00000000

#0xa0 = ff_ganon.hps
.long 0x66665f67
.long 0x616e6f6e
.long 0x2e687073
.long 0x00000000

#0xb0 = ff_zelda.hps
.long 0x66665f7a
.long 0x656c6461
.long 0x2e687073
.long 0x00000000

exit:
rlwinm    r0, r3, 2, 0, 29
 
Last edited:
Top