Random Track Selection For Offline [Vega]
#1
Random Track Selection For Offline [Vega]

Offline only. Does not work in Grand Prix.

This code will give you the ability to have a "random" feature for track selection. Just select any track at the track selection screen. When the Race/TT/Battle begins, it will be a random track that is loaded. For TT's this also effects the loading of the ghost preview screen.

This code makes use of memory addresses 0x8000149E and 0x8000149F. Make sure no other codes in your GCT/Cheat-Manager are using those addresses.

NTSC-U
C0000000 00000009
3D808000 896C149E
280B001F 41A10008
3960001F 396B0001
280B002A 41A00008
39600020 996C149E
896C149F 396B0001
280B0020 41A00008
39600000 996C149F
4E800020 00000000
C2825F74 00000002
3FE08000 8BFF149F
93E31758 00000000
C28529C8 00000002
3F808000 8B9C149E
93861758 00000000

PAL
C0000000 00000009
3D808000 896C149E
280B001F 41A10008
3960001F 396B0001
280B002A 41A00008
39600020 996C149E
896C149F 396B0001
280B0020 41A00008
39600000 996C149F
4E800020 00000000
C28409D4 00000002
3FE08000 8BFF149F
93E31758 00000000
C283D0E8 00000002
3F808000 8B9C149E
93861758 00000000

NTSC-J
C0000000 00000009
3D808000 896C149E
280B001F 41A10008
3960001F 396B0001
280B002A 41A00008
39600020 996C149E
896C149F 396B0001
280B0020 41A00008
39600000 996C149F
4E800020 00000000
C2840040 00000002
3FE08000 8BFF149F
93E31758 00000000
C283C754 00000002
3F808000 8B9C149E
93861758 00000000

NTSC-K
C0000000 00000009
3D808000 896C149E
280B001F 41A10008
3960001F 396B0001
280B002A 41A00008
39600020 996C149E
896C149F 396B0001
280B0020 41A00008
39600000 996C149F
4E800020 00000000
C282ED94 00000002
3FE08000 8BFF149F
93E31758 00000000
C282B4A8 00000002
3F808000 8B9C149E
93861758 00000000



List of Sources-

1st ASM (C0 ASM Track Byte Cycler);

#~~~~~~~~~~~~~~~~#
# START ASSEMBLY #
#~~~~~~~~~~~~~~~~#

#

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#  Memory Address & Value Notes  #
# 0x8000149E = Battle Track Byte #
#  0x8000149F = VS Track Byte  #
#  0x00 thru 0x1F = VS Tracks  #
# 0x20 thru 0x29 = Battle Tracks #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#                    Register Safety Notes                        #
#        r3 safe for use, gets overwritten next address          #
# r4 safe for use, gets overwritten by default instruction at end #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#~~~~~~~~~~~~~~~~~~~~~~~~#
# Load Battle Track Byte #
#~~~~~~~~~~~~~~~~~~~~~~~~#

lis r12, 0x8000
lbz r11, 0x149E (r12)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Battle Track Byte 1st Comparsion Check #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

cmplwi r11, 0x1F
bgt+ _skipinitial #If greater than 0x1F, the battle cycle has already started

li r11, 0x1F #If not greater than 0x1F, begin the start of byte cycle, set value to 0x1F since the next instruction adds 1 to itself, value 0x20 is lowest byte value out of the battle tracks

_skipinitial:
addi r11, r11, 1 #Increment the Battle Byte by 1

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#  Battle Track Byte 2nd Comparison Check  #
# If 0x2A, reset the cycle back down to 0x20 #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

cmplwi r11, 0x2A
blt+ _dontreset1

li r11, 0x20

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Store Updated Battle Byte to Exception Vector Area #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

_dontreset1:
stb r11, 0x149E (r12)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Load VS Track Byte, Increment It #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

lbz r11, 0x149F (r12)
addi r11, r11, 1

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#  Compare VS Track Byte to 0x20 (first battle track)  #
#                If 0x20, reset the cycle              #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

cmplwi r11, 0x20
blt+ _dontreset2

li r11, 0

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Store Updated Track Byte, Default Instruction #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

_dontreset2:
stb r11, 0x149F (r12)

#blr Uncomment if compiling with WiiRDGUI, adjust compiled code accordingly

#

#~~~~~~~~~~~~~~#
# END ASSEMBLY #
#~~~~~~~~~~~~~~#

====

2nd ASM (Load updated VS Track Byte to replace selected Track):

lis r31, 0x8000
lbz r31, 0x149F (r31) #Load Track Byte
stw r31, 0x1758 (r3) #Default Instruction, Store Track Word Value to Memory

====

3rd ASM (Load updated Battle Track Byte to replaced selected Track):

lis r28, 0x8000
lbz r28, 0x149E (r28) #Load Track Byte
stw r28, 0x1758 (r6) #Default Instruction, Store Track Word Value to Memory



Code creator: Vega
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)