Make it compile

This commit is contained in:
DizzyEggg 2019-03-23 15:46:47 +01:00 committed by huderlem
parent 77c4856e62
commit cbdecf2f8d
2 changed files with 331 additions and 295 deletions

View File

@ -447,10 +447,46 @@ void sub_81D2230(struct UnknownStruct_81D1ED4 *arg0)
arg0->unk354 = 1;
}
/* TODO
static void sub_81D2278(struct UnknownStruct_81D1ED4 *arg0, u16 arg1[66][2], struct UnknownSubStruct_81D1ED4 *arg2, struct UnknownSubStruct_81D1ED4 *arg3, u8 arg4, u16 arg5[66][2])
{
s32 var_2C = 0;
u16 r8;
s32 r10, r4, r2, r0, r1, var_30;
if (arg2->unk2 < arg3->unk2)
{
r2 = arg2->unk2;
r10 = arg2->unk2;
r0 = arg3->unk2;
r1 = arg2->unk0;
r4 = r1 << 10;
var_30 = arg3->unk0;
}
else
{
r0 = arg2->unk0;
r10 = arg3->unk2;
r1 = arg3->unk0;
r4 = r1 << 10;
var_30 = arg2->unk0;
r2 = arg3->unk2;
}
r8 = r0 - r2;
if (r8 != 0)
var_2C = ((var_30 - r1) << 10) / r8;
r8++;
if (arg5 == NULL)
{
}
}
*/
NAKED
static void sub_81D2278(struct UnknownStruct_81D1ED4 *arg0, u16 arg1[66][2], struct UnknownSubStruct_81D1ED4 *arg2, struct UnknownSubStruct_81D1ED4 *arg3, u8 arg4, u16 arg5[66][2])
{
asm(".syntax unified\n\
asm_unified("\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
@ -480,7 +516,7 @@ static void sub_81D2278(struct UnknownStruct_81D1ED4 *arg0, u16 arg1[66][2], str
ldrh r3, [r3]\n\
str r3, [sp, 0x8]\n\
b _081D22C6\n\
_081D22B2:\n\
_081D22B2:\n\
ldrh r0, [r5, 0x2]\n\
ldr r1, [sp, 0x4]\n\
ldrh r1, [r1, 0x2]\n\
@ -491,7 +527,7 @@ _081D22B2:\n\
ldrh r3, [r5]\n\
str r3, [sp, 0x8]\n\
mov r2, r10\n\
_081D22C6:\n\
_081D22C6:\n\
subs r0, r2\n\
lsls r0, 16\n\
lsrs r0, 16\n\
@ -503,7 +539,7 @@ _081D22C6:\n\
mov r1, r8\n\
bl __divsi3\n\
str r0, [sp, 0xC]\n\
_081D22DE:\n\
_081D22DE:\n\
mov r0, r8\n\
adds r0, 0x1\n\
lsls r0, 16\n\
@ -525,7 +561,7 @@ _081D22DE:\n\
cmp r7, r8\n\
bcs _081D23B6\n\
movs r7, 0x1\n\
_081D2308:\n\
_081D2308:\n\
adds r2, r3, r6\n\
asrs r1, r4, 10\n\
asrs r0, r4, 9\n\
@ -542,7 +578,7 @@ _081D2308:\n\
cmp r5, r8\n\
bcc _081D2308\n\
b _081D23B6\n\
_081D2328:\n\
_081D2328:\n\
ldr r2, [sp, 0xC]\n\
cmp r2, 0\n\
ble _081D23C0\n\
@ -564,7 +600,7 @@ _081D2328:\n\
bgt _081D237A\n\
mov r1, r12\n\
str r1, [sp, 0x14]\n\
_081D2352:\n\
_081D2352:\n\
ldr r3, [sp, 0x14]\n\
adds r2, r3, r7\n\
asrs r1, r4, 10\n\
@ -585,7 +621,7 @@ _081D2352:\n\
ldr r1, =0x00026bff\n\
cmp r4, r1\n\
ble _081D2352\n\
_081D237A:\n\
_081D237A:\n\
mov r2, r10\n\
adds r1, r2, r5\n\
ldr r3, [sp]\n\
@ -601,7 +637,7 @@ _081D237A:\n\
bcs _081D23B6\n\
mov r3, r12\n\
movs r7, 0x1\n\
_081D2398:\n\
_081D2398:\n\
adds r2, r3, r6\n\
asrs r1, r4, 10\n\
asrs r0, r4, 9\n\
@ -617,11 +653,11 @@ _081D2398:\n\
lsrs r5, r0, 16\n\
cmp r5, r8\n\
bcc _081D2398\n\
_081D23B6:\n\
_081D23B6:\n\
subs r0, r6, 0x4\n\
b _081D248C\n\
.pool\n\
_081D23C0:\n\
_081D23C0:\n\
ldr r1, [sp, 0xC]\n\
cmp r1, 0\n\
bge _081D2464\n\
@ -647,7 +683,7 @@ _081D23C0:\n\
add r1, r9\n\
strh r1, [r3]\n\
b _081D2414\n\
_081D23F2:\n\
_081D23F2:\n\
ldr r0, [sp, 0xC]\n\
adds r4, r0\n\
adds r6, 0x4\n\
@ -665,13 +701,13 @@ _081D23F2:\n\
adds r2, r0\n\
add r2, r9\n\
strh r2, [r3]\n\
_081D2414:\n\
_081D2414:\n\
ldr r0, =0x00026bff\n\
cmp r4, r0\n\
bgt _081D23F2\n\
movs r0, 0x9B\n\
strh r0, [r3]\n\
_081D241E:\n\
_081D241E:\n\
mov r2, r10\n\
adds r1, r2, r5\n\
ldr r3, [sp]\n\
@ -687,7 +723,7 @@ _081D241E:\n\
bcs _081D245A\n\
mov r3, r12\n\
movs r6, 0x1\n\
_081D243C:\n\
_081D243C:\n\
adds r2, r3, r7\n\
asrs r1, r4, 10\n\
asrs r0, r4, 9\n\
@ -703,11 +739,11 @@ _081D243C:\n\
lsrs r5, r0, 16\n\
cmp r5, r8\n\
bcc _081D243C\n\
_081D245A:\n\
_081D245A:\n\
subs r0, r7, 0x4\n\
b _081D248C\n\
.pool\n\
_081D2464:\n\
_081D2464:\n\
ldr r1, [sp]\n\
movs r2, 0xD4\n\
lsls r2, 2\n\
@ -728,12 +764,12 @@ _081D2464:\n\
movs r0, 0x9B\n\
strh r0, [r7, 0x2]\n\
b _081D2494\n\
_081D248C:\n\
_081D248C:\n\
add r0, r12\n\
mov r2, sp\n\
ldrh r2, [r2, 0x10]\n\
strh r2, [r0]\n\
_081D2494:\n\
_081D2494:\n\
add sp, 0x18\n\
pop {r3-r5}\n\
mov r8, r3\n\
@ -742,7 +778,7 @@ _081D2494:\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.syntax divided");
");
}
static void sub_81D24A4(struct UnknownStruct_81D1ED4 *arg0)

View File

@ -203,14 +203,14 @@ void sub_8166380(void)
gUnknown_0203BC90->field_50++;
break;
case 11:
sub_81D2754(&gUnknown_0203BCAC->field_7C58, gUnknown_0203BCAC->field_7C58.unk14[0]);
sub_81D2754(gUnknown_0203BCAC->field_7C58.unk0[0], gUnknown_0203BCAC->field_7C58.unk14[0]);
sub_81D20AC(&gUnknown_0203BCAC->field_7C58);
gUnknown_0203BC90->field_50++;
break;
case 12:
if (!sub_81D20BC(&gUnknown_0203BCAC->field_7C58))
{
sub_81D1F84(&gUnknown_0203BCAC->field_7C58, gUnknown_0203BCAC->field_7C58.unk14, gUnknown_0203BCAC->field_7C58.unk14);
sub_81D1F84(&gUnknown_0203BCAC->field_7C58, gUnknown_0203BCAC->field_7C58.unk14[0], gUnknown_0203BCAC->field_7C58.unk14[0]);
gUnknown_0203BC90->field_50++;
}
break;