Match sub_8146C30
This commit is contained in:
+1
-53
@@ -10,76 +10,24 @@ static u32 sub_8146E0C(struct MysteryEventStruct *);
|
|||||||
static void sub_8146DA0(struct MysteryEventStruct *);
|
static void sub_8146DA0(struct MysteryEventStruct *);
|
||||||
static void sub_8146D94(struct MysteryEventStruct *);
|
static void sub_8146D94(struct MysteryEventStruct *);
|
||||||
|
|
||||||
#ifdef NONMATCHING
|
|
||||||
void sub_8146C30(u32 a0)
|
void sub_8146C30(u32 a0)
|
||||||
{
|
{
|
||||||
struct MysteryEventStruct *r5 = sub_8143D94();
|
struct MysteryEventStruct *r5 = sub_8143D94();
|
||||||
|
|
||||||
r5->unk_0_0 = a0;
|
r5->unk_0_0 = a0;
|
||||||
asm_comment("The switch logic does not match. Specifically, the \"bhi\" is replaced with a \"bls\" and the comparisons with 1 and 3 are swapped chronologically.");
|
|
||||||
switch (a0)
|
switch (a0)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
r5->unk_1 = (Random() % 15) + 16;
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
break;
|
|
||||||
case 2:
|
case 2:
|
||||||
|
r5->unk_1 = (Random() % 15) + 16;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
r5->unk_1 = (Random() % 15) + 1;
|
r5->unk_1 = (Random() % 15) + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
NAKED
|
|
||||||
void sub_8146C30(u32 a0)
|
|
||||||
{
|
|
||||||
asm_unified("\tpush {r4,r5,lr}\n"
|
|
||||||
"\tadds r4, r0, 0\n"
|
|
||||||
"\tbl sub_8143D94\n"
|
|
||||||
"\tadds r5, r0, 0\n"
|
|
||||||
"\tmovs r0, 0x3\n"
|
|
||||||
"\tadds r1, r4, 0\n"
|
|
||||||
"\tands r1, r0\n"
|
|
||||||
"\tldrb r2, [r5]\n"
|
|
||||||
"\tmovs r0, 0x4\n"
|
|
||||||
"\tnegs r0, r0\n"
|
|
||||||
"\tands r0, r2\n"
|
|
||||||
"\torrs r0, r1\n"
|
|
||||||
"\tstrb r0, [r5]\n"
|
|
||||||
"\tcmp r4, 0x2\n"
|
|
||||||
"\tbhi _08146C56\n"
|
|
||||||
"\tcmp r4, 0x1\n"
|
|
||||||
"\tbcs _08146C5C\n"
|
|
||||||
"\tb _08146C80\n"
|
|
||||||
"_08146C56:\n"
|
|
||||||
"\tcmp r4, 0x3\n"
|
|
||||||
"\tbeq _08146C6E\n"
|
|
||||||
"\tb _08146C80\n"
|
|
||||||
"_08146C5C:\n"
|
|
||||||
"\tbl Random\n"
|
|
||||||
"\tlsls r0, 16\n"
|
|
||||||
"\tlsrs r0, 16\n"
|
|
||||||
"\tmovs r1, 0xF\n"
|
|
||||||
"\tbl __umodsi3\n"
|
|
||||||
"\tadds r0, 0x10\n"
|
|
||||||
"\tb _08146C7E\n"
|
|
||||||
"_08146C6E:\n"
|
|
||||||
"\tbl Random\n"
|
|
||||||
"\tlsls r0, 16\n"
|
|
||||||
"\tlsrs r0, 16\n"
|
|
||||||
"\tmovs r1, 0xF\n"
|
|
||||||
"\tbl __umodsi3\n"
|
|
||||||
"\tadds r0, 0x1\n"
|
|
||||||
"_08146C7E:\n"
|
|
||||||
"\tstrb r0, [r5, 0x1]\n"
|
|
||||||
"_08146C80:\n"
|
|
||||||
"\tpop {r4,r5}\n"
|
|
||||||
"\tpop {r0}\n"
|
|
||||||
"\tbx r0");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void sub_8146C88(void)
|
void sub_8146C88(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user