some doc'ing and decomping

This commit is contained in:
Seth Barberee 2020-10-10 14:33:06 -05:00
parent fc0a7eae93
commit 14b4ad7735
14 changed files with 235 additions and 195 deletions

View File

@ -30418,7 +30418,7 @@ _08021A8E:
asrs r5, r0, 16
ldr r4, [r7]
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
ldrb r1, [r4, 0xC]
lsls r0, 24
lsrs r0, 24
@ -31931,7 +31931,7 @@ sub_8022684:
strh r0, [r1, 0x12]
movs r2, 0x12
ldrsh r0, [r1, r2]
bl sub_808DBA8
bl GetFriendArea
ldr r1, [r4]
strb r0, [r1, 0x10]
movs r0, 0x18
@ -33761,7 +33761,7 @@ _08023532:
movs r6, 0
ldrsh r5, [r1, r6]
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
add r4, sp, 0x16C
@ -35339,7 +35339,7 @@ sub_8024184:
lsrs r4, 24
movs r1, 0x8
ldrsh r0, [r0, r1]
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
cmp r4, r0
@ -38164,7 +38164,7 @@ _080257E0:
ldr r0, [r4, 0x1C]
movs r2, 0x8
ldrsh r0, [r0, r2]
bl sub_808DBA8
bl GetFriendArea
ldrb r1, [r4, 0xC]
lsls r0, 24
lsrs r0, 24
@ -38550,7 +38550,7 @@ _08025AFC:
ldr r0, [r0, 0x1C]
movs r1, 0x8
ldrsh r0, [r0, r1]
bl sub_808DBA8
bl GetFriendArea
ldr r1, [r4]
strb r0, [r1, 0xD]
bl sub_8023C60

View File

@ -37884,7 +37884,7 @@ _0803ABCE:
ldr r4, [r0]
movs r1, 0x8
ldrsh r0, [r2, r1]
bl sub_808DBA8
bl GetFriendArea
ldrb r1, [r4, 0x4]
lsls r0, 24
lsrs r0, 24

View File

@ -997,7 +997,7 @@ sub_803D870:
mov r9, r1
b _0803D8B8
_0803D884:
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1

View File

@ -4212,7 +4212,7 @@ sub_8044CA0:
adds r4, r0, 0
lsls r0, r1, 16
asrs r0, 16
bl sub_808DB48
bl GetIsMoving
lsls r0, 24
cmp r0, 0
beq _08044CB6
@ -5222,7 +5222,7 @@ sub_80453AC:
negs r0, r0
mov r9, r0
mov r0, r8
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
@ -5404,7 +5404,7 @@ sub_804550C:
negs r0, r0
mov r9, r0
mov r0, r8
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r7, r0, 24
movs r5, 0

View File

