Mario Kart Wii Gecko Codes, Cheats, & Hacks
Boot into any menu [Melg] - Printable Version

+- Mario Kart Wii Gecko Codes, Cheats, & Hacks (https://mariokartwii.com)
+-- Forum: Cheat Codes (https://mariokartwii.com/forumdisplay.php?fid=51)
+--- Forum: Misc/Other (https://mariokartwii.com/forumdisplay.php?fid=55)
+--- Thread: Boot into any menu [Melg] (/showthread.php?tid=1949)



Boot into any menu [Melg] - Melg - 04-10-2022

This code boots the game into a specified menu. By intelligently selecting which menu to boot into, you can start the game directly into a screen of your choice. For example menu 0x49 "Single Player (coming from Time Trial Change Character)" will boot the game directly into that screen.

Please note that the code should be seen as a base. Some menus will work as is, by just changing the menu ID, but others will need some values (such as character, vehicle, number of races, etc...) to be initiated. Considering the sheet amount of menus (roughly 150), I did not make a version of the code for every single one of them.

Refer to: https://mariokartwii.com/showthread.php?tid=1950 for an example on how values should be initiated. The exact hook and method will differ depending on the menu, but it still gives a good idea of what to do.


Code:
NTSC-U
C261F85C 00000005
48000019 2D733133
32202D6C 3L202D70
CCCCCCCC 00000000
7F8802A6 93830098
60000000 00000000
0462055C 386000MM
C251FF68 00000007
3C60809C 8063D508
8883003B 2C040024
389E1720 38A00920
40A2000C 389E3BA0
38A000B0 8863003A
3863FFFF 7C6329D6
7C841A14 00000000

PAL
C25b9368 00000005
48000019 2D733133
32202D6C 3L202D70
CCCCCCCC 00000000
7F8802A6 93830098
60000000 00000000
045BA068 386000MM
C25243dc 00000007
3C60809C 80631E38
8883003B 2C040024
389E1720 38A00920
40A2000C 389E3BA0
38A000B0 8863003A
3863FFFF 7C6329D6
7C841A14 00000000

NTSC-J
C25B8CE8 00000005
48000019 2D733133
32202D6C 30202D70
CCCCCCCC 00000000
7F8802A6 93830098
60000000 00000000
045B99E8 386000MM
C2523D5C 00000007
3C60809C 80630E98
8883003B 2C040024
389E1720 38A00920
40A2000C 389E3BA0
38A000B0 8863003A
3863FFFF 7C6329D6
7C841A14 00000000

NTSC-K
C25A73C0 00000005
48000019 2D733133
32202D6C 30202D70
CCCCCCCC 00000000
7F8802A6 93830098
60000000 00000000
045A80C0 386000MM
C2512400 00000007
3C60809B 80630478
8883003B 2C040024
389E1720 38A00920
40A2000C 389E3BA0
38A000B0 8863003A
3863FFFF 7C6329D6
7C841A14 00000000


Values to fill:
MM = which menu to use: https://wiki.tockdom.com/wiki/List_of_Identifiers#Menu_Identifiers

L = which license to boot into:
0 = Top-Left
1 = Top-Right
2 = Bottom-Left
3 = Bottom-Right

CCCCCCCC = which controller and slot to use; the physical slot for GCN, and the light that is turned on for the wiimote based ones (which in most cases is just the first one):
GCN Controller
32393200 slot 1
35343800 slot 2
38303400 slot 3
31303630 slot 4

Wii Wheel
32373300 slot 1
35323900 slot 2
37383500 slot 3
31303431 slot 4

Nunchuck:
32373400 slot 1
35333000 slot 2
37383600 slot 3
31303432 slot 4

Classic Controller:
32373500 slot 1
35333100 slot 2
37383700 slot 3
31303433 slot 4


Source:
Code:
#1st ASM:
#inject(0x805b9368)\n\n (PAL)
#inject(0x8061F85C)\n\n (NTSC-U)
#inject(0x805B8CE8)\n\n (NTSC-J)
#inject(0x805A73C0)\n\n (NTSC-K)

#Args: r3 = SystemManager::StaticInstance

bl string
.string "-s132 -l0 -p292"  #-p set to GCN just for compiling purposes; you can get the decimal values by converting the ASCIII strings provided above
.byte 00
.align 2
string:
mflr r28
stw r28, 0x98 (r3)      
#Store pointer to string, which will be used by the function later, also loads the pointer into r28; this hook is followed by a cmpwi r28

#The function this hooks into returns the menu ID to boot into (-1 usually, but the 04 changes it)

Code:
#inject(0x805243dc)\n\n (PAL)
#inject(0x8051FF68)\n\n (NTSC-U)
#inject(0x80523D5C)\n\n (NTSC-J)
#inject(0x80512400)\n\n (NTSC-K)

.set region, 'P' #Must set region value, or else source will not compile
.if (region == 'P')
    .set MENUDATA, 0x809c1e38 
.elseif (region == 'E')
    .set MENUDATA, 0x809bd508
.elseif (region == 'J')
.set MENUDATA, 0x809c0e98
.elseif (region == 'K')
    .set MENUDATA, 0x809B0478
.else
  .err
.endif

#Fixes controller not being properly initiated since we skip the title screen "Press A". Stores the correct InputData substruct pointers depending on the controller. Without this, the correct controller buttons are displayed but the game does not fetch the inputs from the right place.
#r30 = INPUTDATA

lis r3, MENUDATA@ha
lwz r3, MENUDATA@l (r3)
lbz r4, 0x3B (r3)            #Get the controllerType from MenuDataSub
cmpwi r4, 0x24               #Check if it's a GCN
addi r4, r30, 0x1720
li r5, 0x920 
bne+ end
addi r4, r30, 0x3ba0
li r5, 0xB0
end:
lbz r3, 0x3A (r3)            #Get the slot
subi r3, r3, 0x1
mullw r3, r3, r5   
add r4, r4, r3               #Correct pointer depending on controller and slot


Code Creator: Melg


RE: Boot into any menu [Melg] - Melg - 04-10-2022

In case you're wondering what happens when you don't initiate any values on menus that evidently would need to...it either crashes or you get the default values. Here's me booting into menu 0x20 which is single player Versus Mode (yes you can boot directly into a race):
 


RE: Boot into any menu [Melg] - Zeraora - 07-26-2022

NTSC-J and NTSC-K L values are filled in.


RE: Boot into any menu [Melg] - Zeraora - 11-26-2022

One question I wonder is if there is a way to change certain menu transitions.

Let's say after you complete a VS Race, instead of bringing you to the "pick a track screen" you could change it to a different menu, maybe the credits or something.

In theory, it shouldn't be too hard, simply re-use part of this code at the address that controls the new menu transition.


RE: Boot into any menu [Melg] - seanmcnally - 03-22-2024

Thanks for this code. I'm wondering, is it possible to boot into a specific page of a menu? For example, 4 players, character selection screen?


RE: Boot into any menu [Melg] - Cealgair - 03-25-2024

It is. I see the Wiiki page that was linked has since been extensively modifies. Here's a link to an old version that has what you're looking for: https://wiki.tockdom.com/w/index.php?title=List_of_Identifiers&oldid=332888#Menu_Identifiers