Hello Guys! Im new to MED9 (started not long ago with reverse engineering) and i tried to follow the tutorials that are on the Forum here. So far so good... I loaded a Project that is available here where LDRXN is already Named right.
I used a different file where i had a damos. It looks identical but not quite the same.
This is the Subroutine from the predecompiled file from the forum (LDRXN):
ROM:0052D298 # =============== S U B R O U T I N E =======================================
ROM:0052D298
ROM:0052D298
ROM:0052D298 LOAD_LDRXN_AND_LDRXNZK:
ROM:0052D298
ROM:0052D298 .set var_50, -0x50
ROM:0052D298 .set var_4C, -0x4C
ROM:0052D298 .set var_44, -0x44
ROM:0052D298 .set var_28, -0x28
ROM:0052D298 .set var_20, -0x20
ROM:0052D298 .set arg_0, 0
ROM:0052D298
ROM:0052D298 addi r11, r1, arg_0
ROM:0052D29C stwu r1, -0x28(r1)
ROM:0052D2A0 mflr r0
ROM:0052D2A4 bl sub_4C40E0
ROM:0052D2A8 lis r27, unk_5D048E@h
ROM:0052D2AC addi r27, r27, unk_5D048E@l
ROM:0052D2B0 lbz r4, byte_7FC596
ROM:0052D2B4 addi r3, r27, 0
ROM:0052D2B8 bl sub_5A6C4C
ROM:0052D2BC stw r3, dword_7FEF6C
ROM:0052D2C0 lbz r12, byte_7FEECB
ROM:0052D2C4 lbz r9, byte_7FEECE
ROM:0052D2C8 mulli r12, r12, 3
ROM:0052D2CC lis r10, LDRXN1_REF@h <------- Renamed Address
ROM:0052D2D0 add r9, r9, r12
ROM:0052D2D4 addi r10, r10, LDRXN1_REF@l <------- Renamed Address
ROM:0052D2D8 slwi r9, r9, 2
ROM:0052D2DC lwzx r3, r10, r9
This is how my Subroutine looks. Identical but looks wrong to me :/
ROM:0051A5E8 # =============== S U B R O U T I N E =======================================
ROM:0051A5E8
ROM:0051A5E8
ROM:0051A5E8 LOAD_LDRXN_AND_LDRXNZK:
ROM:0051A5E8
ROM:0051A5E8 .set var_50, -0x50
ROM:0051A5E8 .set var_4C, -0x4C
ROM:0051A5E8 .set var_44, -0x44
ROM:0051A5E8 .set var_28, -0x28
ROM:0051A5E8 .set var_20, -0x20
ROM:0051A5E8 .set arg_0, 0
ROM:0051A5E8
ROM:0051A5E8 addi r11, r1, arg_0
ROM:0051A5EC stwu r1, -0x28(r1)
ROM:0051A5F0 mflr r0
ROM:0051A5F4 bl sub_4BD24C
ROM:0051A5F8 lis r27, ((word_5CF4F6+0x10000)@h)
ROM:0051A5FC addi r27, r27, -0xB0A # word_5CF4F6
ROM:0051A600 lbz r4, byte_7FC6D3
ROM:0051A604 addi r3, r27, 0
ROM:0051A608 bl sub_590DD4
ROM:0051A60C stw r3, dword_7FEECC
ROM:0051A610 lbz r9, byte_7FEE2A
ROM:0051A614 lis r10, ((off_5CF528+0x10000)@h) <------- This should be the call to load the map #1. But why is there the 0x10000??
<--------- And here is the add missing
ROM:0051A618 addi r10, r10, -0xAD8 # off_5CF528
ROM:0051A61C clrlslwi r9, r9, 24,2
ROM:0051A620 lwzx r3, r10, r9
Shouldnt be the function always be 100% identical?
Maybe someone can give me a hint so i can learn and progress
Greetings from Austria