@ -7837,7 +7837,7 @@ _0805658C:
mov r2, r8
movs r1, 0x4
ldrsh r0, [r2, r1]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
@ -12629,7 +12629,7 @@ sub_80588F4:
ldr r0, [r5, 0x70]
movs r1, 0x4
ldrsh r0, [r0, r1]
bl sub_808DB78
bl GetLowKickDmg
adds r3, r0, 0
str r4, [sp]
adds r0, r6, 0
@ -19679,10 +19679,10 @@ _0805BDDE:
cmp r8, r5
beq _0805BDDC
mov r0, r8
bl sub_808DACC
bl GetPokemonSize
adds r4, r0, 0
adds r0, r5, 0
bl sub_808DACC
bl GetPokemonSize
lsls r4, 24
lsls r0, 24
cmp r4, r0
@ -20241,7 +20241,7 @@ sub_805C208:
ldr r0, [r1, 0x70]
movs r1, 0x4
ldrsh r0, [r0, r1]
bl sub_808DB90
bl GetSizeOrbDmg
mov r10, r0
adds r0, r6, 0
bl sub_8092B00
@ -44620,7 +44620,7 @@ _08068A8E:
beq _08068AB2
movs r1, 0xE
ldrsh r0, [r2, r1]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
adds r4, r0
@ -44630,7 +44630,7 @@ _08068AB2:
ble _08068A8E
movs r1, 0x8
ldrsh r0, [r6, r1]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
adds r4, r0
@ -44902,7 +44902,7 @@ _08068CE8:
beq _08068CFE
movs r1, 0xE
ldrsh r0, [r4, r1]
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
add r0, sp
@ -44985,7 +44985,7 @@ _08068D6A:
beq _08068DD6
movs r1, 0xE
ldrsh r0, [r5, r1]
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
cmp r0, r8
@ -48189,7 +48189,7 @@ _0806A5CE:
_0806A608:
movs r1, 0x2
ldrsh r0, [r4, r1]
bl sub_808DB14
bl GetWalkableTiles
lsls r0, 24
lsrs r0, 24
cmp r0, 0x4
@ -50621,7 +50621,7 @@ _0806B838:
adds r4, r0, 0
movs r1, 0
ldrsh r0, [r6, r1]
bl sub_808DB60
bl GetUnk1D
lsls r0, 24
lsrs r0, 24
cmp r0, r4
@ -52135,7 +52135,7 @@ sub_806C444:
lsls r0, 16
asrs r6, r0, 16
adds r0, r6, 0
bl sub_808DBC0
bl GetBaseHP
adds r5, r0, 0
movs r4, 0x2
cmp r4, r7
@ -52519,7 +52519,7 @@ _0806C714:
mov r7, r8
movs r1, 0x4
ldrsh r0, [r7, r1]
bl sub_808DB14
bl GetWalkableTiles
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
@ -53649,7 +53649,7 @@ sub_806CF98:
ldr r7, [r4, 0x70]
movs r1, 0x4
ldrsh r0, [r7, r1]
bl sub_808DAE4
bl GetShadowSize
lsls r0, 24
lsrs r4, r0, 24
cmp r5, 0x3
@ -58516,7 +58516,7 @@ sub_806F660:
mov r9, r1
movs r2, 0x4
ldrsh r0, [r4, r2]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r5, r0, 24
ldr r0, _0806F6C0
@ -58882,7 +58882,7 @@ _0806F91C:
ldr r0, [r4, 0x70]
movs r2, 0x4
ldrsh r0, [r0, r2]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r1, r0, 24
adds r0, r4, 0
@ -58993,12 +58993,12 @@ _0806F9F2:
cmp r4, r0
beq _0806FA3C
adds r0, r4, 0
bl sub_808DBF4
bl GetUnk12
lsls r0, 24
cmp r0, 0
bne _0806FA50
adds r0, r4, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
mov r1, sp
@ -59046,7 +59046,7 @@ sub_806FA5C:
mov r10, r0
movs r1, 0
ldrsh r0, [r6, r1]
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
mov r9, r0
@ -59357,7 +59357,7 @@ sub_806FD18:
negs r6, r6
movs r1, 0x4
ldrsh r0, [r4, r1]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r5, r0, 24
movs r2, 0x2
@ -59524,7 +59524,7 @@ _0806FE58:
add r0, sp, 0xC
movs r1, 0
ldrsh r0, [r0, r1]
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r7, r0, 24
ldr r1, _0806FF74
@ -60142,7 +60142,7 @@ sub_8070328:
push {lr}
lsls r0, 16
asrs r0, 16
bl sub_808DB14
bl GetWalkableTiles
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0x3
@ -60770,7 +60770,7 @@ _08070794:
_080707A8:
movs r1, 0x2
ldrsh r0, [r5, r1]
bl sub_808DAFC
bl GetMoveSpeed
adds r4, r0
adds r0, r6, 0
movs r1, 0x6
@ -63348,7 +63348,7 @@ sub_8071A70:
push {lr}
movs r1, 0x2
ldrsh r0, [r0, r1]
bl sub_808DBD8
bl GetUnk33
lsls r0, 24
cmp r0, 0
beq _08071A84
@ -69549,7 +69549,7 @@ _08074B7A:
bne _08074BAE
movs r2, 0x2
ldrsh r0, [r6, r2]
bl sub_808DB2C
bl GetUnk1B
lsls r0, 24
lsrs r4, r0, 24
_08074BAE:
@ -71491,7 +71491,7 @@ _08075AF4:
beq _08075B46
movs r1, 0x2
ldrsh r0, [r5, r1]
bl sub_808DB48
bl GetIsMoving
lsls r0, 24
cmp r0, 0
beq _08075B92
@ -71514,7 +71514,7 @@ _08075B46:
_08075B52:
movs r1, 0x2
ldrsh r0, [r5, r1]
bl sub_808DB48
bl GetIsMoving
lsls r0, 24
cmp r0, 0
beq _08075B68
@ -97089,7 +97089,7 @@ sub_80828E0:
movs r4, 0x1
negs r4, r4
mov r0, r8
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r6, r0, 24
movs r3, 0
@ -97245,7 +97245,7 @@ sub_8082A08:
negs r0, r0
mov r8, r0
mov r0, r9
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r6, r0, 24
movs r3, 0

