07-28-2020, 11:20 PM
Here's the code with all versions ported
NTSC-U
C28529C8 00000006
3D808059 2C1C0026
40A20010 3D604800
616B003C 4800000C
3D604182 616B0070
916C721C 93861758
60000000 00000000
PAL
C283D0E8 00000006
3D80805A 2C1C0026
40A20010 3D604800
616B003C 4800000C
3D604182 616B0070
916C2254 93861758
60000000 00000000
NTSC-J
C283C754 00000006
3D80805A 2C1C0026
40A20010 3D604800
616B003C 4800000C
3D604182 616B0070
916C1BD4 93861758
60000000 00000000
NTSC-K
C282B4A8 00000006
3D808059 2C1C0026
40A20010 3D604800
616B003C 4800000C
3D604182 616B0070
916C02AC 93861758
60000000 00000000
NTSC-U
C28529C8 00000006
3D808059 2C1C0026
40A20010 3D604800
616B003C 4800000C
3D604182 616B0070
916C721C 93861758
60000000 00000000
PAL
C283D0E8 00000006
3D80805A 2C1C0026
40A20010 3D604800
616B003C 4800000C
3D604182 616B0070
916C2254 93861758
60000000 00000000
NTSC-J
C283C754 00000006
3D80805A 2C1C0026
40A20010 3D604800
616B003C 4800000C
3D604182 616B0070
916C1BD4 93861758
60000000 00000000
NTSC-K
C282B4A8 00000006
3D808059 2C1C0026
40A20010 3D604800
616B003C 4800000C
3D604182 616B0070
916C02AC 93861758
60000000 00000000
Code:
#NTSC-U = 808529C8
#PAL = 8083D0E8
#NTSC-J = 8083C754
#NTSC-K = 8082B4A8
.set region, '' #e p j or k
#First half address of instruction location to modify
.if (region == 'E' || region == 'e')
lis r12, 0x8059
.elseif (region == 'P' || region == 'p')
lis r12, 0x805A
.elseif (region == 'J' || region == 'j')
lis r12, 0x805A
.elseif (region == 'K' || region == 'k')
lis r12, 0x8059
.else # Invalid Region
.err
.endif
cmpwi r28, 0x26 #Check selected battle map to value of Twilight House
bne+ reset_camera #If not equal, don't execute code
lis r11, 0x4800 #New instruction value to write to static memory; force camera backwards
ori r11, r11, 0x003C
b the_end
reset_camera:
lis r11, 0x4182 #Default instruction value
ori r11, r11, 0x0070
#Update instruction in static memory responsible for the camera hack
the_end:
.if (region == 'E' || region == 'e')
stw r11, 0x721C (r12)
.elseif (region == 'P' || region == 'p')
stw r11, 0x2254 (r12)
.elseif (region == 'J' || region == 'j')
stw r11, 0x1BD4 (r12)
.elseif (region == 'K' || region == 'k')
stw r11, 0x02AC (r12)
.else # Invalid Region
.err
.endif
stw r28, 0x1758 (r6) #Default Instruction, store battle map value to memory