Show Everyone's True Region ID [Vega]
#1
Show Everyone's True Region ID [Vega]

I made this code because I got tired of seeing White Line (CTGP region ID's) everywhere on Wiimmfi. This code will put the correct line color (on your screen only) for all players in a race. The line color will first be based on what version of MKW Disc/ISO they are using and secondly based on their country code + globe position.

Some notes about using this code:
- This only effects the output of the opponent's line color during the actual race. Live View is not effected by this code.
- This doesn't effect any opponent's geo location nor country flag when you see them on the globe

NTSC-U
C261E0CC 00000015
88830184 2C040045
41820024 2C04004A
4182002C 2C04004B
4182001C 2C040050
41820038 3880000F
48000078 38800001
48000070 38800005
48000068 89830178
2C0C0080 41A2FFE0
2C0C00FF 41820030
38800000 4800004C
89830178 2C0C0041
4182003C 2C0C005F
41820034 2C0C00FF
4182001C 38800002
48000028 8983017C
2C0C0011 41A2FFA0
4BFFFFC8 8983017C
2C0C00E6 41820008
4BFFFFDC 38800003
60000000 00000000

PAL
C26513E0 00000015
88830184 2C040045
41820024 2C04004A
4182002C 2C04004B
4182001C 2C040050
41820038 3880000F
48000078 38800001
48000070 38800005
48000068 89830178
2C0C0080 41A2FFE0
2C0C00FF 41820030
38800000 4800004C
89830178 2C0C0041
4182003C 2C0C005F
41820034 2C0C00FF
4182001C 38800002
48000028 8983017C
2C0C0011 41A2FFA0
4BFFFFC8 8983017C
2C0C00E6 41820008
4BFFFFDC 38800003
60000000 00000000

NTSC-J
C2650A4C 00000015
88830184 2C040045
41820024 2C04004A
4182002C 2C04004B
4182001C 2C040050
41820038 3880000F
48000078 38800001
48000070 38800005
48000068 89830178
2C0C0080 41A2FFE0
2C0C00FF 41820030
38800000 4800004C
89830178 2C0C0041
4182003C 2C0C005F
41820034 2C0C00FF
4182001C 38800002
48000028 8983017C
2C0C0011 41A2FFA0
4BFFFFC8 8983017C
2C0C00E6 41820008
4BFFFFDC 38800003
60000000 00000000

NTSC-K
C263F6F8 00000015
88830184 2C040045
41820024 2C04004A
4182002C 2C04004B
4182001C 2C040050
41820038 3880000F
48000078 38800001
48000070 38800005
48000068 89830178
2C0C0080 41A2FFE0
2C0C00FF 41820030
38800000 4800004C
89830178 2C0C0041
4182003C 2C0C005F
41820034 2C0C00FF
4182001C 38800002
48000028 8983017C
2C0C0011 41A2FFA0
4BFFFFC8 8983017C
2C0C00E6 41820008
4BFFFFDC 38800003
60000000 00000000



Source:
####################
###START ASSEMBLY###
####################

#

#########################
##Grab Disc/ISO Version##
#########################

lbz r4, 0x0184 (r3) #Grab the byte that determines a user's Disc/ISO

########################
##Disc/ISO Byte Checks##
########################

cmpwi r4, 0x45 #Compare byte to 0x45 (USA game)
beq- usa_regid #If equal to 0x45, jump to usa_regid label

cmpwi r4, 0x4A #Compare byte to 0x4A (JAPAN game)
beq- jpn_ortwn #If equal to 0x4A, jump to jpn_twn label

cmpwi r4, 0x4B #Compare byte to 0x4B (KOREA game)
beq- kor_regid #If equal to 0x4B, jump to kor_regid label

cmpwi r4, 0x50 #Compare byte to 0x50 (PAL game)
beq- euro_oraus #If equal to 0x50, jump to euro_oraus label

####################
##White Line Label##
####################

##This label will apply white line as a safety net if the disc/iso byte is not recognized.##
##If somebody has a Taiwan white line, they will also get navigated to this label.##

white_line:
li r4, 0xF #Load 0xF into r4 (this is what the game uses as a safety net, if a region ID value is unreadable)
b the_end #White line applied, jump to the_end label

###################
##Blue Line Label##
###################

usa_regid:
li r4, 0x1 #Load 0x1 into r4
b the_end #Blue line applied, jump to the_end label

#####################
##Purple Line Label##
#####################

kor_regid:
li r4, 0x5 #Load 0x5 into r4
b the_end #Purple line applied, jump to the_end label

#################################
##JAPAN Game Country Code Check##
#################################

##Since Taiwan region is part of the Japan disc/ISO, we need to check the person's country code to see if they have the Taiwan country code##
##That is how Taiwan region is reached legitimately.##
##If the user hasn't set their flag, their country code will be 0xFF. Meaning we will later need to check their globe position##

jpn_ortwn:
lbz r12, 0x0178 (r3) #Load country code from user's USER RECORD

cmpwi r12, 0x80 #Compare country code to Taiwan's country code (0x80)
beq- white_line #If player has Taiwan country code, jump to white_line label

cmpwi r12, 0xFF #See if player hasn't set their flag
beq- check_globe1 #If country code value is 0xFF, user hasn't set flag. Jump to check_globe1 label

##If user has flag set with a country code other than Taiwan, we know to give that user a red line.##
##Proceed down to Red Line Label##

##################
##Red Line Label##
##################

its_jpn:
li r4, 0x0 #Load 0x0 into r4
b the_end #Red line applied, jump to the_end label

###############################
##PAL Game Country Code Check##
###############################

##Since AUS/NZ region is part of the PAL disc/ISO, we need to check the person's country code to see if they have the AUS or NZ country code##
##That is how AUS/NZ region is reached legitimately##
##If the user hasn't set their flag, their country code will be 0xFF. Meaning we will later need to check their globe position##

euro_oraus:
lbz r12, 0x178 (r3) #Load country code from user's USER RECORD

cmpwi r12, 0x41 #Compare country code to Australia's country code (0x41)
beq- its_aus #If player has Australia country code, jump to its_aus label

cmpwi r12, 0x5F #Compare country code to New Zealand's country code (0x5F)
beq- its_aus #If player has New Zealand country code, jump to its_aus label

cmpwi r12, 0xFF #See if player hasn't set their flag
beq- check_globe2 #If country code value is 0xFF, user hasn't set flag. Jump to check_globe2 label

####################
##Green Line Label##
####################

its_eur:
li r4, 0x2 #Load 0x2 into r4
b the_end #Green line applied, jump to the_end label

########################################
##Globe Position Checks for JAPAN Game##
########################################

check_globe1:
lbz r12, 0x017C (r3) #Load 1st byte value of word of Globe Position from user's USER RECORD

cmpwi r12, 0x11 #Compare byte to 0x11 (Taiwan Region ID default geo-location of Taipei City)
beq- white_line #If equal to 0x11, we know to give the user a white line. Jump to white_line label

b its_jpn #If user doesn't have the Taiwan Region ID default geo-location, we know to give them red line. Jump to red_line label.

######################################
##Globe Position Checks for PAL Game##
######################################

check_globe2:
lbz r12, 0x17C (r3) #Load 1st byte value of word of Globe Position from user's USER RECORD

cmpwi r12, 0xE6 #Compare byte to 0xE6 (AUS/NZ Region ID default geo-location of Australian Capital Territory)
beq- its_aus #If equal to 0xE6, we know to give the user a yellow line. Jump to its_aus label

b its_eur #If user doesn't have the AUS/NZ Region ID default geo-location, we know to give them green line. Jump to its_eur label

#####################
##Yellow Line Label##
#####################

its_aus:
li r4, 0x3 #Load 0x3 into r4, no need to add a branch funciton, since next step below is the the_end label.

#################
##The End Label##
#################

the_end: #Default Instruction not needed

#

##################
###END ASSEMBLY###
##################



Code creator: Vega
Code contributor(s): Star (subroutine founder)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)