View File

@ -819,10 +819,10 @@ _0808E426:
cmp r0, 0
bne _0808E456
mov r0, r9
bl sub_808DACC
bl GetPokemonSize
adds r4, r0, 0
adds r0, r5, 0
bl sub_808DACC
bl GetPokemonSize
lsls r4, 24
lsls r0, 24
cmp r4, r0
@ -1109,7 +1109,7 @@ sub_808E668:
cmp r0, 0x1
bls _0808E6D6
adds r0, r1, 0
bl sub_808DAE4
bl GetShadowSize
lsls r0, 24
lsrs r0, 24
movs r3, 0
@ -3068,13 +3068,13 @@ _0808F4FA:
b _0808F6DE
_0808F50A:
ldr r0, [sp, 0x1C]
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r5, r0, 24
mov r3, r8
movs r1, 0x8
ldrsh r0, [r3, r1]
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r6, r0, 24
adds r0, r5, 0
@ -4187,7 +4187,7 @@ _0808FDB0:
mov r1, r10
movs r2, 0
ldrsh r0, [r1, r2]
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_8092524
@ -4239,7 +4239,7 @@ _0808FDB0:
mov r3, r10
movs r1, 0
ldrsh r0, [r3, r1]
bl sub_808DAB4
bl GetCategoryString
adds r1, r0, 0
adds r0, r6, 0
movs r2, 0x14
@ -4257,7 +4257,7 @@ _0808FDB0:
mov r3, r10
movs r1, 0
ldrsh r0, [r3, r1]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 22
adds r0, r4

View File

@ -459,7 +459,7 @@ _080904BA:
mov r8, r1
_080904D2:
ldr r0, [sp, 0xE0]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r5, r0, 24
movs r4, 0
@ -484,7 +484,7 @@ _080904E4:
beq _08090510
movs r1, 0x8
ldrsh r0, [r2, r1]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
adds r5, r0

View File

@ -8416,7 +8416,7 @@ _080A184C:
bl sub_80A8BFC
lsls r0, 16
asrs r0, 16
bl sub_808DB48
bl GetIsMoving
b _080A171E
_080A185E:
lsls r0, r5, 16
@ -8500,7 +8500,7 @@ _080A18F6:
_080A1900: .4byte gUnknown_2039D98
_080A1904:
movs r0, 0x51
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_80925EC
@ -8562,7 +8562,7 @@ _080A197C:
_080A1984: .4byte gUnknown_2039D98
_080A1988:
ldr r0, _080A19D4
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_80925EC
@ -8781,7 +8781,7 @@ _080A1B60: .4byte gUnknown_2039D98
_080A1B64:
ldr r4, _080A1BCC
adds r0, r4, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_8092600
@ -8789,7 +8789,7 @@ _080A1B64:
cmp r0, 0
bne _080A1B88
adds r0, r4, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_80925EC
@ -9036,7 +9036,7 @@ _080A1CCC:
cmp r0, 0
beq _080A1CA4
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_8092600
@ -9065,7 +9065,7 @@ _080A1DA8:
bl sub_80018D8
ldr r4, _080A1DE8
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
@ -9073,7 +9073,7 @@ _080A1DA8:
movs r2, 0
bl sub_8092578
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_8092600
@ -9093,7 +9093,7 @@ _080A1DEC:
asrs r5, r0, 16
ldr r4, _080A1E2C
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
@ -9105,7 +9105,7 @@ _080A1DEC:
b _080A236A
_080A1E14:
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_8092600
@ -9134,7 +9134,7 @@ _080A1E42:
adds r6, r5, 0
ldr r4, _080A1EC4
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
@ -9146,7 +9146,7 @@ _080A1E42:
b _080A236A
_080A1E6C:
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_8092600
@ -9154,7 +9154,7 @@ _080A1E6C:
cmp r0, 0
bne _080A1E8E
adds r0, r5, 0
bl sub_808DBA8
bl GetFriendArea
lsls r0, 24
lsrs r0, 24
bl sub_80925EC

View File

@ -10416,7 +10416,7 @@ sub_80A7428:
movs r1, 0
bl GetFileDataPtr
adds r0, r4, 0
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
ldr r1, _080A7488

View File

