How to Port Codes to other Regions
#5
For context, this does the following....

48000000 #set a pointer to load another pointer from
8032E274 #Load pointer (mem addr) that resides at this pointer
DE000000 #Check a range on the loaded pointer
80008180 #Must be betweeen 80000000 and 81800000 (is it a valid mem 8X address?)
120002C0 #Write a halfword (XXXX) value at the pointer + 0x2C0
0000C3C8 #What XXXX value to write
E0000000 #End if created by 48000000 gecko instruction
80008000 #Reset pointer and base address to start of mem80

The ASM equivalent would be~
.set main_pointer
lis rX, main_pointer@ha
lwz rX, main_pointer@l (rX)
andis. rZ, rY, 0x0001 #Hacky way to check mem8X vs mem9X
bne- skip
li rY, 0xFFFFC3C8 #Set as negative to load it into register in 1 go
sth rY, 0x2C0 (rX) #Writes only 0xC3C8 portion
skip:

Regarding your concerns, the value of 8032E274 needs to be ported. The issue is that this is most likely a static (instance) ptr and these are hard to port because this value is not natively part of any game file (dol/rel). Basically, doing the porting methods described in this thread would not be ideal.

It's still worth a shot. Use the value 32E274 for the CTRL+G step. If it works then replace 8032E274 with new 80xxxxxx value.
Reply


Messages In This Thread
How to Port Codes to other Regions - by Vega - 02-23-2018, 06:31 PM
RE: How to Port Codes to other Regions - by Vega - 03-17-2020, 02:50 PM
RE: How to Port Codes to other Regions - by Vega - 02-17-2025, 02:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)