Random Transformations [Vega] Press your Activator to execute a transformation. The character you transform to is random. This code works on non-transformable characters too! Use the P value to set code to effect you (P1) or the opponent (P2/COM). There are two versions of the code. The 1st version randomly sets the transformation animation type (Power Up or Power Down). The 2nd version of the code requires you to set the transformation type via the T value instead of having the feature of it being randomly generated. Code creator: Vega XXXX = Controller Address ZZZZ = Button Activator Link to X,Y,Z values - https://mariokartwii.com/nonmkwcodes/dbzbt3/bt3gecko.txt P values: 0 = P1 1 = P2/COM T value (for 2nd configuration of code only) 0 = Power Up animation 3 = Power Down animation NTSC-U (includes random animations) 0405727C 2C1F0000 283BXXXX YYYYZZZZ C205727C 00000008 3860000P 3C008004 60002A68 7C0903A6 4E800421 2C030000 41A2FFFC 7C03E800 40820018 7D6C42E6 557FE7FF 41820008 3BE00003 39801234 2C1F0000 00000000 E0000000 80008000 C20572CC 00000003 2C0C1234 40820008 38600001 2C030000 60000000 00000000 C20D71B4 00000005 88630098 2C0C1234 40820018 5563063E 280300A1 4180000C 7C6318F8 5463063E 60000000 00000000 NTSC-U (set T for animation type) 0405727C 2C1F0000 283BXXXX YYYYZZZZ C205727C 00000007 3860000P 3C008004 60002A68 7C0903A6 4E800421 2C030000 41A2FFFC 7C03E800 4082000C 39801234 3BE0000T 2C1F0000 60000000 00000000 E0000000 80008000 C20572CC 00000003 2C0C1234 40820008 38600001 2C030000 60000000 00000000 C20D71B4 00000005 88630098 2C0C1234 4082001C 7C6C42E6 5463063E 280300A1 4180000C 7C6318F8 5463063E 00000000 Code creator: Vega 'Source for RAM Write on Single Option' It rewrites the Original Instruction at the address, so that way if the C2 gets called and the activator is not being pressed after that, the C2 Hook will be overwritten thus not allowing the code to execute anymore. ASM Sources for Single Option 1st ASM #START ASSEMBLY #Notes: When user chooses to do Single Option, this ASM is auto deactivated via a RAM Write (writing the original instruction) then an if-statement then this ASM (followed by a final terminator ofc) #Address #NTSC-U = 8005727C #r0 = safe #r3 thru r6 = safe #CTR = safe #LR = safe #r29 = Current Master Pointer #Set User Slot aka r3 arg li r3, 0 #1P used for compilation, adjust this accordingly #Call GetMasterPointer, r0, r3 thru r6, CTR, and LR get used only #All registers are safe to use without backup lis r0, 0x8004 ori r0, r0, 0x2A68 mtctr r0 bctrl #Check return value. If null (should never be), loop forever infi_loop: cmpwi r3, 0 beq- infi_loop #Check returned Master Pointer vs current Master Pointer in r29 cmpw r3, r29 bne- original_instruction #Master Pointers are a match! #Load the Time Base; place in r11, r11 (plus r12) will remain intact for the other two ASM codes to use mftbl r11 #Set T based on whether or not Time Base was odd or even #For w/ reason on testing it seemed the the LSB of TB is almost always flipped low? Dolphin bug?? #Therefore we will check bit 4 instead of bit 0 rlwinm. r31, r11, 28, 31, 31 #Move bit 4 to bit 0 spot, only keep bit 4 intact beq- set_magic_id #If bit 4 was low, leave r31 as null (Power Up) #Bit 4 was high, do Power Down li r31, 3 #Set a custom Magic ID for later checks in other ASM set_magic_id: li r12, 0x1234 #Original Instruction original_instruction: cmpwi r31, 0 #END ASSEMBLY --- 2nd ASM #START ASSEMBLY #Address #NTSC-U = 800572CC #Check Magic ID that was set by 1st ASM Code cmpwi r12, 0x1234 bne- original_instruction #Set r3 to tell parent function that child function was a success #The child function does basic checks of various aspects fo the transformation before actually doing the transformation #If r3 = 1, then this tells the game to then go ahead and call the next child function which actually does the transformation execution li r3, 1 #Original Instruction original_instruction: cmpwi r3, 0 #END ASSEMBLY --- 3rd ASM #START ASSEMBLY #Address #NTSC-U = 800D71B4 #Original Instruction; load the Character ID (to transform to) from Memory lbz r3, 0x0098 (r3) #Check Magic ID. Fyi Magic ID will reset itself. cmpwi r12, 0x1234 bne- end_code #Magic ID was found, set custom Character ID to transform to. Overwrite the legit one that was previously loaded from memory; r11 (TB) is still intact #Clear everything but least significant byte clrlwi r3, r11, 24 #Character range is 0x00 thru 0xA0, if less than 0xA1, character ID is set cmplwi r3, 0xA1 blt- end_code #TB byte exceeded Character ID range, flip bits as a 'hacky' fix, yuck. #Thus this 'fix' will very very slightly make character ID's above 0x5E occur more often #Flip every bit value, leave only the least significant byte, byte now gauranteed to be less than 0xA1 not r3, r3 clrlwi r3, r3, 24 #End Code end_code: #END ASSEMBLY ==== 1st ASM for requiring user to set T manually #START ASSEMBLY #Notes: When user chooses to do Single Option, this ASM is auto deactivated via a RAM Write (writing the Original instruction) then an if-statement then this ASM (followed by a final terminator ofc) #Address #NTSC-U = 8005727C #r0 = safe #r3 thru r6 = safe #CTR = safe #LR = safe #r29 = Current Master Pointer #Set User Slot aka r3 arg li r3, 0 #1P used for compilation, adjust this accordingly #Call GetMasterPointer, r0, r3 thru r6, CTR, and LR get used only #All registers are safe to use without backup lis r0, 0x8004 ori r0, r0, 0x2A68 mtctr r0 bctrl #Check return value. If null (should never be), loop forever infi_loop: cmpwi r3, 0 beq- infi_loop #Check returned Master Pointer vs current Master Pointer in r29 cmpw r3, r29 bne- original_instruction #Master Pointers are a match! #Set a custom Magic ID for later checks in other ASM li r12, 0x1234 #Set T (0 = power up, 3 = power down) li r31, 0 #0 value used for compilation, adjust this accordingly #Original Instruction original_instruction: cmpwi r31, 0 #END ASSEMBLY --- 3rd ASM for requiring user to manually set T. 2nd ASM is the same for both versions of the code, no need to relist that source again. #START ASSEMBLY #Address #NTSC-U = 800D71B4 #Original Instruction; load the Character ID (to transform to) from Memory lbz r3, 0x0098 (r3) #Check Magic ID. Fyi Magic ID will reset itself. cmpwi r12, 0x1234 bne- end_code #Magic ID was found, set custom Character ID to transform to. Overwrite the legit one that was previously loaded from memory; load TB into r3 then clear everything but least significant byte mftbl r3 clrlwi r3, r3, 24 #Character range is 0x00 thru 0xA0, if less than 0xA1, character ID is set cmplwi r3, 0xA1 blt- end_code #TB byte exceeded Character ID range, flip bits as a 'hacky' fix, yuck. #Thus this 'fix' will very very slightly make character ID's above 0x5E occur more often not r3, r3 clrlwi r3, r3, 24 #End Code end_code: #END ASSEMBLY