Disable Battle Mode Button [JoshuaMK]
#1
Disable Battle Mode Button [JoshuaMK]

Good for CT-CODE distributions. Disables being able to advance in the menus when selected on Battle. Has a side effect of not being able to back out when battle is selected.



(NTSC-U)
C2635FA4 00000005
90830178 3CA0805D
39600018 2C040003
4182000C 656B4182
48000008 656B4800
916544E8 00000000

(PAL)
C25F2E88 00000005
90830178 3CA0805F
39600018 2C040003
4182000C 656B4182
48000008 656B4800
9165EFBC 00000000

(NTSC-J)
C25F2764 00000005
90830178 3CA0805F
39600018 2C040003
4182000C 656B4182
48000008 656B4800
9165E898 00000000

(NTSC-K)
C25E12A8 00000005
90830178 3CA0805E
39600018 2C040003
4182000C 656B4182
48000008 656B4800
9165D3DC 00000000



stw r4, 0x178 (r3) #Default Instruction

.set region, '' #Set e, p, j, or k for compilation region

.if (region == 'E' || region == 'e') # RMCE
    lis r5, 0x805D
.elseif (region == 'P' || region == 'p') # RMCP
    lis r5, 0x805F #Add 0x1 to 0x805E cuz 2nd half address exceeds 0x7FFF
.elseif (region == 'J' || region == 'j') # RMCJ
    lis r5, 0x805F #Add 0x1 to 0x805E cuz 2nd half address exceeds 0x7FFF
.elseif (region == 'K' || region == 'k') # RMCK
    lis r5, 0x805E #Add 0x1 to 0x805D cuz 2nd half address exceeds 0x7FFF
.else # Invalid Region
    .err
.endif

li r11, 0x0018 #Set 2nd half of instruction (branching offset amount)

cmpwi r4, 3
beq- branch_instruction

oris r11, r11, 0x4182 #For beq- instruction
b update_static_mem

branch_instruction:
oris r11, r11, 0x4800 #For b instruction

update_static_mem: #Write in new instruction

.if (region == 'E' || region == 'e') # RMCE
    stw r11, 0x44E8 (r5)
.elseif (region == 'P' || region == 'p') # RMCP
    stw r11, 0xFFFFEFBC (r5)
.elseif (region == 'J' || region == 'j') # RMCJ
    stw r11, 0xFFFFE898 (r5)
.elseif (region == 'K' || region == 'k') # RMCK
    stw r11, 0xFFFFD3DC (r5)
.else # Invalid Region
    .err
.endif



Code Creator: JoshuaMK
Code Contributors: Vega (Optimized Source)
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply


Messages In This Thread
Disable Battle Mode Button [JoshuaMK] - by JoshuaMK - 11-01-2019, 07:45 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)