wiiztec
Smash Journeyman
This code allows forcing a single song from any tracklist to always play on a certain alt or default stage or for multiple songs that corrispond to the frequencies on the stages tracklist
In order to customize this code you'll need to download asmwiird here http://filetrip.net/dl?rmsMB9g0fu
8010F9FC <- Paste this into the top textbox
#paste this into the bottom textbox, and don't touch these first 4 lines
lis r12,0x815F
lhz r12,0xFFFF8422(r12)
slwi r0,r0,16
srwi r0,r0,16
#each stage you want to deal with with this code will have a chunk of code for it
#each cmpwi r27 should be preceeded by the number of the code chunk s1 is for
#stage 1, after the first bne should be s(# of the next code chunk) unless it's the
#last stage then it should be end SS is hex for the stage ID which can be found here
#http://opensa.dantarion.com/wiki/Stage_Module_Files AAAA is the hex of the
#GCC button combination of the alt you can find that out here
#http://geckocodes.org/index.php?arsenal=2 MMMM is the hex of the song ID
#which can be found here http://opensa.dantarion.com/wiki/Song_IDs
#this is your basic code chunk for 1 song forced for 1 alt
s1: cmpwi r27,0xSS
bne s2
cmpwi r12,0xAAAA
bne end
li r0,0xMMMM
#And this is a code chunk for multiple alts each forcing 1 song hopefully the
#pattern is clear enough that you can figure out how to extend it as necessary
s2: cmpwi r27,0xSS
bne s3
s2a1: cmpwi r12,0xA1A1
bne s2a2
li r0,0xM1M1
s2a2: cmpwi r12,0xA2A2
bne s2a3
li r0,0xM2M2
s2a3: cmpwi r12,0xA3A3
bne end
li r0,0xM3M3
#this is a code chunk example for a single alt with multiple songs the IFM's
#are the songs that must be on the stages tracklist when the game picks them
#the code will force it to play the THM's instead
s3: cmpwi r27,0xSS
bne s4
cmpwi r12,0xAAAA
bne end
s3m1: cmpwi r0,0xIFM1
bne s3m2
li r0,0xTHM1
s3m2: cmpwi r0,0xIFM2
bne end
li r0,0xTHM2
#this is a code chunk example for multiple alts with multiple songs hopefully the
#pattern is clear enough that you can figure out how to extend it as necessary
s4: cmpwi r27,0xSS
bne end #(s5 if not last chunk)
s4a1: cmpwi r12,0xA1A1
bne s4a2
s4a1m1: cmpwi r0,0xIFM1
bne s4a1m2
li r0,0xTHM1
s4a1m2: cmpwi r0,0xIFM2
bne end
li r0,0xTHM2
s4a2: cmpwi r12,0xA2A2
bne end
s4a2m1: cmpwi r0,0xIFM1
bne s4a2m2
li r0,0xTHM1
s4a2m2: cmpwi r0,0xIFM2
bne end
li r0,0xTHM2
#don't touch this last line
end:stw r0,0(r29)
Keep a copy of your ASM in order to make future edits because if you use asmwiird to disassemble it'll convert everything to decimal and make it a huge pain in the ass to edit
As a further example here is the code as it is in my Project M 3.6 edition
lis r12,0x815F
lhz r12,0xFFFF8422(r12)
slwi r0,r0,16
srwi r0,r0,16
s1: cmpwi r27,0x03
bne s2
cmpwi r12,0x0140
beq end
li r0,0x2722
s2: cmpwi r27,0x0D
bne s3
cmpwi r12,0x0140
bne end
li r0,0x2754
s3: cmpwi r27,0x2A
bne s4
cmpwi r12,0x0140
bne end
li r0,0x2803
s4: cmpwi r27,0x29
bne s5
cmpwi r12,0x0140
bne s4a2
li r0,0x2735
s4a2: cmpwi r12,0x0110
bne end
li r0,0x2740
s5: cmpwi r27,0x01
bne s6
cmpwi r12,0x0140
beq end
li r0,0x26FC
s6: cmpwi r27,0x04
bne s7
cmpwi r12,0x0110
bne end
li r0,0x27CD
s7: cmpwi r27,0x06
bne s8
cmpwi r12,0x0100
bne s7a2
li r0,0x27D5
s7a2: cmpwi r12,0x0110
bne s7a3
li r0,0x27CB
s7a3: cmpwi r12,0x0140
bne end
li r0,0x27D5
s8: cmpwi r27,0x30
bne s9
cmpwi r12,0x0140
bne end
li r0,0x281A
s9: cmpwi r27,0x32
bne s10
cmpwi r12,0x0140
bne end
li r0,0x2802
s10: cmpwi r27,0x2F
bne s11
cmpwi r12,0x1040
bne end
li r0,0x2800
s11: cmpwi r27,0x21
bne s12
cmpwi r12,0x0110
bne end
s11m1: cmpwi r0,0x27B3
bne s11m2
li r0,0x27A5
s11m2: cmpwi r0,0x27B4
bne end
li r0,0x27A7
s12: cmpwi r27,0x33
bne s13
cmpwi r12,0x1010
bne end
li r0,0x27A3
s13: cmpwi r27,0x1C
bne end
cmpwi r12,0x0140
beq end
li r0,0x27A0
end:stw r0,0(r29)
In order to customize this code you'll need to download asmwiird here http://filetrip.net/dl?rmsMB9g0fu
8010F9FC <- Paste this into the top textbox
#paste this into the bottom textbox, and don't touch these first 4 lines
lis r12,0x815F
lhz r12,0xFFFF8422(r12)
slwi r0,r0,16
srwi r0,r0,16
#each stage you want to deal with with this code will have a chunk of code for it
#each cmpwi r27 should be preceeded by the number of the code chunk s1 is for
#stage 1, after the first bne should be s(# of the next code chunk) unless it's the
#last stage then it should be end SS is hex for the stage ID which can be found here
#http://opensa.dantarion.com/wiki/Stage_Module_Files AAAA is the hex of the
#GCC button combination of the alt you can find that out here
#http://geckocodes.org/index.php?arsenal=2 MMMM is the hex of the song ID
#which can be found here http://opensa.dantarion.com/wiki/Song_IDs
#this is your basic code chunk for 1 song forced for 1 alt
s1: cmpwi r27,0xSS
bne s2
cmpwi r12,0xAAAA
bne end
li r0,0xMMMM
#And this is a code chunk for multiple alts each forcing 1 song hopefully the
#pattern is clear enough that you can figure out how to extend it as necessary
s2: cmpwi r27,0xSS
bne s3
s2a1: cmpwi r12,0xA1A1
bne s2a2
li r0,0xM1M1
s2a2: cmpwi r12,0xA2A2
bne s2a3
li r0,0xM2M2
s2a3: cmpwi r12,0xA3A3
bne end
li r0,0xM3M3
#this is a code chunk example for a single alt with multiple songs the IFM's
#are the songs that must be on the stages tracklist when the game picks them
#the code will force it to play the THM's instead
s3: cmpwi r27,0xSS
bne s4
cmpwi r12,0xAAAA
bne end
s3m1: cmpwi r0,0xIFM1
bne s3m2
li r0,0xTHM1
s3m2: cmpwi r0,0xIFM2
bne end
li r0,0xTHM2
#this is a code chunk example for multiple alts with multiple songs hopefully the
#pattern is clear enough that you can figure out how to extend it as necessary
s4: cmpwi r27,0xSS
bne end #(s5 if not last chunk)
s4a1: cmpwi r12,0xA1A1
bne s4a2
s4a1m1: cmpwi r0,0xIFM1
bne s4a1m2
li r0,0xTHM1
s4a1m2: cmpwi r0,0xIFM2
bne end
li r0,0xTHM2
s4a2: cmpwi r12,0xA2A2
bne end
s4a2m1: cmpwi r0,0xIFM1
bne s4a2m2
li r0,0xTHM1
s4a2m2: cmpwi r0,0xIFM2
bne end
li r0,0xTHM2
#don't touch this last line
end:stw r0,0(r29)
Keep a copy of your ASM in order to make future edits because if you use asmwiird to disassemble it'll convert everything to decimal and make it a huge pain in the ass to edit
As a further example here is the code as it is in my Project M 3.6 edition
lis r12,0x815F
lhz r12,0xFFFF8422(r12)
slwi r0,r0,16
srwi r0,r0,16
s1: cmpwi r27,0x03
bne s2
cmpwi r12,0x0140
beq end
li r0,0x2722
s2: cmpwi r27,0x0D
bne s3
cmpwi r12,0x0140
bne end
li r0,0x2754
s3: cmpwi r27,0x2A
bne s4
cmpwi r12,0x0140
bne end
li r0,0x2803
s4: cmpwi r27,0x29
bne s5
cmpwi r12,0x0140
bne s4a2
li r0,0x2735
s4a2: cmpwi r12,0x0110
bne end
li r0,0x2740
s5: cmpwi r27,0x01
bne s6
cmpwi r12,0x0140
beq end
li r0,0x26FC
s6: cmpwi r27,0x04
bne s7
cmpwi r12,0x0110
bne end
li r0,0x27CD
s7: cmpwi r27,0x06
bne s8
cmpwi r12,0x0100
bne s7a2
li r0,0x27D5
s7a2: cmpwi r12,0x0110
bne s7a3
li r0,0x27CB
s7a3: cmpwi r12,0x0140
bne end
li r0,0x27D5
s8: cmpwi r27,0x30
bne s9
cmpwi r12,0x0140
bne end
li r0,0x281A
s9: cmpwi r27,0x32
bne s10
cmpwi r12,0x0140
bne end
li r0,0x2802
s10: cmpwi r27,0x2F
bne s11
cmpwi r12,0x1040
bne end
li r0,0x2800
s11: cmpwi r27,0x21
bne s12
cmpwi r12,0x0110
bne end
s11m1: cmpwi r0,0x27B3
bne s11m2
li r0,0x27A5
s11m2: cmpwi r0,0x27B4
bne end
li r0,0x27A7
s12: cmpwi r27,0x33
bne s13
cmpwi r12,0x1010
bne end
li r0,0x27A3
s13: cmpwi r27,0x1C
bne end
cmpwi r12,0x0140
beq end
li r0,0x27A0
end:stw r0,0(r29)
Last edited: