split out pokemon funcs and decomp another nullsub

This commit is contained in:
Seth Barberee 2020-09-16 00:15:52 -05:00
parent d2be6ce16c
commit 424db9c41b
7 changed files with 617 additions and 554 deletions

View File

@ -2075,9 +2075,4 @@ xxx_dungeon_8001340:
bx r0
thumb_func_end xxx_dungeon_8001340
thumb_func_start nullsub_3
nullsub_3:
bx lr
thumb_func_end nullsub_3
.align 2, 0 @ Don't pad with nop.

View File

@ -5,555 +5,6 @@
.text
thumb_func_start sub_808DAB4
sub_808DAB4:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DAC8
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldr r0, [r1, 0x4]
bx lr
.align 2, 0
_0808DAC8: .4byte gMonsterParameters
thumb_func_end sub_808DAB4
thumb_func_start sub_808DACC
sub_808DACC:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DAE0
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x9]
bx lr
.align 2, 0
_0808DAE0: .4byte gMonsterParameters
thumb_func_end sub_808DACC
thumb_func_start sub_808DAE4
sub_808DAE4:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DAF8
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x19]
bx lr
.align 2, 0
_0808DAF8: .4byte gMonsterParameters
thumb_func_end sub_808DAE4
thumb_func_start sub_808DAFC
sub_808DAFC:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB10
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldr r0, [r1, 0xC]
bx lr
.align 2, 0
_0808DB10: .4byte gMonsterParameters
thumb_func_end sub_808DAFC
thumb_func_start sub_808DB14
sub_808DB14:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB28
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x15]
bx lr
.align 2, 0
_0808DB28: .4byte gMonsterParameters
thumb_func_end sub_808DB14
thumb_func_start sub_808DB2C
sub_808DB2C:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB44
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x1B]
lsls r0, 25
lsrs r0, 24
bx lr
.align 2, 0
_0808DB44: .4byte gMonsterParameters
thumb_func_end sub_808DB2C
thumb_func_start sub_808DB48
sub_808DB48:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB5C
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x1C]
bx lr
.align 2, 0
_0808DB5C: .4byte gMonsterParameters
thumb_func_end sub_808DB48
thumb_func_start sub_808DB60
sub_808DB60:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB74
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x1D]
bx lr
.align 2, 0
_0808DB74: .4byte gMonsterParameters
thumb_func_end sub_808DB60
thumb_func_start sub_808DB78
sub_808DB78:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB8C
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrh r0, [r1, 0x2C]
bx lr
.align 2, 0
_0808DB8C: .4byte gMonsterParameters
thumb_func_end sub_808DB78
thumb_func_start sub_808DB90
sub_808DB90:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DBA4
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrh r0, [r1, 0x2E]
bx lr
.align 2, 0
_0808DBA4: .4byte gMonsterParameters
thumb_func_end sub_808DB90
thumb_func_start sub_808DBA8
sub_808DBA8:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DBBC
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x16]
bx lr
.align 2, 0
_0808DBBC: .4byte gMonsterParameters
thumb_func_end sub_808DBA8
thumb_func_start sub_808DBC0
sub_808DBC0:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DBD4
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrh r0, [r1, 0x1E]
bx lr
.align 2, 0
_0808DBD4: .4byte gMonsterParameters
thumb_func_end sub_808DBC0
thumb_func_start sub_808DBD8
sub_808DBD8:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DBF0
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
adds r1, 0x33
ldrb r0, [r1]
bx lr
.align 2, 0
_0808DBF0: .4byte gMonsterParameters
thumb_func_end sub_808DBD8
thumb_func_start sub_808DBF4
sub_808DBF4:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DC08
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x12]
bx lr
.align 2, 0
_0808DC08: .4byte gMonsterParameters
thumb_func_end sub_808DBF4
thumb_func_start sub_808DC0C
sub_808DC0C:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DC24
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
movs r2, 0x34
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DC24: .4byte gMonsterParameters
thumb_func_end sub_808DC0C
thumb_func_start sub_808DC28
sub_808DC28:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DC44
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
lsls r1, 1
adds r2, 0x24
adds r2, r1
ldrh r0, [r2]
bx lr
.align 2, 0
_0808DC44: .4byte gMonsterParameters
thumb_func_end sub_808DC28
thumb_func_start sub_808DC48
sub_808DC48:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DC64
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
lsls r1, 1
adds r2, 0x28
adds r2, r1
ldrh r0, [r2]
bx lr
.align 2, 0
_0808DC64: .4byte gMonsterParameters
thumb_func_end sub_808DC48
thumb_func_start sub_808DC68
sub_808DC68:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DC80
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
adds r2, 0x13
adds r2, r1
ldrb r0, [r2]
bx lr
.align 2, 0
_0808DC80: .4byte gMonsterParameters
thumb_func_end sub_808DC68
thumb_func_start sub_808DC84
sub_808DC84:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DC9C
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
adds r2, 0x17
adds r2, r1
ldrb r0, [r2]
bx lr
.align 2, 0
_0808DC9C: .4byte gMonsterParameters
thumb_func_end sub_808DC84
thumb_func_start sub_808DCA0
sub_808DCA0:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DCBC
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
lsls r1, 1
adds r2, 0x3C
adds r2, r1
movs r1, 0
ldrsh r0, [r2, r1]
bx lr
.align 2, 0
_0808DCBC: .4byte gMonsterParameters
thumb_func_end sub_808DCA0
thumb_func_start sub_808DCC0
sub_808DCC0:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DCD8
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
adds r1, 0x40
movs r2, 0
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DCD8: .4byte gMonsterParameters
thumb_func_end sub_808DCC0
thumb_func_start sub_808DCDC
sub_808DCDC:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DCF8
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
lsls r1, 1
adds r2, 0x42
adds r2, r1
movs r1, 0
ldrsh r0, [r2, r1]
bx lr
.align 2, 0
_0808DCF8: .4byte gMonsterParameters
thumb_func_end sub_808DCDC
thumb_func_start sub_808DCFC
sub_808DCFC:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DD14
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
movs r2, 0x3E
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DD14: .4byte gMonsterParameters
thumb_func_end sub_808DCFC
thumb_func_start sub_808DD18
sub_808DD18:
push {r4,lr}
lsls r0, 16
asrs r0, 16
ldr r2, _0808DD44
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
ldr r4, [r2, 0x20]
subs r1, 0x1
adds r0, r4, 0
muls r0, r1
movs r1, 0xA
bl __divsi3
adds r4, r0
adds r0, r4, 0
pop {r4}
pop {r1}
bx r1
.align 2, 0
_0808DD44: .4byte gMonsterParameters
thumb_func_end sub_808DD18
thumb_func_start sub_808DD48
sub_808DD48:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DD64
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
ldr r3, [r2, 0x38]
ldr r2, [r2, 0x34]
str r2, [r1]
str r3, [r1, 0x4]
bx lr
.align 2, 0
_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
thumb_func_start sub_808DE10
sub_808DE10:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DE2C
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
ldrh r0, [r2, 0x10]
asrs r0, r1
movs r1, 0x1
ands r0, r1
bx lr
.align 2, 0
_0808DE2C: .4byte gMonsterParameters
thumb_func_end sub_808DE10
thumb_func_start sub_808DE30
sub_808DE30:
push {r4,lr}