@ -96,7 +96,7 @@ _0808CEA4:
movs r5, 0x1
strb r5, [r0, 0x3]
adds r0, r7, 0
bl sub_808DBC0
bl GetBaseHP
mov r1, sp
movs r4, 0
strh r0, [r1, 0x16]
@ -260,7 +260,7 @@ sub_808CFD0:
strb r5, [r7, 0x2]
strb r0, [r7, 0x3]
mov r0, r9
bl sub_808DBC0
bl GetBaseHP
strh r0, [r7, 0x16]
mov r0, r9
movs r1, 0
@ -377,7 +377,7 @@ sub_808D0D8:
strb r4, [r7, 0x3]
movs r1, 0x8
ldrsh r0, [r7, r1]
bl sub_808DBC0
bl GetBaseHP
movs r5, 0
strh r0, [r7, 0x16]
movs r2, 0x8
@ -1269,7 +1269,7 @@ _0808D6FA:
beq _0808D728
movs r1, 0x8
ldrsh r0, [r2, r1]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
adds r5, r0
@ -1331,7 +1331,7 @@ _0808D76A:
beq _0808D798
movs r2, 0x8
ldrsh r0, [r1, r2]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
adds r5, r0
@ -1352,7 +1352,7 @@ _0808D798:
adds r1, r0, r1
movs r2, 0x8
ldrsh r0, [r1, r2]
bl sub_808DACC
bl GetPokemonSize
lsls r0, 24
lsrs r0, 24
adds r5, r0

View File

@ -200,96 +200,4 @@ sub_808DD48:
_0808DD64: .4byte gMonsterParameters
thumb_func_end sub_808DD48
thumb_func_start sub_808DD68
sub_808DD68:
push {lr}
lsls r0, 16
asrs r2, r0, 16
cmp r1, 0
bne _0808DD88
ldr r0, _0808DD84
ldr r1, [r0]
lsls r0, r2, 3
adds r0, r2
lsls r0, 3
adds r0, r1
ldrb r0, [r0, 0x8]
b _0808DD8A
.align 2, 0
_0808DD84: .4byte gMonsterParameters
_0808DD88:
movs r0, 0xA
_0808DD8A:
pop {r1}
bx r1
thumb_func_end sub_808DD68
thumb_func_start sub_808DD90
sub_808DD90:
push {lr}
sub sp, 0xC
lsls r0, 16
asrs r2, r0, 16
ldr r0, _0808DDBC
ldr r1, [r0]
lsls r0, r2, 3
adds r0, r2
lsls r0, 3
adds r0, r1
ldrh r0, [r0, 0x10]
cmp r0, 0
beq _0808DDC8
ldr r1, _0808DDC0
mov r0, sp
bl sprintf
ldr r1, _0808DDC4
mov r0, sp
bl OpenFile
b _0808DDCA
.align 2, 0
_0808DDBC: .4byte gMonsterParameters
_0808DDC0: .4byte gUnknown_8107684
_0808DDC4: .4byte gUnknown_8510000
_0808DDC8:
movs r0, 0
_0808DDCA:
add sp, 0xC
pop {r1}
bx r1
thumb_func_end sub_808DD90
thumb_func_start sub_808DDD0
sub_808DDD0:
push {lr}
sub sp, 0xC
lsls r0, 16
asrs r2, r0, 16
ldr r0, _0808DDFC
ldr r1, [r0]
lsls r0, r2, 3
adds r0, r2
lsls r0, 3
adds r0, r1
ldrh r0, [r0, 0x10]
cmp r0, 0
beq _0808DE08
ldr r1, _0808DE00
mov r0, sp
bl sprintf
ldr r1, _0808DE04
mov r0, sp
bl OpenFileAndGetFileDataPtr
b _0808DE0A
.align 2, 0
_0808DDFC: .4byte gMonsterParameters
_0808DE00: .4byte gUnknown_8107684
_0808DE04: .4byte gUnknown_8510000
_0808DE08:
movs r0, 0
_0808DE0A:
add sp, 0xC
pop {r1}
bx r1
thumb_func_end sub_808DDD0
.align 2,0 @ don't pad with nop

View File

