Change Reg ID, Flag, Globe Pos Live in Room or in Between Races [Vega]
#1
Change Reg ID, Flag, Globe Pos Live in Room or in Between Races [Vega]

 This code that allows you to change your Region ID (line color), Country Code (Flag Image), and Globe Location in between races. If desired, you can be in an open room and use your activators to swap between two sets of country codes/globe positions LIVE.

I designed the code where effects take place on both your screen and opponents' screens.

NOTICE: When using this code to make changes take effect race after race (like changing region ID's in between races), press your activators during the course vote (not during the actual race itself). If you press your activators during a race, then not press them when you are on the course vote, the code will not update your changes when the next race begins.

For using this code to change region, flag image, and globe position in an idle open room, simply press your activators whenever you want. Changes take effect instantly.

NTSC-U
C26609D8 00000010
3D808034 618CXXXX
A16C0000 38E0ZZZZ
38C0zzzz 7D603838
7C003800 41820014
7D603038 7C003000
4182001C 48000048
3CC0YY01 3CE0WWWW
60E7wwww 3980000R
48000014 3CC0yy01
3CE0PPPP 60E7pppp
3980000r 90C300B8
90E300BC 998300C5
3D608042 616B67E7
90CB0071 90EB1075
998B0000 88030000
60000000 00000000

PAL
C2662ABC 00000010
3D808034 618CXXXX
A16C0000 38E0ZZZZ
38C0zzzz 7D603838
7C003800 41820014
7D603038 7C003000
4182001C 48000048
3CC0YY01 3CE0WWWW
60E7wwww 3980000R
48000014 3CC0yy01
3CE0PPPP 60E7pppp
3980000r 90C300B8
90E300BC 998300C5
3D608042 616BAB67
90CB0071 90EB1075
998B0000 88030000
60000000 00000000

NTSC-J
C2662128 00000010
3D808034 618CXXXX
A16C0000 38E0ZZZZ
38C0zzzz 7D603838
7C003800 41820014
7D603038 7C003000
4182001C 48000048
3CC0YY01 3CE0WWWW
60E7wwww 3980000R
48000014 3CC0yy01
3CE0PPPP 60E7pppp
3980000r 90C300B8
90E300BC 998300C5
3D608042 616BA4E7
90CB0071 90EB1075
998B0000 88030000
60000000 00000000

NTSC-K
C2650DD4 00000010
3D808033 618CXXXX
A16C0000 38E0ZZZZ
38C0zzzz 7D603838
7C003800 41820014
7D603038 7C003000
4182001C 48000048
3CC0YY01 3CE0WWWW
60E7wwww 3980000R
48000014 3CC0yy01
3CE0PPPP 60E7pppp
3980000r 90C300B8
90E300BC 998300C5
3D608041 616B8B87
90CB0071 90EB1075
998B0000 88030000
60000000 00000000

XXXX = Controller Address
ZZZZ = Button to activate R region value, YY country code value, and WWWWwwww globe position value
zzzz = Button to activate r region value, yy country code value, and PPPPpppp globe position value
R, r = Region ID values to switch back and forth with



Source (NTSC-K Code)
#~~~~~~~~~~~~~~~~#
# START ASSEMBLY #
#~~~~~~~~~~~~~~~~#

#

#~~~~~~~~~~#
# (NTSC-K) #
#~~~~~~~~~~#

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#                              Register Safety Notes                                     #
#       r0 is safe to use because it is used by the default ASM at end of code           #
# r6 & r7 are safe to use because regardless of which subroutine route is later taken... #
#               r6 later gets overwritten by a rlwinm. function &...                     #
#                    r7 later gets overwritten by a lwz function                         #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Controller Address Config #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~#

lis r12, 0x8033 #Set the first half of the Korean controller address
ori r12, r12, 0xXXXX #Set specific second half of Korean controller address

#~~~~~~~~~~~~~~~~~~~~~~~#
# Load Controller Input #
#~~~~~~~~~~~~~~~~~~~~~~~#

lhz r11, 0 (r12) #Load the halfword from address of r12 into r11

#~~~~~~~~~~~~~~~~~ #
# Set User's Acts #
#~~~~~~~~~~~~~~~~~~~~#

li r7, 0xZZZZ #Load 0xZZZZ value in r7; Set first activator
li r6, 0xzzzz #Load 0xzzzz value in r6; Set other activator

#~~~~~~~~~~~~~~~#
# Logical AND 1 #
#~~~~~~~~~~~~~~~#

and r0, r11, r7 #Logically AND the contents of r11 & r7, store result into r0
cmpw r0, r7 #Compare value of r0 to r7.
beq- set_regionoption1 #If equal (activator is pressed), jump to set_regionoption1 label

#~~~~~~~~~~~~~~~#
# Logical AND 2 #
#~~~~~~~~~~~~~~~#

and r0, r11, r6 #Logically AND the contents of r11 & r6, store result into r0
cmpw r0, r6 #Compare value of r0 to r6
beq- set_regionoption2 #If equal (other activator is pressed), jump to set_regionoption2 label

b dont_doshit #If ZZZZ or zzzz wasn't pressed, jump to dont_doshit label

#~~~~~~~~~~~~~~~~~~~~~~~~~#
# set_regionoption1 label #
#~~~~~~~~~~~~~~~~~~~~~~~~~#

set_regionoption1:
lis r6, 0xYY01 #Activate YY Country flag/code value
lis r7, 0xWWWW #Activate WWWW first half globe position
ori r7, r7, 0xwwww #Activate wwww second half globe position
li r12, 0xR #Activate R region ID
b finalize_value #Jump to finalize_value, because we don't want the r Region ID to set

#~~~~~~~~~~~~~~~~~~~~~~~~~#
# set_regionoption2 label #
#~~~~~~~~~~~~~~~~~~~~~~~~~#

set_regionoption2:
lis r6, 0xyy01 #Activate YY Country flag/code value; lis instead of li is used due to 0x7FFF limit
lis r7, 0xPPPP #Activate PPPP first half globe position
ori r7, r7, 0xpppp #Activate pppp second half globe position
li r12, 0xr #Activate r Region ID

#~~~~~~~~~~~~~~~~~~~~~~#
# finalize_value label #
#~~~~~~~~~~~~~~~~~~~~~~#

finalize_value:
stw r6, 0x00B8 (r3) #Store the new Country code value to its proper location on USER record
stw r7, 0x00BC (r3) #Store the new Globe Position value to its proper location on USER record
stb r12, 0x00C5 (r3) #Store the new Region ID value to its proper location on USER record
lis r11, 0x8041 #Set 1st half of Anarion's Region ID Address as a base to store self-sided values
ori r11, r11, 0x8B87 #Set 2nd half of Anarion's Region ID Changer Address
stw r6, 0x0071 (r11) #Store Country Code value to Anarion's Country Flag Changer code address
stw r7, 0x1075 (r11) #Store Globe position value to Anarion's Globe Position Changer address
stb r12, 0 (r11) #Store Region value to Anarion's Region ID Changer address

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# dont_doshit label; Default ASM #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

dont_doshit:
lbz r0, 0 (r3)

#

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



Code creator: Vega
Code credits: Anarion (Used his addresses to make effects appear on your screen)
Reply
#2
Is it possible to switch with more than 2 regions?
Reply
#3
(09-19-2018, 04:23 PM)Atlas Wrote: Is it possible to switch with more than 2 regions?

Yea, rewrite the source to allow so.
Reply
#4
Upgraded the code so now you can press your activator(s) while pressing other buttons
Reply
#5
I'm having an issue with the PAL version of this code, I set up the XXXX, zzzz and ZZZZ values ( by using the "Controller Address & Button Values (X,Y,Z) Values" thread) , but when I go in game and connect, go into an open room and try this, it doesn't work for some reason. Does anyone know a fix to this? (I also set up the other values)
Reply
#6
Paste the compiled code that you are using.

EDIT:To anyone else reading, we discovered on Discord it was Wiimm's Tools botching the GCT.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)