556
asm/pokemon.s Normal file
View File

@ -0,0 +1,556 @@
.include "constants/gba_constants.inc"
.include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_808DAB4
sub_808DAB4:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DAC8
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldr r0, [r1, 0x4]
bx lr
.align 2, 0
_0808DAC8: .4byte gMonsterParameters
thumb_func_end sub_808DAB4
thumb_func_start sub_808DACC
sub_808DACC:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DAE0
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x9]
bx lr
.align 2, 0
_0808DAE0: .4byte gMonsterParameters
thumb_func_end sub_808DACC
thumb_func_start sub_808DAE4
sub_808DAE4:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DAF8
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x19]
bx lr
.align 2, 0
_0808DAF8: .4byte gMonsterParameters
thumb_func_end sub_808DAE4
thumb_func_start sub_808DAFC
sub_808DAFC:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB10
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldr r0, [r1, 0xC]
bx lr
.align 2, 0
_0808DB10: .4byte gMonsterParameters
thumb_func_end sub_808DAFC
thumb_func_start sub_808DB14
sub_808DB14:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB28
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x15]
bx lr
.align 2, 0
_0808DB28: .4byte gMonsterParameters
thumb_func_end sub_808DB14
thumb_func_start sub_808DB2C
sub_808DB2C:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB44
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x1B]
lsls r0, 25
lsrs r0, 24
bx lr
.align 2, 0
_0808DB44: .4byte gMonsterParameters
thumb_func_end sub_808DB2C
thumb_func_start sub_808DB48
sub_808DB48:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB5C
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x1C]
bx lr
.align 2, 0
_0808DB5C: .4byte gMonsterParameters
thumb_func_end sub_808DB48
thumb_func_start sub_808DB60
sub_808DB60:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB74
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x1D]
bx lr
.align 2, 0
_0808DB74: .4byte gMonsterParameters
thumb_func_end sub_808DB60
thumb_func_start sub_808DB78
sub_808DB78:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DB8C
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrh r0, [r1, 0x2C]
bx lr
.align 2, 0
_0808DB8C: .4byte gMonsterParameters
thumb_func_end sub_808DB78
thumb_func_start sub_808DB90
sub_808DB90:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DBA4
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrh r0, [r1, 0x2E]
bx lr
.align 2, 0
_0808DBA4: .4byte gMonsterParameters
thumb_func_end sub_808DB90
thumb_func_start sub_808DBA8
sub_808DBA8:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DBBC
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x16]
bx lr
.align 2, 0
_0808DBBC: .4byte gMonsterParameters
thumb_func_end sub_808DBA8
thumb_func_start sub_808DBC0
sub_808DBC0:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DBD4
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrh r0, [r1, 0x1E]
bx lr
.align 2, 0
_0808DBD4: .4byte gMonsterParameters
thumb_func_end sub_808DBC0
thumb_func_start sub_808DBD8
sub_808DBD8:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DBF0
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
adds r1, 0x33
ldrb r0, [r1]
bx lr
.align 2, 0
_0808DBF0: .4byte gMonsterParameters
thumb_func_end sub_808DBD8
thumb_func_start sub_808DBF4
sub_808DBF4:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DC08
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
ldrb r0, [r1, 0x12]
bx lr
.align 2, 0
_0808DC08: .4byte gMonsterParameters
thumb_func_end sub_808DBF4
thumb_func_start sub_808DC0C
sub_808DC0C:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DC24
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
movs r2, 0x34
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DC24: .4byte gMonsterParameters
thumb_func_end sub_808DC0C
thumb_func_start sub_808DC28
sub_808DC28:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DC44
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
lsls r1, 1
adds r2, 0x24
adds r2, r1
ldrh r0, [r2]
bx lr
.align 2, 0
_0808DC44: .4byte gMonsterParameters
thumb_func_end sub_808DC28
thumb_func_start sub_808DC48
sub_808DC48:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DC64
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
lsls r1, 1
adds r2, 0x28
adds r2, r1
ldrh r0, [r2]
bx lr
.align 2, 0
_0808DC64: .4byte gMonsterParameters
thumb_func_end sub_808DC48
thumb_func_start sub_808DC68
sub_808DC68:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DC80
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
adds r2, 0x13
adds r2, r1
ldrb r0, [r2]
bx lr
.align 2, 0
_0808DC80: .4byte gMonsterParameters
thumb_func_end sub_808DC68
thumb_func_start sub_808DC84
sub_808DC84:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DC9C
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
adds r2, 0x17
adds r2, r1
ldrb r0, [r2]
bx lr
.align 2, 0
_0808DC9C: .4byte gMonsterParameters
thumb_func_end sub_808DC84
thumb_func_start sub_808DCA0
sub_808DCA0:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DCBC
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
lsls r1, 1
adds r2, 0x3C
adds r2, r1
movs r1, 0
ldrsh r0, [r2, r1]
bx lr
.align 2, 0
_0808DCBC: .4byte gMonsterParameters
thumb_func_end sub_808DCA0
thumb_func_start sub_808DCC0
sub_808DCC0:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DCD8
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
adds r1, 0x40
movs r2, 0
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DCD8: .4byte gMonsterParameters
thumb_func_end sub_808DCC0
thumb_func_start sub_808DCDC
sub_808DCDC:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DCF8
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
lsls r1, 1
adds r2, 0x42
adds r2, r1
movs r1, 0
ldrsh r0, [r2, r1]
bx lr
.align 2, 0
_0808DCF8: .4byte gMonsterParameters
thumb_func_end sub_808DCDC
thumb_func_start sub_808DCFC
sub_808DCFC:
lsls r0, 16
asrs r0, 16
ldr r1, _0808DD14
ldr r2, [r1]
lsls r1, r0, 3
adds r1, r0
lsls r1, 3
adds r1, r2
movs r2, 0x3E
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DD14: .4byte gMonsterParameters
thumb_func_end sub_808DCFC
thumb_func_start sub_808DD18
sub_808DD18:
push {r4,lr}
lsls r0, 16
asrs r0, 16
ldr r2, _0808DD44
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
ldr r4, [r2, 0x20]
subs r1, 0x1
adds r0, r4, 0
muls r0, r1
movs r1, 0xA
bl __divsi3
adds r4, r0
adds r0, r4, 0
pop {r4}
pop {r1}
bx r1
.align 2, 0
_0808DD44: .4byte gMonsterParameters
thumb_func_end sub_808DD18
thumb_func_start sub_808DD48
sub_808DD48:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DD64
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
ldr r3, [r2, 0x38]
ldr r2, [r2, 0x34]
str r2, [r1]
str r3, [r1, 0x4]
bx lr
.align 2, 0
_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
thumb_func_start sub_808DE10
sub_808DE10:
lsls r0, 16
asrs r0, 16
ldr r2, _0808DE2C
ldr r3, [r2]
lsls r2, r0, 3
adds r2, r0
lsls r2, 3
adds r2, r3
ldrh r0, [r2, 0x10]
asrs r0, r1
movs r1, 0x1
ands r0, r1
bx lr
.align 2, 0
_0808DE2C: .4byte gMonsterParameters
thumb_func_end sub_808DE10
.align 2,0