@ -8,21 +8,147 @@ extern struct gPokemon *gMonsterParameters;
extern struct FileArchive gUnknown_8510000;
extern const char gUnknown_8107684;
//u8 sub_808DDD0(s16 r0)
//{
// // Looks like this loads the dialogue sprite for the pokemon
//
// // TODO stack is being added instead of being substracted
// // Else this matches
// char buffer[0xC];
// if(gMonsterParameters[r0].dialogue_sprites != 0)
// {
// sprintf(buffer, &gUnknown_8107684);
// OpenFileAndGetFileDataPtr(buffer, &gUnknown_8510000);
// return;
// }
// return 0;
//}
#ifndef NONMATCHING
NAKED
#endif
// Pretty confided args are correct yet compiler disagrees
u8 sub_808DD68(s16 r0, u32 r1)
{
#ifdef NONMATCHING
if (r1 != 0)
{
return 0xA;
}
else
{
return gMonsterParameters[r0].overworld_sprite;
}
#else
asm_unified("\tpush {lr}\n"
"\tlsls r0, 16\n"
"\tasrs r2, r0, 16\n"
"\tcmp r1, 0\n"
"\tbne _0808DD88\n"
"\tldr r0, _0808DD84\n"
"\tldr r1, [r0]\n"
"\tlsls r0, r2, 3\n"
"\tadds r0, r2\n"
"\tlsls r0, 3\n"
"\tadds r0, r1\n"
"\tldrb r0, [r0, 0x8]\n"
"\tb _0808DD8A\n"
"\t.align 2, 0\n"
"_0808DD84: .4byte gMonsterParameters\n"
"_0808DD88:\n"
"\tmovs r0, 0xA\n"
"_0808DD8A:\n"
"\tpop {r1}\n"
"\tbx r1");
#endif
}
#ifndef NONMATCHING
NAKED
#endif
struct OpenedFile *sub_808DD90(s16 r0)
{
#ifdef NONMATCHING
// Looks like this loads the dialogue sprite for the pokemon
// Two words: register memes... else it matches
// Fix this and then one after matches too
char buffer[0xC];
if(gMonsterParameters[r0].dialogue_sprites == 0)
{
return NULL;
}
sprintf(buffer, &gUnknown_8107684);
return OpenFile(buffer, &gUnknown_8510000);
#else
asm_unified("\tpush {lr}\n"
"\tsub sp, 0xC\n"
"\tlsls r0, 16\n"
"\tasrs r2, r0, 16\n"
"\tldr r0, _0808DDBC\n"
"\tldr r1, [r0]\n"
"\tlsls r0, r2, 3\n"
"\tadds r0, r2\n"
"\tlsls r0, 3\n"
"\tadds r0, r1\n"
"\tldrh r0, [r0, 0x10]\n"
"\tcmp r0, 0\n"
"\tbeq _0808DDC8\n"
"\tldr r1, _0808DDC0\n"
"\tmov r0, sp\n"
"\tbl sprintf\n"
"\tldr r1, _0808DDC4\n"
"\tmov r0, sp\n"
"\tbl OpenFile\n"
"\tb _0808DDCA\n"
"\t.align 2, 0\n"
"_0808DDBC: .4byte gMonsterParameters\n"
"_0808DDC0: .4byte gUnknown_8107684\n"
"_0808DDC4: .4byte gUnknown_8510000\n"
"_0808DDC8:\n"
"\tmovs r0, 0\n"
"_0808DDCA:\n"
"\tadd sp, 0xC\n"
"\tpop {r1}\n"
"\tbx r1");
#endif
}
#ifndef NONMATCHING
NAKED
#endif
struct OpenedFile *sub_808DDD0(s16 r0)
{
#ifdef NONMATCHING
// Looks like this loads the dialogue sprite for the pokemon
// Two words: register memes... else it matches
char buffer[0xC];
if(gMonsterParameters[r0].dialogue_sprites == 0)
{
return NULL;
}
sprintf(buffer, &gUnknown_8107684);
return OpenFileAndGetFileDataPtr(buffer, &gUnknown_8510000);
#else
asm_unified("\tpush {lr}\n"
"\tsub sp, 0xC\n"
"\tlsls r0, 16\n"
"\tasrs r2, r0, 16\n"
"\tldr r0, _0808DDFC\n"
"\tldr r1, [r0]\n"
"\tlsls r0, r2, 3\n"
"\tadds r0, r2\n"
"\tlsls r0, 3\n"
"\tadds r0, r1\n"
"\tldrh r0, [r0, 0x10]\n"
"\tcmp r0, 0\n"
"\tbeq _0808DE08\n"
"\tldr r1, _0808DE00\n"
"\tmov r0, sp\n"
"\tbl sprintf\n"
"\tldr r1, _0808DE04\n"
"\tmov r0, sp\n"
"\tbl OpenFileAndGetFileDataPtr\n"
"\tb _0808DE0A\n"
"\t.align 2, 0\n"
"_0808DDFC: .4byte gMonsterParameters\n"
"_0808DE00: .4byte gUnknown_8107684\n"
"_0808DE04: .4byte gUnknown_8510000\n"
"_0808DE08:\n"
"\tmovs r0, 0\n"
"_0808DE0A:\n"
"\tadd sp, 0xC\n"
"\tpop {r1}\n"
"\tbx r1");
#endif
}
bool8 sub_808DE10(s16 r0, s32 r1)
{

View File

@ -3,73 +3,72 @@
extern struct gPokemon *gMonsterParameters;
u8 *sub_808DAB4(s16 r0)
u8 *GetCategoryString(s16 r0)
{
return gMonsterParameters[r0].category;
}
u8 sub_808DACC(s16 r0)
u8 GetPokemonSize(s16 r0)
{
return gMonsterParameters[r0].size;
}
u8 sub_808DAE4(s16 r0)
u8 GetShadowSize(s16 r0)
{
return gMonsterParameters[r0].shadow_size;
}
s32 sub_808DAFC(s16 r0)
s32 GetMoveSpeed(s16 r0)
{
return gMonsterParameters[r0].move_speed;
}
u8 sub_808DB14(s16 r0)
u8 GetWalkableTiles(s16 r0)
{
return gMonsterParameters[r0].walkable_tiles;
}
u8 sub_808DB2C(s16 r0)
u8 GetUnk1B(s16 r0)
{
return ((u8)(gMonsterParameters[r0].unk1B) << 25) >> 24;
}
bool8 sub_808DB48(s16 r0)
bool8 GetIsMoving(s16 r0)
{
return gMonsterParameters[r0].isMoving;
}
u8 sub_808DB60(s16 r0)
u8 GetUnk1D(s16 r0)
{
return gMonsterParameters[r0].unk1D;
}
u16 sub_808DB78(s16 r0)
u16 GetLowKickDmg(s16 r0)
{
return gMonsterParameters[r0].lowkick_dmg;
}
u16 sub_808DB90(s16 r0)
u16 GetSizeOrbDmg(s16 r0)
{
return gMonsterParameters[r0].sizeorb_dmg;
}
u8 sub_808DBA8(s16 r0)
u8 GetFriendArea(s16 r0)
{
return gMonsterParameters[r0].friend_area;
}
u16 sub_808DBC0(s16 r0)
u16 GetBaseHP(s16 r0)
{
return gMonsterParameters[r0].base_hp;
}
bool8 sub_808DBD8(s16 r0)
bool8 GetUnk33(s16 r0)
{
return gMonsterParameters[r0].unk33;
}
u8 sub_808DBF4(s16 r0)
u8 GetUnk12(s16 r0)
{
return gMonsterParameters[r0].unk12;
}
@ -78,3 +77,9 @@ s16 sub_808DC0C(s16 r0)
{
return gMonsterParameters[r0].evolve_from;
}
// TODO fix calculation to match
//u32 sub_808DC28(s16 r0, u32 r1)
//{
// return gMonsterParameters[r0].base_att + (r1 << 1);
//}

View File

@ -398,7 +398,7 @@ gUnknown_202DE58 = .; /* 202DE58 */
gUnknown_202DEA8 = .; /* 202DEA8 */
. += 0xF0;
gUnknown_202DF98 = .; /* 202DF98 */
gUnknown_202DF98 = .; /* 202DF98 ( Parner Nickname? ) */
. += 0x50;
gUnknown_202DFE8 = .; /* 202DFE8 */
@ -473,7 +473,7 @@ gUnknown_202E791 = .; /* 202E791 */
gUnknown_202E794 = .; /* 202E794 */
. += 0x4;
gUnknown_202E798 = .; /* 202E798 */
gUnknown_202E798 = .; /* 202E798 (on screen dialogue text) */
. += 0x3E8;
gUnknown_202EB80 = .; /* 202EB80 */
@ -1019,7 +1019,8 @@ gUnknown_2039B48 = .; /* 2039B48 */
gUnknown_2039D50 = .; /* 2039D50 */
. += 0x48;
gUnknown_2039D98 = .; /* 2039D98 (seems to be copy of gTeamName)*/
gUnknown_2039D98 = .; /* 2039D98 (seems to be storage for strings.. used for
both Team Name and Player Name) */
. += 0xC;
gUnknown_2039DA4 = .; /* 2039DA4 */