Remove guess code, fix pointer formatting

This commit is contained in:
Phlosioneer 2019-02-15 00:20:24 -05:00
parent 197ad274b4
commit fbcfb69fe6

View file

@ -26,13 +26,7 @@ struct UnknownStruct_0203CF40
u16 field8;
u16 fieldA;
u32 fieldC;
void* field10[19];
};
struct UnknownStruct_sub_81C7850
{
// Unknown size; at least 3.
void (*data[3])(u32);
void *field10[19];
};
struct UnknownStruct_sub_81C76C4
@ -40,13 +34,6 @@ struct UnknownStruct_sub_81C76C4
u32 data[523];
};
struct UnknownStruct_sub_81C7C28
{
struct CompressedSpriteSheet sheet;
u32 field4;
};
extern u32 sub_81C9430(void);
extern void sub_81CAADC(void);
extern u32 sub_81C99D4(void);
@ -602,7 +589,7 @@ void sub_81C7418()
void sub_81C742C(u8 taskId)
{
s16* dataPtr;
s16 *dataPtr;
u32 v1;
bool32 v2;
@ -709,12 +696,12 @@ void sub_81C760C(void)
SetVBlankCallback(sub_81C7418);
}
void* sub_81C761C(u32 index, u32 size)
void *sub_81C761C(u32 index, u32 size)
{
return gUnknown_0203CF40->field10[index] = (void*)Alloc(size);
}
void* sub_81C763C(u32 index)
void *sub_81C763C(u32 index)
{
return gUnknown_0203CF40->field10[index];
}
@ -775,10 +762,9 @@ bool32 sub_81C76C4(void)
u32 sub_81C76FC(void)
{
// This is a guess.
struct UnknownStruct_sub_81C76C4 *v1;
u32 *v1;
v1 = sub_81C763C(0);
return sub_81C70D8(v1->data[3]);
return sub_81C70D8(v1[3]);
}
void sub_81C7710(void)
@ -802,8 +788,7 @@ bool32 sub_81C7738(void)
u32 sub_81C7764(s32 a0)
{
// This is a guess.
struct UnknownStruct_sub_81C76C4 *v1;
u32 *v1;
switch (a0)
{
@ -818,7 +803,7 @@ u32 sub_81C7764(s32 a0)
case 1:
v1 = sub_81C763C(0);
decompress_and_copy_tile_data_to_vram(0, &gPokenavHeader_Gfx, 0, 0, 0);
SetBgTilemapBuffer(0, &v1->data[11]);
SetBgTilemapBuffer(0, &v1[11]);
CopyToBgTilemapBuffer(0, &gPokenavHeader_Tilemap, 0, 0);
CopyPaletteIntoBufferUnfaded(gPokenavHeader_Pal, 0, 0x20);
CopyBgTilemapBufferToVram(0);
@ -871,29 +856,26 @@ u32 sub_81C786C(void)
void sub_81C7880(void)
{
// This is a guess.
struct UnknownStruct_0203CF40* v1;
u32 *v1;
v1 = sub_81C763C(0);
v1->fieldC = sub_81C7078(atk47_cmd47, 4);
v1[3] = sub_81C7078(atk47_cmd47, 4);
}
void sub_81C78A0(void)
{
// This is a guess.
struct UnknownStruct_0203CF40* v1;
u32 *v1;
v1 = sub_81C763C(0);
v1->fieldC = sub_81C7078(sub_81C791C, 4);
v1[3] = sub_81C7078(sub_81C791C, 4);
}
bool32 sub_81C78C0(void)
{
// This is a guess.
struct UnknownStruct_0203CF40* v1;
u32 *v1;
v1 = sub_81C763C(0);
return sub_81C70D8(v1->fieldC);
return sub_81C70D8(v1[3]);
}
u32 atk47_cmd47(s32 a0)
@ -955,7 +937,7 @@ void sub_81C7990(u32 a0, u16 a1)
}
__attribute__((naked))
void sub_81C79BC(u16* a0, u16* a1, u32 a2, u32 a3, u32 unused, u32 a5, u32 a6)
void sub_81C79BC(u16 *a0, u16 *a1, u32 a2, u32 a3, u32 unused, u32 a5, u32 a6)
{
asm(".syntax unified\n\
push {r4-r7,lr}\n\
@ -1146,7 +1128,7 @@ void sub_81C7B74(void)
void sub_81C7BA4(u32 a0)
{
u32* v1;
u32 *v1;
v1 = sub_81C763C(0);
sub_81C7BF8(v1[4]);
@ -1166,7 +1148,7 @@ void sub_81C7BF8(u32 a0)
void sub_81C7C28(void)
{
u32* v1;
u32 *v1;
u32 i;
u8 v2;
u32 v3;
@ -1203,7 +1185,7 @@ void sub_81C7CB4(u16 *a0)
a0[19] = (v1 >> 8) * -1;
}
struct Sprite* sub_81C7CCC(void)
struct Sprite *sub_81C7CCC(void)
{
struct Sprite **v1;
struct Sprite *v2;