Ultimate Region ID Cycler In Between Races [Vega]
#1
Ultimate Region ID Cycler In Between Races [Vega]

This is similar to other "Change Region ID in between Races Online" Codes but it also changes your Flag + Globe Location, and you will see the effects also occur on your own screen (other Change Region ID codes will only update the effects on the opponents' screens).

I have made this code in honor of Nutmeg who was the first person ever (in Feb 2012) to change Region ID's in between races online.

This code will cycle through all 7 Region IDs in ascending order and then repeat once China has been used. It's automated, no button activators required. Your Region ID, the Region ID's default geo-location, and your flag image (if applicable) will cycle after every single race. Everyone will see the effects.

NOTE: There is a small side effect. Before you do your first race, if you view your Mii on the globe, it will have the country's flag image turned on (if applicable) even if it's off in your Wii settings.

PAL
0400AF7C 4800005C
C26437D0 0000000C
3D40809C 3D808024
3D608042 814A2108
618C5DA8 616BAB67
892A00C5 39290001
28090007 41A00008
39200000 55251838
7C85602E 38A50004
7C05602E 992B0000
908B0071 900B1075
992A00C5 908A00B8
900A00BC 39610020
60000000 00000000

NTSC-U
0400AEDC 4800005C
C26123B0 0000000C
3D40809C 3D808024
3D608042 814AD958
618C5A90 616B67E7
892A00C5 39290001
28090007 41A00008
39200000 55251838
7C85602E 38A50004
7C05602E 992B0000
908B0071 900B1075
992A00C5 908A00B8
900A00BC 39610020
60000000 00000000

NTSC-J
0400AEA0 4800005C
C2642E3C 0000000C
3D40809C 3D808024
3D608042 814A1168
618C5758 616BA4E7
892A00C5 39290001
28090007 41A00008
39200000 55251838
7C85602E 38A50004
7C05602E 992B0000
908B0071 900B1075
992A00C5 908A00B8
900A00BC 39610020
60000000 00000000

NTSC-K
0400B028 4800005C
C2631AE8 0000000C
3D40809B 3D808024
3D608041 814A0748
618C5B88 616B8B87
892A00C5 39290001
28090007 41A00008
39200000 55251838
7C85602E 38A50004
7C05602E 992B0000
908B0071 900B1075
992A00C5 908A00B8
900A00BC 39610020
60000000 00000000



Code creator: Vega
Code credits: Seeky (USER static ptr), Anarion (local Geo Packet), Atlas (default Geo Packet)



RAM Write:
Code:
#Jump from 2nd instruction of SetCountry Func to first instruction of Func that only executes for Countries that have their Location within enabled. This forces flag image (if applicable) no matter what. Needed for rare troublesome SYSCONFs
#PAL    8000AF7C
#NTSC-U 8000AEDC
#NTSC-J 8000AEA0
#NTSC-K 8000B028
b 0x5C

ASM Source:
Code:
#C2 Hook Addresses
#NTSC-U 806123B0
#PAL    806437D0
#NTSC-J 80642E3C
#NTSC-K 80631AE8

#Region Setting
.set region, '' #Set e p j or k

#Hook Notes
#Hooked at epilogue of j_SadRKNetSELECTHandler_DestroyInstance func which occurs once per online event (the very moment your vote is casted)

#Set Static Ptrs
.if (region == 'P' || region == 'p') #PAL
        .set geo_table, 0x80245DA8
        .set anarion, 0x8042AB67
        .set user_static, 0x809C2108
.elseif (region == 'E' || region == 'e') #NTSC-U
        .set geo_table, 0x80245A90
        .set anarion, 0x804267E7
        .set user_static, 0x809BD958
.elseif (region == 'J' || region == 'j') #NTSC-J
        .set geo_table, 0x80245758
        .set anarion, 0x8042A4E7
        .set user_static, 0x809C1168
.elseif (region == 'K' || region == 'k') #NTSC-K
        .set geo_table, 0x80245B88
        .set anarion, 0x80418B87
        .set user_static, 0x809B0748
.else #Invalid Region
        .err #Region match not detected. Tell the Assembler to halt and throw an error.
.endif

#Register Safety Notes
#r0, r4 thru r12 safe, r27 thru r31 safe

#Set a register to hold USER Static instance ptr, make it signed cuz we will directly load from it
lis r10, user_static@ha

#Set a register to hold the static ptr to the default geo table
lis r12, geo_table@h

#Set a register to hold the static ptr to memory region where game keeps your legit Region Information
lis r11, anarion@h

#Complete ptr's
lwz r10, user_static@l (r10)
ori r12, r12, geo_table@l
ori r11, r11, anarion@l

#Load your USER Packet Region ID, increment, and check against upper bound
lbz r9, 0x00C5 (r10)
addi r9, r9, 1
cmplwi r9, 7
blt+ 0x8

#Reset Region ID
li r9, 0

#Multiply Region ID by 8 to get exact ptr within geo table
slwi r5, r9, 3

#Load new Country+State+City Values from geo table
lwzx r4, r5, r12

#Load new Globe Location
addi r5, r5, 4
lwzx r0, r5, r12

#Write new Values to Anarion's "Packet"
stb r9, 0 (r11)
stw r4, 0x0071 (r11)
stw r0, 0x1075 (r11)

#Write all new values to USER Packet
stb r9, 0xC5 (r10)
stw r4, 0xB8 (r10)
stw r0, 0xBC (r10)

#Original Instruction of Hook Address
addi r11, sp, 32
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)