51
include/pokemon.h Normal file
View File

@ -0,0 +1,51 @@
#ifdef POKEMON_H
#define POKEMON_H
struct gPokemon
{
/* 0x0 */ u32 species; // pointer to string
/* 0x4 */ u32 category; // pointer to string
/* 0x8 */ u8 palette; // between 0 - 12
/* 0x9 */ u8 size; // between 0x01 - 0x06
/* 0xA */ u8 unk0;
/* 0xB */ u8 unk1;
/* 0xC */ s32 speed;
/* 0x10 */ u16 dial_sprite;
/* 0x12 */ u8 unk2;
/* 0x13 */ u8 type_1; // between 0x00 - 0x11
/* 0x14 */ u8 type_2; // between 0x00 - 0x11
/* 0x15 */ u8 walkable_tiles; // between 0x00 - 0x05
/* 0x16 */ u8 friend_area; // 0x00 - 0x39
/* 0x17 */ u8 ability_1; // between 0x00 - 0x4C
/* 0x18 */ u8 ability_2; // between 0x00 - 0x4C
/* 0x19 */ u8 shadow_size; // between 0x0 - 0x2
/* 0x1A */ u8 unk3;
/* 0x1B */ u8 unk4;
/* 0x1C */ bool8 isMoving;
/* 0x1D */ u8 unk5;
/* 0x1E */ u16 base_hp;
/* 0x20 */ u16 base_exp;
/* 0x22 */ u16 unk6;
/* 0x24 */ u16 base_att;
/* 0x26 */ u16 base_sp_att;
/* 0x28 */ u16 base_def;
/* 0x2A */ u16 base_sp_def;
/* 0x2C */ u16 lowkick_dmg;
/* 0x2E */ u16 sizeorb_dmg;
/* 0x30 */ u8 unk7;
/* 0x31 */ u8 unk8;
/* 0x32 */ u8 unk9;
/* 0x33 */ bool8 unk10;
/* 0x34 */ u16 prior_evolution;
/* 0x36 */ u16 evol_type;
/* 0x38 */ u16 evol_need1;
/* 0x3A */ u16 evol_need2;
/* 0x3C */ u16 dexNum;
/* 0x3E */ u8 internalNum;
/* 0x40 */ u16 base_recruit;
/* 0x42 */ u16 unk11;
/* 0x44 */ u16 alphaNum;
/* 0x46 */ u16 parentNum;
}
#endif

View File

@ -41,6 +41,7 @@ SECTIONS {
{
asm/crt0.o(.text);
asm/code.o(.text);
src/code.o(.text);
asm/event_flag.o(.text);
src/event_flag.o(.text);
asm/code_8002774.o(.text);
@ -71,6 +72,8 @@ SECTIONS {
asm/save.o(.text);
src/save1.o(.text);
asm/code_8012A18.o(.text);
asm/pokemon.o(.text);
src/pokemon.o(.text);
asm/code_808DAB4.o(.text);
src/dungeon.o(.text);
asm/code_809017C.o(.text);

5
src/code.c Normal file
View File

@ -0,0 +1,5 @@
#include "global.h"
void nullsub_3(void)
{
}

2
src/pokemon.c Normal file
View File

@ -0,0 +1,2 @@
#include "global.h"
#include "pokemon.h"