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
#2
You could use an address that only executes during Battle selection and make a code that calls OSRestart (reset game).
Reply
#3
That wasn't thee point of this code though so it won't be changed
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#4
Nvm, I'm dumb lol. Finally got around to testing this and I see what you mean. Nice work! Anyway could you make something like this to bypass the ESRB Rating Screen on the RMCE game? That would be very useful for american players.


Btw try this source out Wink You will only need the C2 ASM for the code.

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
Reply
#5
Why do Americans need to bypass it? Why not everybody?
Also, smart ASM
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#6
It's only in the American game cuz of American regulations for Age Ratings. It doesn't exist in the other MKW's
Reply
#7
oh lol
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#8
Went ahead and tested the new source, it works.
Reply
#9
Cool. Smile
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#10
Hey Josh, I always forget there's a TT & Battle code subforum lol.

Do you want this to stay in Misc/Other or moved to TT & Battle? Doesn't matter to me
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)