Merge remote-tracking branch 'upstream/master'

This commit is contained in:
AnonymousRandomPerson 2022-12-21 23:41:55 -05:00
commit b4fe2857e9
139 changed files with 8225 additions and 15205 deletions

View File

@ -10833,320 +10833,4 @@ _080243D6:
_080243E4: .4byte gUnknown_3001B60
thumb_func_end sub_802437C
thumb_func_start sub_80243E8
sub_80243E8:
push {r4,r5,lr}
sub sp, 0x3C
ldr r3, _08024448
ldr r0, _0802444C
ldr r0, [r0]
ldr r2, _08024450
adds r1, r0, r2
movs r4, 0
ldrsh r2, [r1, r4]
movs r4, 0xDD
lsls r4, 2
adds r1, r0, r4
movs r4, 0
ldrsh r1, [r1, r4]
muls r1, r2
movs r4, 0xDC
lsls r4, 2
adds r2, r0, r4
movs r4, 0
ldrsh r2, [r2, r4]
adds r1, r2
lsls r1, 1
adds r0, 0x1A
adds r0, r1
movs r2, 0
ldrsh r1, [r0, r2]
movs r0, 0x58
muls r0, r1
ldr r4, [r3]
adds r4, r0
add r5, sp, 0x28
adds r1, r4, 0
adds r1, 0x4C
adds r0, r5, 0
movs r2, 0xA
bl sub_80922B4
ldr r1, _08024454
mov r0, sp
adds r2, r5, 0
bl sprintf_2
adds r0, r4, 0
add sp, 0x3C
pop {r4,r5}
pop {r1}
bx r1
.align 2, 0
_08024448: .4byte gRecruitedPokemonRef
_0802444C: .4byte gUnknown_3001B60
_08024450: .4byte 0x00000376
_08024454: .4byte gUnknown_80DC9A4
thumb_func_end sub_80243E8
thumb_func_start sub_8024458
sub_8024458:
push {r4-r6,lr}
adds r4, r0, 0
adds r5, r1, 0
lsls r4, 16
asrs r4, 16
ldr r6, _080244DC
movs r0, 0xA6
lsls r0, 1
movs r1, 0x8
bl MemoryAlloc
str r0, [r6]
adds r1, r0, 0
adds r1, 0x48
strh r4, [r1]
adds r1, 0x98
str r5, [r1]
adds r2, r0, 0
adds r2, 0xE4
lsls r1, r5, 1
adds r1, r5
lsls r1, 3
adds r1, 0xE8
adds r1, r0, r1
str r1, [r2]
adds r0, 0xE8
bl sub_8006518
ldr r1, [r6]
adds r0, r1, 0
adds r0, 0xE0
ldr r2, [r0]
lsls r0, r2, 1
adds r0, r2
lsls r0, 3
adds r1, r0
adds r1, 0xE8
ldr r0, _080244E0
ldm r0!, {r2-r4}
stm r1!, {r2-r4}
ldm r0!, {r2-r4}
stm r1!, {r2-r4}
ldr r2, [r6]
adds r0, r2, 0
adds r0, 0xE4
ldr r1, [r0]
movs r3, 0xA4
lsls r3, 1
adds r0, r2, r3
str r0, [r1, 0x14]
movs r4, 0xA5
lsls r4, 1
adds r1, r2, r4
movs r0, 0xA
strb r0, [r1]
bl sub_8024604
bl sub_802452C
ldr r0, [r6]
bl sub_8013984
movs r0, 0x1
pop {r4-r6}
pop {r1}
bx r1
.align 2, 0
_080244DC: .4byte gUnknown_203B2AC
_080244E0: .4byte gUnknown_80DC9C8
thumb_func_end sub_8024458
thumb_func_start sub_80244E4
sub_80244E4:
push {r4,lr}
ldr r4, _08024500
ldr r0, [r4]
bl GetKeyPress
cmp r0, 0x1
beq _08024504
cmp r0, 0x2
bne _0802450E
movs r0, 0x1
bl PlayMenuSoundEffect
movs r0, 0x2
b _08024524
.align 2, 0
_08024500: .4byte gUnknown_203B2AC
_08024504:
movs r0, 0
bl PlayMenuSoundEffect
movs r0, 0x3
b _08024524
_0802450E:
ldr r0, [r4]
bl sub_8013938
lsls r0, 24
cmp r0, 0
bne _0802451E
movs r0, 0
b _08024524
_0802451E:
bl sub_802452C
movs r0, 0x1
_08024524:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_80244E4
thumb_func_start sub_802452C
sub_802452C:
push {lr}
bl sub_8024588
bl sub_80245D0
pop {r0}
bx r0
thumb_func_end sub_802452C
thumb_func_start sub_802453C
sub_802453C:
push {r4,r5,lr}
ldr r4, _08024580
ldr r2, [r4]
cmp r2, 0
beq _0802457A
adds r0, r2, 0
adds r0, 0xE0
ldr r0, [r0]
lsls r1, r0, 1
adds r1, r0
lsls r1, 3
adds r1, r2, r1
adds r1, 0xE8
ldr r0, _08024584
ldm r0!, {r2,r3,r5}
stm r1!, {r2,r3,r5}
ldm r0!, {r2,r3,r5}
stm r1!, {r2,r3,r5}
bl ResetUnusedInputStruct
ldr r0, [r4]
adds r0, 0xE8
movs r1, 0x1
movs r2, 0x1
bl sub_800641C
ldr r0, [r4]
bl MemoryFree
movs r0, 0
str r0, [r4]
_0802457A:
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_08024580: .4byte gUnknown_203B2AC
_08024584: .4byte gUnknown_80DC9B0
thumb_func_end sub_802453C
thumb_func_start sub_8024588
sub_8024588:
push {r4,lr}
ldr r4, _080245C4
ldr r0, [r4]
ldrh r1, [r0, 0x20]
movs r2, 0xA4
lsls r2, 1
adds r0, r2
movs r2, 0
strb r1, [r0]
ldr r0, [r4]
ldrh r1, [r0, 0x1E]
ldr r3, _080245C8
adds r0, r3
strb r1, [r0]
ldr r0, [r4]
ldr r1, _080245CC
adds r0, r1
strb r2, [r0]
bl ResetUnusedInputStruct
ldr r0, [r4]
adds r0, 0xE8
movs r1, 0x1
movs r2, 0x1
bl sub_800641C
pop {r4}
pop {r0}
bx r0
.align 2, 0
_080245C4: .4byte gUnknown_203B2AC
_080245C8: .4byte 0x00000149
_080245CC: .4byte 0x0000014b
thumb_func_end sub_8024588
thumb_func_start sub_80245D0
sub_80245D0:
push {r4,lr}
sub sp, 0x4
ldr r0, _08024600
ldr r4, [r0]
movs r0, 0x1E
ldrsh r1, [r4, r0]
lsls r2, r1, 2
adds r0, r4, 0
adds r0, 0x34
adds r0, r2
ldr r0, [r0]
adds r2, r4, 0
adds r2, 0x4C
adds r3, r4, 0
adds r3, 0xB0
adds r4, 0xE0
ldr r4, [r4]
str r4, [sp]
bl CreatePokemonInfoTabScreen
add sp, 0x4
pop {r4}
pop {r0}
bx r0
.align 2, 0
_08024600: .4byte gUnknown_203B2AC
thumb_func_end sub_80245D0
thumb_func_start sub_8024604
sub_8024604:
push {r4,r5,lr}
ldr r4, _08024654
ldr r0, [r4]
movs r1, 0x2
str r1, [r0, 0x34]
movs r1, 0x3
str r1, [r0, 0x38]
movs r1, 0x5
str r1, [r0, 0x3C]
adds r1, r0, 0
adds r1, 0xE0
ldr r3, [r1]
movs r1, 0x3
movs r2, 0x1
bl sub_8013818
ldr r0, [r4]
adds r5, r0, 0
adds r5, 0x4C
ldr r2, _08024658
adds r0, 0x48
movs r3, 0
ldrsh r1, [r0, r3]
movs r0, 0x58
muls r0, r1
ldr r4, [r2]
adds r4, r0
movs r0, 0x7
bl sub_80023E4
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
adds r0, r5, 0
adds r1, r4, 0
bl sub_808FF20
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_08024654: .4byte gUnknown_203B2AC
_08024658: .4byte gRecruitedPokemonRef
thumb_func_end sub_8024604
.align 2,0

View File

@ -2089,71 +2089,4 @@ _0803C10C:
bx r1
thumb_func_end sub_803C0DC
thumb_func_start sub_803C110
sub_803C110:
push {r4,lr}
lsls r0, 16
asrs r4, r0, 16
adds r0, r4, 0
bl sub_8098134
lsls r0, 24
cmp r0, 0
beq _0803C180
adds r0, r4, 0
bl GetBaseSpecies
lsls r0, 16
asrs r0, 16
cmp r4, r0
bne _0803C180
adds r0, r4, 0
bl sub_803C0DC
lsls r0, 24
cmp r0, 0
beq _0803C180
movs r0, 0x6
bl sub_80023E4
lsls r0, 24
cmp r0, 0
bne _0803C188
ldr r1, _0803C184
movs r2, 0
ldrsh r0, [r1, r2]
cmp r0, 0
beq _0803C168
adds r2, r1, 0
_0803C154:
movs r3, 0
ldrsh r0, [r2, r3]
cmp r0, r4
beq _0803C180
adds r1, 0x2
adds r2, 0x2
movs r3, 0
ldrsh r0, [r1, r3]
cmp r0, 0
bne _0803C154
_0803C168:
bl GetPlayerPokemonStruct
movs r1, 0x8
ldrsh r0, [r0, r1]
cmp r0, r4
beq _0803C180
bl sub_808D378
movs r2, 0x8
ldrsh r0, [r0, r2]
cmp r0, r4
bne _0803C188
_0803C180:
movs r0, 0
b _0803C18A
.align 2, 0
_0803C184: .4byte gUnknown_80E8126
_0803C188:
movs r0, 0x1
_0803C18A:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_803C110
.align 2,0

View File

@ -391,7 +391,7 @@ _0803D3C0:
bl xxx_init_struct_8094924_restore_809485C
adds r0, r4, 0
mov r1, r9
bl sub_80971EC
bl RestoreWonderMail
adds r0, r4, 0
bl nullsub_102
movs r0, 0x1
@ -440,7 +440,7 @@ _0803D436:
bl xxx_init_struct_8094924_save_809486C
adds r0, r4, 0
adds r1, r6, 0
bl sub_8097270
bl SaveWonderMail
adds r0, r4, 0
bl nullsub_102
movs r2, 0x1
@ -2691,7 +2691,7 @@ _0803E5A2:
adds r0, r1
movs r1, 0
strb r1, [r0]
bl sub_8083F58
bl UpdateDungeonMusic
bl sub_8011860
bl sub_8040B60
movs r0, 0
@ -3128,7 +3128,7 @@ _0803E96A:
pop {r0}
bx r0
.align 2, 0
_0803E9A4: .4byte gUnknown_202EE88
_0803E9A4: .4byte gDungeonPaletteFile
_0803E9A8: .4byte gUnknown_80F62AC
_0803E9AC: .4byte gUnknown_202EDC8
_0803E9B0: .4byte gDungeonGlobalData
@ -3269,7 +3269,7 @@ _0803EA92:
pop {r0}
bx r0
.align 2, 0
_0803EACC: .4byte gUnknown_202EE88
_0803EACC: .4byte gDungeonPaletteFile
_0803EAD0: .4byte gUnknown_80F62AC
_0803EAD4: .4byte gUnknown_202EDC8
_0803EAD8: .4byte gDungeonGlobalData

View File

@ -573,7 +573,7 @@ sub_80426C8:
cmp r4, 0x3
bne _080426D8
movs r0, 0
bl sub_8083E88
bl DungeonStartNewBGM
_080426D8:
cmp r5, 0x4
beq _080426F0

View File

@ -5,98 +5,6 @@
.text
thumb_func_start sub_8042A84
sub_8042A84:
push {r4-r7,lr}
adds r4, r1, 0
adds r7, r2, 0
lsls r0, 16
asrs r5, r0, 16
movs r6, 0x80
lsls r6, 2
adds r0, r4, 0
bl sub_8042768
lsls r0, 24
cmp r0, 0
beq _08042AF8
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0
bl sub_804151C
adds r0, r7, 0
movs r1, 0x42
bl sub_803E708
adds r5, r4, 0
adds r5, 0x20
_08042AB4:
ldr r1, [r4, 0x1C]
ldr r0, _08042B00
cmp r1, r0
bgt _08042AF0
movs r0, 0x42
bl sub_803E46C
ldr r1, [r4, 0x1C]
adds r1, r6
str r1, [r4, 0x1C]
movs r0, 0x80
lsls r0, 1
adds r6, r0
ldr r0, [r4, 0x10]
subs r0, r1
cmp r0, 0
bge _08042AD8
adds r0, 0xFF
_08042AD8:
asrs r1, r0, 8
ldr r0, _08042B04
ldr r0, [r0]
ldr r2, _08042B08
adds r0, r2
movs r2, 0
ldrsh r0, [r0, r2]
subs r1, r0
movs r0, 0x8
negs r0, r0
cmp r1, r0
bge _08042AB4
_08042AF0:
movs r0, 0
strb r0, [r5]
bl sub_804178C
_08042AF8:
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08042B00: .4byte 0x0000c7ff
_08042B04: .4byte gDungeonGlobalData
_08042B08: .4byte 0x000181f2
thumb_func_end sub_8042A84
thumb_func_start sub_8042B0C
sub_8042B0C:
push {lr}
adds r1, r0, 0
movs r0, 0x9F
lsls r0, 1
movs r2, 0x5
bl sub_8042A84
pop {r0}
bx r0
thumb_func_end sub_8042B0C
thumb_func_start sub_8042B20
sub_8042B20:
push {lr}
adds r1, r0, 0
movs r0, 0xDE
lsls r0, 1
movs r2, 0xE
bl sub_8042A84
pop {r0}
bx r0
thumb_func_end sub_8042B20
thumb_func_start sub_8042B34
sub_8042B34:
push {r4-r7,lr}
@ -787,7 +695,7 @@ _0804300C:
ldr r3, _08043134
adds r0, r3
strb r1, [r0]
bl sub_8083F34
bl StopDungeonBGM
bl sub_803D4AC
bl sub_804513C
bl sub_8043CD8
@ -1323,7 +1231,7 @@ _0804351C:
lsls r0, 1
adds r0, r1
ldrh r0, [r0]
bl sub_8083E88
bl DungeonStartNewBGM
bl sub_80847D4
_08043544:
bl sub_8049840
@ -1360,7 +1268,7 @@ _08043544:
_08043594:
bl sub_804AAD4
bl sub_8049B8C
bl sub_804966C
bl LoadDungeonTilesetAssets
cmp r6, 0
bne _080435D0
bl sub_806B168
@ -1689,7 +1597,7 @@ _0804384A:
cmp r0, 0x1B
bne _08043896
movs r0, 0x3C
bl sub_8083ED8
bl DungeonFadeOutBGM
_08043896:
movs r0, 0x4
movs r1, 0x4F
@ -2828,4 +2736,4 @@ _080441B4: .4byte gTeamInventory_203B460
_080441B8: .4byte gRecruitedPokemonRef
thumb_func_end sub_8044124
.align 2, 0
.align 2, 0

View File

@ -4,328 +4,6 @@
.syntax unified
.text
thumb_func_start xxx_dungeon_80442D0
xxx_dungeon_80442D0:
push {r4-r7,lr}
lsls r0, 24
lsrs r7, r0, 24
bl GetLeaderEntity
adds r5, r0, 0
cmp r5, 0
beq _0804431A
bl TriggerWeatherAbilities
adds r0, r5, 0
bl GetMovementSpeed
ldr r3, _08044320
ldr r1, _08044324
ldr r1, [r1]
movs r2, 0xCC
lsls r2, 3
adds r1, r2
movs r2, 0
ldrsh r1, [r1, r2]
lsls r1, 1
movs r2, 0x32
muls r0, r2
adds r1, r0
adds r1, r3
movs r3, 0
ldrsh r0, [r1, r3]
cmp r0, 0
beq _0804431A
ldr r0, [r5, 0x70]
movs r1, 0xA4
lsls r1, 1
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
beq _08044328
_0804431A:
movs r0, 0
b _0804444E
.align 2, 0
_08044320: .4byte gSpeedTurns
_08044324: .4byte gDungeonGlobalData
_08044328:
bl GetLeaderEntity
adds r5, r0, 0
cmp r5, 0
beq _0804431A
movs r0, 0
bl UseAttack
lsls r0, 24
cmp r0, 0
bne _0804435C
ldr r0, _08044388
ldr r1, [r0]
ldr r2, _0804438C
adds r0, r1, r2
ldrb r0, [r0]
cmp r0, 0
bne _08044356
ldr r3, _08044390
adds r0, r1, r3
ldrb r0, [r0]
cmp r0, 0
beq _0804435C
_08044356:
movs r0, 0xC
bl sub_803E46C
_0804435C:
ldr r0, [r5, 0x70]
adds r0, 0xF8
movs r1, 0
strb r1, [r0]
bl sub_8044B28
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0
bne _0804431A
ldr r0, _08044388
ldr r1, [r0]
adds r0, r1, 0
adds r0, 0xB8
str r5, [r0]
adds r1, 0xBC
str r2, [r1]
cmp r7, 0
beq _08044394
movs r7, 0
b _0804439A
.align 2, 0
_08044388: .4byte gDungeonGlobalData
_0804438C: .4byte 0x0000066c
_08044390: .4byte 0x00000673
_08044394:
adds r0, r5, 0
bl TickStatusHeal
_0804439A:
bl sub_8044B28
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
bne _0804431A
adds r0, r5, 0
bl sub_8071DA4
ldr r6, _08044434
ldr r1, [r6]
movs r0, 0x1
strb r0, [r1, 0xF]
bl sub_805D8C8
ldr r0, [r6]
strb r4, [r0, 0xF]
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _0804444C
adds r0, r5, 0
bl sub_8072CF4
bl sub_8086AC0
movs r0, 0
bl sub_8043ED0
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _0804444C
ldr r2, [r5, 0x70]
ldrh r1, [r2]
movs r3, 0x80
lsls r3, 8
adds r0, r3, 0
ands r0, r1
cmp r0, 0
beq _08044400
subs r3, 0x1
adds r0, r3, 0
ands r0, r1
movs r3, 0x80
lsls r3, 7
adds r1, r3, 0
orrs r0, r1
strh r0, [r2]
_08044400:
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _0804444C
bl sub_8044454
bl sub_8044B28
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
bne _0804444C
ldr r2, [r6]
adds r0, r2, 0
adds r0, 0xBC
ldr r1, [r0]
cmp r1, 0
beq _08044438
bl sub_805F02C
ldr r0, [r6]
adds r0, 0xBC
str r4, [r0]
movs r7, 0x1
b _08044328
.align 2, 0
_08044434: .4byte gDungeonGlobalData
_08044438:
ldr r0, [r5, 0x70]
adds r0, 0xF8
ldrb r0, [r0]
cmp r0, 0
beq _0804444C
movs r3, 0xCC
lsls r3, 3
adds r0, r2, r3
strh r1, [r0]
b _08044328
_0804444C:
movs r0, 0x1
_0804444E:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end xxx_dungeon_80442D0
thumb_func_start sub_8044454
sub_8044454:
push {r4-r6,lr}
ldr r0, _080444E8
ldr r1, [r0]
ldrb r0, [r1, 0xE]
cmp r0, 0
beq _080444E2
movs r0, 0
strb r0, [r1, 0xE]
movs r6, 0
_08044466:
ldr r0, _080444E8
ldr r0, [r0]
lsls r1, r6, 2
ldr r2, _080444EC
adds r0, r2
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _080444DC
ldr r5, [r4, 0x70]
ldrh r0, [r5]
movs r2, 0x80
lsls r2, 8
adds r1, r2, 0
ands r0, r1
cmp r0, 0
beq _080444DC
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _080444E2
adds r0, r4, 0
bl TickStatusHeal
adds r0, r4, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _080444DC
adds r0, r4, 0
bl sub_8071DA4
adds r0, r4, 0
movs r1, 0
bl DecideAction
adds r0, r4, 0
bl sub_8072CF4
bl sub_8086AC0
movs r0, 0
bl sub_8043ED0
ldrh r0, [r5]
ldr r2, _080444F0
adds r1, r2, 0
ands r0, r1
movs r2, 0x80
lsls r2, 7
adds r1, r2, 0
orrs r0, r1
strh r0, [r5]
_080444DC:
adds r6, 0x1
cmp r6, 0x13
ble _08044466
_080444E2:
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_080444E8: .4byte gDungeonGlobalData
_080444EC: .4byte 0x000135cc
_080444F0: .4byte 0x00007fff
thumb_func_end sub_8044454
thumb_func_start sub_80444F4
sub_80444F4:
push {r4-r6,lr}
adds r6, r0, 0
bl GetLeaderEntity
cmp r6, r0
bne _08044566
ldr r0, _0804456C
ldr r1, [r0]
ldrb r0, [r1, 0xE]
cmp r0, 0
beq _08044566
movs r0, 0
strb r0, [r1, 0xE]
movs r5, 0
_08044510:
ldr r0, _0804456C
ldr r0, [r0]
lsls r1, r5, 2
ldr r2, _08044570
adds r0, r2
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _08044560
cmp r6, r4
beq _08044560
ldr r0, [r4, 0x70]
ldrh r0, [r0]
movs r2, 0x80
lsls r2, 8
adds r1, r2, 0
ands r0, r1
cmp r0, 0
beq _08044560
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _08044566
adds r0, r4, 0
movs r1, 0
bl DecideAction
adds r0, r4, 0
bl sub_8072CF4
bl sub_8086AC0
movs r0, 0
bl sub_8043ED0
_08044560:
adds r5, 0x1
cmp r5, 0x13
ble _08044510
_08044566:
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_0804456C: .4byte gDungeonGlobalData
_08044570: .4byte 0x000135cc
thumb_func_end sub_80444F4
thumb_func_start sub_8044574
sub_8044574:
@ -658,570 +336,4 @@ _08044818: .4byte gDungeonGlobalData
_0804481C: .4byte 0x0001357c
thumb_func_end sub_8044574
thumb_func_start sub_8044820
sub_8044820:
push {r4-r7,lr}
mov r7, r8
push {r7}
movs r7, 0
ldr r0, _08044830
mov r8, r0
b _080448FC
.align 2, 0
_08044830: .4byte gSpeedTurns
_08044834:
ldr r4, [r5, 0x70]
ldr r0, [r6]
adds r0, 0xB8
str r5, [r0]
bl TriggerWeatherAbilities
ldrh r2, [r4]
movs r1, 0x80
lsls r1, 8
adds r0, r1, 0
ands r0, r2
cmp r0, 0
bne _080448FA
movs r1, 0x80
lsls r1, 7
adds r0, r1, 0
ands r0, r2
lsls r0, 16
lsrs r1, r0, 16
cmp r1, 0
beq _0804486C
ldr r1, _08044868
adds r0, r1, 0
ands r0, r2
strh r0, [r4]
b _080448FA
.align 2, 0
_08044868: .4byte 0x0000bfff
_0804486C:
movs r2, 0xA2
lsls r2, 1
adds r0, r4, r2
strb r1, [r0]
adds r0, r5, 0
bl GetMovementSpeed
ldr r1, [r6]
movs r2, 0xCC
lsls r2, 3
adds r1, r2
movs r2, 0
ldrsh r1, [r1, r2]
lsls r1, 1
movs r2, 0x32
muls r0, r2
adds r1, r0
add r1, r8
movs r2, 0
ldrsh r0, [r1, r2]
cmp r0, 0
beq _080448FA
movs r1, 0xA4
lsls r1, 1
adds r0, r4, r1
ldrb r0, [r0]
cmp r0, 0
bne _080448FA
ldrh r1, [r4]
ldr r2, _08044984
adds r0, r2, 0
ands r1, r0
movs r0, 0
strh r1, [r4]
ldr r2, _08044988
adds r1, r4, r2
strb r0, [r1]
adds r0, r5, 0
bl TickStatusHeal
adds r0, r5, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _080448FA
adds r0, r5, 0
bl sub_8071DA4
adds r0, r5, 0
movs r1, 0
bl DecideAction
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _08044924
adds r0, r5, 0
bl sub_8072CF4
bl sub_8086AC0
movs r0, 0
bl sub_8043ED0
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _08044924
_080448FA:
adds r7, 0x1
_080448FC:
cmp r7, 0xF
bgt _08044924
ldr r6, _0804498C
ldr r0, [r6]
lsls r1, r7, 2
ldr r2, _08044990
adds r0, r2
adds r0, r1
ldr r5, [r0]
adds r0, r5, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _080448FA
bl sub_8044B28
lsls r0, 24
cmp r0, 0
beq _08044834
_08044924:
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _0804497A
movs r7, 0
_08044930:
ldr r0, _0804498C
ldr r0, [r0]
lsls r1, r7, 2
ldr r2, _08044990
adds r0, r2
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _08044974
ldr r0, [r4, 0x70]
movs r1, 0xA2
lsls r1, 1
adds r5, r0, r1
ldrb r0, [r5]
cmp r0, 0
beq _08044974
adds r0, r4, 0
bl sub_8074094
adds r0, r4, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _08044974
adds r0, r4, 0
bl sub_8071DA4
movs r0, 0
strb r0, [r5]
_08044974:
adds r7, 0x1
cmp r7, 0xF
ble _08044930
_0804497A:
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08044984: .4byte 0x00003fff
_08044988: .4byte 0x00000145
_0804498C: .4byte gDungeonGlobalData
_08044990: .4byte 0x0001358c
thumb_func_end sub_8044820
thumb_func_start sub_8044994
sub_8044994:
push {r4-r7,lr}
mov r7, r8
push {r7}
ldr r1, _08044A94
ldr r4, _08044A98
ldr r0, [r4]
movs r2, 0xCC
lsls r2, 3
adds r0, r2
movs r3, 0
ldrsh r0, [r0, r3]
lsls r0, 1
adds r1, 0x32
adds r0, r1
movs r1, 0
ldrsh r0, [r0, r1]
cmp r0, 0
beq _08044A8A
bl sub_8071B48
ldr r0, [r4]
ldr r2, _08044A9C
adds r0, r2
movs r2, 0
strb r2, [r0]
ldr r0, [r4]
ldr r3, _08044AA0
adds r0, r3
strb r2, [r0]
ldr r0, [r4]
ldr r1, _08044AA4
adds r0, r1
strb r2, [r0]
ldr r0, [r4]
adds r3, 0x2
adds r0, r3
strb r2, [r0]
ldr r0, [r4]
ldr r3, _08044AA8
adds r1, r0, r3
str r2, [r1]
ldr r1, _08044AAC
adds r0, r1
movs r1, 0x2
str r1, [r0]
mov r8, r2
adds r7, r4, 0
_080449F2:
ldr r0, [r7]
mov r2, r8
lsls r1, r2, 2
ldr r3, _08044AB0
adds r0, r3
adds r0, r1
ldr r5, [r0]
adds r0, r5, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _08044A7A
ldr r0, [r5, 0x70]
adds r4, r0, 0
movs r0, 0xA4
lsls r0, 1
adds r1, r4, r0
movs r0, 0
strb r0, [r1]
ldrb r0, [r4, 0x6]
movs r6, 0x1
cmp r0, 0
beq _08044A24
movs r6, 0
_08044A24:
adds r0, r5, 0
movs r1, 0x32
bl HasAbility
lsls r0, 24
cmp r0, 0
beq _08044A46
ldr r1, [r7]
ldr r2, _08044AA8
adds r0, r1, r2
str r5, [r0]
ldr r3, _08044AAC
adds r1, r3
adds r0, r4, 0
adds r0, 0x98
ldr r0, [r0]
str r0, [r1]
_08044A46:
adds r0, r5, 0
movs r1, 0x3F
bl HasAbility
lsls r0, 24
cmp r0, 0
beq _08044A60
ldr r0, [r7]
ldr r1, _08044AA4
adds r0, r1
adds r0, r6
movs r1, 0x1
strb r1, [r0]
_08044A60:
adds r0, r5, 0
movs r1, 0x38
bl HasAbility
lsls r0, 24
cmp r0, 0
beq _08044A7A
ldr r0, [r7]
ldr r2, _08044A9C
adds r0, r2
adds r0, r6
movs r1, 0x1
strb r1, [r0]
_08044A7A:
movs r3, 0x1
add r8, r3
mov r0, r8
cmp r0, 0x13
ble _080449F2
movs r0, 0
bl sub_8043ED0
_08044A8A:
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08044A94: .4byte gSpeedTurns
_08044A98: .4byte gDungeonGlobalData
_08044A9C: .4byte 0x000037f8
_08044AA0: .4byte 0x000037f9
_08044AA4: .4byte 0x000037fa
_08044AA8: .4byte 0x00017b2c
_08044AAC: .4byte 0x00017b38
_08044AB0: .4byte 0x000135cc
thumb_func_end sub_8044994
thumb_func_start sub_8044AB4
sub_8044AB4:
push {r4,lr}
ldr r1, _08044ADC
ldr r0, _08044AE0
ldr r0, [r0]
movs r2, 0xCC
lsls r2, 3
adds r0, r2
movs r2, 0
ldrsh r0, [r0, r2]
adds r0, 0x1
lsls r0, 1
adds r1, 0x32
adds r0, r1
movs r1, 0
ldrsh r0, [r0, r1]
cmp r0, 0
beq _08044B1A
movs r4, 0
b _08044AE6
.align 2, 0
_08044ADC: .4byte gSpeedTurns
_08044AE0: .4byte gDungeonGlobalData
_08044AE4:
adds r4, 0x1
_08044AE6:
cmp r4, 0x13
bgt _08044B08
ldr r0, _08044B20
ldr r0, [r0]
lsls r1, r4, 2
ldr r2, _08044B24
adds r0, r2
adds r0, r1
ldr r0, [r0]
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _08044AE4
movs r0, 0
bl UseAttack
_08044B08:
movs r0, 0x1
movs r1, 0
bl sub_807EAA0
bl sub_8086AC0
movs r0, 0
bl sub_8043ED0
_08044B1A:
pop {r4}
pop {r0}
bx r0
.align 2, 0
_08044B20: .4byte gDungeonGlobalData
_08044B24: .4byte 0x000135cc
thumb_func_end sub_8044AB4
thumb_func_start sub_8044B28
sub_8044B28:
push {r4,lr}
ldr r4, _08044B48
ldr r0, [r4]
ldrb r0, [r0, 0x4]
cmp r0, 0
bne _08044B76
bl GetLeaderEntity
cmp r0, 0
bne _08044B50
ldr r0, [r4]
ldr r1, _08044B4C
adds r0, r1
movs r1, 0x1
strb r1, [r0]
b _08044B76
.align 2, 0
_08044B48: .4byte gDungeonGlobalData
_08044B4C: .4byte 0x00000654
_08044B50:
ldr r0, [r4]
ldrb r2, [r0, 0x2]
cmp r2, 0x1
bne _08044B68
ldr r2, _08044B64
adds r1, r0, r2
movs r0, 0x2
strb r0, [r1]
b _08044B76
.align 2, 0
_08044B64: .4byte 0x00000654
_08044B68:
cmp r2, 0x2
beq _08044B70
movs r0, 0
b _08044B78
_08044B70:
ldr r1, _08044B80
adds r0, r1
strb r2, [r0]
_08044B76:
movs r0, 0x1
_08044B78:
pop {r4}
pop {r1}
bx r1
.align 2, 0
_08044B80: .4byte 0x00000654
thumb_func_end sub_8044B28
thumb_func_start sub_8044B84
sub_8044B84:
push {lr}
ldr r0, _08044B9C
ldr r0, [r0]
ldrb r0, [r0, 0x10]
cmp r0, 0
bne _08044BA0
bl sub_8044B28
lsls r0, 24
lsrs r0, 24
b _08044BA2
.align 2, 0
_08044B9C: .4byte gDungeonGlobalData
_08044BA0:
movs r0, 0x1
_08044BA2:
pop {r1}
bx r1
thumb_func_end sub_8044B84
thumb_func_start sub_8044BA8
sub_8044BA8:
push {r4,r5,lr}
lsls r0, 16
lsrs r4, r0, 16
lsls r1, 24
lsrs r5, r1, 24
cmp r4, 0x26
bne _08044BCC
bl sub_8043D10
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
bne _08044BCC
ldr r0, _08044BC8
b _08044C02
.align 2, 0
_08044BC8: .4byte gUnknown_80F91EC
_08044BCC:
ldr r1, _08044BEC
lsls r0, r4, 3
adds r4, r0, r1
ldr r0, [r4]
ldr r1, _08044BF0
bl strcmp
cmp r0, 0
beq _08044BE0
movs r0, 0x1
_08044BE0:
lsls r0, 24
cmp r0, 0
beq _08044BF4
ldr r0, [r4]
b _08044C04
.align 2, 0
_08044BEC: .4byte gUnknown_80F7C50
_08044BF0: .4byte gUnknown_80F697C
_08044BF4:
ldr r4, _08044C0C
adds r0, r5, 0
bl GetItemCategory
lsls r0, 3
adds r4, 0x4
adds r0, r4
_08044C02:
ldr r0, [r0]
_08044C04:
pop {r4,r5}
pop {r1}
bx r1
.align 2, 0
_08044C0C: .4byte gActions
thumb_func_end sub_8044BA8
thumb_func_start sub_8044C10
sub_8044C10:
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
bl sub_8083654
adds r2, r0, 0
adds r1, r2, 0
adds r1, 0x44
movs r3, 0
movs r0, 0
strh r0, [r1]
cmp r4, 0
beq _08044C44
adds r0, r2, 0
adds r0, 0x48
strb r3, [r0]
adds r0, 0x8
strb r3, [r0]
adds r1, 0x14
ldr r0, _08044C4C
strh r0, [r1]
adds r1, 0x2
movs r0, 0x1
negs r0, r0
strh r0, [r1]
_08044C44:
pop {r4}
pop {r0}
bx r0
.align 2, 0
_08044C4C: .4byte 0x0000ffff
thumb_func_end sub_8044C10
thumb_func_start sub_8044C50
sub_8044C50:
push {r4,lr}
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
bl sub_8083654
adds r2, r0, 0
adds r0, 0x44
movs r1, 0
strh r4, [r0]
adds r0, 0x4
strb r1, [r0]
adds r0, 0x8
strb r1, [r0]
adds r1, r2, 0
adds r1, 0x58
ldr r0, _08044C84
strh r0, [r1]
adds r1, 0x2
movs r0, 0x1
negs r0, r0
strh r0, [r1]
pop {r4}
pop {r0}
bx r0
.align 2, 0
_08044C84: .4byte 0x0000ffff
thumb_func_end sub_8044C50
.align 2, 0

View File

@ -1652,7 +1652,7 @@ _0804802E:
_08048038:
adds r0, r4, 0
adds r1, r5, 0
bl sub_8048400
bl XEyeSeedAction
b _080482B4
_08048042:
adds r0, r4, 0

View File

@ -5,331 +5,6 @@
.text
thumb_func_start sub_80495E4
sub_80495E4:
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
movs r2, 0
ldr r0, _08049658
mov r9, r0
mov r12, r9
ldr r7, _0804965C
ldr r1, _08049660
mov r8, r1
_080495FA:
lsls r1, r2, 3
lsls r0, r2, 2
adds r6, r2, 0x1
subs r1, r2
adds r0, r2
lsls r0, 2
adds r0, r2
lsls r0, 6
movs r4, 0
lsls r2, r1, 5
mov r3, r8
adds r5, r0, r3
movs r3, 0x37
_08049614:
mov r1, r12
ldr r0, [r1]
adds r1, r0, r7
adds r1, r2
adds r0, r5
adds r0, r4
str r0, [r1]
adds r4, 0x18
adds r2, 0x4
subs r3, 0x1
cmp r3, 0
bge _08049614
adds r2, r6, 0
cmp r2, 0x1F
ble _080495FA
movs r2, 0
mov r3, r9
ldr r1, [r3]
ldr r4, _08049664
adds r0, r1, r4
movs r3, 0
strh r2, [r0]
adds r4, 0x2
adds r0, r1, r4
strh r2, [r0]
ldr r0, _08049668
adds r1, r0
strb r3, [r1]
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08049658: .4byte gDungeonGlobalData
_0804965C: .4byte 0x0000e8c0
_08049660: .4byte 0x00003a18
_08049664: .4byte 0x00003a0e
_08049668: .4byte 0x00013570
thumb_func_end sub_80495E4
thumb_func_start sub_804966C
sub_804966C:
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0xC
ldr r1, _08049734
ldr r0, _08049738
mov r8, r0
ldr r6, _0804973C
ldr r0, [r6]
ldr r5, _08049740
adds r0, r5
movs r2, 0
ldrsh r0, [r0, r2]
add r0, r8
ldrb r2, [r0]
mov r0, sp
bl sprintf
ldr r7, _08049744
mov r0, sp
adds r1, r7, 0
bl OpenFileAndGetFileDataPtr
adds r4, r0, 0
ldr r0, _08049748
movs r1, 0
adds r2, r4, 0
bl DecompressATGlobalFile
adds r0, r4, 0
bl CloseFile
ldr r1, _0804974C
ldr r0, [r6]
adds r0, r5
movs r3, 0
ldrsh r2, [r0, r3]
mov r0, sp
bl sprintf
mov r0, sp
adds r1, r7, 0
bl OpenFileAndGetFileDataPtr
ldr r1, _08049750
str r0, [r1]
ldr r1, _08049754
ldr r0, [r6]
adds r0, r5
movs r4, 0
ldrsh r0, [r0, r4]
add r0, r8
ldrb r2, [r0]
mov r0, sp
bl sprintf
mov r0, sp
adds r1, r7, 0
bl OpenFileAndGetFileDataPtr
adds r4, r0, 0
ldr r0, [r6]
ldr r1, _08049758
adds r0, r1
ldr r1, _0804975C
adds r2, r4, 0
bl DecompressATFile
adds r0, r4, 0
bl CloseFile
ldr r0, [r6]
adds r2, r0, r5
movs r3, 0
ldrsh r0, [r2, r3]
cmp r0, 0x3F
bgt _08049768
ldr r1, _08049760
add r0, r8
ldrb r2, [r0]
mov r0, sp
bl sprintf
mov r0, sp
adds r1, r7, 0
bl OpenFileAndGetFileDataPtr
adds r4, r0, 0
ldr r0, [r6]
ldr r1, _08049764
adds r0, r1
movs r1, 0x93
lsls r1, 4
adds r2, r4, 0
bl DecompressATFile
adds r0, r4, 0
bl CloseFile
b _08049794
.align 2, 0
_08049734: .4byte gUnknown_80F6A04
_08049738: .4byte gUnknown_8108EC0
_0804973C: .4byte gDungeonGlobalData
_08049740: .4byte 0x00003a0e
_08049744: .4byte gDungeonFileArchive
_08049748: .4byte 0x06008000
_0804974C: .4byte gUnknown_80F6A10
_08049750: .4byte gUnknown_202EE88
_08049754: .4byte gUnknown_80F6A1C
_08049758: .4byte 0x00011884
_0804975C: .4byte 0x00001194
_08049760: .4byte gUnknown_80F6A28
_08049764: .4byte 0x00012c24
_08049768:
ldr r1, _080497E8
movs r3, 0
ldrsh r2, [r2, r3]
mov r0, sp
bl sprintf
mov r0, sp
adds r1, r7, 0
bl OpenFileAndGetFileDataPtr
adds r4, r0, 0
ldr r0, [r6]
ldr r1, _080497EC
adds r0, r1
movs r1, 0x90
lsls r1, 2
adds r2, r4, 0
bl DecompressATFile
adds r0, r4, 0
bl CloseFile
_08049794:
ldr r1, _080497F0
ldr r5, _080497F4
ldr r0, [r5]
ldr r4, _080497F8
adds r0, r4
movs r3, 0
ldrsh r2, [r0, r3]
mov r0, sp
bl sprintf
ldr r1, _080497FC
mov r0, sp
bl OpenFileAndGetFileDataPtr
adds r1, r0, 0
ldr r0, _08049800
str r1, [r0]
ldr r0, _08049804
movs r2, 0x20
bl sub_8004AA4
ldr r2, _08049808
movs r6, 0
strb r6, [r2]
movs r3, 0x1
strb r3, [r2, 0x1]
movs r0, 0x2
strb r0, [r2, 0x2]
movs r0, 0x3
strb r0, [r2, 0x3]
ldr r1, _0804980C
ldr r0, [r5]
adds r0, r4
movs r4, 0
ldrsh r0, [r0, r4]
adds r0, r1
ldrb r0, [r0]
cmp r0, 0x1
bne _08049810
strb r3, [r2, 0x4]
strb r6, [r2, 0x5]
b _08049814
.align 2, 0
_080497E8: .4byte gUnknown_80F6A34
_080497EC: .4byte 0x00012c24
_080497F0: .4byte gUnknown_80F6A40
_080497F4: .4byte gDungeonGlobalData
_080497F8: .4byte 0x00003a0e
_080497FC: .4byte gDungeonFileArchive
_08049800: .4byte gUnknown_202F18C
_08049804: .4byte gUnknown_202EE8C
_08049808: .4byte gWalkableTileToCrossableTerrain
_0804980C: .4byte gDungeonWaterType
_08049810:
strb r6, [r2, 0x4]
strb r3, [r2, 0x5]
_08049814:
add sp, 0xC
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_804966C
thumb_func_start sub_8049820
sub_8049820:
push {lr}
ldr r0, _08049838
ldr r0, [r0]
bl CloseFile
ldr r0, _0804983C
ldr r0, [r0]
bl CloseFile
pop {r0}
bx r0
.align 2, 0
_08049838: .4byte gUnknown_202F18C
_0804983C: .4byte gUnknown_202EE88
thumb_func_end sub_8049820
thumb_func_start sub_8049840
sub_8049840:
push {lr}
ldr r0, _08049860
ldr r0, [r0]
ldr r1, _08049864
adds r0, r1
movs r1, 0
ldrsh r0, [r0, r1]
bl sub_8043CE4
lsls r0, 24
cmp r0, 0
beq _08049870
ldr r1, _08049868
ldr r0, _0804986C
b _08049874
.align 2, 0
_08049860: .4byte gDungeonGlobalData
_08049864: .4byte 0x00003a0e
_08049868: .4byte gUnknown_203B430
_0804986C: .4byte gUnknown_80F69EC
_08049870:
ldr r1, _0804987C
ldr r0, _08049880
_08049874:
str r0, [r1]
pop {r0}
bx r0
.align 2, 0
_0804987C: .4byte gUnknown_203B430
_08049880: .4byte gUnknown_80F69D4
thumb_func_end sub_8049840
thumb_func_start sub_8049884
sub_8049884:
push {r4-r6,lr}
movs r5, 0
_08049888:
movs r4, 0
adds r6, r5, 0x1
_0804988C:
adds r0, r4, 0
adds r1, r5, 0
bl sub_80498A8
adds r4, 0x1
cmp r4, 0x37
ble _0804988C
adds r5, r6, 0
cmp r5, 0x1F
ble _08049888
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_8049884
thumb_func_start sub_80498A8
sub_80498A8:
push {r4-r7,lr}
@ -3030,301 +2705,4 @@ _0804ACD4:
_0804ACE0: .4byte 0x000104c4
thumb_func_end sub_804AC20
thumb_func_start sub_804ACE4
sub_804ACE4:
push {lr}
movs r1, 0
ldrsh r2, [r0, r1]
movs r3, 0x2
ldrsh r1, [r0, r3]
adds r0, r2, 0
bl GetMapTile_1
ldr r0, [r0, 0x14]
cmp r0, 0
beq _0804AD06
bl GetEntityType
cmp r0, 0x3
bne _0804AD06
movs r0, 0x1
b _0804AD08
_0804AD06:
movs r0, 0
_0804AD08:
pop {r1}
bx r1
thumb_func_end sub_804ACE4
thumb_func_start sub_804AD0C
sub_804AD0C:
push {lr}
movs r1, 0
ldrsh r2, [r0, r1]
movs r3, 0x2
ldrsh r1, [r0, r3]
adds r0, r2, 0
bl GetMapTile_1
ldr r1, [r0, 0x10]
cmp r1, 0
beq _0804AD2C
ldr r0, [r1]
cmp r0, 0x1
bne _0804AD2C
adds r0, r1, 0
b _0804AD2E
_0804AD2C:
movs r0, 0
_0804AD2E:
pop {r1}
bx r1
thumb_func_end sub_804AD0C
thumb_func_start sub_804AD34
sub_804AD34:
push {r4-r7,lr}
mov r7, r8
push {r7}
adds r6, r0, 0
movs r0, 0
mov r8, r0
movs r1, 0
ldrsh r0, [r6, r1]
movs r2, 0x2
ldrsh r1, [r6, r2]
bl GetMapTile_2
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x3
ands r0, r1
cmp r0, 0
bne _0804ADB6
movs r0, 0x88
lsls r0, 1
ands r0, r1
cmp r0, 0
bne _0804ADB6
movs r0, 0x1
mov r8, r0
ldr r0, _0804ADFC
ands r0, r1
movs r1, 0x1
orrs r0, r1
strh r0, [r2]
movs r5, 0x1
negs r5, r5
_0804AD74:
movs r4, 0x1
negs r4, r4
adds r7, r5, 0x1
_0804AD7A:
movs r1, 0
ldrsh r0, [r6, r1]
adds r0, r4, r0
movs r2, 0x2
ldrsh r1, [r6, r2]
adds r1, r5, r1
bl sub_80498A8
movs r1, 0
ldrsh r0, [r6, r1]
adds r0, r4, r0
movs r2, 0x2
ldrsh r1, [r6, r2]
adds r1, r5, r1
bl sub_8049BB0
movs r1, 0
ldrsh r0, [r6, r1]
adds r0, r4, r0
movs r2, 0x2
ldrsh r1, [r6, r2]
adds r1, r5, r1
bl sub_80402AC
adds r4, 0x1
cmp r4, 0x1
ble _0804AD7A
adds r5, r7, 0
cmp r5, 0x1
ble _0804AD74
_0804ADB6:
mov r0, r8
cmp r0, 0
beq _0804ADEE
movs r5, 0
_0804ADBE:
ldr r0, _0804AE00
ldr r0, [r0]
lsls r1, r5, 2
ldr r2, _0804AE04
adds r0, r2
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _0804ADDE
adds r0, r4, 0
bl sub_806CF98
_0804ADDE:
adds r5, 0x1
cmp r5, 0x13
ble _0804ADBE
bl sub_8049ED4
adds r0, r6, 0
bl sub_8042A14
_0804ADEE:
mov r0, r8
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r1}
bx r1
.align 2, 0
_0804ADFC: .4byte 0x0000fffc
_0804AE00: .4byte gDungeonGlobalData
_0804AE04: .4byte 0x000135cc
thumb_func_end sub_804AD34
thumb_func_start sub_804AE08
sub_804AE08:
push {r4-r7,lr}
mov r7, r8
push {r7}
adds r7, r0, 0
movs r0, 0
mov r8, r0
movs r1, 0
ldrsh r0, [r7, r1]
movs r2, 0x2
ldrsh r1, [r7, r2]
bl GetMapTile_2
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x3
ands r0, r1
cmp r0, 0
bne _0804AE72
movs r0, 0x88
lsls r0, 1
ands r0, r1
cmp r0, 0
bne _0804AE72
movs r0, 0x1
mov r8, r0
ldr r0, _0804AE80
ands r0, r1
movs r1, 0x1
orrs r0, r1
strh r0, [r2]
ldrh r1, [r2, 0x4]
movs r0, 0x10
orrs r0, r1
strh r0, [r2, 0x4]
movs r5, 0x1
negs r5, r5
_0804AE50:
movs r4, 0x1
negs r4, r4
adds r6, r5, 0x1
_0804AE56:
movs r1, 0
ldrsh r0, [r7, r1]
adds r0, r4, r0
movs r2, 0x2
ldrsh r1, [r7, r2]
adds r1, r5, r1
bl sub_8049BB0
adds r4, 0x1
cmp r4, 0x1
ble _0804AE56
adds r5, r6, 0
cmp r5, 0x1
ble _0804AE50
_0804AE72:
mov r0, r8
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r1}
bx r1
.align 2, 0
_0804AE80: .4byte 0x0000fffc
thumb_func_end sub_804AE08
thumb_func_start sub_804AE84
sub_804AE84:
push {r4-r7,lr}
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r5, r1]
movs r2, 0x2
ldrsh r1, [r5, r2]
bl GetMapTile_2
adds r2, r0, 0
ldrh r1, [r2, 0x4]
movs r0, 0x10
ands r0, r1
cmp r0, 0
beq _0804AF0E
ldr r0, _0804AF14
ands r0, r1
strh r0, [r2, 0x4]
movs r6, 0x1
negs r6, r6
_0804AEAA:
movs r4, 0x1
negs r4, r4
adds r7, r6, 0x1
_0804AEB0:
movs r1, 0
ldrsh r0, [r5, r1]
adds r0, r4, r0
movs r2, 0x2
ldrsh r1, [r5, r2]
adds r1, r6, r1
bl sub_80498A8
movs r1, 0
ldrsh r0, [r5, r1]
adds r0, r4, r0
movs r2, 0x2
ldrsh r1, [r5, r2]
adds r1, r6, r1
bl sub_80402AC
adds r4, 0x1
cmp r4, 0x1
ble _0804AEB0
adds r6, r7, 0
cmp r6, 0x1
ble _0804AEAA
movs r6, 0
_0804AEDE:
ldr r0, _0804AF18
ldr r0, [r0]
lsls r1, r6, 2
ldr r2, _0804AF1C
adds r0, r2
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _0804AEFE
adds r0, r4, 0
bl sub_806CF98
_0804AEFE:
adds r6, 0x1
cmp r6, 0x13
ble _0804AEDE
bl sub_8049ED4
adds r0, r5, 0
bl sub_8042A14
_0804AF0E:
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0804AF14: .4byte 0x0000ffef
_0804AF18: .4byte gDungeonGlobalData
_0804AF1C: .4byte 0x000135cc
thumb_func_end sub_804AE84
.align 2, 0

View File

@ -3832,7 +3832,7 @@ _0805459E:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8057E1C
bl FocusEnergyMoveAction
bl _080554BA
_080545AE:
movs r3, 0x80
@ -3882,7 +3882,7 @@ _0805460A:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8057D20
bl WhirlpoolMoveAction
bl _080554BA
_0805461A:
adds r0, r7, 0
@ -4161,7 +4161,7 @@ _08054888:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_80576D0
bl YawnMoveAction
bl _080554BA
_08054898:
adds r0, r7, 0
@ -4525,7 +4525,7 @@ _08054BC8:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805B7FC
bl ReflectMoveAction
bl _080554BA
_08054BD8:
adds r0, r7, 0
@ -4539,14 +4539,14 @@ _08054BE8:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_80591D8
bl SafeguardMoveAction
bl _080554BA
_08054BF8:
adds r0, r7, 0
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_80590C8
bl MistMoveAction
bl _080554BA
_08054C08:
adds r0, r7, 0
@ -4609,7 +4609,7 @@ _08054C88:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805BD70
bl ScannerOrbAction
bl _080554BA
_08054C98:
adds r0, r7, 0
@ -4651,7 +4651,7 @@ _08054CE2:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805834C
bl BideMoveAction
b _080554BA
_08054CF0:
adds r0, r7, 0
@ -4709,7 +4709,7 @@ _08054D56:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_80582EC
bl RazorWindMoveAction
b _080554BA
_08054D64:
adds r0, r7, 0
@ -4723,14 +4723,14 @@ _08054D72:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805B2E4
bl MagicCoatMoveAction
b _080554BA
_08054D80:
adds r0, r7, 0
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8057720
bl NightmareMoveAction
b _080554BA
_08054D8E:
adds r0, r7, 0
@ -4793,7 +4793,7 @@ _08054DFE:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805B5F4
bl LeechSeedMoveAction
b _080554BA
_08054E0C:
adds r0, r7, 0
@ -4821,7 +4821,7 @@ _08054E36:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805BD7C
bl RadarOrbAction
b _080554BA
_08054E44:
adds r0, r7, 0
@ -4982,7 +4982,7 @@ _08054F78:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805C474
bl StairsOrbAction
b _080554BA
_08054F86:
adds r0, r7, 0
@ -5010,7 +5010,7 @@ _08054FB0:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805777C
bl VitalThrowMoveAction
b _080554BA
_08054FBE:
adds r0, r7, 0
@ -5038,7 +5038,7 @@ _08054FE8:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8057788
bl DigMoveAction
b _080554BA
_08054FF6:
adds r0, r7, 0
@ -5073,14 +5073,14 @@ _0805502E:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805C480
bl LongtossOrbAction
b _080554BA
_0805503C:
adds r0, r7, 0
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805C48C
bl PierceOrbAction
b _080554BA
_0805504A:
adds r0, r7, 0
@ -5115,7 +5115,7 @@ _08055082:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805C1F8
bl ShockerOrbAction
b _080554BA
_08055090:
adds r0, r7, 0
@ -5138,7 +5138,7 @@ _080550B0:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805B2F0
bl ProtectMoveAction
b _080554BA
_080550BE:
adds r0, r7, 0
@ -5215,7 +5215,7 @@ _0805514A:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8057E28
bl SmokescreenMoveAction
b _080554BA
_08055158:
adds r0, r7, 0
@ -5229,7 +5229,7 @@ _08055166:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805991C
bl StockpileMoveAction
b _080554BA
_08055174:
adds r0, r7, 0
@ -5271,14 +5271,14 @@ _080551BA:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805B3A8
bl MirrorCoatMoveAction
b _080554BA
_080551C8:
adds r0, r7, 0
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805B208
bl PerishSongMoveAction
b _080554BA
_080551D6:
adds r0, r7, 0
@ -5292,7 +5292,7 @@ _080551E4:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805B37C
bl DestinyBondMoveAction
b _080554BA
_080551F2:
adds r0, r7, 0
@ -5334,7 +5334,7 @@ _08055238:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8058BE0
bl EndureMoveAction
b _080554BA
_08055246:
adds r0, r7, 0
@ -5488,7 +5488,7 @@ _0805536C:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8058F58
bl NaturePowerMoveAction
b _080554BA
_0805537A:
adds r0, r7, 0
@ -5572,14 +5572,14 @@ _08055414:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8058DBC
bl PsychUpMoveAction
b _080554BA
_08055422:
adds r0, r7, 0
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_8057BEC
bl SnoreMoveAction
b _080554BA
_08055430:
adds r0, r7, 0
@ -5607,7 +5607,7 @@ _0805545A:
adds r1, r5, 0
mov r2, r8
mov r3, r9
bl sub_805C1B0
bl IdentifyOrbAction
b _080554BA
_08055468:
adds r0, r7, 0
@ -5808,7 +5808,7 @@ _080555D6:
adds r0, r7, 0
adds r1, r7, 0
movs r3, 0x2
bl sub_8076E20
bl LowerAttackStageTarget
_08055604:
add sp, 0x48
pop {r3-r5}
@ -6777,7 +6777,7 @@ _08055D54:
adds r0, r5, 0
adds r1, r5, 0
movs r2, 0x1
bl sub_8076090
bl PausedStatusTarget
adds r4, 0xFB
ldrb r0, [r4]
cmp r0, 0
@ -6829,7 +6829,7 @@ _08055DEC:
bl SendMessage
adds r0, r4, 0
adds r1, r4, 0
bl sub_80769CC
bl ImmobilizedStatusTarget
_08055E10:
ldrh r1, [r5]
movs r0, 0x2
@ -6842,7 +6842,7 @@ _08055E10:
bl SendMessage
adds r0, r4, 0
adds r1, r4, 0
bl sub_80769CC
bl ImmobilizedStatusTarget
_08055E2C:
ldrh r1, [r5]
movs r0, 0x4
@ -6855,7 +6855,7 @@ _08055E2C:
bl SendMessage
adds r0, r4, 0
adds r1, r4, 0
bl sub_80769CC
bl ImmobilizedStatusTarget
_08055E48:
ldrh r1, [r5]
movs r0, 0x8
@ -6869,7 +6869,7 @@ _08055E48:
adds r0, r4, 0
adds r1, r4, 0
movs r2, 0x1
bl sub_8077780
bl ParalyzeStatusTarget
_08055E66:
ldrh r1, [r5]
movs r0, 0x10
@ -6883,7 +6883,7 @@ _08055E66:
adds r0, r4, 0
adds r1, r4, 0
movs r2, 0x1
bl sub_8077780
bl ParalyzeStatusTarget
_08055E84:
ldrh r1, [r5]
movs r0, 0x20
@ -6897,7 +6897,7 @@ _08055E84:
adds r0, r4, 0
adds r1, r4, 0
movs r2, 0x1
bl sub_80763F8
bl PoisonedStatusTarget
_08055EA2:
ldrh r1, [r5]
movs r0, 0x40
@ -6911,7 +6911,7 @@ _08055EA2:
adds r0, r4, 0
adds r1, r4, 0
movs r2, 0x1
bl sub_80763F8
bl PoisonedStatusTarget
_08055EC0:
ldrh r1, [r5]
movs r0, 0x80
@ -6946,7 +6946,7 @@ _08055EEA:
adds r1, r4, 0
movs r2, 0x1
movs r3, 0x1
bl sub_8076210
bl BurnedStatusTarget
_08055F0C:
ldrh r1, [r5]
movs r0, 0x80
@ -6961,7 +6961,7 @@ _08055F0C:
adds r0, r4, 0
adds r1, r4, 0
movs r2, 0x1
bl sub_807614C
bl InfatuateStatusTarget
_08055F2C:
adds r5, r6, r7
ldrh r1, [r5]
@ -7557,7 +7557,7 @@ _08056418:
adds r0, r5, 0
adds r1, r5, 0
movs r2, 0
bl sub_8077AE4
bl ConfuseStatusTarget
adds r4, 0xFB
ldrb r0, [r4]
cmp r0, 0

File diff suppressed because it is too large Load Diff

View File

@ -2907,7 +2907,7 @@ sub_805EFB4:
mov r8, r0
lsls r1, 24
lsrs r7, r1, 24
bl sub_8083654
bl GetLeaderEntityData
adds r6, r0, 0
cmp r7, 0
beq _0805EFE2
@ -3146,7 +3146,7 @@ _0805F19C: .4byte gUnknown_80F9BB0
thumb_func_start sub_805F1A0
sub_805F1A0:
push {lr}
bl sub_8083654
bl GetLeaderEntityData
adds r0, 0x44
pop {r1}
bx r1
@ -3155,7 +3155,7 @@ sub_805F1A0:
thumb_func_start sub_805F1AC
sub_805F1AC:
push {lr}
bl sub_8083654
bl GetLeaderEntityData
adds r0, 0x44
ldrh r0, [r0]
pop {r1}
@ -3638,7 +3638,7 @@ _0805F5B0:
movs r2, 0x1
movs r3, 0x1
bl sub_804A728
bl sub_8083654
bl GetLeaderEntityData
adds r0, 0x48
strb r7, [r0]
movs r0, 0
@ -3726,7 +3726,7 @@ _0805F65C:
cmp r0, 0
beq _0805F64E
_0805F676:
bl sub_8083654
bl GetLeaderEntityData
adds r0, 0x48
strb r7, [r0]
cmp r4, r7
@ -7991,7 +7991,7 @@ _08061994:
subs r0, 0x1
cmp r0, r9
bge _08061994
bl sub_8083654
bl GetLeaderEntityData
ldrb r1, [r0, 0x9]
add r0, sp, 0x4
bl GetAvailTacticsforLvl
@ -19743,7 +19743,7 @@ _0806780C:
lsls r0, 24
cmp r0, 0
beq _08067834
bl sub_8044210
bl IsDungeonMaze
lsls r0, 24
cmp r0, 0
beq _0806782C
@ -23059,7 +23059,7 @@ _08069228:
adds r1, r4, 0
bl xxx_pokemon2_to_pokemonstruct_index_808DF2C
_0806926E:
bl sub_8044210
bl IsDungeonMaze
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0
@ -23258,7 +23258,7 @@ _080693CC:
adds r1, r4, 0
bl xxx_pokemon2_to_pokemonstruct_index_808DF2C
_0806940E:
bl sub_8044210
bl IsDungeonMaze
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0

View File

@ -416,7 +416,7 @@ _0806A608:
adds r1, r6, 0
movs r2, 0x1
movs r3, 0
bl sub_8076210
bl BurnedStatusTarget
b _0806A6D2
.align 2, 0
_0806A640: .4byte gDungeonWaterType

View File

@ -139,7 +139,7 @@ _0806D100:
adds r0, r6, 0
adds r1, r5, 0
movs r3, 0x1
bl sub_8077084
bl RaiseAttackStageTarget
_0806D118:
adds r0, r6, 0
bl EntityExists

View File

@ -4,113 +4,6 @@
.syntax unified
.text
thumb_func_start sub_807049C
sub_807049C:
push {r4-r7,lr}
adds r6, r0, 0
adds r4, r1, 0
ldr r7, [r6, 0x70]
movs r1, 0
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTile_1
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r4, r1]
cmp r0, 0
blt _0807055A
movs r2, 0x2
ldrsh r1, [r4, r2]
cmp r1, 0
blt _0807055A
cmp r0, 0x37
bgt _0807055A
cmp r1, 0x1F
bgt _0807055A
ldrh r1, [r5]
movs r0, 0x10
ands r0, r1
cmp r0, 0
bne _0807055A
ldr r0, [r5, 0x10]
cmp r0, 0
beq _080704E2
bl GetEntityType
cmp r0, 0x1
bne _0807055A
_080704E2:
bl IsFixedDungeon
lsls r0, 24
cmp r0, 0
bne _08070504
adds r0, r7, 0
adds r0, 0xE4
ldrb r0, [r0]
cmp r0, 0x3
beq _08070552
adds r0, r6, 0
movs r1, 0x9
bl HasItem
lsls r0, 24
cmp r0, 0
bne _08070552
_08070504:
movs r1, 0x2
ldrsh r0, [r7, r1]
bl GetCrossableTerrain
lsls r0, 24
lsrs r4, r0, 24
ldrh r0, [r5]
movs r5, 0x3
ands r5, r0
adds r0, r6, 0
movs r1, 0xC
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _08070526
movs r4, 0x2
_08070526:
adds r0, r6, 0
movs r1, 0xD
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _08070536
movs r4, 0x3
_08070536:
cmp r4, 0x1
beq _0807054A
cmp r4, 0x1
bgt _08070544
cmp r4, 0
beq _0807054E
b _08070552
_08070544:
cmp r4, 0x2
beq _08070556
b _08070552
_0807054A:
cmp r5, 0x2
beq _08070552
_0807054E:
cmp r5, 0x1
bne _0807055A
_08070552:
movs r0, 0
b _0807055C
_08070556:
cmp r5, 0
bne _08070552
_0807055A:
movs r0, 0x1
_0807055C:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_807049C
thumb_func_start sub_8070564
sub_8070564:
@ -189,305 +82,4 @@ _080705E8:
bx r1
thumb_func_end sub_8070564
thumb_func_start sub_80705F0
sub_80705F0:
push {r4-r7,lr}
adds r6, r0, 0
adds r4, r1, 0
ldr r7, [r6, 0x70]
movs r1, 0
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTile_1
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r4, r1]
cmp r0, 0
blt _0807069A
movs r2, 0x2
ldrsh r1, [r4, r2]
cmp r1, 0
blt _0807069A
cmp r0, 0x37
bgt _0807069A
cmp r1, 0x1F
bgt _0807069A
ldrh r1, [r5]
movs r0, 0x10
ands r0, r1
cmp r0, 0
bne _0807069A
ldr r0, [r5, 0x10]
cmp r0, 0
beq _08070636
bl GetEntityType
cmp r0, 0x1
bne _0807069A
_08070636:
bl IsFixedDungeon
lsls r0, 24
cmp r0, 0
bne _08070658
adds r0, r7, 0
adds r0, 0xE4
ldrb r0, [r0]
cmp r0, 0x3
beq _08070696
adds r0, r6, 0
movs r1, 0x9
bl HasItem
lsls r0, 24
cmp r0, 0
bne _08070696
_08070658:
movs r1, 0x2
ldrsh r0, [r7, r1]
bl GetCrossableTerrain
lsls r0, 24
lsrs r4, r0, 24
ldrh r0, [r5]
movs r5, 0x3
ands r5, r0
adds r0, r6, 0
movs r1, 0xC
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _0807067A
movs r4, 0x2
_0807067A:
adds r0, r6, 0
movs r1, 0xD
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _0807068A
movs r4, 0x3
_0807068A:
cmp r4, 0
blt _08070696
cmp r4, 0x2
bgt _08070696
cmp r5, 0
beq _0807069A
_08070696:
movs r0, 0
b _0807069C
_0807069A:
movs r0, 0x1
_0807069C:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_80705F0
thumb_func_start sub_80706A4
sub_80706A4:
push {r4-r7,lr}
adds r7, r0, 0
adds r4, r1, 0
ldr r6, [r7, 0x70]
movs r1, 0
ldrsh r0, [r4, r1]
movs r2, 0x2
ldrsh r1, [r4, r2]
bl GetMapTile_1
adds r5, r0, 0
movs r1, 0
ldrsh r0, [r4, r1]
cmp r0, 0
blt _0807076A
movs r2, 0x2
ldrsh r1, [r4, r2]
cmp r1, 0
blt _0807076A
cmp r0, 0x37
bgt _0807076A
cmp r1, 0x1F
bgt _0807076A
ldrh r1, [r5]
movs r0, 0x10
ands r0, r1
cmp r0, 0
bne _0807076A
ldr r0, [r5, 0x10]
cmp r0, 0
beq _080706F2
bl GetEntityType
cmp r0, 0x1
bne _0807076A
ldr r0, [r5, 0x10]
ldr r0, [r0, 0x70]
cmp r0, r6
bne _0807076A
_080706F2:
bl IsFixedDungeon
lsls r0, 24
cmp r0, 0
bne _08070714
adds r0, r6, 0
adds r0, 0xE4
ldrb r0, [r0]
cmp r0, 0x3
beq _08070762
adds r0, r7, 0
movs r1, 0x9
bl HasItem
lsls r0, 24
cmp r0, 0
bne _08070762
_08070714:
movs r1, 0x2
ldrsh r0, [r6, r1]
bl GetCrossableTerrain
lsls r0, 24
lsrs r4, r0, 24
ldrh r0, [r5]
movs r5, 0x3
ands r5, r0
adds r0, r7, 0
movs r1, 0xC
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _08070736
movs r4, 0x2
_08070736:
adds r0, r7, 0
movs r1, 0xD
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _08070746
movs r4, 0x3
_08070746:
cmp r4, 0x1
beq _0807075A
cmp r4, 0x1
bgt _08070754
cmp r4, 0
beq _0807075E
b _08070762
_08070754:
cmp r4, 0x2
beq _08070766
b _08070762
_0807075A:
cmp r5, 0x2
beq _08070762
_0807075E:
cmp r5, 0x1
bne _0807076A
_08070762:
movs r0, 0
b _0807076C
_08070766:
cmp r5, 0
bne _08070762
_0807076A:
movs r0, 0x1
_0807076C:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_80706A4
thumb_func_start GetMovementSpeed
GetMovementSpeed:
push {r4-r6,lr}
adds r6, r0, 0
ldr r5, [r6, 0x70]
movs r4, 0
movs r0, 0x84
lsls r0, 1
adds r1, r5, r0
movs r2, 0x4
_08070784:
ldrb r0, [r1, 0x5]
cmp r0, 0
beq _0807078C
subs r4, 0x1
_0807078C:
ldrb r0, [r1]
cmp r0, 0
beq _08070794
adds r4, 0x1
_08070794:
adds r1, 0x1
subs r2, 0x1
cmp r2, 0
bge _08070784
adds r0, r5, 0
adds r0, 0xAC
ldrb r0, [r0]
cmp r0, 0x4
bne _080707A8
subs r4, 0x1
_080707A8:
movs r1, 0x2
ldrsh r0, [r5, r1]
bl GetMoveSpeed
adds r4, r0
adds r0, r6, 0
movs r1, 0x6
bl HasType
lsls r0, 24
cmp r0, 0
beq _080707D0
adds r0, r6, 0
bl GetWeather
lsls r0, 24
lsrs r0, 24
cmp r0, 0x7
bne _080707D0
adds r4, 0x1
_080707D0:
movs r0, 0x4
ldrsh r1, [r5, r0]
ldr r0, _0807081C
cmp r1, r0
bne _080707DC
adds r4, 0x1
_080707DC:
movs r0, 0x2
ldrsh r1, [r5, r0]
movs r0, 0xBE
lsls r0, 1
cmp r1, r0
bne _080707FE
ldrb r0, [r5, 0x6]
cmp r0, 0
beq _080707FE
ldr r0, _08070820
ldr r0, [r0]
ldr r1, _08070824
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
beq _080707FE
adds r4, 0x1
_080707FE:
cmp r4, 0
bge _08070804
movs r4, 0
_08070804:
cmp r4, 0x4
ble _0807080A
movs r4, 0x4
_0807080A:
movs r1, 0x82
lsls r1, 1
adds r0, r5, r1
str r4, [r0]
adds r0, r4, 0
pop {r4-r6}
pop {r1}
bx r1
.align 2, 0
_0807081C: .4byte 0x000001a3
_08070820: .4byte gDungeonGlobalData
_08070824: .4byte 0x0000066e
thumb_func_end GetMovementSpeed
.align 2, 0

View File

@ -1,397 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_8070E3C
sub_8070E3C:
push {r4-r7,lr}
adds r4, r0, 0
adds r6, r1, 0
adds r7, r2, 0
ldr r0, [r4, 0x70]
movs r1, 0x2
ldrsh r0, [r0, r1]
bl GetCrossableTerrain
lsls r0, 24
lsrs r5, r0, 24
movs r2, 0
ldrsh r0, [r6, r2]
ldr r1, _08070EB0
lsls r2, r7, 2
adds r2, r1
movs r3, 0
ldrsh r1, [r2, r3]
adds r0, r1
movs r3, 0x2
ldrsh r1, [r6, r3]
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x10
ands r0, r1
cmp r0, 0
bne _08070F0C
ldr r0, [r2, 0x10]
cmp r0, 0
beq _08070E8A
bl GetEntityType
cmp r0, 0x1
bne _08070F0C
_08070E8A:
bl IsFixedDungeon
lsls r0, 24
cmp r0, 0
bne _08070EDC
ldr r0, [r4, 0x70]
adds r0, 0xE4
ldrb r0, [r0]
cmp r0, 0x3
beq _08070EAC
adds r0, r4, 0
movs r1, 0x9
bl HasItem
lsls r0, 24
cmp r0, 0
beq _08070EB4
_08070EAC:
movs r5, 0x3
b _08070EDC
.align 2, 0
_08070EB0: .4byte gAdjacentTileOffsets
_08070EB4:
adds r0, r4, 0
movs r1, 0xC
bl HasIQSkill
lsls r0, 24
cmp r0, 0
bne _08070EDA
adds r0, r4, 0
movs r1, 0xD
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _08070EDC
movs r0, 0x1
ands r0, r7
movs r5, 0x3
cmp r0, 0
beq _08070EDC
_08070EDA:
movs r5, 0x2
_08070EDC:
movs r1, 0
ldrsh r0, [r6, r1]
movs r2, 0x2
ldrsh r1, [r6, r2]
bl GetMapTile_1
adds r2, r0, 0
adds r1, r2, 0
adds r1, 0xA
adds r1, r5
ldr r2, _08070F08
movs r0, 0x7
ands r0, r7
adds r0, r2
ldrb r1, [r1]
ldrb r0, [r0]
ands r0, r1
cmp r0, 0
beq _08070F0C
movs r0, 0x1
b _08070F0E
.align 2, 0
_08070F08: .4byte gUnknown_8106FB5
_08070F0C:
movs r0, 0
_08070F0E:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8070E3C
thumb_func_start sub_8070F14
sub_8070F14:
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
movs r1, 0x4
ldrsh r0, [r4, r1]
ldr r1, _08070F70
lsls r2, r5, 2
adds r2, r1
movs r3, 0
ldrsh r1, [r2, r3]
adds r0, r1
movs r3, 0x6
ldrsh r1, [r4, r3]
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x10
ands r0, r1
cmp r0, 0
bne _08070F78
ldr r0, [r2, 0x10]
cmp r0, 0
bne _08070F78
movs r1, 0x4
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTile_1
adds r2, r0, 0
ldr r1, _08070F74
movs r0, 0x7
ands r0, r5
adds r0, r1
ldrb r1, [r2, 0xA]
ldrb r0, [r0]
ands r0, r1
cmp r0, 0
beq _08070F78
movs r0, 0x1
b _08070F7A
.align 2, 0
_08070F70: .4byte gAdjacentTileOffsets
_08070F74: .4byte gUnknown_8106FBD
_08070F78:
movs r0, 0
_08070F7A:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8070F14
thumb_func_start sub_8070F80
sub_8070F80:
push {r4-r6,lr}
adds r4, r0, 0
adds r6, r1, 0
ldr r0, [r4, 0x70]
movs r1, 0x2
ldrsh r0, [r0, r1]
bl GetCrossableTerrain
lsls r0, 24
lsrs r5, r0, 24
movs r2, 0x4
ldrsh r0, [r4, r2]
ldr r1, _08070FF4
lsls r2, r6, 2
adds r2, r1
movs r3, 0
ldrsh r1, [r2, r3]
adds r0, r1
movs r3, 0x6
ldrsh r1, [r4, r3]
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTile_1
adds r2, r0, 0
ldrh r1, [r2]
movs r0, 0x10
ands r0, r1
cmp r0, 0
bne _08071050
ldr r0, [r2, 0x10]
cmp r0, 0
beq _08070FCC
bl GetEntityType
cmp r0, 0x1
bne _08071050
_08070FCC:
bl IsFixedDungeon
lsls r0, 24
cmp r0, 0
bne _08071020
ldr r0, [r4, 0x70]
adds r0, 0xE4
ldrb r0, [r0]
cmp r0, 0x3
beq _08070FEE
adds r0, r4, 0
movs r1, 0x9
bl HasItem
lsls r0, 24
cmp r0, 0
beq _08070FF8
_08070FEE:
movs r5, 0x3
b _08071020
.align 2, 0
_08070FF4: .4byte gAdjacentTileOffsets
_08070FF8:
adds r0, r4, 0
movs r1, 0xC
bl HasIQSkill
lsls r0, 24
cmp r0, 0
bne _0807101E
adds r0, r4, 0
movs r1, 0xD
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _08071020
movs r0, 0x1
ands r0, r6
movs r5, 0x3
cmp r0, 0
beq _08071020
_0807101E:
movs r5, 0x2
_08071020:
movs r1, 0x4
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl GetMapTile_1
adds r2, r0, 0
adds r1, r2, 0
adds r1, 0xA
adds r1, r5
ldr r2, _0807104C
movs r0, 0x7
ands r0, r6
adds r0, r2
ldrb r1, [r1]
ldrb r0, [r0]
ands r0, r1
cmp r0, 0
beq _08071050
movs r0, 0x1
b _08071052
.align 2, 0
_0807104C: .4byte gUnknown_8106FC5
_08071050:
movs r0, 0
_08071052:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_8070F80
thumb_func_start sub_8071058
sub_8071058:
push {r4-r7,lr}
adds r5, r0, 0
adds r7, r1, 0
ldr r0, [r5, 0x70]
movs r1, 0x2
ldrsh r0, [r0, r1]
bl GetCrossableTerrain
lsls r0, 24
lsrs r6, r0, 24
movs r2, 0x4
ldrsh r0, [r5, r2]
ldr r1, _080710D4
lsls r2, r7, 2
adds r2, r1
movs r3, 0
ldrsh r1, [r2, r3]
adds r0, r1
movs r3, 0x6
ldrsh r1, [r5, r3]
movs r3, 0x2
ldrsh r2, [r2, r3]
adds r1, r2
bl GetMapTile_1
adds r4, r0, 0
ldrh r1, [r4]
movs r0, 0x10
ands r0, r1
cmp r0, 0
bne _08071130
ldr r0, [r4, 0x10]
cmp r0, 0
beq _080710AE
bl GetEntityType
cmp r0, 0x1
beq _080710AE
ldr r0, [r4, 0x10]
ldr r0, [r0, 0x70]
ldrb r0, [r0, 0x6]
cmp r0, 0
bne _08071130
_080710AE:
bl IsFixedDungeon
lsls r0, 24
cmp r0, 0
bne _08071100
ldr r0, [r5, 0x70]
adds r0, 0xE4
ldrb r0, [r0]
cmp r0, 0x3
beq _080710D0
adds r0, r5, 0
movs r1, 0x9
bl HasItem
lsls r0, 24
cmp r0, 0
beq _080710D8
_080710D0:
movs r6, 0x3
b _08071100
.align 2, 0
_080710D4: .4byte gAdjacentTileOffsets
_080710D8:
adds r0, r5, 0
movs r1, 0xC
bl HasIQSkill
lsls r0, 24
cmp r0, 0
bne _080710FE
adds r0, r5, 0
movs r1, 0xD
bl HasIQSkill
lsls r0, 24
cmp r0, 0
beq _08071100
movs r0, 0x1
ands r0, r7
movs r6, 0x3
cmp r0, 0
beq _08071100
_080710FE:
movs r6, 0x2
_08071100:
movs r1, 0x4
ldrsh r0, [r5, r1]
movs r2, 0x6
ldrsh r1, [r5, r2]
bl GetMapTile_1
adds r4, r0, 0
adds r1, r4, 0
adds r1, 0xA
adds r1, r6
ldr r2, _0807112C
movs r0, 0x7
ands r0, r7
adds r0, r2
ldrb r1, [r1]
ldrb r0, [r0]
ands r0, r1
cmp r0, 0
beq _08071130
movs r0, 0x1
b _08071132
.align 2, 0
_0807112C: .4byte gUnknown_8106FCD
_08071130:
movs r0, 0
_08071132:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8071058
.align 2, 0

View File

@ -978,7 +978,7 @@ _080744D8:
adds r1, r5, 0
movs r2, 0x7F
movs r3, 0
bl sub_8077910
bl RaiseMovementSpeedTarget
_0807450C:
mov r0, r8
adds r0, 0xA8

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -515,7 +515,7 @@ _0807D1A4:
bl sub_80522F4
mov r0, r8
adds r1, r5, 0
bl sub_8076D10
bl PetrifiedStatusTarget
b _0807D3A8
.align 2, 0
_0807D1D0: .4byte gDungeonGlobalData
@ -708,7 +708,7 @@ _0807D35C:
bne _0807D36A
mov r0, r8
adds r1, r5, 0
bl sub_8076D10
bl PetrifiedStatusTarget
_0807D36A:
mov r1, r10
ldrb r0, [r1, 0x7]

View File

@ -653,7 +653,7 @@ _080801F2:
adds r0, r5, 0
adds r1, r4, 0
movs r3, 0x1
bl sub_8076E20
bl LowerAttackStageTarget
b _08080240
.align 2, 0
_08080208: .4byte gUnknown_8106A50
@ -668,7 +668,7 @@ _0808020C:
adds r0, r5, 0
adds r1, r4, 0
movs r3, 0x1
bl sub_8076F80
bl LowerDefenseStageTarget
b _08080240
.align 2, 0
_08080228: .4byte gUnknown_8106A4C
@ -681,7 +681,7 @@ _0808022C:
adds r0, r5, 0
adds r1, r4, 0
movs r3, 0x1
bl sub_8076F80
bl LowerDefenseStageTarget
_08080240:
add sp, 0x8
pop {r4,r5}
@ -837,7 +837,7 @@ sub_8080364:
cmp r1, 0
beq _08080370
movs r2, 0x1
bl sub_8077AE4
bl ConfuseStatusTarget
_08080370:
pop {r0}
bx r0
@ -887,7 +887,7 @@ sub_80803B4:
beq _080803C2
movs r2, 0x1
movs r3, 0x1
bl sub_80779F0
bl LowerMovementSpeedTarget
_080803C2:
pop {r0}
bx r0
@ -899,7 +899,7 @@ sub_80803C8:
cmp r1, 0
beq _080803D4
movs r2, 0x1
bl sub_80763F8
bl PoisonedStatusTarget
_080803D4:
pop {r0}
bx r0

View File

@ -5,222 +5,6 @@
.text
thumb_func_start sub_80833E8
sub_80833E8:
push {r4,r5,lr}
adds r5, r0, 0
adds r4, r1, 0
movs r1, 0
ldrsh r0, [r5, r1]
movs r2, 0x2
ldrsh r1, [r5, r2]
bl GetMapTile_1
adds r1, r0, 0
ldr r0, _08083438
ldr r3, [r0]
ldr r2, _0808343C
adds r0, r3, r2
ldrb r2, [r0]
cmp r2, 0
bne _0808340C
movs r2, 0x2
_0808340C:
ldrb r0, [r1, 0x9]
cmp r0, 0xFF
bne _08083440
movs r1, 0
ldrsh r0, [r5, r1]
subs r0, r2
str r0, [r4]
movs r1, 0
ldrsh r0, [r5, r1]
adds r0, r2
adds r0, 0x1
str r0, [r4, 0x8]
movs r1, 0x2
ldrsh r0, [r5, r1]
subs r0, r2
str r0, [r4, 0x4]
movs r1, 0x2
ldrsh r0, [r5, r1]
adds r0, r2
adds r0, 0x1
b _0808346A
.align 2, 0
_08083438: .4byte gDungeonGlobalData
_0808343C: .4byte 0x00018209
_08083440:
lsls r1, r0, 3
subs r1, r0
lsls r1, 2
ldr r2, _08083474
adds r1, r2
adds r1, r3, r1
movs r2, 0x2
ldrsh r0, [r1, r2]
subs r0, 0x1
str r0, [r4]
movs r2, 0x6
ldrsh r0, [r1, r2]
adds r0, 0x2
str r0, [r4, 0x8]
movs r2, 0x4
ldrsh r0, [r1, r2]
subs r0, 0x1
str r0, [r4, 0x4]
movs r2, 0x8
ldrsh r0, [r1, r2]
adds r0, 0x2
_0808346A:
str r0, [r4, 0xC]
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_08083474: .4byte 0x000104c4
thumb_func_end sub_80833E8
thumb_func_start IsTargetTwoTilesAway
IsTargetTwoTilesAway:
push {r4-r7,lr}
sub sp, 0x4
adds r3, r0, 0
adds r6, r1, 0
movs r0, 0
ldrsh r1, [r3, r0]
movs r2, 0
ldrsh r0, [r6, r2]
subs r1, r0
cmp r1, 0
bge _08083490
negs r1, r1
_08083490:
cmp r1, 0x1
bgt _080834A8
movs r5, 0x2
ldrsh r1, [r3, r5]
movs r2, 0x2
ldrsh r0, [r6, r2]
subs r1, r0
cmp r1, 0
bge _080834A4
negs r1, r1
_080834A4:
cmp r1, 0x1
ble _0808355A
_080834A8:
movs r5, 0
ldrsh r4, [r3, r5]
movs r1, 0
ldrsh r0, [r6, r1]
subs r2, r4, r0
cmp r2, 0
bge _080834B8
negs r2, r2
_080834B8:
movs r5, 0x2
ldrsh r1, [r3, r5]
movs r5, 0x2
ldrsh r0, [r6, r5]
subs r0, r1, r0
cmp r0, 0
bge _080834C8
negs r0, r0
_080834C8:
cmp r0, r2
bge _080834CE
adds r0, r2, 0
_080834CE:
cmp r0, 0x2
bne _0808355E
adds r5, r4, 0
adds r4, r1, 0
movs r7, 0
_080834D8:
movs r1, 0
ldrsh r0, [r6, r1]
cmp r5, r0
bge _080834E2
adds r5, 0x1
_080834E2:
cmp r5, r0
ble _080834E8
subs r5, 0x1
_080834E8:
movs r2, 0x2
ldrsh r0, [r6, r2]
cmp r4, r0
bge _080834F2
adds r4, 0x1
_080834F2:
cmp r4, r0
ble _080834F8
subs r4, 0x1
_080834F8:
adds r0, r5, 0
adds r1, r4, 0
str r3, [sp]
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
ldr r3, [sp]
cmp r0, 0
beq _0808355E
adds r7, 0x1
cmp r7, 0x1
ble _080834D8
movs r0, 0
ldrsh r5, [r6, r0]
movs r1, 0x2
ldrsh r4, [r6, r1]
movs r7, 0
_0808351E:
movs r2, 0
ldrsh r0, [r3, r2]
cmp r5, r0
bge _08083528
adds r5, 0x1
_08083528:
cmp r5, r0
ble _0808352E
subs r5, 0x1
_0808352E:
movs r1, 0x2
ldrsh r0, [r3, r1]
cmp r4, r0
bge _08083538
adds r4, 0x1
_08083538:
cmp r4, r0
ble _0808353E
subs r4, 0x1
_0808353E:
adds r0, r5, 0
adds r1, r4, 0
str r3, [sp]
bl GetMapTile_1
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
ldr r3, [sp]
cmp r0, 0
beq _0808355E
adds r7, 0x1
cmp r7, 0x1
ble _0808351E
_0808355A:
movs r0, 0x1
b _08083560
_0808355E:
movs r0, 0
_08083560:
add sp, 0x4
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end IsTargetTwoTilesAway
thumb_func_start sub_8083568
sub_8083568:
push {r4,r5,lr}
@ -296,4 +80,4 @@ _080835FA:
bx r1
thumb_func_end sub_8083568
.align 2, 0
.align 2, 0

View File

@ -5,15 +5,6 @@
.text
thumb_func_start sub_8083654
sub_8083654:
push {lr}
bl GetLeaderEntity
ldr r0, [r0, 0x70]
pop {r1}
bx r1
thumb_func_end sub_8083654
thumb_func_start sub_8083660
sub_8083660:
push {r4-r7,lr}
@ -591,847 +582,4 @@ _08083A9E:
bx r0
thumb_func_end sub_8083904
thumb_func_start sub_8083AB0
sub_8083AB0:
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x14
adds r5, r1, 0
adds r7, r2, 0
lsls r0, 16
asrs r0, 16
mov r8, r0
ldr r0, _08083AFC
ldr r0, [r0]
ldr r1, _08083B00
adds r4, r0, r1
movs r6, 0
adds r0, r5, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _08083AE4
adds r0, r5, 0
bl GetEntityType
cmp r0, 0x1
bne _08083AE4
ldr r6, [r5, 0x70]
_08083AE4:
ldr r5, [r7, 0x70]
cmp r6, 0
beq _08083B04
mov r0, sp
adds r1, r6, 0
bl sub_80709C8
adds r0, r4, 0
mov r1, sp
bl CopyStringtoBuffer
b _08083B0E
.align 2, 0
_08083AFC: .4byte gDungeonGlobalData
_08083B00: .4byte 0x0001ce98
_08083B04:
ldr r0, _08083C04
ldr r1, [r0]
adds r0, r4, 0
bl CopyStringtoBuffer
_08083B0E:
mov r0, sp
adds r1, r5, 0
bl sub_80709C8
adds r0, r4, 0
adds r0, 0xA
mov r1, sp
bl CopyStringtoBuffer
movs r2, 0
mov r3, r8
strh r3, [r4, 0x14]
ldr r0, [r5, 0x60]
str r0, [r4, 0x1C]
ldr r0, [r5, 0x18]
str r0, [r4, 0x20]
ldrb r0, [r5, 0x9]
adds r1, r4, 0
adds r1, 0x2A
strb r0, [r1]
ldrh r0, [r5, 0x10]
strh r0, [r4, 0x24]
ldrb r0, [r5, 0x14]
subs r1, 0x4
strb r0, [r1]
ldrb r0, [r5, 0x15]
adds r1, 0x1
strb r0, [r1]
ldrb r1, [r5, 0x16]
adds r0, r4, 0
adds r0, 0x28
strb r1, [r0]
ldrb r0, [r5, 0x17]
adds r1, r4, 0
adds r1, 0x29
strb r0, [r1]
ldr r0, _08083C08
ldr r0, [r0]
ldr r1, _08083C0C
adds r0, r1
ldr r0, [r0]
str r0, [r4, 0x18]
adds r3, r4, 0
adds r3, 0x2B
strb r2, [r3]
adds r6, r4, 0
adds r6, 0x2C
strb r2, [r6]
movs r0, 0x2D
adds r0, r4
mov r12, r0
strb r2, [r0]
adds r4, 0x2E
strb r2, [r4]
adds r0, r5, 0
adds r0, 0x60
ldrb r1, [r0]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08083BF8
movs r0, 0x8
ands r0, r1
cmp r0, 0
bne _08083BF8
adds r1, r5, 0
adds r1, 0x62
ldrb r0, [r1]
cmp r0, 0x13
bne _08083BA4
ldr r0, _08083C10
ldrb r0, [r0]
ldrb r2, [r3]
adds r0, r2
strb r0, [r3]
_08083BA4:
ldrb r0, [r1]
cmp r0, 0x2B
bne _08083BB4
ldr r0, _08083C14
ldrb r0, [r0]
ldrb r2, [r3]
adds r0, r2
strb r0, [r3]
_08083BB4:
ldrb r0, [r1]
cmp r0, 0x21
bne _08083BC4
ldr r0, _08083C18
ldrb r0, [r0]
ldrb r3, [r6]
adds r0, r3
strb r0, [r6]
_08083BC4:
ldrb r0, [r1]
cmp r0, 0x2B
bne _08083BD4
ldr r0, _08083C14
ldrb r0, [r0]
ldrb r2, [r6]
adds r0, r2
strb r0, [r6]
_08083BD4:
ldrb r0, [r1]
cmp r0, 0x1E
bne _08083BE8
ldr r0, _08083C1C
ldrb r0, [r0]
mov r3, r12
ldrb r3, [r3]
adds r0, r3
mov r2, r12
strb r0, [r2]
_08083BE8:
ldrb r0, [r1]
cmp r0, 0x22
bne _08083BF8
ldr r0, _08083C20
ldrb r0, [r0]
ldrb r3, [r4]
adds r0, r3
strb r0, [r4]
_08083BF8:
add sp, 0x14
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08083C04: .4byte gUnknown_80FE6F4
_08083C08: .4byte gDungeonGlobalData
_08083C0C: .4byte 0x00000644
_08083C10: .4byte gUnknown_810AC60
_08083C14: .4byte gUnknown_810AC68
_08083C18: .4byte gUnknown_810AC62
_08083C1C: .4byte gUnknown_810AC64
_08083C20: .4byte gUnknown_810AC66
thumb_func_end sub_8083AB0
thumb_func_start sub_8083C24
sub_8083C24:
push {lr}
ldr r0, _08083C3C
ldr r0, [r0]
ldr r1, _08083C40
adds r0, r1
movs r2, 0x14
ldrsh r1, [r0, r2]
ldr r0, _08083C44
cmp r1, r0
ble _08083C48
movs r0, 0
b _08083C4A
.align 2, 0
_08083C3C: .4byte gDungeonGlobalData
_08083C40: .4byte 0x0001ce98
_08083C44: .4byte 0x00000225
_08083C48:
movs r0, 0x1
_08083C4A:
pop {r1}
bx r1
thumb_func_end sub_8083C24
thumb_func_start sub_8083C50
sub_8083C50:
push {lr}
ldr r0, _08083C74
ldr r0, [r0]
ldr r1, _08083C78
adds r0, r1
movs r2, 0x14
ldrsh r1, [r0, r2]
ldr r0, _08083C7C
cmp r1, r0
beq _08083C70
adds r0, 0x3
cmp r1, r0
beq _08083C70
subs r0, 0x2
cmp r1, r0
bne _08083C80
_08083C70:
movs r0, 0x1
b _08083C82
.align 2, 0
_08083C74: .4byte gDungeonGlobalData
_08083C78: .4byte 0x0001ce98
_08083C7C: .4byte 0x00000227
_08083C80:
movs r0, 0
_08083C82:
pop {r1}
bx r1
thumb_func_end sub_8083C50
thumb_func_start sub_8083C88
sub_8083C88:
push {r4-r6,lr}
lsls r0, 24
lsrs r6, r0, 24
ldr r4, _08083CC4
ldr r0, [r4]
ldr r1, _08083CC8
adds r5, r0, r1
ldr r1, _08083CCC
adds r0, r1
ldrb r0, [r0]
bl GetUnk9
lsls r0, 24
cmp r0, 0
bne _08083CB6
ldr r0, [r4]
ldr r1, _08083CD0
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _08083CC0
cmp r6, 0
bne _08083CC0
_08083CB6:
movs r0, 0x14
ldrsh r1, [r5, r0]
ldr r0, _08083CD4
cmp r1, r0
beq _08083CD8
_08083CC0:
movs r0, 0x1
b _08083CDA
.align 2, 0
_08083CC4: .4byte gDungeonGlobalData
_08083CC8: .4byte 0x0001ce98
_08083CCC: .4byte 0x00000644
_08083CD0: .4byte 0x0000065c
_08083CD4: .4byte 0x00000227
_08083CD8:
movs r0, 0
_08083CDA:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_8083C88
thumb_func_start sub_8083CE0
sub_8083CE0:
push {lr}
lsls r0, 24
cmp r0, 0
beq _08083CF2
ldr r0, _08083D00
movs r1, 0x1A
ldrsh r0, [r0, r1]
cmp r0, 0x1
ble _08083CFC
_08083CF2:
ldr r0, _08083D04
movs r1, 0x80
lsls r1, 1
bl PlayFanfareSE
_08083CFC:
pop {r0}
bx r0
.align 2, 0
_08083D00: .4byte gUnknown_202EE10
_08083D04: .4byte 0x0000012d
thumb_func_end sub_8083CE0
thumb_func_start sub_8083D08
sub_8083D08:
push {lr}
movs r0, 0x97
lsls r0, 1
movs r1, 0x80
lsls r1, 1
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D08
thumb_func_start sub_8083D1C
sub_8083D1C:
push {lr}
ldr r0, _08083D2C
movs r1, 0x80
lsls r1, 1
bl PlayFanfareSE
pop {r0}
bx r0
.align 2, 0
_08083D2C: .4byte 0x00000133
thumb_func_end sub_8083D1C
thumb_func_start sub_8083D30
sub_8083D30:
push {lr}
ldr r0, _08083D40
movs r1, 0x80
lsls r1, 1
bl PlayFanfareSE
pop {r0}
bx r0
.align 2, 0
_08083D40: .4byte 0x0000012f
thumb_func_end sub_8083D30
thumb_func_start sub_8083D44
sub_8083D44:
push {lr}
movs r0, 0x98
lsls r0, 1
movs r1, 0x80
lsls r1, 1
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D44
thumb_func_start sub_8083D58
sub_8083D58:
push {lr}
movs r1, 0x80
lsls r1, 1
movs r0, 0xC8
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D58
thumb_func_start sub_8083D68
sub_8083D68:
push {lr}
movs r1, 0x80
lsls r1, 1
movs r0, 0xCF
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D68
thumb_func_start sub_8083D78
sub_8083D78:
push {lr}
movs r1, 0x80
lsls r1, 1
movs r0, 0xD3
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D78
thumb_func_start sub_8083D88
sub_8083D88:
push {lr}
movs r1, 0x80
lsls r1, 1
movs r0, 0xCC
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083D88
thumb_func_start sub_8083D98
sub_8083D98:
push {lr}
movs r0, 0x33
bl sub_8083E88
ldr r2, _08083DCC
ldr r0, [r2]
ldr r1, _08083DD0
adds r0, r1
movs r1, 0
strb r1, [r0]
ldr r0, [r2]
ldr r3, _08083DD4
adds r0, r3
strb r1, [r0]
ldr r0, [r2]
adds r3, 0x27
adds r0, r3
strb r1, [r0]
ldr r0, [r2]
ldr r1, _08083DD8
adds r0, r1
ldr r1, _08083DDC
strh r1, [r0]
pop {r0}
bx r0
.align 2, 0
_08083DCC: .4byte gDungeonGlobalData
_08083DD0: .4byte 0x0000066f
_08083DD4: .4byte 0x00000672
_08083DD8: .4byte 0x0000066a
_08083DDC: .4byte 0x000003e7
thumb_func_end sub_8083D98
thumb_func_start sub_8083DE0
sub_8083DE0:
push {lr}
movs r0, 0x34
bl sub_8083E88
ldr r2, _08083E14
ldr r0, [r2]
ldr r1, _08083E18
adds r0, r1
movs r1, 0
strb r1, [r0]
ldr r0, [r2]
ldr r3, _08083E1C
adds r0, r3
strb r1, [r0]
ldr r0, [r2]
adds r3, 0x27
adds r0, r3
strb r1, [r0]
ldr r0, [r2]
ldr r1, _08083E20
adds r0, r1
ldr r1, _08083E24
strh r1, [r0]
pop {r0}
bx r0
.align 2, 0
_08083E14: .4byte gDungeonGlobalData
_08083E18: .4byte 0x0000066f
_08083E1C: .4byte 0x00000672
_08083E20: .4byte 0x0000066a
_08083E24: .4byte 0x000003e7
thumb_func_end sub_8083DE0
thumb_func_start sub_8083E28
sub_8083E28:
push {lr}
movs r1, 0x80
lsls r1, 1
movs r0, 0xCF
bl PlayFanfareSE
pop {r0}
bx r0
thumb_func_end sub_8083E28
thumb_func_start PlaySoundEffect
PlaySoundEffect:
push {lr}
lsls r0, 16
lsrs r2, r0, 16
ldr r0, _08083E54
cmp r2, r0
beq _08083E4E
movs r1, 0x80
lsls r1, 1
adds r0, r2, 0
bl PlayFanfareSE
_08083E4E:
pop {r0}
bx r0
.align 2, 0
_08083E54: .4byte 0x000003e5
thumb_func_end PlaySoundEffect
thumb_func_start sub_8083E58
sub_8083E58:
push {lr}
lsls r0, 16
lsrs r1, r0, 16
ldr r0, _08083E70
cmp r1, r0
beq _08083E6A
adds r0, r1, 0
bl StopFanfareSE
_08083E6A:
pop {r0}
bx r0
.align 2, 0
_08083E70: .4byte 0x000003e5
thumb_func_end sub_8083E58
thumb_func_start IsFanfareSEPlaying_2
IsFanfareSEPlaying_2:
push {lr}
lsls r0, 16
lsrs r0, 16
bl IsFanfareSEPlaying
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
thumb_func_end IsFanfareSEPlaying_2
thumb_func_start sub_8083E88
sub_8083E88:
ldr r1, _08083E9C
ldr r1, [r1]
ldr r3, _08083EA0
adds r2, r1, r3
movs r3, 0
strh r0, [r2]
ldr r0, _08083EA4
adds r1, r0
strh r3, [r1]
bx lr
.align 2, 0
_08083E9C: .4byte gDungeonGlobalData
_08083EA0: .4byte 0x0001ceda
_08083EA4: .4byte 0x0001ced4
thumb_func_end sub_8083E88
thumb_func_start sub_8083EA8
sub_8083EA8:
push {r4,r5,lr}
lsls r0, 16
lsrs r0, 16
ldr r2, _08083ECC
ldr r2, [r2]
movs r4, 0x80
lsls r4, 8
adds r3, r4, 0
ldr r5, _08083ED0
adds r4, r2, r5
orrs r0, r3
strh r0, [r4]
ldr r0, _08083ED4
adds r2, r0
strh r1, [r2]
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_08083ECC: .4byte gDungeonGlobalData
_08083ED0: .4byte 0x0001ceda
_08083ED4: .4byte 0x0001ced4
thumb_func_end sub_8083EA8
thumb_func_start sub_8083ED8
sub_8083ED8:
push {lr}
lsls r0, 16
lsrs r0, 16
bl FadeOutAllMusic
ldr r0, _08083F00
ldr r1, [r0]
ldr r2, _08083F04
adds r0, r1, r2
ldr r2, _08083F08
strh r2, [r0]
ldr r3, _08083F0C
adds r0, r1, r3
strh r2, [r0]
ldr r0, _08083F10
adds r1, r0
strh r2, [r1]
pop {r0}
bx r0
.align 2, 0
_08083F00: .4byte gDungeonGlobalData
_08083F04: .4byte 0x0001ced6
_08083F08: .4byte 0x000003e7
_08083F0C: .4byte 0x0001ced8
_08083F10: .4byte 0x0001ceda
thumb_func_end sub_8083ED8
thumb_func_start sub_8083F14
sub_8083F14:
push {lr}
bl sub_8083F34
bl xxx_call_stop_bgm
pop {r0}
bx r0
thumb_func_end sub_8083F14
thumb_func_start xxx_call_GetCurrentBGSong
xxx_call_GetCurrentBGSong:
push {lr}
bl GetCurrentBGSong
lsls r0, 16
lsrs r0, 16
pop {r1}
bx r1
thumb_func_end xxx_call_GetCurrentBGSong
thumb_func_start sub_8083F34
sub_8083F34:
ldr r0, _08083F4C
ldr r0, [r0]
ldr r1, _08083F50
adds r0, r1
movs r1, 0
str r1, [r0]
str r1, [r0, 0x4]
ldr r1, _08083F54
strh r1, [r0, 0xA]
strh r1, [r0, 0xC]
strh r1, [r0, 0xE]
bx lr
.align 2, 0
_08083F4C: .4byte gDungeonGlobalData
_08083F50: .4byte 0x0001cecc
_08083F54: .4byte 0x000003e7
thumb_func_end sub_8083F34
thumb_func_start sub_8083F58
sub_8083F58:
push {r4,lr}
ldr r0, _08083F7C
ldr r2, [r0]
ldr r0, _08083F80
adds r4, r2, r0
ldr r1, _08083F84
adds r3, r2, r1
ldrh r1, [r3]
ldr r0, _08083F88
cmp r1, r0
bne _08083FB2
ldr r1, _08083F8C
adds r0, r2, r1
ldrb r0, [r0]
cmp r0, 0
beq _08083F90
movs r1, 0x12
b _08083FB2
.align 2, 0
_08083F7C: .4byte gDungeonGlobalData
_08083F80: .4byte 0x0001cecc
_08083F84: .4byte 0x0000066a
_08083F88: .4byte 0x000003e7
_08083F8C: .4byte 0x0000066f
_08083F90:
ldr r1, _08083FA0
adds r0, r2, r1
ldrb r0, [r0]
cmp r0, 0
beq _08083FA4
movs r1, 0x80
b _08083FB2
.align 2, 0
_08083FA0: .4byte 0x00000672
_08083FA4:
ldr r1, _08083FC4
adds r0, r2, r1
ldrb r0, [r0]
movs r1, 0x11
cmp r0, 0
bne _08083FB2
ldrh r1, [r4, 0xE]
_08083FB2:
ldr r0, [r4]
cmp r0, 0x4
bne _08083FC8
ldrh r0, [r4, 0xC]
cmp r1, r0
beq _08083FDA
movs r0, 0x2
b _08083FD6
.align 2, 0
_08083FC4: .4byte 0x00000699
_08083FC8:
ldr r2, _08083FEC
cmp r1, r2
beq _08083FDA
ldrh r0, [r4, 0xA]
cmp r0, r2
bne _08083FDA
movs r0, 0x1
_08083FD6:
str r0, [r4]
strh r1, [r4, 0xA]
_08083FDA:
ldr r0, [r4]
cmp r0, 0x4
bhi _08084084
lsls r0, 2
ldr r1, _08083FF0
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_08083FEC: .4byte 0x000003e7
_08083FF0: .4byte _08083FF4
.align 2, 0
_08083FF4:
.4byte _08084084
.4byte _08084008
.4byte _08084050
.4byte _0808405E
.4byte _08084084
_08084008:
ldrh r1, [r4, 0xA]
ldr r0, _08084014
cmp r1, r0
bne _08084018
movs r0, 0
b _08084040
.align 2, 0
_08084014: .4byte 0x000003e7
_08084018:
movs r0, 0x80
lsls r0, 8
ands r0, r1
cmp r0, 0
beq _08084030
ldr r0, _0808402C
ands r0, r1
bl StartNewBGM
b _0808403A
.align 2, 0
_0808402C: .4byte 0x00007fff
_08084030:
ldr r0, _08084048
ands r0, r1
ldrh r1, [r4, 0x8]
bl FadeInNewBGM
_0808403A:
ldrh r0, [r4, 0xA]
strh r0, [r4, 0xC]
movs r0, 0x4
_08084040:
str r0, [r4]
ldr r0, _0808404C
strh r0, [r4, 0xA]
b _08084084
.align 2, 0
_08084048: .4byte 0x00007fff
_0808404C: .4byte 0x000003e7
_08084050:
movs r0, 0x1E
bl FadeOutBGM
movs r0, 0x1E
str r0, [r4, 0x4]
movs r0, 0x3
b _08084082
_0808405E:
ldr r0, [r4, 0x4]
cmp r0, 0
beq _0808406C
subs r0, 0x1
str r0, [r4, 0x4]
cmp r0, 0
bne _08084084
_0808406C:
ldrh r1, [r4, 0xA]
ldr r0, _0808407C
cmp r1, r0
bne _08084080
bl StopBGM
movs r0, 0
b _08084082
.align 2, 0
_0808407C: .4byte 0x000003e7
_08084080:
movs r0, 0x1
_08084082:
str r0, [r4]
_08084084:
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_8083F58
thumb_func_start sub_808408C
sub_808408C:
ldr r2, _0808409C
movs r1, 0x1
orrs r1, r0
ldr r0, _080840A0
ands r0, r1
str r0, [r2]
bx lr
.align 2, 0
_0808409C: .4byte gUnknown_203B458
_080840A0: .4byte 0x00ffffff
thumb_func_end sub_808408C
thumb_func_start sub_80840A4
sub_80840A4:
ldr r3, _080840C8
ldr r0, [r3]
ldr r2, _080840CC
adds r1, r0, 0
muls r1, r2
adds r1, 0x1
lsrs r0, r1, 16
muls r1, r2
adds r1, 0x1
str r1, [r3]
ldr r2, _080840D0
ands r1, r2
orrs r0, r1
ldr r1, _080840D4
ands r0, r1
movs r1, 0x1
orrs r0, r1
bx lr
.align 2, 0
_080840C8: .4byte gUnknown_203B458
_080840CC: .4byte 0x5d588b65
_080840D0: .4byte 0xffff0000
_080840D4: .4byte 0x00ffffff
thumb_func_end sub_80840A4
.align 2, 0

View File

@ -86,7 +86,7 @@ _0808427C:
_08084290:
movs r0, 0x36
bl sub_803E668
bl sub_8083F58
bl UpdateDungeonMusic
ldrh r1, [r4, 0xA]
movs r2, 0xA
ldrsh r0, [r4, r2]
@ -804,80 +804,4 @@ _08084846:
_08084850: .4byte 0x000003e6
thumb_func_end sub_80847D4
thumb_func_start sub_8084854
sub_8084854:
push {r4,r5,lr}
adds r4, r0, 0
ldr r5, _08084874
ldr r2, [r5]
movs r1, 0xCF
lsls r1, 3
adds r0, r2, r1
ldrb r0, [r0]
cmp r0, 0
beq _0808487C
ldrb r1, [r4, 0x5]
ldr r3, _08084878
adds r0, r2, r3
strb r1, [r0]
b _080848C8
.align 2, 0
_08084874: .4byte gDungeonGlobalData
_08084878: .4byte 0x00003a0d
_0808487C:
ldrb r0, [r4, 0x4]
bl sub_8098100
lsls r0, 24
cmp r0, 0
beq _08084898
ldr r0, [r5]
ldrb r1, [r4, 0x5]
ldr r2, _08084894
adds r0, r2
strb r1, [r0]
b _080848C8
.align 2, 0
_08084894: .4byte 0x00003a0d
_08084898:
ldrb r0, [r4, 0x2]
bl sub_8098100
lsls r0, 24
cmp r0, 0
beq _080848B4
ldr r0, [r5]
ldrb r1, [r4, 0x3]
ldr r3, _080848B0
adds r0, r3
strb r1, [r0]
b _080848C8
.align 2, 0
_080848B0: .4byte 0x00003a0d
_080848B4:
ldr r0, [r5]
ldrb r1, [r4, 0x1]
ldr r2, _080848E0
adds r0, r2
strb r1, [r0]
ldrb r0, [r4, 0x2]
cmp r0, 0x40
beq _080848C8
bl sub_8097FA8
_080848C8:
ldr r0, _080848E4
ldr r0, [r0]
ldr r3, _080848E8
adds r0, r3
movs r1, 0x1
strb r1, [r0]
movs r0, 0
bl sub_807E5E4
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_080848E0: .4byte 0x00003a0d
_080848E4: .4byte gDungeonGlobalData
_080848E8: .4byte 0x00000675
thumb_func_end sub_8084854
.align 2,0

View File

@ -438,7 +438,7 @@ _08085E5E:
pop {r0}
bx r0
.align 2, 0
_08085E70: .4byte gUnknown_202EE88
_08085E70: .4byte gDungeonPaletteFile
_08085E74: .4byte 0xffffff00
_08085E78: .4byte 0xffff00ff
_08085E7C: .4byte 0xff00ffff
@ -745,7 +745,7 @@ sub_8086124:
sub_8086130:
push {lr}
movs r0, 0x3C
bl sub_8083ED8
bl DungeonFadeOutBGM
movs r0, 0x3C
movs r1, 0x46
bl sub_803E708

View File

@ -79,7 +79,7 @@ TeamMeaniesPreFightDialogue:
bl sub_803E708
bl sub_8087144
movs r0, 0xA
bl sub_8083E88
bl DungeonStartNewBGM
ldr r0, _08087050
bl DisplayDungeonDialogue
movs r0, 0xA
@ -253,7 +253,7 @@ sub_8087144:
mov r0, r9
str r0, [r4, 0x8]
movs r0, 0xA
bl sub_8083E88
bl DungeonStartNewBGM
adds r0, r7, 0
bl sub_8086A54
mov r0, r8
@ -327,7 +327,7 @@ sub_8087230:
bl GetEntityFromClientType
adds r5, r0, 0
movs r0, 0x72
bl sub_8083E88
bl DungeonStartNewBGM
bl sub_8085374
bl sub_80854D4
movs r0, 0x4
@ -514,7 +514,7 @@ ZapdosPreFightDialogue:
bl sub_803E708
movs r0, 0x3
bl ZapdosScreenFlash
bl sub_8083F14
bl DungeonStopBGM
movs r0, 0xED
lsls r0, 1
bl PlaySoundEffect
@ -523,7 +523,7 @@ ZapdosPreFightDialogue:
ldr r0, [sp, 0x68]
bl ZapdosDropInEffect
movs r0, 0x9
bl sub_8083E88
bl DungeonStartNewBGM
adds r0, r6, 0
movs r1, 0x6
movs r2, 0x4

View File

@ -5,67 +5,6 @@
.text
thumb_func_start sub_809733C
sub_809733C:
push {r4-r6,lr}
lsls r0, 16
asrs r4, r0, 16
lsls r1, 24
lsrs r6, r1, 24
cmp r4, 0xD
beq _0809737C
lsls r0, r4, 16
lsrs r5, r0, 16
movs r0, 0
movs r1, 0x2C
adds r2, r5, 0
bl sub_8001784
cmp r0, 0
bne _0809737C
movs r0, 0
movs r1, 0x2B
adds r2, r5, 0
adds r3, r6, 0
bl sub_800199C
cmp r6, 0
beq _0809737C
cmp r4, 0xE
blt _0809737C
cmp r4, 0xF
ble _08097378
cmp r4, 0x1C
bne _0809737C
_08097378:
bl sub_809674C
_0809737C:
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_809733C
thumb_func_start sub_8097384
sub_8097384:
push {lr}
lsls r0, 16
asrs r0, 16
cmp r0, 0xD
bne _08097392
movs r0, 0
b _080973A4
_08097392:
lsls r2, r0, 16
lsrs r2, 16
movs r0, 0
movs r1, 0x2C
bl sub_8001784
cmp r0, 0
beq _080973A4
movs r0, 0x1
_080973A4:
pop {r1}
bx r1
thumb_func_end sub_8097384
thumb_func_start sub_80973A8
sub_80973A8:
push {r4-r6,lr}

View File

@ -1,9 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
.align 2,0

View File

@ -5,28 +5,6 @@
.text
thumb_func_start sub_8097DD0
sub_8097DD0:
push {lr}
adds r2, r0, 0
adds r3, r1, 0
ldr r1, [r2]
ldr r0, [r3]
cmp r1, r0
bne _08097DEA
ldr r1, [r2, 0x4]
ldr r0, [r3, 0x4]
cmp r1, r0
bne _08097DEA
movs r0, 0x1
b _08097DEC
_08097DEA:
movs r0, 0
_08097DEC:
pop {r1}
bx r1
thumb_func_end sub_8097DD0
thumb_func_start sub_8097DF0
sub_8097DF0:
push {r4-r7,lr}

View File

@ -488,7 +488,7 @@ _080988E4:
movs r1, 0
bl GroundMap_ExecuteEvent
movs r0, 0x1E
bl sub_8098F44
bl GroundMainGameCancelRequest
movs r0, 0x1E
bl FadeOutAllMusic
_080988F8:

View File

@ -6485,7 +6485,7 @@ sub_809C39C:
movs r2, 0x1
negs r2, r2
movs r1, 0
bl sub_8098D1C
bl GroundMainGroundRequest
_0809C3CC:
bl sub_801D1E0
pop {r0}
@ -6515,7 +6515,7 @@ sub_809C3D8:
movs r2, 0x1
negs r2, r2
movs r1, 0
bl sub_8098D1C
bl GroundMainGroundRequest
_0809C408:
bl sub_801D1E0
pop {r0}
@ -6545,7 +6545,7 @@ sub_809C414:
movs r2, 0x1
negs r2, r2
movs r1, 0
bl sub_8098D1C
bl GroundMainGroundRequest
b _0809C458
.align 2, 0
_0809C444: .4byte gUnknown_3001B64

View File

@ -677,74 +677,4 @@ _0809D708:
bx r1
thumb_func_end sub_809D6E4
thumb_func_start sub_809D710
sub_809D710:
push {r4,lr}
adds r4, r0, 0
adds r3, r1, 0
lsls r2, 16
asrs r2, 16
ldr r1, _0809D73C
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r1, 0x8
adds r0, r1
ldr r0, [r0]
str r0, [r3]
movs r0, 0x2
strh r0, [r3, 0x4]
cmp r4, 0
beq _0809D740
ldrh r0, [r4, 0x10]
strh r0, [r3, 0x6]
ldrb r0, [r4, 0x12]
b _0809D746
.align 2, 0
_0809D73C: .4byte gFunctionScriptTable
_0809D740:
ldr r0, _0809D750
strh r0, [r3, 0x6]
movs r0, 0xFF
_0809D746:
strb r0, [r3, 0x8]
pop {r4}
pop {r0}
bx r0
.align 2, 0
_0809D750: .4byte 0x0000ffff
thumb_func_end sub_809D710
thumb_func_start sub_809D754
sub_809D754:
push {r4,lr}
adds r4, r0, 0
adds r0, 0x24
bl sub_809D568
adds r4, 0x84
adds r0, r4, 0
bl sub_809D568
movs r0, 0x1
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_809D754
thumb_func_start sub_809D770
sub_809D770:
push {r4,lr}
adds r4, r0, 0
adds r0, 0x24
bl sub_809D568
adds r0, r4, 0
adds r0, 0x84
bl sub_809D568
movs r0, 0x4
strh r0, [r4, 0x26]
movs r0, 0x1
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_809D770
.align 2,0

View File

@ -1,85 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_803A3BC
sub_803A3BC:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x84
movs r5, 0x1
add r4, sp, 0x60
add r6, sp, 0x68
add r0, sp, 0x7C
mov r8, r0
add r0, sp, 0x80
mov r10, r0
_0803A3D6:
lsls r0, r5, 24
lsrs r0, 24
bl UnlockFriendArea
adds r5, 0x1
cmp r5, 0x39
ble _0803A3D6
movs r5, 0
adds r7, r4, 0
_0803A3E8:
movs r0, 0
mov r9, r0
ldr r0, _0803A454
str r0, [sp, 0x7C]
adds r5, 0x1
lsls r4, r5, 16
asrs r4, 16
adds r0, r7, 0
movs r1, 0
movs r2, 0x8
bl memset
movs r0, 0x27
strh r0, [r7]
adds r0, r6, 0
adds r1, r4, 0
bl CopySpeciesNametoBuffer
adds r0, r6, 0
adds r1, r6, 0
bl CopyStringtoBuffer
movs r0, 0x40
strb r0, [r6]
mov r0, r8
str r0, [sp]
str r7, [sp, 0x4]
add r0, sp, 0x8
adds r1, r4, 0
adds r2, r6, 0
movs r3, 0x43
bl sub_808CFD0
add r0, sp, 0x8
bl sub_808D1DC
ldr r0, _0803A458
cmp r5, r0
ble _0803A3E8
mov r0, r9
str r0, [sp, 0x80]
mov r0, r10
movs r1, 0x1
bl WriteSavetoPak
add sp, 0x84
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0803A454: .4byte 0x00001006
_0803A458: .4byte 0x0000012b
thumb_func_end sub_803A3BC
.align 2,0

View File

@ -706,113 +706,4 @@ _080908CE:
bx r0
thumb_func_end sub_8090888
thumb_func_start sub_80908D8
sub_80908D8:
push {lr}
adds r2, r0, 0
ldrb r0, [r2]
cmp r0, 0x3E
bhi _08090908
ldr r0, _08090900
ldrb r3, [r2]
adds r0, r3, r0
ldrb r1, [r2, 0x1]
ldrb r0, [r0]
cmp r1, r0
bcs _08090908
ldr r1, _08090904
lsls r0, r3, 2
adds r0, r1
ldrb r1, [r2, 0x1]
ldr r0, [r0]
adds r0, r1
ldrb r0, [r0]
b _0809090A
.align 2, 0
_08090900: .4byte gDungeonFloorCount
_08090904: .4byte gUnknown_8108084
_08090908:
movs r0, 0x1
_0809090A:
pop {r1}
bx r1
thumb_func_end sub_80908D8
thumb_func_start sub_8090910
sub_8090910:
push {r4-r7,lr}
adds r5, r0, 0
adds r7, r1, 0
ldr r4, _0809094C
adds r0, r4, 0
bl RandomCapped
adds r6, r0, 0
adds r0, r4, 0
bl RandomCapped
adds r2, r0, 0
ldrb r0, [r5]
cmp r0, 0x3E
bhi _08090954
ldr r0, _08090950
ldrb r1, [r5]
adds r1, r0
ldrb r0, [r5, 0x1]
ldrb r1, [r1]
cmp r0, r1
bcs _08090954
adds r0, r7, 0
adds r1, r6, 0
bl sub_8091E94
lsls r0, 24
lsrs r0, 24
b _08090956
.align 2, 0
_0809094C: .4byte 0x0000270f
_08090950: .4byte gDungeonFloorCount
_08090954:
movs r0, 0x46
_08090956:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8090910
thumb_func_start sub_809095C
sub_809095C:
push {r4,lr}
lsls r0, 24
lsrs r3, r0, 24
cmp r3, 0x3E
bls _0809096A
_08090966:
movs r0, 0x1
b _0809098C
_0809096A:
movs r2, 0
ldr r0, _08090994
ldrb r1, [r0]
adds r4, r0, 0
cmp r1, 0x3F
beq _0809098A
adds r1, r4, 0
_08090978:
adds r0, r2, r1
ldrb r0, [r0]
cmp r0, r3
beq _08090966
adds r2, 0x1
adds r0, r2, r4
ldrb r0, [r0]
cmp r0, 0x3F
bne _08090978
_0809098A:
movs r0, 0
_0809098C:
pop {r4}
pop {r1}
bx r1
.align 2, 0
_08090994: .4byte gUnknown_810A350
thumb_func_end sub_809095C
.align 2,0

35
asm/dungeon_music.s Normal file
View File

@ -0,0 +1,35 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_80840A4
sub_80840A4:
ldr r3, _080840C8
ldr r0, [r3]
ldr r2, _080840CC
adds r1, r0, 0
muls r1, r2
adds r1, 0x1
lsrs r0, r1, 16
muls r1, r2
adds r1, 0x1
str r1, [r3]
ldr r2, _080840D0
ands r1, r2
orrs r0, r1
ldr r1, _080840D4
ands r0, r1
movs r1, 0x1
orrs r0, r1
bx lr
.align 2, 0
_080840C8: .4byte gUnknown_203B458
_080840CC: .4byte 0x5d588b65
_080840D0: .4byte 0xffff0000
_080840D4: .4byte 0x00ffffff
thumb_func_end sub_80840A4
.align 2,0

View File

@ -4,205 +4,6 @@
.syntax unified
.text
thumb_func_start GroundMap_ExecuteEvent
GroundMap_ExecuteEvent:
push {r4,r5,lr}
sub sp, 0xC
adds r4, r0, 0
adds r5, r1, 0
lsls r4, 16
asrs r4, 16
lsls r5, 24
lsrs r5, 24
ldr r1, _080A4C44
movs r0, 0
adds r2, r4, 0
adds r3, r5, 0
bl Log
movs r0, 0
mov r1, sp
adds r2, r4, 0
bl sub_809D710
cmp r5, 0
beq _080A4C2C
mov r1, sp
movs r0, 0x5
strh r0, [r1, 0x4]
_080A4C2C:
ldr r0, _080A4C48
ldr r0, [r0]
ldr r3, _080A4C4C
movs r1, 0
mov r2, sp
bl GroundScript_ExecutePP
add sp, 0xC
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_080A4C44: .4byte gUnknown_8117594
_080A4C48: .4byte gUnknown_3001B6C
_080A4C4C: .4byte gUnknown_81175E0
thumb_func_end GroundMap_ExecuteEvent
thumb_func_start GroundMap_ExecuteStation
GroundMap_ExecuteStation:
push {r4-r6,lr}
mov r6, r8
push {r6}
sub sp, 0x14
adds r4, r0, 0
adds r5, r1, 0
adds r6, r2, 0
mov r8, r3
lsls r4, 16
asrs r4, 16
lsls r5, 16
asrs r5, 16
lsls r6, 24
asrs r6, 24
mov r0, r8
lsls r0, 24
lsrs r0, 24
mov r8, r0
ldr r1, _080A4CB8
str r6, [sp]
str r0, [sp, 0x4]
movs r0, 0
adds r2, r4, 0
adds r3, r5, 0
bl Log
add r0, sp, 0x8
adds r1, r4, 0
adds r2, r5, 0
adds r3, r6, 0
bl GroundMap_GetStationScript
mov r0, r8
cmp r0, 0
beq _080A4C9C
add r1, sp, 0x8
movs r0, 0x5
strh r0, [r1, 0x4]
_080A4C9C:
ldr r0, _080A4CBC
ldr r0, [r0]
ldr r3, _080A4CC0
movs r1, 0
add r2, sp, 0x8
bl GroundScript_ExecutePP
add sp, 0x14
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_080A4CB8: .4byte gUnknown_81175EC
_080A4CBC: .4byte gUnknown_3001B6C
_080A4CC0: .4byte gUnknown_8117644
thumb_func_end GroundMap_ExecuteStation
thumb_func_start GroundMap_ExecuteEnter
GroundMap_ExecuteEnter:
push {r4,lr}
sub sp, 0xC
adds r4, r0, 0
lsls r4, 16
asrs r4, 16
ldr r1, _080A4D08
movs r0, 0
adds r2, r4, 0
bl Log
mov r0, sp
adds r1, r4, 0
bl sub_80A4BE8
mov r1, sp
movs r3, 0
movs r2, 0
movs r0, 0x2
strh r0, [r1, 0x4]
mov r0, sp
strh r2, [r0, 0x6]
strb r3, [r0, 0x8]
ldr r0, _080A4D0C
ldr r0, [r0]
ldr r3, _080A4D10
movs r1, 0
mov r2, sp
bl GroundScript_ExecutePP
add sp, 0xC
pop {r4}
pop {r0}
bx r0
.align 2, 0
_080A4D08: .4byte gUnknown_8117650
_080A4D0C: .4byte gUnknown_3001B6C
_080A4D10: .4byte gUnknown_8117698
thumb_func_end GroundMap_ExecuteEnter
thumb_func_start sub_80A4D14
sub_80A4D14:
push {lr}
ldr r0, _080A4D28
ldr r0, [r0]
bl sub_809D678
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.align 2, 0
_080A4D28: .4byte gUnknown_3001B6C
thumb_func_end sub_80A4D14
thumb_func_start sub_80A4D2C
sub_80A4D2C:
push {lr}
adds r1, r0, 0
lsls r1, 16
asrs r1, 16
ldr r0, _080A4D44
ldr r0, [r0]
bl sub_809D968
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.align 2, 0
_080A4D44: .4byte gUnknown_3001B6C
thumb_func_end sub_80A4D2C
thumb_func_start sub_80A4D48
sub_80A4D48:
push {lr}
lsls r0, 16
asrs r2, r0, 16
movs r0, 0x1
negs r0, r0
cmp r2, r0
beq _080A4D74
ldr r1, _080A4D70
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r0, r1
movs r1, 0
ldrsh r0, [r0, r1]
cmp r0, 0x5
beq _080A4D6C
cmp r0, 0x8
bne _080A4D74
_080A4D6C:
movs r0, 0
b _080A4D76
.align 2, 0
_080A4D70: .4byte gUnknown_811BAF4
_080A4D74:
movs r0, 0x1
_080A4D76:
pop {r1}
bx r1
thumb_func_end sub_80A4D48
thumb_func_start sub_80A4D7C
sub_80A4D7C:

View File

@ -5,220 +5,6 @@
.text
thumb_func_start sub_809D8EC
sub_809D8EC:
push {r4,r5,lr}
adds r4, r0, 0
lsls r1, 16
asrs r5, r1, 16
cmp r5, 0
bne _0809D910
bl sub_809A750
lsls r0, 24
cmp r0, 0
bne _0809D910
adds r0, r4, 0
movs r1, 0
bl sub_80A2460
str r0, [r4, 0x28]
movs r0, 0
b _0809D922
_0809D910:
adds r0, r4, 0
adds r0, 0x46
strh r5, [r0]
movs r0, 0x2
strh r0, [r4, 0x26]
ldr r1, _0809D928
movs r0, 0x1
strb r0, [r1]
movs r0, 0x1
_0809D922:
pop {r4,r5}
pop {r1}
bx r1
.align 2, 0
_0809D928: .4byte gUnknown_2039A36
thumb_func_end sub_809D8EC
thumb_func_start sub_809D92C
sub_809D92C:
push {lr}
ldr r1, _0809D93C
bl sub_809D770
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.align 2, 0
_0809D93C: .4byte gUnknown_81165C8
thumb_func_end sub_809D92C
thumb_func_start sub_809D940
sub_809D940:
push {r4,lr}
bl sub_80A8B74
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
bl sub_80AC378
orrs r4, r0
lsls r4, 24
lsrs r4, 24
bl sub_80AD290
orrs r4, r0
lsls r4, 24
lsrs r4, 24
adds r0, r4, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_809D940
thumb_func_start sub_809D968
sub_809D968:
push {r4-r6,lr}
adds r5, r0, 0
lsls r1, 16
asrs r6, r1, 16
movs r4, 0
adds r2, r5, 0
adds r2, 0x46
ldrh r1, [r2]
movs r0, 0
ldrsh r3, [r2, r0]
movs r0, 0x1
negs r0, r0
cmp r3, r0
beq _0809D98E
cmp r3, r6
bne _0809D98E
ldr r0, _0809D9B4
strh r0, [r2]
movs r4, 0x1
_0809D98E:
adds r2, r5, 0
adds r2, 0xA6
ldrh r1, [r2]
movs r0, 0
ldrsh r3, [r2, r0]
movs r0, 0x1
negs r0, r0
cmp r3, r0
beq _0809D9AA
cmp r3, r6
bne _0809D9AA
ldr r0, _0809D9B4
strh r0, [r2]
movs r4, 0x1
_0809D9AA:
adds r0, r4, 0
pop {r4-r6}
pop {r1}
bx r1
.align 2, 0
_0809D9B4: .4byte 0x0000ffff
thumb_func_end sub_809D968
thumb_func_start sub_809D9B8
sub_809D9B8:
lsls r0, 16
asrs r0, 16
ldr r1, _0809D9D4
adds r1, r0, r1
movs r3, 0
movs r2, 0x1
strb r2, [r1]
ldr r1, _0809D9D8
lsls r0, 2
adds r0, r1
str r3, [r0]
ldr r0, _0809D9DC
strb r2, [r0]
bx lr
.align 2, 0
_0809D9D4: .4byte gUnknown_2039A38
_0809D9D8: .4byte gUnknown_2039B48
_0809D9DC: .4byte gUnknown_2039A36
thumb_func_end sub_809D9B8
thumb_func_start sub_809D9E0
sub_809D9E0:
lsls r0, 16
asrs r0, 16
ldr r2, _0809D9FC
adds r2, r0, r2
movs r3, 0x1
strb r3, [r2]
ldr r2, _0809DA00
lsls r0, 2
adds r0, r2
str r1, [r0]
ldr r0, _0809DA04
strb r3, [r0]
bx lr
.align 2, 0
_0809D9FC: .4byte gUnknown_2039A38
_0809DA00: .4byte gUnknown_2039B48
_0809DA04: .4byte gUnknown_2039A36
thumb_func_end sub_809D9E0
thumb_func_start sub_809DA08
sub_809DA08:
push {r4,r5,lr}
adds r5, r0, 0
lsls r1, 16
asrs r4, r1, 16
ldr r1, _0809DA2C
lsls r0, r4, 2
adds r0, r1
str r2, [r0]
cmp r4, 0
bne _0809DA38
bl sub_809A750
lsls r0, 24
cmp r0, 0
bne _0809DA30
movs r0, 0
b _0809DA5E
.align 2, 0
_0809DA2C: .4byte gUnknown_2039B48
_0809DA30:
adds r0, r5, 0
adds r0, 0x46
strh r4, [r0]
b _0809DA52
_0809DA38:
movs r1, 0x80
adds r2, r5, 0
adds r2, 0x46
adds r0, r4, 0
orrs r0, r1
strh r0, [r2]
ldr r0, _0809DA64
adds r0, r4, r0
movs r1, 0x1
strb r1, [r0]
ldr r0, _0809DA68
adds r0, r4, r0
strb r1, [r0]
_0809DA52:
movs r0, 0x2
strh r0, [r5, 0x26]
ldr r1, _0809DA6C
movs r0, 0x1
strb r0, [r1]
movs r0, 0x1
_0809DA5E:
pop {r4,r5}
pop {r1}
bx r1
.align 2, 0
_0809DA64: .4byte gUnknown_2039A38
_0809DA68: .4byte gUnknown_2039AC0
_0809DA6C: .4byte gUnknown_2039A36
thumb_func_end sub_809DA08
thumb_func_start HandleAction
HandleAction:
push {r4-r7,lr}
@ -1151,7 +937,7 @@ _0809E390:
movs r3, 0x2
ldrsh r2, [r1, r3]
movs r1, 0
bl sub_8098D1C
bl GroundMainGroundRequest
_0809E3BA:
ldr r1, [r4]
adds r0, r7, 0
@ -2389,7 +2175,7 @@ _0809EF26:
ldrsh r2, [r0, r1]
adds r0, r6, 0
adds r1, r5, 0
bl sub_8098D1C
bl GroundMainGroundRequest
b _0809EAE0
.align 2, 0
_0809EF38: .4byte gUnknown_81165D4
@ -2424,7 +2210,7 @@ _0809EF70:
movs r2, 0x2
ldrsh r1, [r0, r2]
adds r0, r4, 0
bl sub_8098E18
bl GroundMainRescueRequest
mov r0, r9
movs r1, 0x1
bl sub_80A2460
@ -3286,7 +3072,7 @@ _0809F68E:
_0809F6C6:
adds r0, r4, 0
adds r1, r5, 0
bl sub_8098E18
bl GroundMainRescueRequest
bl _0809EAE0
.align 2, 0
_0809F6D4: .4byte gUnknown_8116684
@ -3297,7 +3083,7 @@ _0809F6DC:
movs r1, 0x1
negs r1, r1
adds r0, r4, 0
bl sub_8098E18
bl GroundMainRescueRequest
bl _0809EAE0
_0809F6EA:
mov r1, r9
@ -8553,7 +8339,7 @@ _080A2298:
bl sub_8011C28
_080A229E:
adds r0, r5, 0
bl sub_8098F00
bl GroundMainGameEndRequest
lsls r0, r5, 16
lsrs r0, 16
bl FadeOutAllMusic
@ -8928,28 +8714,4 @@ _080A257C:
bx r0
thumb_func_end sub_80A2558
thumb_func_start sub_80A2584
sub_80A2584:
push {lr}
lsls r1, 16
asrs r1, 16
lsls r0, 16
asrs r0, 16
bl sub_809ABB4
pop {r0}
bx r0
thumb_func_end sub_80A2584
thumb_func_start sub_80A2598
sub_80A2598:
push {lr}
lsls r1, 16
asrs r1, 16
lsls r0, 16
asrs r0, 16
bl sub_809AC18
pop {r0}
bx r0
thumb_func_end sub_80A2598
.align 2,0

View File

@ -294,443 +294,4 @@ _0802D7C8: .4byte gUnknown_80D4928
_0802D7CC: .4byte gUnknown_80E014C
thumb_func_end sub_802D73C
thumb_func_start sub_802D7D0
sub_802D7D0:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _0802D826
ldr r1, [sp]
cmp r1, 0x1
beq _0802D7EA
ldr r0, _0802D800
ldr r0, [r0]
str r1, [r0, 0x70]
_0802D7EA:
ldr r0, [sp]
cmp r0, 0x3
beq _0802D804
cmp r0, 0x3
ble _0802D820
cmp r0, 0x4
beq _0802D820
cmp r0, 0x6
beq _0802D80C
b _0802D820
.align 2, 0
_0802D800: .4byte gUnknown_203B2F8
_0802D804:
movs r0, 0x2
bl sub_802D1A0
b _0802D826
_0802D80C:
ldr r0, _0802D81C
ldr r1, [r0]
movs r0, 0x1
str r0, [r1, 0x4]
movs r0, 0x10
bl sub_802D1A0
b _0802D826
.align 2, 0
_0802D81C: .4byte gUnknown_203B2F8
_0802D820:
movs r0, 0
bl sub_802D1A0
_0802D826:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_802D7D0
thumb_func_start sub_802D82C
sub_802D82C:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _0802D8C6
ldr r1, [sp]
cmp r1, 0x1
beq _0802D846
ldr r0, _0802D858
ldr r0, [r0]
str r1, [r0, 0x74]
_0802D846:
ldr r0, [sp]
subs r0, 0x1
cmp r0, 0x6
bhi _0802D8C0
lsls r0, 2
ldr r1, _0802D85C
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0802D858: .4byte gUnknown_203B2F8
_0802D85C: .4byte _0802D860
.align 2, 0
_0802D860:
.4byte _0802D8C0
.4byte _0802D8C0
.4byte _0802D87C
.4byte _0802D8C0
.4byte _0802D8C0
.4byte _0802D898
.4byte _0802D8AC
_0802D87C:
ldr r0, _0802D894
ldr r0, [r0]
ldrb r0, [r0, 0x10]
bl sub_8096C3C
bl sub_8096C80
movs r0, 0x8
bl sub_802D1A0
b _0802D8C6
.align 2, 0
_0802D894: .4byte gUnknown_203B2F8
_0802D898:
ldr r0, _0802D8A8
ldr r1, [r0]
movs r0, 0x9
str r0, [r1, 0x4]
movs r0, 0x10
bl sub_802D1A0
b _0802D8C6
.align 2, 0
_0802D8A8: .4byte gUnknown_203B2F8
_0802D8AC:
ldr r0, _0802D8BC
ldr r1, [r0]
movs r0, 0x9
str r0, [r1, 0x4]
movs r0, 0xF
bl sub_802D1A0
b _0802D8C6
.align 2, 0
_0802D8BC: .4byte gUnknown_203B2F8
_0802D8C0:
movs r0, 0x1
bl sub_802D1A0
_0802D8C6:
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_802D82C
thumb_func_start sub_802D8CC
sub_802D8CC:
push {lr}
movs r0, 0x1
bl sub_802C598
cmp r0, 0x4
bhi _0802D93A
lsls r0, 2
ldr r1, _0802D8E4
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_0802D8E4: .4byte _0802D8E8
.align 2, 0
_0802D8E8:
.4byte _0802D93A
.4byte _0802D93A
.4byte _0802D930
.4byte _0802D8FC
.4byte _0802D914
_0802D8FC:
bl sub_802C620
ldr r1, _0802D910
ldr r1, [r1]
strb r0, [r1, 0x10]
movs r0, 0xD
bl sub_802D1A0
b _0802D93A
.align 2, 0
_0802D910: .4byte gUnknown_203B2F8
_0802D914:
bl sub_802C620
ldr r2, _0802D92C
ldr r1, [r2]
strb r0, [r1, 0x10]
ldr r1, [r2]
movs r0, 0xC
str r0, [r1, 0x4]
movs r0, 0xF
bl sub_802D1A0
b _0802D93A
.align 2, 0
_0802D92C: .4byte gUnknown_203B2F8
_0802D930:
bl sub_802C688
movs r0, 0x1
bl sub_802D1A0
_0802D93A:
pop {r0}
bx r0
thumb_func_end sub_802D8CC
thumb_func_start sub_802D940
sub_802D940:
push {r4,lr}
sub sp, 0x4
movs r0, 0
str r0, [sp]
bl sub_802C598
ldr r4, _0802D980
ldr r0, [r4]
adds r0, 0x78
bl sub_8012FD8
lsls r0, 24
cmp r0, 0
bne _0802D970
ldr r0, [r4]
adds r0, 0x78
mov r1, sp
bl sub_8013114
ldr r1, [sp]
cmp r1, 0x1
beq _0802D970
ldr r0, [r4]
str r1, [r0, 0x6C]
_0802D970:
ldr r0, [sp]
cmp r0, 0x2
beq _0802D98A
cmp r0, 0x2
bgt _0802D984
cmp r0, 0x1
beq _0802D9E0
b _0802D9E6
.align 2, 0
_0802D980: .4byte gUnknown_203B2F8
_0802D984:
cmp r0, 0x5
beq _0802D9CC
b _0802D9E6
_0802D98A:
ldr r0, _0802D9BC
ldr r3, [r0]
ldrb r0, [r3, 0x9]
cmp r0, 0
beq _0802D9C4
ldr r2, _0802D9C0
ldrb r1, [r3, 0x10]
lsls r0, r1, 2
adds r0, r1
lsls r0, 2
adds r0, 0xF0
ldr r1, [r2]
adds r1, r0
ldrb r0, [r1]
cmp r0, 0x5
bls _0802D9C4
ldrb r0, [r3, 0xA]
ldrb r1, [r1, 0x4]
cmp r0, r1
bne _0802D9C4
movs r0, 0x7
bl sub_802D1A0
b _0802D9E6
.align 2, 0
_0802D9BC: .4byte gUnknown_203B2F8
_0802D9C0: .4byte gUnknown_203B490
_0802D9C4:
movs r0, 0xE
bl sub_802D1A0
b _0802D9E6
_0802D9CC:
ldr r0, _0802D9DC
ldr r1, [r0]
movs r0, 0xC
str r0, [r1, 0x4]
movs r0, 0xF
bl sub_802D1A0
b _0802D9E6
.align 2, 0
_0802D9DC: .4byte gUnknown_203B2F8
_0802D9E0:
movs r0, 0xC
bl sub_802D1A0
_0802D9E6:
add sp, 0x4
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_802D940
thumb_func_start sub_802D9F0
sub_802D9F0:
push {r4,lr}
sub sp, 0x4
movs r0, 0
str r0, [sp]
bl sub_802C598
ldr r4, _0802DA30
ldr r0, [r4]
adds r0, 0x78
bl sub_8012FD8
ldr r0, [r4]
adds r0, 0xC8
bl sub_8012FD8
lsls r0, 24
cmp r0, 0
bne _0802DA1E
ldr r0, [r4]
adds r0, 0xC8
mov r1, sp
bl sub_8013114
_0802DA1E:
ldr r0, [sp]
cmp r0, 0x3
beq _0802DA40
cmp r0, 0x3
bgt _0802DA34
cmp r0, 0x1
beq _0802DA38
b _0802DA56
.align 2, 0
_0802DA30: .4byte gUnknown_203B2F8
_0802DA34:
cmp r0, 0x4
bne _0802DA56
_0802DA38:
movs r0, 0xC
bl sub_802D1A0
b _0802DA56
_0802DA40:
bl sub_802C688
ldr r0, [r4]
ldrb r0, [r0, 0x10]
bl sub_8096C3C
bl sub_8096C80
movs r0, 0x8
bl sub_802D1A0
_0802DA56:
add sp, 0x4
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_802D9F0
thumb_func_start sub_802DA60
sub_802DA60:
push {lr}
bl sub_802DEE0
cmp r0, 0x1
bls _0802DA7C
cmp r0, 0x3
bhi _0802DA7C
bl sub_802DF24
ldr r0, _0802DA80
ldr r0, [r0]
ldr r0, [r0, 0x4]
bl sub_802D1A0
_0802DA7C:
pop {r0}
bx r0
.align 2, 0
_0802DA80: .4byte gUnknown_203B2F8
thumb_func_end sub_802DA60
thumb_func_start sub_802DA84
sub_802DA84:
push {lr}
sub sp, 0x4
mov r0, sp
bl sub_80144A4
cmp r0, 0
bne _0802DA9C
ldr r0, _0802DAA4
ldr r0, [r0]
ldr r0, [r0, 0x4]
bl sub_802D1A0
_0802DA9C:
add sp, 0x4
pop {r0}
bx r0
.align 2, 0
_0802DAA4: .4byte gUnknown_203B2F8
thumb_func_end sub_802DA84
thumb_func_start sub_802DAA8
sub_802DAA8:
push {r4,lr}
ldr r4, _0802DAD0
ldr r0, [r4]
ldrb r0, [r0, 0x10]
bl GetJobSlotInfo
adds r1, r0, 0
ldr r4, [r4]
ldrb r0, [r4, 0x9]
cmp r0, 0
beq _0802DAD4
ldrb r0, [r1]
cmp r0, 0x5
beq _0802DAD4
ldrb r0, [r4, 0xA]
ldrb r1, [r1, 0x4]
cmp r0, r1
bne _0802DAD4
movs r0, 0
b _0802DAD6
.align 2, 0
_0802DAD0: .4byte gUnknown_203B2F8
_0802DAD4:
movs r0, 0x1
_0802DAD6:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_802DAA8
thumb_func_start sub_802DADC
sub_802DADC:
push {r4,lr}
ldr r3, _0802DAEC
ldr r0, [r3]
ldrb r0, [r0, 0x9]
cmp r0, 0
bne _0802DAF0
_0802DAE8:
movs r0, 0x1
b _0802DB1C
.align 2, 0
_0802DAEC: .4byte gUnknown_203B2F8
_0802DAF0:
ldr r0, _0802DB24
ldr r0, [r0]
adds r1, r0, 0
adds r1, 0xF0
movs r2, 0
_0802DAFA:
ldrb r0, [r1]
cmp r0, 0
beq _0802DAE8
cmp r0, 0x5
beq _0802DAE8
cmp r0, 0x5
bls _0802DB12
ldr r0, [r3]
ldrb r0, [r0, 0xA]
ldrb r4, [r1, 0x4]
cmp r0, r4
bne _0802DAE8
_0802DB12:
adds r1, 0x14
adds r2, 0x1
cmp r2, 0x7
ble _0802DAFA
movs r0, 0
_0802DB1C:
pop {r4}
pop {r1}
bx r1
.align 2, 0
_0802DB24: .4byte gUnknown_203B490
thumb_func_end sub_802DADC
.align 2,0

View File

@ -661,99 +661,4 @@ sub_802CF5C:
_0802CFCC: .4byte gUnknown_203B2F4
thumb_func_end sub_802CF5C
thumb_func_start sub_802CFD0
sub_802CFD0:
push {r4-r6,lr}
sub sp, 0x60
ldr r6, _0802D02C
ldr r0, [r6]
ldr r0, [r0, 0x34]
bl sub_8008C54
ldr r0, [r6]
ldr r0, [r0, 0x34]
bl sub_80073B8
ldr r0, [r6]
movs r1, 0x1E
ldrsh r4, [r0, r1]
lsls r4, 3
adds r5, r4, 0
adds r5, 0xA
ldr r2, _0802D030
ldr r3, [r0, 0x34]
movs r0, 0
str r0, [sp]
adds r0, r5, 0
movs r1, 0
bl xxx_call_draw_string
adds r4, 0x4
ldr r1, [r6]
adds r0, r1, 0
adds r0, 0x9E
ldrb r0, [r0]
lsls r0, 3
adds r5, r4, r0
movs r0, 0x1E
ldrsh r2, [r1, r0]
adds r2, 0x1
movs r0, 0x7
str r0, [sp]
ldr r0, [r1, 0x34]
str r0, [sp, 0x4]
adds r0, r5, 0
movs r1, 0
movs r3, 0x2
bl sub_8012BC4
movs r5, 0
b _0802D076
.align 2, 0
_0802D02C: .4byte gUnknown_203B2F4
_0802D030: .4byte gUnknown_80DFDBC
_0802D034:
ldr r0, [r6]
movs r2, 0x1E
ldrsh r1, [r0, r2]
movs r2, 0x1C
ldrsh r0, [r0, r2]
muls r0, r1
adds r0, r5
lsls r0, 24
lsrs r0, 24
bl sub_803B344
adds r4, r0, 0
ldr r0, [r6]
ldr r1, [r0, 0x34]
str r1, [sp, 0x8]
adds r1, r5, 0
bl sub_8013800
str r0, [sp, 0x50]
adds r0, r4, 0
add r1, sp, 0x8
bl sub_803B35C
mov r1, sp
adds r1, 0x4B
movs r0, 0x1
strb r0, [r1]
ldr r0, [r4, 0x14]
str r0, [sp, 0x54]
add r0, sp, 0x8
bl CreateRescueTitle
adds r5, 0x1
_0802D076:
ldr r0, [r6]
movs r1, 0x1A
ldrsh r0, [r0, r1]
cmp r5, r0
blt _0802D034
ldr r0, _0802D094
ldr r0, [r0]
ldr r0, [r0, 0x34]
bl sub_80073E0
add sp, 0x60
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_0802D094: .4byte gUnknown_203B2F4
thumb_func_end sub_802CFD0
.align 2,0

View File

@ -136,25 +136,31 @@
MsgEnd 0
.byte 0xf6, 0x00, 0xae, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x28, 0x13, 0x08
.byte 0x54, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
setAnimation 2
.byte 0x2d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xdb, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
pause 1
.byte 0x3c, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
msgEnd 0
.byte 0xf6, 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x28, 0x13, 0x08
.byte 0x54, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
setAnimation 2
.byte 0x2d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xdb, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
pause 1
.byte 0x3c, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
msgEnd 0
.byte 0xf6, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x28, 0x13, 0x08
.byte 0x54, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
setAnimation 2
.byte 0x2d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xdb, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00
.byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x28, 0x13, 0x08, 0x54, 0x00, 0x02, 0x00
pause 1
.byte 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xcc, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
msgEnd 0
.byte 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
closeThread
.byte 0xf6, 0x00, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x28, 0x13, 0x08
.byte 0x54, 0x00, 0x02, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x01, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x28, 0x13, 0x08, 0x54, 0x00, 0x02, 0x00
@ -32035,17 +32041,20 @@
.byte 0xcc, 0xbd, 0x22, 0x08, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.byte 0xf6, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xbe, 0x22, 0x08
.byte 0x08, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
changeTileset 0xB1
pushR14
msgEnd 0x163
.byte 0x2e, 0x2e, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x6e
.byte 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x61, 0x30, 0x35, 0x70, 0x30, 0x33, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x00, 0x94, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xe8, 0xbd, 0x22, 0x08
.byte 0xf6, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xbe, 0x22, 0x08, 0x08, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x0c, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xf6, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xbe, 0x22, 0x08
.byte 0x08, 0x00, 0x00, 0x00, 0xb1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x0c, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x22, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xe0, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xdb, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xa8, 0xc1, 0x22, 0x08, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x23, 0x01, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

View File

@ -644,7 +644,7 @@
.4byte GroundD01P01StationFile_Text
.byte 0x3b, 0x39, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
changeTileset 0xB2
.byte 0x0c, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
StartSceneRunCall 0
PlayMusic 0x67
.byte 0x22, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
waitFlag 3
@ -658,8 +658,8 @@
.byte 0xf6, 0x00, 0x16, 0x02
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.4byte GroundD01P01StationFile_Text
.byte 0x54, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x2d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
setAnimation 2
loadData 7 0 0
.byte 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
pause 0x1E
selectFace bottomL 0 0
@ -669,8 +669,8 @@
PicNameTextBox 2 0x822F630
closeTextBox
pause 0xA
.byte 0x2e, 0x15, 0x01, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xcf, 0x02, 0x26, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
selectFace 0x15 0x1 0x9
initVariableTextbox 2 0x26 1
variableTextBox 1 0x822F5C8
variableTextBox 1 0x822F590
elseTextBox 0x822F52C
@ -680,8 +680,8 @@
PicNameTextBox 2 0x822F4D0
closeTextBox
pause 0xA
.byte 0x2e, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xcf, 0x02, 0x26, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
selectFace 0x15 1 0
initVariableTextbox 0x2 0x26 1
variableTextBox 1 0x822F4C4
variableTextBox 3 0x822F4C4
elseTextBox 0x822F4C4
@ -692,7 +692,7 @@
setFlag 6
waitFlag 5
pause 0x1E
.byte 0x2e, 0x15, 0x03, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
selectFace 0x15 3 0x41
PicNameTextBox 3 0x822F498
closeTextBox
setFlag 6
@ -700,14 +700,14 @@
pause 0x1E
setFlag 6
pause 0x1
.byte 0x4c, 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xe8, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
playSound 0x1D6
executeScript SWEAT_FUNC
pause 0x1E
.byte 0x4d, 0x00, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x2e, 0x15, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
stopSound 0x1D6
selectFace 0x15 0 4
scrollTextbox 0 0x822F468
scrollTextbox 0 0x822F430
.byte 0x2e, 0x15, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
selectFace 0x15 0 1
scrollTextBox 0 0x822F3E8
scrollTextBox 0 0x822F3AC
closeTextBox
@ -742,29 +742,28 @@
waitFlag 5
setFlag 6
waitFlag 5
.byte 0x2e, 0x15, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xcf, 0x02, 0x26, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xd0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf2, 0x22, 0x08
.byte 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0xf2, 0x22, 0x08
selectFace 0x15 1 1
initVariableTextbox 0x2 0x26 1
variableTextBox 1 0x822F2F0
elseTextBox 0x822F2D8
rotate 8 CW east
pause 0xA
.byte 0x2e, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xcf, 0x02, 0x26, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xd0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xf2, 0x22, 0x08
.byte 0xd0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf2, 0x22, 0x08
.byte 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0xf2, 0x22, 0x08
.byte 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xf2, 0x22, 0x08
selectFace 0x15 1 0
initVariableTextbox 2 0x26 1
variableTextBox 1 0x822F2B0
variableTextBox 1 0x822F270
elseTextBox 0x822F244
elseTextBox 0x822F20C
closeTextBox
pause 0x1E
.byte 0x2e, 0x15, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
selectFace 0x15 0 4
scrollTextBox 0 0x822F1FC
closeTextBox
pause 0x1E
.byte 0x2e, 0x15, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xcf, 0x02, 0x26, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0xd0, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xf1, 0x22, 0x08
.byte 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0xf1, 0x22, 0x08
selectFace 0x15 1 0
initVariableTextbox 0x2 0x26 1
variableTextBox 1 0x822F1A0
elseTextBox 0x822F148
closeTextBox
setFlag 6
waitFlag 5
@ -872,7 +871,7 @@
loadData 7 3 0
waitFlag 8
playSound 0x1C9
.byte 0xe8, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
executeScript 0x27
pause 0x14
setFlag 5
waitFlag 8
@ -923,7 +922,7 @@
playMusic 0x72
.byte 0x22, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
waitFlag 3
.byte 0x23, 0x01, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
fadeOut 1 0x1E 0
pause 0x1E
endFuncandScript

View File

@ -1,21 +0,0 @@
.section .rodata
.global gUnknown_8106FB5
gUnknown_8106FB5: @ 8106FB5
@ replacing .incbin "baserom.gba", 0x00106fb5, 0x8
.byte 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
.global gUnknown_8106FBD
gUnknown_8106FBD: @ 8106FBD
@ replacing .incbin "baserom.gba", 0x00106fbd, 0x8
.byte 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
.global gUnknown_8106FC5
gUnknown_8106FC5: @ 8106FC5
@ replacing .incbin "baserom.gba", 0x00106fc5, 0x8
.byte 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
.global gUnknown_8106FCD
gUnknown_8106FCD: @ 8106FCD
@ replacing .incbin "baserom.gba", 0x00106fcd, 0x8
.byte 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80

View File

@ -172,7 +172,7 @@
.endm
.macro renameTeam
.byte 0x3D, 0x00, 0x00, 0x00
.byte 0x3e, 0x00, 0x00, 0x00
.4byte 0x00, 0x00, 0x00
.endm

View File

@ -4,7 +4,7 @@
void MuzzleTarget(struct DungeonEntity *pokemon, struct DungeonEntity *target);
void sub_8078E18(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void sub_8078F50(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void sub_8078FDC(struct DungeonEntity * pokemon, struct DungeonEntity * target, s16 param_3);
void ExposeStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s16 param_3);
void IdentityItemHolders(struct DungeonEntity *pokemon, struct DungeonEntity *target);
void BlindTarget(struct DungeonEntity *pokemon, struct DungeonEntity *target);
void CrossEyeVisionTarget(struct DungeonEntity *pokemon, struct DungeonEntity *target);

24
include/code_80958E8.h Normal file
View File

@ -0,0 +1,24 @@
struct subStruct_203B490
{
// size: 0xC
u8 dungeon;
u8 unk1;
u32 unk4;
u32 unk8;
};
struct unkStruct_203B490
{
// size: 0x330?
struct WonderMail unk0[4];
struct WonderMail unk50[8];
struct WonderMail unkF0[8];
u8 unk190[0x28];
u8 unk1B8[0x78];
struct subStruct_203B490 unk230[16];
u8 unk2F0[0x38];
u8 unk328;
};
extern struct unkStruct_203B490 *gUnknown_203B490;

View File

@ -6,7 +6,7 @@ struct unkStruct_80A2608
/* 0x6 */ u16 unk6;
/* 0x8 */ u16 unk8;
/* 0xA */ u16 unkA;
/* 0xC */ u8 unkC;
/* 0xC */ u8 dungeonIndex;
/* 0xD */ u8 unkD;
/* 0xE */ s16 unkE;
/* 0x10 */ u8 unk10;

View File

@ -3,7 +3,7 @@
#define NUM_DUNGEON_MAZE (NUM_DUNGEONS - DUNGEON_NORMAL_MAZE_2)
enum Dungeon
enum DungeonIndex
{
DUNGEON_TINY_WOODS = 0,
DUNGEON_THUNDERWAVE_CAVE = 1,

View File

@ -28,5 +28,9 @@ struct Dungeon
extern struct Dungeon gDungeons[];
extern struct DungeonName gDungeonNames[];
const u8 *GetDungeonName1(u8 dungeon);
u32 sub_80908D8(struct DungeonLocation *dungeon);
u8 sub_8090910(struct DungeonLocation *dungeon, u32 param_2);
bool8 sub_809095C(u8 dungeon);
u8 GetUnk9(u8 dungeon);
#endif //GUARD_DUNGEON_H

View File

@ -3,7 +3,8 @@
#include "dungeon_entity.h"
void DecideAction(struct DungeonEntity *pokemon);
u8 sub_8075BF4(struct DungeonEntity * pokemon, s32 param_2);
u32 sub_8075818(struct DungeonEntity *entity);
void sub_8075900(struct DungeonEntity *pokemon, u8 r1);
void DecideAction(struct DungeonEntity *pokemon, u32 unused);
#endif

View File

@ -1,7 +1,9 @@
#ifndef GUARD_DUNGEON_ENGINE_H
#define GUARD_DUNGEON_ENGINE_H
bool8 IsBossBattle();
bool8 IsFixedDungeon();
bool8 IsBossBattle(void);
bool8 IsFixedDungeon(void);
bool8 IsDungeonMaze(void);
void RunDungeon(bool8 param_1);
#endif

View File

@ -32,6 +32,10 @@ struct DungeonActionContainer
// Position of the Pokémon the last time it threw an item.
/* 0x8 */ struct Position lastItemThrowPosition;
u8 unkC;
u8 fillD[3];
u8 fill10[4];
// Position of the target that the Pokémon wants throw an item at.
/* 0x14 */ struct Position itemTargetPosition;
};
struct DungeonEntityData
@ -79,9 +83,6 @@ struct DungeonEntityData
u8 fill3F;
/* 0x40 */ u8 joinLocation; // Uses the dungeon index in dungeon.h.
/* 0x44 */ struct DungeonActionContainer action;
u8 fill55[0x58 - 0x55];
// Position of the target that the Pokémon wants throw an item at.
/* 0x58 */ struct Position itemTargetPosition;
/* 0x5C */ u8 types[2];
/* 0x5E */ u8 abilities[2];
/* 0x60 */ struct ItemSlot heldItem;
@ -99,7 +100,8 @@ struct DungeonEntityData
/* 0x8C */ u8 IQSkillsSelected[4]; // IQ skills selected in the IQ skills menu.
/* 0x90 */ u8 IQSkillsEnabled[4];
/* 0x94 */ u8 tactic;
u8 fill95[0x9C - 0x95];
u8 fill95[0x98 - 0x95];
/* 0x98 */ u32 unk98;
/* 0x9C */ u32 unk9C;
/* 0xA0 */ u32 unkA0;
/* 0xA4 */ u8 clientType;
@ -114,7 +116,8 @@ struct DungeonEntityData
/* 0xAE */ u8 nonVolatileStatusDamageTimer;
u8 fillAF;
/* 0xB0 */ u8 immobilizeStatus;
u8 fillB1[0xB8 - 0xB1];
u8 fillB1[0xB4 - 0xB1];
/* 0xB4 */ s32 unkB4;
/* 0xB8 */ u8 immobilizeStatusTurnsLeft;
/* 0xB9 */ u8 immobilizeStatusDamageTimer;
u8 fillBA[0xBC - 0xBA];
@ -135,7 +138,8 @@ struct DungeonEntityData
/* 0xCC */ u8 cursedDamageTimer;
u8 fillCD[0xD0 - 0xCD];
/* 0xD0 */ u8 linkedStatus;
u8 fillD1[0xD8 - 0xD1];
u8 fillD1[0xD4 - 0xD1];
/* 0xD4 */ u32 unkD4;
/* 0xD8 */ u8 unkD8;
/* 0xD9 */ u8 linkedStatusTurnsLeft;
/* 0xDA */ u8 linkedStatusDamageTimer;
@ -163,7 +167,7 @@ struct DungeonEntityData
/* 0xF5 */ bool8 exposedStatus;
/* 0xF6 */ bool8 isColorChanged;
/* 0xF7 */ bool8 isBoss;
/* 0xF8 */ u8 unkF8;
/* 0xF8 */ bool8 movementSpeedChanged; // Toggled when pokemon is movement speed is sped up
/* 0xF9 */ u8 unkF9;
/* 0xFA */ u8 terrifiedTurnsLeft; // Doubles as a bool for whether the Pokémon is terrified.
u8 unkFB;
@ -199,7 +203,10 @@ struct DungeonEntityData
/* 0x14E */ u16 visualFlags;
/* 0x150 */ u16 previousVisualFlags;
/* 0x152 */ u8 unk152;
u8 fill153[0x158 - 0x153];
u8 unk153;
u8 unk154;
u8 unk155;
u8 fill158[0x158 - 0x156];
u8 unk158;
u8 unk159;
u8 unk15A;
@ -208,7 +215,10 @@ struct DungeonEntityData
u8 unk15D;
u8 unk15E;
u8 unk15F;
u8 fill160[0x169 - 0x160];
u8 fill160[0x164 - 0x160];
/* 0x164 */ u8 unk164;
/* 0x165 */ u8 unk165;
u8 fill166[0x169 - 0x166];
u8 turnsSinceWarpScarfActivation;
/* 0x16C */ struct Position targetPosition;
/* 0x170 */ struct Position posPixel;
@ -243,7 +253,7 @@ struct DungeonEntity
// X = (posWorld * 24 + 16) * 256, while Y = (posWorld * 24 + 12) * 256.
/* 0xC */ struct Position32 posPixel;
/* 0x14 */ struct Position32 prevPosPixel;
u8 fill1C[0x20 - 0x1C];
s32 unk1C;
/* 0x20 */ bool8 visible; // Turned off when a Pokémon faints.
u8 fill21[0x25 - 0x21];
/* 0x25 */ u8 roomIndex;
@ -298,6 +308,7 @@ enum MovementFlag
{
MOVEMENT_FLAG_SWAPPED_PLACES = 1 << 5,
MOVEMENT_FLAG_MOVING = 1 << 9,
MOVEMENT_FLAG_UNK_14 = 1 << 14,
MOVEMENT_FLAG_SWAPPED_PLACES_PETRIFIED = 1 << 15 // Set if the Pokémon is petrified and the leader cures them by swapping places.
};

View File

@ -21,6 +21,38 @@ struct DungeonGlobalData_sub
u8 unk2;
};
struct unkDungeonGlobal_unk1CE98_sub
{
/* 0x0 */ u8 buffer1[0xA];
/* 0xA */ u8 buffer2[0xA];
/* 0x14 */ s16 unk14;
/* 0x16 */ u8 fill16[0x2];
/* 0x18 */ struct DungeonLocation dungeonLocation;
/* 0x1C */ struct ItemSlot heldItem;
/* 0x20 */ u32 expPoints;
/* 0x24 */ s16 maxHP;
/* 0x26 */ u8 attack;
/* 0x27 */ u8 specialAttack;
/* 0x28 */ u8 defense;
/* 0x29 */ u8 specialDefense;
/* 0x2A */ u8 level;
/* 0x2B */ u8 attBoost;
/* 0x2C */ u8 spAttBoost;
/* 0x2D */ u8 defBoost;
/* 0x2E */ u8 spDefBoost;
u8 unk4; // speedBoost?
};
struct DungeonMusicPlayer
{
u32 state;
u32 fadeOutSpeed;
u16 fadeInSpeed;
u16 songIndex;
u16 pastSongIndex;
u16 queuedSongIndex;
};
struct DungeonGlobalData
{
u8 unk0;
@ -33,21 +65,26 @@ struct DungeonGlobalData
u8 unk8;
u8 fill9[0xC - 0x9];
u8 unkC;
u8 unkD[0xF - 0xD];
u8 unkD;
u8 unkE;
/* 0xF */ bool8 inputAllowed; // Whether the game is currently accepting input. Set to false while action animations play.
u8 fill10;
u8 unk10;
u8 unk11;
s16 unk12;
u8 fill14[0x16D - 0x14];
u8 fill14[0xB8 - 0x14];
struct DungeonEntity *unkB8;
u32 unkBC;
u8 fillC0[0x16D - 0xC0];
u8 unk16D;
u8 fill16E[0x179 - 0x16E];
/* 0x179 */ bool8 pokemonExposed; // True if a Pokémon on the floor has the Exposed status.
u8 fill17A[0x17C - 0x17A];
struct DungeonGlobalData_sub unk17C[0x100];
/* 0x57C */ u8 fill57C[0x644 - 0x57c];
/* 0x644 */ u8 unk644;
/* 0x645 */ u8 floorNumber;
u8 fill646[0x65C - 0x646];
/* 0x644 */ struct DungeonLocation dungeonLocation;
u8 fill646[0x654 - 0x648];
u8 unk654;
u8 fill655[0x65C - 0x655];
u8 unk65C;
u8 fill65D[0x660 - 0x65D];
/* 0x660 */ s16 speedTurnCounter; // Handles turn order when Pokémon have different movement speeds.
@ -55,25 +92,35 @@ struct DungeonGlobalData
/* 0x666 */ u16 turnsLeft; // Turns remaining before getting swept out of the dungeon.
u8 fill668[0x66A - 0x668];
u16 unk66A;
u8 fill66C[0x66E - 0x66C];
u8 unk66C;
u8 unk66D;
/* 0x66E */ u8 unk66E;
u8 fill66F[0x671 - 0x66F];
u8 unk66F;
u8 unk670;
/* 0x671 */ bool8 monsterHouseActive;
/* 0x672 */ u8 unk672;
u8 fill673[0x674 - 0x673];
u8 unk673;
u8 unk674;
u8 unk675;
/* 0x676 */ bool8 itemHoldersIdentified;
u8 unk677[0x68A - 0x677];
u8 unk677;
u8 unk678;
u8 unk679[0x68A - 0x679];
/* 0x68A */ u8 unk68A;
u8 fill68B[0x363C - 0x68B];
u8 fill68B[0x699 - 0x68B];
u8 unk699;
u8 fill69A[0x363C - 0x69A];
/* 0x363C */ u8 expYieldRankings[NUM_SPECIES];
u8 fill37E3[0x37FC - 0x37D9];
u8 fill37E3[0x37F4 - 0x37D9];
/* 0x37F4 */ s32 unk37F4;
/* 0x37F8 */ bool8 hasPlus[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FA */ bool8 hasMinus[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FC */ bool8 decoyActive;
u8 fill37FD[0x3A0D - 0x37FD];
/* 0x3A0D */ u8 unk3A0D;
/* 0x3A0E */ s16 tileset;
u8 fill3A10[0x3A14 - 0x3A10];
/* 0x3A10 */ u16 unk3A10;
u8 fill3A10[0x3A14 - 0x3A12];
/* 0x3A14 */ s16 bossBattleIndex;
/* 0x3A18 */ struct MapTile mapTiles[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X];
u8 fillE218[0xE23C - 0xE218];
@ -90,7 +137,7 @@ struct DungeonGlobalData
/* 0xE26F */ u8 startingWeather[8]; // The weather at the start of the floor. If the weather changes, then expires, revert back to the starting weather.
/* 0xE277 */ u8 mudSportTurnsLeft;
/* 0xE278 */ u8 waterSportTurnsLeft;
/* 0xE279 */ u8 negateWeatherEffects; // Air Lock and Cloud Nine toggle this to disable weather effects
/* 0xE279 */ bool8 negateWeatherEffects; // Air Lock and Cloud Nine toggle this to disable weather effects
u8 fillE27A[0xE8C0 - 0xE27A];
/* 0xE8C0 */ struct MapTile* mapTilePointers[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X];
u8 fill104C0[0x104C4 - 0x104C0];
@ -99,7 +146,11 @@ struct DungeonGlobalData
/* 0x10844 */ s16 numRoomExits[MAX_ROOM_COUNT];
u8 fill10874[0x10884 - 0x10874];
/* 0x10884 */ struct Position roomExits[MAX_ROOM_COUNT][32]; // Arrays of room exits for each room.
u8 fill11444[0x1356C - 0x11484];
u8 fill11444[0x11884 - 0x11484];
u8 unk11884[0x1194];
u8 fill12A18[0x12C24 - 0x12A18];
u8 unk12C24[0x930];
u8 fill13554[0x1356C - 0x13554];
u8 unk1356C;
u8 fill1356D[0x13570 - 0x1356D];
/* 0x13570 */ u8 unk13570;
@ -113,10 +164,12 @@ struct DungeonGlobalData
/* 0x1358C */ struct DungeonEntity *wildPokemon[DUNGEON_MAX_WILD_POKEMON];
/* 0x135CC */ struct DungeonEntity *allPokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon
/* 0x1361C */ struct DungeonEntity *clientPokemon[2]; // Not sure how large this array is.
u8 fill13624[0x17B30 - 0x13624];
/* 0x17B30 */ u32 unk17B30;
/* 0x17B34 */ u8 fillunk1734[0x17B3C - 0x17B34];
/* 0x17B30 */ u32 unk17B3C;
u8 fill13624[0x17B2C - 0x13624];
/* 0x17B2C */ struct DungeonEntity *lightningRodPokemon;
/* 0x17B30 */ struct DungeonEntity *snatchPokemon;
/* 0x17B34 */ u8 fillunk1734[0x17B38 - 0x17B34];
/* 0x17B38 */ u32 unk17B38;
/* 0x17B3C */ u32 unk17B3C;
u8 fill17B40[0x181E8 - 0x17B40];
/* 0x181E8 */ struct Position posScreenWorld;
/* 0x181EC */ struct Position prevPosScreenWorld;
@ -136,6 +189,10 @@ struct DungeonGlobalData
u8 unk18217;
u8 fill18218[0x1C578 - 0x18218];
u8 unk1C578;
u8 fill1C579[0x1CE98 - 0x1C579];
/* 0x1CE98 */ struct unkDungeonGlobal_unk1CE98_sub unk1CE98;
u32 unk1CEC8;
/* 0x1CECC */ struct DungeonMusicPlayer musPlayer;
};
#endif

View File

@ -2,5 +2,6 @@
#define GUARD_DUNGEON_LEADER_H
struct DungeonEntity* GetLeaderEntity();
struct DungeonEntityData* GetLeaderEntityData(void);
#endif

16
include/dungeon_music.h Normal file
View File

@ -0,0 +1,16 @@
#ifndef GUARD_DUNGEON_MUSIC_H
#define GUARD_DUNGEON_MUSIC_H
void PlaySoundEffect(u32 songIndex);
void StopSoundEffect(u32 songIndex);
bool8 IsFanfareSEPlaying_2(u16 songIndex);
void DungeonStartNewBGM(u16 songIndex);
void DungeonFadeInNewBGM(u16 songIndex, u32 fadeInSpeed);
void DungeonFadeOutBGM(u16 speed);
void DungeonStopBGM(void);
u16 DungeonGetCurrentBGSong(void);
void StopDungeonBGM(void);
void UpdateDungeonMusic(void);
#endif

View File

@ -1,6 +1,9 @@
#ifndef GUARD_EXCLUSIVE_POKEMON_H
#define GUARD_EXCLUSIVE_POKEMON_H
#include "code_8092334.h"
#define NUM_EXCLUSIVE_POKEMON 12
struct ExclusivePokemon
@ -36,6 +39,9 @@ extern struct ExclusivePokemonData *gUnknown_203B498;
void LoadExclusivePokemon(void);
struct ExclusivePokemonData *GetExclusivePokemon(void);
void InitializeExclusivePokemon(void);
bool8 IsExclusivePokemonUnlocked(s16 pokeID);
void UnlockExclusivePokemon(s16 pokeID);
void WriteExclusivePokemon(struct unkStruct_8094924 *r0);
void ReadExclusivePokemon(struct unkStruct_8094924 *r0);
#endif // GUARD_EXCLUSIVE_POKEMON_H

View File

@ -38,5 +38,6 @@ struct OpenedFile *OpenFileAndGetFileDataPtr(const char *filename, const struct
struct OpenedFile *Call_OpenFileAndGetFileDataPtr(const char *filename, const struct FileArchive *arc);
u32 DecompressATFile(char *result, s32 resultLength, struct OpenedFile *file);
void CloseFile(struct OpenedFile *openedFile);
u32 DecompressATGlobalFile(u32 *result, s32 resultLength, struct OpenedFile *file);
#endif //GUARD_FILE_SYSTEM_H

View File

@ -10,11 +10,11 @@ struct unkStruct_203B2BC
u16 unkA;
u32 itemIndex;
struct HeldItem itemToGive;
struct HeldItem unk14;
struct HeldItem item2;
struct PokemonStruct *unk18;
u8 unk1C;
u32 unk20;
u16 unk24;
u16 moveID;
struct PokemonMove unk28[8];
u32 unk68;
u32 unk6C;

47
include/ground_script.h Normal file
View File

@ -0,0 +1,47 @@
struct GroundScript_ExecutePP_3
{
// size: 0xC
u8 *scriptPointer;
s16 scriptType;
s16 unk6;
u8 unk8;
};
struct GroundScript_ExecutePP_1_sub
{
// size: 0x60
/* 0x0 */ s16 scriptType;
/* 0x2 */ s16 unk2;
/* 0x4 */ u8 *scriptPointer1;
/* 0x8 */ u8 *scriptPointer2;
/* 0xC */ u16 unkC;
/* 0xE */ u8 unkE;
/* 0xF */ u8 fillF;
/* 0x10 */ u32 unk10;
/* 0x14 */ u32 unk14;
/* 0x18 */ u8 fill18[0x22 - 0x18];
/* 0x22 */ u16 unk22;
/* 0x24 */ u16 unk24;
/* 0x26 */ u32 unk26;
u8 fill50[0x60 - 0x2A];
} __attribute__((packed));
typedef void (*Callback)(u32, void *);
struct GroundScript_ExecutePP_1_sub2
{
Callback callbacks[10]; // IDK the size..
};
struct GroundScript_ExecutePP_1
{
struct GroundScript_ExecutePP_1_sub2 *unk0;
u32 unk4;
u32 fill8;
u32 unkC;
u16 unk10;
u8 unk12;
u8 fill18[0x24 - 0x13];
struct GroundScript_ExecutePP_1_sub unk24;
struct GroundScript_ExecutePP_1_sub unk84;
u16 unkE4;
};

View File

@ -88,7 +88,7 @@ s32 GetItemBuyPrice(u8 itemIndex);
s32 GetItemSellPrice(u8 itemIndex);
s32 GetItemOrder(u8 itemIndex);
u8 GetItemPalette(u8 itemIndex);
u8 GetItemCategory(u8 itemIndex);
u32 GetItemCategory(u8 itemIndex);
u32 GetItemUnkThrow(u8 itemIndex, u32 r1);
u8 *GetItemDescription(u8 itemIndex);
bool8 GetItemAIFlag(u8 itemIndex, u32 r1);

View File

@ -16,6 +16,7 @@ enum TileType
TILE_TYPE_MAP_EDGE = 1 << 4,
TILE_TYPE_SHOP = 1 << 5,
TILE_TYPE_MONSTER_HOUSE = 1 << 6,
TILE_TYPE_UNK_8 = 1 << 8,
TILE_TYPE_STAIRS = 1 << 9
};

10
include/move_checks.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef GUARD_MOVE_CHECKS_H
#define GUARD_MOVE_CHECKS_H
bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct PokemonMove *move);
bool8 CanUseOnTargetWithStatusChecker(struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move);
bool8 HasDisabledMove(struct PokemonMove *moves);
bool8 LastUsedMoveOutOfPP(struct PokemonMove *moves);
bool8 HasLastUsedMove(struct PokemonMove *moves);
#endif

View File

@ -0,0 +1,28 @@
#ifndef GUARD_MOVE_EFFECTS_TARGET_H
#define GUARD_MOVE_EFFECTS_TARGET_H
u8 sub_8075BF4(struct DungeonEntity * pokemon, s32 sleepTurns);
void sub_8075C58(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 turns, bool8 displayMessage);
bool8 CannotSleep(struct DungeonEntity * pokemon, struct DungeonEntity * target, u8 param_3, bool8 displayMessage);
void NightmareStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 turns);
void NappingStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 turns);
void YawnedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 turns);
void SleeplessStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void PausedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, u8 param_3, s32 turns, bool8 displayMessage);
void InfatuateStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void BurnedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, u8 param_3, bool8 displayMessage);
void PoisonedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void BadlyPoisonedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void FrozenStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void SqueezedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s16 param_3, bool32 displayMessage);
void ImmobilizedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void IngrainedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void WrapTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void sub_8076CB4(s32 param_1);
void PetrifiedStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void LowerAttackStageTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 index, s32 decrement, u8 param_5, bool8 displayMessage);
void LowerDefenseStageTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 index, s32 decrement, u8 param_5, bool8 displayMessage);
void RaiseAttackStageTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 index, s32 increment);
void RaiseDefenseStageTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 index, s32 increment);
#endif

View File

@ -17,7 +17,7 @@ struct Offense {
u8 att[2];
u8 def[2];
};
};
struct unkPokeSubStruct_C
{
@ -31,7 +31,7 @@ struct PokemonStruct
/* 0x0 */ u16 unk0; // recruited??
/* 0x1 */ bool8 isLeader;
/* 0x3 */ u8 unkHasNextStage; // set to a random value?
/* 0x4 */ struct DungeonLocation unk4;
/* 0x4 */ struct DungeonLocation dungeonLocation;
/* 0x8 */ s16 speciesNum; // species #
/* 0xC */ struct unkPokeSubStruct_C unkC[2];
/* 0x14 */ s16 IQ;
@ -69,27 +69,27 @@ struct unkStruct_8094184
struct PokemonStruct2
{
// size 0x68
u16 unk0; // corresponds to unk0 inPokemonStruct
bool8 isLeader; // unk2
u8 unkHasNextStage; // unk3
struct DungeonLocation unk4; // unk4
u16 IQ; // IQ (other offset)
u16 unkA;
u16 unkC;
s16 speciesNum; // speciesNum (other offset)
u16 unk10; // pokeHP
u16 unk12; // pokeHP
struct Offense offense; // offense (other offset)
u32 unk18; // unk1C
struct unkStruct_8094184 moves;
/* 40 */ struct ItemSlot itemSlot; // heldItem
u32 unk44; // some struct
u32 unk48; // some struct (same type as 44)
u32 IQSkills; // unk20
u8 unk50; // unk24
u8 fill51[3];
struct unkStruct_808E6F4 unk54;
u8 name[POKEMON_NAME_LENGTH]; // name (other offset)
/* 0x0 */ u16 unk0; // corresponds to unk0 inPokemonStruct
/* 0x2 */ bool8 isLeader; // unk2
/* 0x3 */ u8 unkHasNextStage; // unk3
/* 0x4 */ struct DungeonLocation dungeonLocation; // unk4
/* 0x8 */ u16 IQ; // IQ (other offset)
/* 0xA */ u16 unkA;
/* 0xC */ u16 unkC;
/* 0xE */ s16 speciesNum; // speciesNum (other offset)
/* 0x10 */ u16 unk10; // pokeHP
/* 0x12 */ u16 unk12; // pokeHP
/* 0x14 */ struct Offense offense; // offense (other offset)
/* 0x18 */ u32 unk18; // unk1C
/* 0x1C */ struct unkStruct_8094184 moves;
/* 0x40 */ struct ItemSlot itemSlot; // heldItem
/* 0x44 */ u32 unk44; // some struct
/* 0x48 */ u32 unk48; // some struct (same type as 44)
/* 0x4C */ u32 IQSkills; // unk20
/* 0x50 */ u8 unk50; // unk24
/* 0x51 */ u8 fill51[3];
/* 0x54 */ struct unkStruct_808E6F4 unk54;
/* 0x58 */ u8 name[POKEMON_NAME_LENGTH]; // name (other offset)
};
struct unkStruct_203B45C
@ -206,7 +206,7 @@ u8 GetWalkableTiles(s16 index);
u8 GetUnk1B(s16 index);
bool8 GetIsMoving(s16 index);
u8 GetUnk1D(s16 index);
u16 GetLowKickDmg(s16 index);
u32 GetLowKickDmg(s16 index);
u32 GetSizeOrbDmg(s16 index);
u8 GetFriendArea(s16 index);
u16 GetBaseHP(s16 index);

View File

@ -17,7 +17,7 @@ struct RescueTeamData
{
u8 teamName[TEAM_NAME_LENGTH];
s32 teamRankPts;
u8 unk10;
bool8 isTeamRenamed;
};
extern struct RescueTeamData *gRescueTeamInfoRef;
@ -34,7 +34,7 @@ void SetTeamRankPoints(s32 newPts);
void AddToTeamRankPts(s32 newPts);
u8 GetRescueTeamRank(void);
const u8 *GetTeamRankString(u8 index);
u8 sub_80921B8(void);
u8 GetIsTeamRenamed(void);
u32 SaveRescueTeamInfo(u8 *param_1,u32 param_2);
u32 ReadRescueTeamInfo(u8 *param_1, u32 param_2);

View File

@ -77,6 +77,7 @@ void sub_8011C40(s32 in);
char *sub_8011C4C(void);
void sub_8011CA8(u32 *out, s32 size);
u32 ReadSaveFromPak(u32 *a);
u32 WriteSavetoPak(s32 *param_1, u32 param_2);
u32 sub_8011F9C(s32 *r0, u8 *dest, s32 size);
u32 sub_8011FA8(void);
bool8 IsSaveCorrupted(void);

View File

@ -9,15 +9,31 @@
u8 GetFlashFireStatus(struct DungeonEntity *pokemon);
void UpdateFlashFireBoost(struct DungeonEntity * pokemon, struct DungeonEntity *target);
void sub_80772C0(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 statStage, s32 param_4, bool8 displayMessage);
void sub_8077434(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 statStage, s32 param_4, bool8 displayMessage);
void sub_8077540(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 statStage);
void sub_80775DC(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 statStage, bool8 displayMessage);
void sub_80776C0(struct DungeonEntity * pokemon,struct DungeonEntity * target, bool8 displayMessage);
void sub_8077780(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void sub_8077910(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 turns, bool8 diplayMessage);
void sub_80779F0(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 param_3, bool8 displayMessage);
void sub_8077AE4(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void sub_8077BB4(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void ChangeAttackMultiplierTarget(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 statStage, s32 param_4, bool8 displayMessage);
void ChangeDefenseMultiplierTarget(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 statStage, s32 param_4, bool8 displayMessage);
void RaiseAccuracyStageTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 statStage);
void LowerAccuracyStageTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 statStage, bool8 displayMessage);
void CringeStatusTarget(struct DungeonEntity * pokemon,struct DungeonEntity * target, bool8 displayMessage);
void ParalyzeStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void RaiseMovementSpeedTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 turns, bool8 diplayMessage);
void LowerMovementSpeedTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 levels, bool8 displayMessage);
void ConfuseStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void CowerStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void HealTargetHP(struct DungeonEntity *pokemon, struct DungeonEntity *target, s32 param_3, s32 param_4, bool32 displayMessage);
void HandleScannerOrb(struct DungeonEntity* pokemon, struct DungeonEntity* target);
void HandleStairsOrb(struct DungeonEntity* pokemon, struct DungeonEntity* target);
void HandleRadarOrb(struct DungeonEntity* pokemon, struct DungeonEntity* target);
void HandleLeechSeed(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 displayMessage);
void DestinyBondStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void SureShotStatusTarget(struct DungeonEntity *pokemon, struct DungeonEntity * target, s32 turns);
void WhifferStatusTarget(struct DungeonEntity *pokemon, struct DungeonEntity * target, s32 turns);
void FixedDamageStatusTarget(struct DungeonEntity *pokemon, struct DungeonEntity * target);
void FocusEnergyStatusTarget(struct DungeonEntity *pokemon, struct DungeonEntity * target);
void CurseStatusTarget(struct DungeonEntity *pokemon, struct DungeonEntity * target);
void SnatchStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void TauntStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void HandleStockpile(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void InvisibleStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
void PerishSongTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target);
#endif

View File

@ -1,5 +1,5 @@
#ifndef GUARD_STATUS_CHECKER_H
#define GUARD_STATUS_CHECKER_H
#ifndef GUARD_STATUS_ACTIONS_H
#define GUARD_STATUS_ACTIONS_H
#include "constants/move.h"
#include "dungeon_entity.h"
@ -7,7 +7,7 @@
bool8 sub_805B668(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
bool8 sub_805B734(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 RecycleMoveAction(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805B7FC(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
bool8 ReflectMoveAction(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
bool8 sub_805B808(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
bool8 sub_805B884(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 SkullBashMoveAction(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
@ -23,8 +23,8 @@ bool8 CleanseOrbAction(struct DungeonEntity *pokemon,struct DungeonEntity *targe
bool8 sub_805BC70(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805BC98(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
bool8 SilenceOrbAction(struct DungeonEntity *pokemon,struct DungeonEntity *target);
bool8 sub_805BD70(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805BD7C(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 ScannerOrbAction(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 RadarOrbAction(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 TransferOrbAction(struct DungeonEntity *pokemon,struct DungeonEntity *target);
bool8 sub_805BE90(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 LuminousOrbAction(struct DungeonEntity *pokemon,struct DungeonEntity *target);
@ -37,10 +37,10 @@ bool8 TrapbustOrbAction(struct DungeonEntity *pokemon,struct DungeonEntity *targ
bool8 sub_805C080(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C128(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C138(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
bool8 sub_805C1B0(struct DungeonEntity *pokemon, struct DungeonEntity *target);
u32 sub_805C1BC(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
bool8 IdentifyOrbAction(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C1BC(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, s32 param_4);
bool8 sub_805C1E4(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C1F8(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 ShockerOrbAction(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C208(struct DungeonEntity *pokemon, struct DungeonEntity *target, struct PokemonMove *move, u32 param_4);
bool8 sub_805C288(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C2A0(struct DungeonEntity *pokemon, struct DungeonEntity *target);
@ -49,13 +49,8 @@ bool8 sub_805C3DC(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C3F8(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C45C(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C468(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C474(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C480(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 sub_805C48C(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 CanUseOnSelfWithStatusChecker(struct DungeonEntity *pokemon, struct PokemonMove *move);
bool8 CanUseOnTargetWithStatusChecker(struct DungeonEntity *user, struct DungeonEntity *target, struct PokemonMove *move);
bool8 HasDisabledMove(struct PokemonMove *moves);
bool8 LastUsedMoveOutOfPP(struct PokemonMove *moves);
bool8 HasLastUsedMove(struct PokemonMove *moves);
bool8 StairsOrbAction(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 LongtossOrbAction(struct DungeonEntity *pokemon, struct DungeonEntity *target);
bool8 PierceOrbAction(struct DungeonEntity *pokemon, struct DungeonEntity *target);
#endif

View File

@ -3,6 +3,7 @@
#include "dungeon_entity.h"
s32 GetMovementSpeed(struct DungeonEntity *pokemon);
bool8 HasNegativeStatus(struct DungeonEntity *pokemon);
bool8 IsSleeping(struct DungeonEntity *pokemon);
bool8 HasQuarterHPOrLess(struct DungeonEntity *pokemon);

View File

@ -29,8 +29,7 @@ struct WonderMail
/* 0x1 */ u8 missionType; // mission type
/* 0x2 */ u8 unk2;
/* 0x3 */ u8 unk3;
/* 0x4 */ u8 dungeon; // dungeon
/* 0x5 */ u8 floor; // floor
/* 0x4 */ struct DungeonLocation dungeon;
/* 0x8 */ u32 unk8;
/* 0xC */ s16 clientSpecies; // client pokemon
/* 0xE */ s16 targetSpecies; // target

79
include/wonder_mail_3.h Normal file
View File

@ -0,0 +1,79 @@
struct unkStruct_203B2F4
{
u8 fill0[0x1A];
s16 unk1A;
s16 unk1C;
s16 unk1E;
u8 fill20[0x34 - 0x20];
u32 unk34;
u32 unk38;
struct UnkTextStruct2 unk3C[4];
u8 unk9C[4];
};
extern struct unkStruct_203B2F4 *gUnknown_203B2F4;
struct unkStruct_802C39C
{
/* 0x0 */ u32 unk0[2];
/* 0x8 */ struct DungeonLocation *unk8;
/* 0xC */ u8 *unkC;
/* 0x10 */ s16 unk10;
/* 0x12 */ s16 unk12;
/* 0x14 */ u8 unk14;
/* 0x15 */ u8 fill15[0x1B];
/* 0x34 */ u8 fill34[2];
/* 0x36 */ u8 fill36[0x3C - 0x36];
/* 0x3C */ u8 unk3C[0xC];
/* 0x48 */ u8 fill48[4];
/* 0x4C */ u32 unk4C;
/* 0x50 */ u8 *unk50[3];
};
struct unkStruct_803B344
{
// size: 0xB4
struct WonderMail unk0;
u8* unk14;
u8* unk18;
u8 fill1C[0x3C - 0x1C];
u8 unk3C[0x78];
};
struct unkSubStruct_203B2F8
{
struct WonderMail wonderMail;
u8 *unk14;
u8 *unk18;
};
struct unkStruct_203B2F8
{
// size: 0x208
s32 state; // state
s32 fallbackState;
u8 unk8;
u8 unk9;
u8 unkA;
u8 unkB;
struct unkSubStruct_203B2F8 *unkC;
u8 unk10;
u8 fill11[0x14 - 0x11];
u32 unk14;
u8 fill18[0x58 - 0x18];
u8 unk58;
u8 fill59[0x64 - 0x59];
u8 *unk64;
u32 unk68;
u32 unk6C;
u32 unk70;
u32 unk74;
u8 unk78[0xC8 - 0x78];
u8 unkC8[4];
u8 fillCC[0x118 - 0xCC];
struct MenuItem unk118[8];
struct MenuItem unk158[8];
u16 unk198[8];
struct UnkTextStruct2 unk1A8[4];
u32 unk1E4;
};
extern struct unkStruct_203B2F8 *gUnknown_203B2F8;

View File

@ -116,6 +116,7 @@ SECTIONS {
asm/gulpin_shop.o(.text);
src/gulpin_shop_1.o(.text);
asm/code_801EE10.o(.text);
src/code_801EE10.o(.text);
src/luminous_cave.o(.text);
src/friend_list_menu_1.o(.text);
asm/friend_list_menu.o(.text);
@ -174,13 +175,13 @@ SECTIONS {
src/wonder_mail_main_menu.o(.text);
src/ds_menus.o(.text);
src/debug_menu.o(.text);
asm/debug_menu.o(.text);
src/debug_menu_mid.o(.text);
asm/debug_menu_1.o(.text);
src/debug_menu_2.o(.text);
asm/debug_menu_2.o(.text);
src/debug_menu_1.o(.text);
asm/code_803B050.o(.text);
src/code_803B050.o(.text);
src/pokemon_mail.o(.text);
src/code_803C1B4.o(.text);
asm/code_803C1D0.o(.text);
@ -219,7 +220,8 @@ SECTIONS {
asm/code_805744C.o(.text);
src/code_8057824.o(.text);
asm/code_8057824.o(.text);
src/status_checker.o(.text);
src/status_actions.o(.text);
src/move_checks.o(.text);
asm/code_805D8C8.o(.text);
src/targeting.o(.text);
src/code_8069E0C.o(.text);
@ -238,7 +240,6 @@ SECTIONS {
src/dungeon_capabilities.o(.text);
asm/code_8070BC0.o(.text);
src/dungeon_capabilities_1.o(.text);
asm/code_8070E3C.o(.text);
src/dungeon_ai_targeting.o(.text);
src/dungeon_pokemon_attributes.o(.text);
asm/code_80718D8.o(.text);
@ -248,7 +249,7 @@ SECTIONS {
src/code_8073CF0.o(.text);
asm/code_8073CF0.o(.text);
src/dungeon_ai.o(.text);
asm/code_8075BA4.o(.text);
src/move_effects_target.o(.text);
src/status.o(.text);
asm/code_8077274.o(.text);
src/code_8077274_1.o(.text);
@ -268,6 +269,8 @@ SECTIONS {
asm/code_808333C.o(.text);
src/dungeon_leader.o(.text);
asm/code_8083654.o(.text);
src/dungeon_music.o(.text);
asm/dungeon_music.o(.text);
src/dungeon_random.o(.text);
src/code_808417C.o(.text);
asm/code_808417C.o(.text);
@ -290,6 +293,7 @@ SECTIONS {
asm/dungeon.o(.text);
src/dungeon_2.o(.text);
asm/dungeon_2.o(.text);
src/dungeon_2_1.o(.text);
src/items.o(.text);
src/rescue_team_info.o(.text);
src/text_util.o(.text);
@ -325,7 +329,7 @@ SECTIONS {
src/exclusive_pokemon_1.o(.text);
src/position_util.o(.text);
asm/code_8098468.o(.text);
src/code_8098BDC.o(.text);
src/ground_main.o(.text);
asm/code_8098BDC.o(.text);
src/code_809D148.o(.text);
asm/code_809D148.o(.text);
@ -454,7 +458,7 @@ SECTIONS {
data/data_80F4E2C.o(.rodata);
src/type_chart.o(.rodata);
data/data_80F54B4.o(.rodata);
src/status_checker.o(.rodata);
src/move_checks.o(.rodata);
data/data_80F5668.o(.rodata);
src/dungeon_pokemon_attributes.o(.rodata);
data/data_80F59C8.o(.rodata);
@ -463,7 +467,6 @@ SECTIONS {
src/type_effectiveness.o(.data);
data/data_8106F7C.o(.rodata);
src/dungeon_capabilities_1.o(.rodata);
data/data_8106FB5.o(.rodata);
src/dungeon_ai_targeting.o(.rodata);
data/data_8107010.o(.rodata);
src/friend_area.o(.rodata);

View File

@ -11,7 +11,7 @@
void xxx_call_stop_bgm(void);
extern u8 sub_80023E4(u8);
extern bool8 sub_80023E4(u8);
extern void xxx_call_stop_fanfare_se(u16 r0);
struct UnkSaveStruct1
@ -87,15 +87,15 @@ void sub_801169C(void)
void sub_8011760(void)
{
if(sub_80023E4(0xD) != 0)
if(sub_80023E4(0xD))
StartNewBGM(MUS_WORLD_CALAMITY);
else if(sub_80023E4(0xC) != 0)
else if(sub_80023E4(0xC))
StartNewBGM(MUS_POKEMON_SQUARE);
}
void sub_801178C(void)
{
if(sub_80023E4(0xD) != 0)
if(sub_80023E4(0xD))
StartNewBGM(MUS_WORLD_CALAMITY);
else
StartNewBGM(MUS_POKEMON_SQUARE);
@ -103,7 +103,7 @@ void sub_801178C(void)
void sub_80117AC(void)
{
if(sub_80023E4(0xD) == 0)
if(!sub_80023E4(0xD))
FadeOutBGM(0x1E);
}

157
src/code_801EE10.c Normal file
View File

@ -0,0 +1,157 @@
#include "global.h"
#include "code_800D090.h"
#include "pokemon.h"
#include "input.h"
#include "memory.h"
#include "text.h"
struct unkStruct_203B2AC
{
u8 unk0[0x1E];
s16 unk1E;
s16 unk20;
u8 unk22[0x34 - 0x22];
u32 unk34[3];
u8 unk40[0x48 - 0x40];
s16 unk48;
u32 unk4C;
u8 unk50[0xB0 - 0x50];
u32 unkB0;
u8 fillB4[0xE0 - 0xB4];
u32 unkE0;
struct UnkTextStruct2 *unkE4;
struct UnkTextStruct2 unkE8[4];
u8 unk148[4];
};
extern struct unkStruct_203B2AC *gUnknown_203B2AC;
struct unkStruct_3001B60
{
u8 fill0[0x1A];
s16 unk1A[2];
u8 fill1C[0x370 - 0x1E];
s16 unk370;
s16 unk372;
s16 unk374;
s16 unk376;
};
extern struct unkStruct_3001B60 *gUnknown_3001B60;
extern struct UnkTextStruct2 gUnknown_80DC9B0;
extern struct UnkTextStruct2 gUnknown_80DC9C8;
extern void sub_8013818(void *, u32, u32, u32);
extern bool8 sub_80023E4(u32);
extern void sub_808FF20(u32 *, struct PokemonStruct *, bool8);
extern void CreatePokemonInfoTabScreen(u32, s16, u32 *, u32 *, u32);
extern s32 GetKeyPress(void *);
extern bool8 sub_8013938(void *);
extern void sub_802452C(void);
extern void PlayMenuSoundEffect(u32);
extern void sub_8013984(void *);
void sub_80922B4(u8 *buffer, u8 *string, s32 size);
void sub_8024588(void);
void sub_80245D0(void);
void sub_8024604(void);
extern u8 gUnknown_80DC9A4[];
struct PokemonStruct *sub_80243E8(void)
{
u8 buffer [40];
u8 nameBuffer [20];
struct PokemonStruct *pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_3001B60->unk1A[gUnknown_3001B60->unk376 * gUnknown_3001B60->unk374 + gUnknown_3001B60->unk370]];
sub_80922B4(nameBuffer, pokeStruct->name, POKEMON_NAME_LENGTH);
sprintf_2(buffer, gUnknown_80DC9A4,nameBuffer); // %s
return pokeStruct;
}
bool8 sub_8024458(s16 param_1, s32 param_2)
{
s32 param_1_s32 = param_1;
gUnknown_203B2AC = MemoryAlloc(sizeof(struct unkStruct_203B2AC), 8);
gUnknown_203B2AC->unk48 = param_1_s32;
gUnknown_203B2AC->unkE0 = param_2;
gUnknown_203B2AC->unkE4 = &gUnknown_203B2AC->unkE8[param_2];
sub_8006518(gUnknown_203B2AC->unkE8);
gUnknown_203B2AC->unkE8[gUnknown_203B2AC->unkE0] = gUnknown_80DC9C8;
gUnknown_203B2AC->unkE4->unk14 = gUnknown_203B2AC->unk148;
gUnknown_203B2AC->unk148[2] = 10;
sub_8024604();
sub_802452C();
sub_8013984(gUnknown_203B2AC);
return TRUE;
}
u8 sub_80244E4(void)
{
switch(GetKeyPress(gUnknown_203B2AC))
{
case 2:
PlayMenuSoundEffect(1);
return 2;
case 1:
PlayMenuSoundEffect(0);
return 3;
default:
if (sub_8013938(gUnknown_203B2AC) != 0) {
sub_802452C();
return 1;
}
else {
return 0;
}
}
}
void sub_802452C(void)
{
sub_8024588();
sub_80245D0();
}
void sub_802453C(void)
{
if(gUnknown_203B2AC)
{
gUnknown_203B2AC->unkE8[gUnknown_203B2AC->unkE0] = gUnknown_80DC9B0;
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B2AC->unkE8, 1, 1);
MemoryFree(gUnknown_203B2AC);
gUnknown_203B2AC = NULL;
}
}
void sub_8024588(void)
{
gUnknown_203B2AC->unk148[0] = gUnknown_203B2AC->unk20;
gUnknown_203B2AC->unk148[1] = gUnknown_203B2AC->unk1E;
gUnknown_203B2AC->unk148[3] = 0;
ResetUnusedInputStruct();
sub_800641C(gUnknown_203B2AC->unkE8,1,1);
}
void sub_80245D0(void)
{
CreatePokemonInfoTabScreen
(gUnknown_203B2AC->unk34[gUnknown_203B2AC->unk1E],
gUnknown_203B2AC->unk1E,&gUnknown_203B2AC->unk4C,
&gUnknown_203B2AC->unkB0,gUnknown_203B2AC->unkE0);
}
void sub_8024604(void)
{
struct PokemonStruct *pokeStruct;
u32 *iVar3;
gUnknown_203B2AC->unk34[0] = 2;
gUnknown_203B2AC->unk34[1] = 3;
gUnknown_203B2AC->unk34[2] = 5;
sub_8013818(gUnknown_203B2AC,3,1,gUnknown_203B2AC->unkE0);
iVar3 = &gUnknown_203B2AC->unk4C;
pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_203B2AC->unk48];
sub_808FF20(iVar3,pokeStruct, sub_80023E4(7));
}

42
src/code_803B050.c Normal file
View File

@ -0,0 +1,42 @@
#include "global.h"
#include "pokemon.h"
extern s16 gUnknown_80E8126[];
extern struct PokemonStruct *GetPlayerPokemonStruct(void);
extern struct PokemonStruct *sub_808D378(void);
extern bool8 sub_803C0DC(s16);
extern bool8 sub_8098134(s16);
extern s16 GetBaseSpecies(s16);
extern bool8 sub_80023E4(u32);
bool8 sub_803C110(s16 index)
{
struct PokemonStruct *pokeStruct;
s16 *psVar5;
s16 *psVar6;
s32 species_s32;
species_s32 = (s32)index;
if ((!sub_8098134(index)) || (index != GetBaseSpecies(index)) || (!sub_803C0DC(index))) {
return FALSE;
}
else {
if (!sub_80023E4(6)) {
psVar5 = &gUnknown_80E8126[0];
if (*psVar5 != 0) {
psVar6 = &gUnknown_80E8126[0];
do {
if (*psVar6 == species_s32) return FALSE;
psVar5++;
psVar6++;
} while (*psVar5 != SPECIES_NONE);
}
pokeStruct = GetPlayerPokemonStruct();
if ((pokeStruct->speciesNum == species_s32) ||
(pokeStruct = sub_808D378(), pokeStruct->speciesNum == species_s32)) return FALSE;
}
return TRUE;
}
}

View File

@ -1,11 +1,10 @@
#include "global.h"
#include "dungeon.h"
extern s32 sub_80908D8(u32);
s32 sub_803C1B4(s32 r0, u8 r1)
u32 sub_803C1B4(struct DungeonLocation *dungeon, u8 r1)
{
s32 temp;
temp = sub_80908D8(r0);
temp = sub_80908D8(dungeon);
if(r1 == 2)
{
temp += 2;

View File

@ -4,6 +4,7 @@
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
#include "dungeon_map_access.h"
#include "dungeon_music.h"
#include "file_system.h"
#include "play_time.h"
@ -18,7 +19,6 @@ extern void sub_80060EC(void);
extern void sub_800CB20(void);
extern void LoadBufferedInputs(void);
extern void xxx_call_update_bg_sound_input(void);
extern void sub_8083F58(void);
extern void sub_8011860(void);
extern void sub_803F580(u32);
@ -59,7 +59,7 @@ void sub_8040094(u8 r0)
sub_800CB20();
LoadBufferedInputs();
xxx_call_update_bg_sound_input();
sub_8083F58();
UpdateDungeonMusic();
sub_8011860();
}

View File

@ -13,43 +13,43 @@ struct unkStruct_80420E8
};
extern void sub_803ED30(u8, struct DungeonEntity *r0, u8, u8);
extern void sub_804151C(struct DungeonEntity *r0, u32 r1, u8 r2);
extern void sub_80416E0(struct DungeonEntity *r0, u32, u32);
extern u8 sub_8042768(struct DungeonEntity *r0);
extern void sub_806CDD4(struct DungeonEntity *r0, u8, u32);
extern void sub_803ED30(u8, struct DungeonEntity *pokemon, u8, u8);
extern void sub_804151C(struct DungeonEntity *pokemon, u32 r1, u8 r2);
extern void sub_80416E0(struct DungeonEntity *pokemon, u32, u32);
extern u8 sub_8042768(struct DungeonEntity *pokemon);
extern void sub_806CDD4(struct DungeonEntity *pokemon, u8, u32);
extern u32 sub_806F62C(u32);
extern void PlaySoundEffect(u32);
extern u8 sub_803F428(struct DungeonEntity *r0);
extern void sub_8041550(struct DungeonEntity *r0, u32, u32, u32, u32, u32);
extern u8 sub_803F428(struct DungeonEntity *pokemon);
extern void sub_8041550(struct DungeonEntity *pokemon, u32, u32, u32, u32, u32);
void sub_80421C0(struct DungeonEntity *r0, u16 r1);
void sub_80421C0(struct DungeonEntity *pokemon, u16 r1);
void sub_8041AD0(struct DungeonEntity *r0)
void sub_8041AD0(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xA2 << 1, 1);
sub_804151C(pokemon, 0xA2 << 1, 1);
}
void sub_8041AE0(struct DungeonEntity *r0)
void sub_8041AE0(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x143, 1);
sub_804151C(pokemon, 0x143, 1);
}
void sub_8041AF4(struct DungeonEntity *r0)
void sub_8041AF4(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x25, 1);
sub_80421C0(r0, 0x197);
sub_804151C(pokemon, 0x25, 1);
sub_80421C0(pokemon, 0x197);
}
void nullsub_57(void)
{
}
void sub_8041B18(struct DungeonEntity *r0)
void sub_8041B18(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x141, 1);
sub_804151C(pokemon, 0x141, 1);
}
void nullsub_58(void)
@ -60,36 +60,36 @@ void nullsub_59(void)
{
}
void sub_8041B34(struct DungeonEntity *r0)
void sub_8041B34(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 7, 1);
sub_804151C(pokemon, 7, 1);
}
void nullsub_60(void)
{
}
void sub_8041B48(struct DungeonEntity *r0)
void sub_8041B48(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 4, 0);
sub_804151C(pokemon, 4, 0);
}
void nullsub_61(void)
{
}
void sub_8041B5C(struct DungeonEntity *r0)
void sub_8041B5C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x171, 1);
sub_804151C(pokemon, 0x171, 1);
}
void nullsub_62(struct DungeonEntity *r0)
void nullsub_62(struct DungeonEntity *pokemon)
{
}
void sub_8041B74(struct DungeonEntity *r0)
void sub_8041B74(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x171, 0);
sub_804151C(pokemon, 0x171, 0);
}
void nullsub_63(void)
@ -100,9 +100,9 @@ void nullsub_64(void)
{
}
void sub_8041B90(struct DungeonEntity *r0)
void sub_8041B90(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xD6 << 1, 0);
sub_804151C(pokemon, 0xD6 << 1, 0);
}
void nullsub_65(void)
@ -113,60 +113,60 @@ void nullsub_66(void)
{
}
void sub_8041BA8(struct DungeonEntity *r0)
void sub_8041BA8(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 4, 1);
sub_804151C(pokemon, 4, 1);
}
void nullsub_67(void)
{
}
void sub_8041BBC(struct DungeonEntity *r0)
void sub_8041BBC(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xD4 << 1, 1);
sub_804151C(pokemon, 0xD4 << 1, 1);
}
void nullsub_68(void)
{
}
void sub_8041BD0(struct DungeonEntity *r0, u8 r1)
void sub_8041BD0(struct DungeonEntity *pokemon, u8 r1)
{
if(r1 == 0)
{
return;
}
sub_80421C0(r0, 0x1a5);
sub_80421C0(pokemon, 0x1a5);
}
void sub_8041BE8(struct DungeonEntity *r0)
void sub_8041BE8(struct DungeonEntity *pokemon)
{
sub_80421C0(r0, 0xCB << 1);
sub_80421C0(pokemon, 0xCB << 1);
}
void sub_8041BF8(struct DungeonEntity *r0)
void sub_8041BF8(struct DungeonEntity *pokemon)
{
sub_806CDD4(r0, 0xA, NUM_DIRECTIONS);
sub_806CDD4(pokemon, 0xA, NUM_DIRECTIONS);
}
void sub_8041C08(struct DungeonEntity *r0)
void sub_8041C08(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x1a7, 1);
sub_804151C(pokemon, 0x1a7, 1);
}
void sub_8041C1C(struct DungeonEntity *r0)
void sub_8041C1C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x1a7, 1);
sub_804151C(pokemon, 0x1a7, 1);
}
void nullsub_69(void)
{
}
void sub_8041C34(struct DungeonEntity *r0)
void sub_8041C34(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x4C, 1);
sub_804151C(pokemon, 0x4C, 1);
}
void nullsub_70(void)
@ -177,24 +177,24 @@ void nullsub_71(void)
{
}
void sub_8041C4C(struct DungeonEntity *r0, u32 r1)
void sub_8041C4C(struct DungeonEntity *pokemon, u32 r1)
{
sub_804151C(r0, r1, 1);
sub_804151C(pokemon, r1, 1);
}
void sub_8041C58(struct DungeonEntity *r0)
void sub_8041C58(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x1a9, 1);
sub_804151C(pokemon, 0x1a9, 1);
}
void sub_8041C6C(struct DungeonEntity *r0)
void sub_8041C6C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x9D << 1, 1);
sub_804151C(pokemon, 0x9D << 1, 1);
}
void sub_8041C7C(struct DungeonEntity *r0)
void sub_8041C7C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x9D << 1, 1);
sub_804151C(pokemon, 0x9D << 1, 1);
}
void nullsub_72(void)
@ -205,96 +205,96 @@ void nullsub_73(void)
{
}
void sub_8041C94(struct DungeonEntity *r0)
void sub_8041C94(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x171, 1);
sub_804151C(pokemon, 0x171, 1);
}
void sub_8041CA8(struct DungeonEntity *r0)
void sub_8041CA8(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 7, 1);
sub_804151C(pokemon, 7, 1);
}
void sub_8041CB8(struct DungeonEntity *r0)
void sub_8041CB8(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x18b, 1);
sub_804151C(pokemon, 0x18b, 1);
}
void sub_8041CCC(struct DungeonEntity *r0)
void sub_8041CCC(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xC5 << 1, 1);
sub_804151C(pokemon, 0xC5 << 1, 1);
}
void sub_8041CDC(struct DungeonEntity *r0)
void sub_8041CDC(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 5, 1);
sub_804151C(pokemon, 5, 1);
}
void sub_8041CEC(struct DungeonEntity *r0)
void sub_8041CEC(struct DungeonEntity *pokemon)
{
sub_80421C0(r0, 0x19d);
sub_80421C0(pokemon, 0x19d);
}
void nullsub_74(void)
{
}
void sub_8041D00(struct DungeonEntity *r0, struct DungeonEntity *r1)
void sub_8041D00(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
sub_804151C(r1, 0x2F, 1);
sub_804151C(r0, 0x30, 1);
sub_804151C(target, 0x2F, 1);
sub_804151C(pokemon, 0x30, 1);
}
void nullsub_75(void)
void nullsub_75(struct DungeonEntity *pokemon)
{
}
void nullsub_76(void)
void nullsub_76(struct DungeonEntity *pokemon)
{
}
void nullsub_77(void)
void nullsub_77(struct DungeonEntity *pokemon)
{
}
void nullsub_78(void)
void nullsub_78(struct DungeonEntity *pokemon)
{
}
void nullsub_79(void)
void nullsub_79(struct DungeonEntity *pokemon)
{
}
void nullsub_80(void)
void nullsub_80(struct DungeonEntity *pokemon)
{
}
void sub_8041D38(struct DungeonEntity * r0)
void sub_8041D38(struct DungeonEntity * pokemon)
{
sub_804151C(r0, 0x21, 1);
sub_804151C(pokemon, 0x21, 1);
}
void sub_8041D48(struct DungeonEntity * r0)
void sub_8041D48(struct DungeonEntity * pokemon)
{
sub_80421C0(r0, 0x191);
sub_80421C0(pokemon, 0x191);
}
void nullsub_81(void)
{
}
void sub_8041D5C(struct DungeonEntity *r0)
void sub_8041D5C(struct DungeonEntity *pokemon)
{
if(sub_8042768(r0) == 0)
if(sub_8042768(pokemon) == 0)
{
return;
}
sub_803ED30(r0->entityData->stockpileCount, r0, 1, 0xB);
sub_803ED30(pokemon->entityData->stockpileCount, pokemon, 1, 0xB);
}
void sub_8041D84(struct DungeonEntity * r0)
void sub_8041D84(struct DungeonEntity *pokemon)
{
sub_80421C0(r0, 0x19f);
sub_80421C0(pokemon, 0x19f);
}
void nullsub_82(void)
@ -305,14 +305,14 @@ void nullsub_83(void)
{
}
void sub_8041D9C(struct DungeonEntity * r0)
void sub_8041D9C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x131, 1);
sub_804151C(pokemon, 0x131, 1);
}
void sub_8041DB0(struct DungeonEntity * r0)
void sub_8041DB0(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x30, 1);
sub_804151C(pokemon, 0x30, 1);
}
void nullsub_84(void)
@ -339,257 +339,257 @@ void nullsub_88(void)
{
}
void sub_8041DD8(struct DungeonEntity *r0, s16 r1)
void sub_8041DD8(struct DungeonEntity *pokemon, s16 r1)
{
u32 temp;
temp = r1;
if(HasType(r0, TYPE_GHOST) != 0)
sub_804151C(r0, temp, 1);
if(HasType(pokemon, TYPE_GHOST) != 0)
sub_804151C(pokemon, temp, 1);
else
sub_804151C(r0, TYPE_GHOST, 1);
sub_804151C(pokemon, TYPE_GHOST, 1);
}
void nullsub_89(void)
{
}
void sub_8041E0C(struct DungeonEntity *r0)
void sub_8041E0C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x41, 1);
sub_804151C(pokemon, 0x41, 1);
}
void sub_8041E1C(struct DungeonEntity *r0)
void sub_8041E1C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x8F << 1, 1);
sub_80421C0(r0, 0xCE << 1);
sub_804151C(pokemon, 0x8F << 1, 1);
sub_80421C0(pokemon, 0xCE << 1);
}
void sub_8041E3C(struct DungeonEntity *r0)
void sub_8041E3C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xD7 << 1, 1);
sub_804151C(pokemon, 0xD7 << 1, 1);
}
void sub_8041E4C(struct DungeonEntity *r0)
void sub_8041E4C(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x1b1, 1);
sub_804151C(pokemon, 0x1b1, 1);
}
void sub_8041E60(struct DungeonEntity *r0)
void sub_8041E60(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x1a9, 1);
sub_804151C(pokemon, 0x1a9, 1);
}
void sub_8041E74(struct DungeonEntity *r0)
void sub_8041E74(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xC9 << 1, 1);
sub_804151C(pokemon, 0xC9 << 1, 1);
}
void sub_8041E84(struct DungeonEntity *r0)
void sub_8041E84(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xC7 << 1, 1);
sub_804151C(pokemon, 0xC7 << 1, 1);
}
void sub_8041E94(struct DungeonEntity *r0)
void sub_8041E94(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xC8 << 1, 1);
sub_804151C(pokemon, 0xC8 << 1, 1);
}
void sub_8041EA4(struct DungeonEntity *r0)
void sub_8041EA4(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x15, 1);
sub_804151C(pokemon, 0x15, 1);
}
void sub_8041EB4(struct DungeonEntity *r0)
void sub_8041EB4(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x171, 1);
sub_804151C(pokemon, 0x171, 1);
}
void sub_8041EC8(struct DungeonEntity *r0)
void sub_8041EC8(struct DungeonEntity *pokemon)
{
sub_80421C0(r0, 0x197);
sub_80421C0(pokemon, 0x197);
}
void sub_8041ED8(struct DungeonEntity *r0)
void sub_8041ED8(struct DungeonEntity *pokemon)
{
sub_80421C0(r0, 0x197);
sub_80421C0(pokemon, 0x197);
}
void sub_8041EE8(struct DungeonEntity *r0)
void sub_8041EE8(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0x15, 1);
sub_804151C(pokemon, 0x15, 1);
}
void sub_8041EF8(struct DungeonEntity *r0)
void sub_8041EF8(struct DungeonEntity *pokemon)
{
sub_804151C(r0, 0xF, 1);
sub_804151C(pokemon, 0xF, 1);
}
void sub_8041F08(struct DungeonEntity *r0)
void sub_8041F08(struct DungeonEntity *pokemon)
{
sub_8041550(r0, 0x15, 1, 3, 2, 0);
sub_8041550(pokemon, 0x15, 1, 3, 2, 0);
}
void nullsub_90(void)
{
}
void sub_8041F28(struct DungeonEntity *r0, u32 r1)
void sub_8041F28(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0xCA << 1, 1);
sub_804151C(pokemon, 0xCA << 1, 1);
}
else
{
sub_804151C(r0, 0x193, 1);
sub_804151C(pokemon, 0x193, 1);
}
}
void sub_8041F4C(struct DungeonEntity *r0, u32 r1)
void sub_8041F4C(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0x18f, 1);
sub_804151C(pokemon, 0x18f, 1);
}
else
{
sub_804151C(r0, 0x191, 1);
sub_804151C(pokemon, 0x191, 1);
}
}
void sub_8041F70(struct DungeonEntity *r0, u32 r1)
void sub_8041F70(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0x1a9, 1);
sub_804151C(pokemon, 0x1a9, 1);
}
else
{
sub_804151C(r0, 0xC9 << 1, 1);
sub_804151C(pokemon, 0xC9 << 1, 1);
}
}
void sub_8041F94(struct DungeonEntity *r0, u32 r1)
void sub_8041F94(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0xC7 << 1, 1);
sub_804151C(pokemon, 0xC7 << 1, 1);
}
else
{
sub_804151C(r0, 0xC8 << 1, 1);
sub_804151C(pokemon, 0xC8 << 1, 1);
}
}
void sub_8041FB4(struct DungeonEntity *r0, u32 r1)
void sub_8041FB4(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0x1a9, 1);
sub_804151C(pokemon, 0x1a9, 1);
}
else
{
sub_804151C(r0, 0xC9 << 1, 1);
sub_804151C(pokemon, 0xC9 << 1, 1);
}
}
void sub_8041FD8(struct DungeonEntity *r0, u32 r1)
void sub_8041FD8(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0xCA << 1, 1);
sub_804151C(pokemon, 0xCA << 1, 1);
}
else
{
sub_804151C(r0, 0x193, 1);
sub_804151C(pokemon, 0x193, 1);
}
}
void sub_8041FFC(struct DungeonEntity *r0, u32 r1)
void sub_8041FFC(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0xC7 << 1, 1);
sub_804151C(pokemon, 0xC7 << 1, 1);
}
else
{
sub_804151C(r0, 0xC8 << 1, 1);
sub_804151C(pokemon, 0xC8 << 1, 1);
}
}
void sub_804201C(struct DungeonEntity *r0, u32 r1)
void sub_804201C(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0x18f, 1);
sub_804151C(pokemon, 0x18f, 1);
}
else
{
sub_804151C(r0, 0x191, 1);
sub_804151C(pokemon, 0x191, 1);
}
}
void sub_8042040(struct DungeonEntity *r0, u32 r1)
void sub_8042040(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0xC6 << 1, 1);
sub_804151C(pokemon, 0xC6 << 1, 1);
}
else
{
sub_804151C(r0, 0xD, 1);
sub_804151C(pokemon, 0xD, 1);
}
}
void sub_8042060(struct DungeonEntity *r0, u32 r1)
void sub_8042060(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0x18d, 1);
sub_804151C(pokemon, 0x18d, 1);
}
else
{
sub_804151C(r0, 0xE, 1);
sub_804151C(pokemon, 0xE, 1);
}
}
void sub_8042080(struct DungeonEntity *r0, u32 r1)
void sub_8042080(struct DungeonEntity *pokemon, u32 r1)
{
if(r1 == 0)
{
sub_804151C(r0, 0xC6 << 1, 1);
sub_804151C(pokemon, 0xC6 << 1, 1);
}
else
{
sub_804151C(r0, 0xD, 1);
sub_804151C(pokemon, 0xD, 1);
}
}
void sub_80420A0(struct DungeonEntity *r0, u32 r1)
void sub_80420A0(struct DungeonEntity *pokemon, u32 r1)
{
sub_804151C(r0, 0x143, 1);
sub_804151C(pokemon, 0x143, 1);
}
void nullsub_91(void)
{
}
void sub_80420B8(struct DungeonEntity *r0, u32 r1)
void sub_80420B8(struct DungeonEntity *pokemon, u32 r1)
{
sub_804151C(r0, 0x19, 1);
sub_804151C(pokemon, 0x19, 1);
}
void sub_80420C8(struct DungeonEntity *r0)
void sub_80420C8(struct DungeonEntity *pokemon)
{
sub_8041550(r0, 0x15, 1, 3, 2, 0);
sub_8041550(pokemon, 0x15, 1, 3, 2, 0);
}
void nullsub_92(void)
void nullsub_92(struct DungeonEntity *pokemon)
{
}
void sub_80420E8(struct DungeonEntity *r0, struct unkStruct_80420E8 *r1)
void sub_80420E8(struct DungeonEntity *pokemon, struct unkStruct_80420E8 *r1)
{
u32 temp;
u32 arg;
@ -612,58 +612,58 @@ void sub_80420E8(struct DungeonEntity *r0, struct unkStruct_80420E8 *r1)
arg = 11;
break;
}
sub_8041550(r0, arg, 1, 3, 0, 1);
sub_8041550(pokemon, arg, 1, 3, 0, 1);
}
void sub_8042148(struct DungeonEntity *r0)
void sub_8042148(struct DungeonEntity *pokemon)
{
sub_80421C0(r0, 0x1a7);
sub_804151C(r0, 0x9F << 1, 1);
sub_80421C0(pokemon, 0x1a7);
sub_804151C(pokemon, 0x9F << 1, 1);
}
void nullsub_93()
{
}
void sub_804216C(u32 r0, struct DungeonEntity *r1, u32 r2)
void sub_804216C(struct DungeonEntity *pokemon, struct DungeonEntity *target, u32 r2)
{
if(r2 == 1)
sub_804151C(r1, 0xF8, 1);
sub_804151C(target, 0xF8, 1);
else
sub_804151C(r1, 0xF9, 1);
sub_804151C(target, 0xF9, 1);
}
void sub_804218C(u32 r0, struct DungeonEntity *r1)
void sub_804218C(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
sub_804151C(r1, 0x2A, 1);
sub_804151C(target, 0x2A, 1);
}
void sub_804219C(struct DungeonEntity *r0)
void sub_804219C(struct DungeonEntity *pokemon)
{
sub_80416E0(r0, 0x90, 1);
sub_80416E0(pokemon, 0x90, 1);
}
void sub_80421AC(u32 r0, struct DungeonEntity * r1)
void sub_80421AC(struct DungeonEntity *pokemon, struct DungeonEntity * target)
{
sub_804151C(r1, 0x167, 1);
sub_804151C(target, 0x167, 1);
}
void sub_80421C0(struct DungeonEntity *r0, u16 r1)
void sub_80421C0(struct DungeonEntity *pokemon, u16 r1)
{
if(r0 == NULL)
if(pokemon == NULL)
PlaySoundEffect(r1);
else
if(sub_8042768(r0) != 0)
if(sub_8042768(pokemon) != 0)
PlaySoundEffect(r1);
}
void sub_80421EC(struct DungeonEntity *r0, u16 r1)
void sub_80421EC(struct DungeonEntity *pokemon, u16 r1)
{
if(sub_803F428(r0) != 0)
if(sub_803F428(pokemon) != 0)
PlaySoundEffect(r1);
}
void sub_8042208(struct DungeonEntity *r0, u8 r1)
void sub_8042208(struct DungeonEntity *pokemon, u8 r1)
{
if(r1 == 0)
PlaySoundEffect(0x152);
@ -673,9 +673,9 @@ void sub_8042208(struct DungeonEntity *r0, u8 r1)
PlaySoundEffect(0x150);
}
void sub_8042238(u32 r0, struct DungeonEntity *r1)
void sub_8042238(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
if(r1->entityData->isEnemy)
if(target->entityData->isEnemy)
PlaySoundEffect(0x157);
else
PlaySoundEffect(0x156);

View File

@ -1,12 +1,15 @@
#include "global.h"
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
extern void sub_804151C(struct DungeonEntity *r0, u32 r1, u8 r2);
extern void sub_803E708(u32 r0, u32 r1);
extern void sub_80416A4(struct DungeonEntity *r0, u32 r1, u32 r2);
extern void sub_80416A4(struct Position *r0, u32 r1, u32 r2);
extern void sub_80421C0(struct DungeonEntity *r0, u16 r1);
extern u8 sub_8042768(struct DungeonEntity *pokemon);
extern void sub_804178C(u32);
extern void sub_804151C(struct DungeonEntity *pokemon, u32 r1, u8 r2);
extern void sub_803E46C(u32);
void sub_80428A0(struct DungeonEntity *r0)
{
@ -106,13 +109,13 @@ void sub_80429E8(struct DungeonEntity *r0)
sub_804151C(r0, 0x11d, 1);
}
void sub_80429FC(struct DungeonEntity *r0)
void sub_80429FC(struct Position *r0)
{
sub_80416A4(r0, 0xCF << 1, 1);
sub_80421C0(NULL, 0xD4);
}
void sub_8042A14(struct DungeonEntity *r0)
void sub_8042A14(struct Position *r0)
{
sub_80416A4(r0, 0x36, 1);
}
@ -122,7 +125,7 @@ void sub_8042A24(struct DungeonEntity *r0)
sub_804151C(r0, 0x15, 1);
}
void sub_8042A34(struct DungeonEntity *r0)
void sub_8042A34(struct Position *r0)
{
sub_80416A4(r0, 0x9F << 1, 0);
}
@ -132,12 +135,12 @@ void sub_8042A44(struct DungeonEntity *r0)
sub_804151C(r0, 0xDA << 1, 1);
}
void sub_8042A54(struct DungeonEntity *r0)
void sub_8042A54(struct Position *r0)
{
sub_80416A4(r0, 0x37, 1);
}
void sub_8042A64(struct DungeonEntity *r0)
void sub_8042A64(struct Position *r0)
{
sub_80416A4(r0, 0x29, 1);
}
@ -146,3 +149,42 @@ void sub_8042A74(struct DungeonEntity *r0)
{
sub_804151C(r0, 0x18, 1);
}
void sub_8042A84(s16 param_1, struct DungeonEntity *entity, u32 param_3)
{
s32 iVar2;
s32 iVar3;
s32 r6;
s32 param_1_s16;
param_1_s16 = param_1;
r6 = 0x200;
if (sub_8042768(entity) != 0) {
sub_804151C(entity,param_1_s16,0);
sub_803E708(param_3,0x42);
do {
if (0xc7ff < entity->unk1C) break;
sub_803E46C(0x42);
iVar2 = entity->unk1C + r6;
entity->unk1C = iVar2;
r6 += 0x100;
iVar3 = entity->posPixel.y - iVar2;
if (iVar3 < 0) {
iVar3 += 0xff;
}
} while (-8 <= (iVar3 >> 8) - gDungeonGlobalData->posScreenPixel.y);
entity->visible = 0;
sub_804178C(0);
}
}
void sub_8042B0C(struct DungeonEntity *entity)
{
sub_8042A84(0x13e, entity, 5);
}
void sub_8042B20(struct DungeonEntity *entity)
{
sub_8042A84(0x1BC, entity, 0xE);
}

View File

@ -15,7 +15,7 @@ void sub_8045BF8(u8 *, struct ItemSlot *);
void sub_8045ACC(void)
{
struct DungeonEntity *uVar2;
struct DungeonEntity *entity;
s32 index;
s32 pokeCount;
@ -23,18 +23,18 @@ void sub_8045ACC(void)
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{
uVar2 = gDungeonGlobalData->teamPokemon[index];
if (EntityExists(uVar2)) {
gDungeonGlobalData->allPokemon[pokeCount] = uVar2;
entity = gDungeonGlobalData->teamPokemon[index];
if (EntityExists(entity)) {
gDungeonGlobalData->allPokemon[pokeCount] = entity;
pokeCount++;
}
}
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
uVar2 = gDungeonGlobalData->wildPokemon[index];
if (EntityExists(uVar2)) {
gDungeonGlobalData->allPokemon[pokeCount] = uVar2;
entity = gDungeonGlobalData->wildPokemon[index];
if (EntityExists(entity)) {
gDungeonGlobalData->allPokemon[pokeCount] = entity;
pokeCount++;
}
}
@ -43,15 +43,15 @@ void sub_8045ACC(void)
}
}
s32 GetTeamMemberEntityIndex(struct DungeonEntity *entity)
s32 GetTeamMemberEntityIndex(struct DungeonEntity *pokemon)
{
struct DungeonEntity *uVar2;
struct DungeonEntity *entity;
s32 index;
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{
uVar2 = gDungeonGlobalData->teamPokemon[index];
if (entity == uVar2)
entity = gDungeonGlobalData->teamPokemon[index];
if (pokemon == entity)
return index;
}
return -1;

View File

@ -3,11 +3,14 @@
#include "constants/status.h"
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
#include "move_effects_target.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "number_util.h"
#include "moves.h"
#include "code_8077274_1.h"
#include "position.h"
#include "status.h"
extern u8 *gUnknown_80F89F4[];
extern u8 gAvailablePokemonNames[0x58];
@ -33,17 +36,12 @@ extern u8 *gPtrSelfHealPreventedHungerMessage[];
extern u8 *gUnknown_80F9740[];
extern u8 *gUnknown_80F9760[];
extern void sub_807D148(struct DungeonEntity *pokemon, struct DungeonEntity *r1, u32 r2, u32 r3);
extern void sub_8075FCC(struct DungeonEntity *pokemon, struct DungeonEntity *r1);
extern void sub_8077AE4(struct DungeonEntity *pokemon, struct DungeonEntity *r1, u32 r2);
extern void sub_807D148(struct DungeonEntity *pokemon, struct DungeonEntity *r1, u32 r2, struct Position *r3);
extern void sub_8072008(struct DungeonEntity *pokemon, struct DungeonEntity *r1, u32 r2, u8 r3, u32);
extern void sub_8076D10(struct DungeonEntity *pokemon, struct DungeonEntity *r1);
extern void LevelDownTarget(struct DungeonEntity *pokemon, struct DungeonEntity *r1, u32 r2);
extern void sub_8078B5C(struct DungeonEntity *, struct DungeonEntity *, u32, u32, u32);
extern void SetMessageArgument(u8 *buffer, struct DungeonEntity *r1, u32);
extern void sub_80522F4(struct DungeonEntity *pokemon, struct DungeonEntity *r1, const char[]);
extern void sub_8077910(struct DungeonEntity *pokemon, struct DungeonEntity *r1, u32, u32);
extern void HealTargetHP(struct DungeonEntity *pokemon, struct DungeonEntity *r1, s16, s16, u32);
extern void sub_806F370(struct DungeonEntity *pokemon, struct DungeonEntity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
extern void sub_8078A58(struct DungeonEntity *, struct DungeonEntity *, s16, u32);
extern s32 sub_8042520(struct DungeonEntity *);
@ -63,12 +61,12 @@ void sub_8048364(struct DungeonEntity *pokemon, struct DungeonEntity *target, u8
void sub_8048374(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
HealTargetHP(pokemon, target, gUnknown_80F4FB6, gUnknown_80F4FB8, 1);
HealTargetHP(pokemon, target, gUnknown_80F4FB6, gUnknown_80F4FB8, TRUE);
}
void sub_804839C(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
HealTargetHP(pokemon, target, gUnknown_80F4FBA, gUnknown_80F4FBC, 1);
HealTargetHP(pokemon, target, gUnknown_80F4FBA, gUnknown_80F4FBC, TRUE);
}
void sub_80483C4(struct DungeonEntity *pokemon, struct DungeonEntity *target)
@ -78,7 +76,7 @@ void sub_80483C4(struct DungeonEntity *pokemon, struct DungeonEntity *target)
void sub_80483D4(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
HealTargetHP(pokemon, target, 0, gUnknown_80F4FBE, 1);
HealTargetHP(pokemon, target, 0, gUnknown_80F4FBE, TRUE);
}
void sub_80483F4(struct DungeonEntity *pokemon, struct DungeonEntity *target)
@ -86,14 +84,14 @@ void sub_80483F4(struct DungeonEntity *pokemon, struct DungeonEntity *target)
BlindTarget(pokemon, target);
}
void sub_8048400(struct DungeonEntity *pokemon, struct DungeonEntity *target)
void XEyeSeedAction(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
CrossEyeVisionTarget(pokemon, target);
}
void sub_804840C(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
sub_8077910(pokemon, target, 0, 1);
RaiseMovementSpeedTarget(pokemon, target, 0, TRUE);
}
void sub_804841C(struct DungeonEntity *pokemon, struct DungeonEntity *target)
@ -121,17 +119,17 @@ void sub_8048450(struct DungeonEntity *pokemon, struct DungeonEntity *target)
void sub_8048480(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
sub_807D148(pokemon, target, 0, 0);
sub_807D148(pokemon, target, 0, NULL);
}
void sub_8048490(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
sub_8075FCC(pokemon, target);
SleeplessStatusTarget(pokemon, target);
}
void sub_804849C(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
sub_8077AE4(pokemon, target, 1);
ConfuseStatusTarget(pokemon, target, TRUE);
}
void sub_80484A8(struct DungeonEntity *pokemon, struct DungeonEntity *target)
@ -141,7 +139,7 @@ void sub_80484A8(struct DungeonEntity *pokemon, struct DungeonEntity *target)
void sub_80484BC(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
sub_8076D10(pokemon, target);
PetrifiedStatusTarget(pokemon, target);
}
void sub_80484C8(struct DungeonEntity *pokemon, struct DungeonEntity *target)
@ -201,27 +199,27 @@ void sub_80485B0(struct DungeonEntity *pokemon, struct DungeonEntity * target)
{
bool8 isMoveBoosted;
s32 moveIndex;
struct DungeonEntityData *iVar5;
struct DungeonEntityData *entityData;
register struct PokemonMove *movePtr1 asm("r4"); // r4
register struct PokemonMove *movePtr2 asm("r5"); // r5
u8 cVar8;
u8 moveBoost;
s32 movePowerBoost;
s32 maxPowerBoost;
isMoveBoosted = FALSE;
cVar8 = 1;
iVar5 = target->entityData;
moveBoost = 1;
entityData = target->entityData;
if (DungeonRandomCapped(100) < gUnknown_80F4F46)
cVar8 = 3;
if (iVar5->isLeader) {
for(moveIndex = 0, movePtr1 = &iVar5->moves[0], movePtr2 = movePtr1; moveIndex < MAX_MON_MOVES; movePtr1++, movePtr2++, moveIndex++)
moveBoost = 3;
if (entityData->isLeader) {
for(moveIndex = 0, movePtr1 = &entityData->moves[0], movePtr2 = movePtr1; moveIndex < MAX_MON_MOVES; movePtr1++, movePtr2++, moveIndex++)
{
if((movePtr1->moveFlags & MOVE_FLAG_EXISTS) && (movePtr1->moveFlags & MOVE_FLAG_SET))
{
if(GetMovePower(movePtr2) == 0) continue;
movePowerBoost = movePtr1->powerBoost;
maxPowerBoost = GetMoveMaxPowerBoost(movePtr2);
movePtr1->powerBoost += cVar8;
movePtr1->powerBoost += moveBoost;
if(movePtr1->powerBoost >= maxPowerBoost)
movePtr1->powerBoost = maxPowerBoost;
if(movePowerBoost != movePtr1->powerBoost)
@ -231,7 +229,7 @@ void sub_80485B0(struct DungeonEntity *pokemon, struct DungeonEntity * target)
if (isMoveBoosted) {
sub_80522F4(pokemon,target,*gUnknown_80FE454);
if (cVar8 != 1) {
if (moveBoost != 1) {
sub_803E708(10,0x40);
sub_80522F4(pokemon,target,*gUnknown_80FE434);
}
@ -251,7 +249,7 @@ void sub_804869C(struct DungeonEntity *pokemon, struct DungeonEntity * target, u
struct DungeonEntity *entity;
u8 auStack28 [4];
if (param_3 != '\0') {
if (param_3 != 0) {
entityData = target->entityData;
entityData_1 = entityData;
if (gDungeonGlobalData->unk675 != 0) {

View File

@ -1,17 +1,14 @@
#include "global.h"
#include "constants/status.h"
#include "code_80521D0.h"
#include "move_effects_target.h"
#include "dungeon_random.h"
#include "item.h"
#include "status.h"
extern void sub_803E708(u32, u32);
extern void sub_80421C0(struct DungeonEntity *r0, u16 r1);
extern void sub_8078B5C(struct DungeonEntity *, struct DungeonEntity *, u32, u32, u32);
extern void sub_80763F8(struct DungeonEntity *, struct DungeonEntity *, u32);
extern void sub_80769CC(struct DungeonEntity *, struct DungeonEntity *);
extern void sub_8076210(struct DungeonEntity *, struct DungeonEntity *, u32, u32);
extern void sub_8077780(struct DungeonEntity *, struct DungeonEntity *, u32);
extern void sub_8076E20(struct DungeonEntity *, struct DungeonEntity *, u32, u32, u32, u32);
extern u8 gAvailablePokemonNames[];
extern u8 gUnknown_202DE58[];
@ -34,9 +31,9 @@ extern u8 *gUnknown_80FE3E8[];
bool8 sub_8048D50(struct DungeonEntity * pokemon, struct ItemSlot *item)
{
struct DungeonEntityData *iVar2;
struct DungeonEntityData *entityData;
iVar2 = pokemon->entityData;
entityData = pokemon->entityData;
if ((item->itemFlags & ITEM_FLAG_STICKY) != 0) {
sub_8045BF8(gUnknown_202DE58, item);
@ -45,7 +42,7 @@ bool8 sub_8048D50(struct DungeonEntity * pokemon, struct ItemSlot *item)
}
else
{
if ((iVar2->muzzledStatus == MUZZLED_STATUS_MUZZLED) && (IsEdibleItem(item->itemIndex))) {
if ((entityData->muzzledStatus == MUZZLED_STATUS_MUZZLED) && (IsEdibleItem(item->itemIndex))) {
SetMessageArgument(gAvailablePokemonNames,pokemon,0);
SendMessage(pokemon,*gUnknown_80FDCA4);
return FALSE;
@ -69,20 +66,20 @@ void sub_8048E04(struct DungeonEntity *pokemon, struct DungeonEntity * target)
switch(DungeonRandomCapped(5))
{
case 0:
sub_80763F8(pokemon, target, 1);
PoisonedStatusTarget(pokemon, target, TRUE);
break;
case 1:
sub_80769CC(pokemon, target);
ImmobilizedStatusTarget(pokemon, target);
break;
case 2:
sub_8076210(pokemon, target, 1, 1);
BurnedStatusTarget(pokemon, target, 1, TRUE);
break;
case 3:
sub_8077780(pokemon, target, 1);
ParalyzeStatusTarget(pokemon, target, TRUE);
break;
case 4:
sub_8076E20(pokemon, target, gUnknown_8106A4C, 3, 1, 1);
sub_8076E20(pokemon, target, gUnknown_8106A50, 3, 1, 1);
LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C, 3, 1, TRUE);
LowerAttackStageTarget(pokemon, target, gUnknown_8106A50, 3, 1, TRUE);
break;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,12 @@
#include "global.h"
#include "constants/bg_music.h"
#include "constants/direction.h"
#include "constants/friend_area.h"
#include "constants/weather.h"
#include "dungeon_global_data.h"
#include "dungeon_entity.h"
#include "dungeon_map_access.h"
#include "dungeon_music.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "dungeon_util_1.h"
@ -310,11 +312,9 @@ extern u8 sub_800E9A8(u32);
extern void sub_800DC14(u32);
extern void sub_8086A3C(struct DungeonEntity *r0);
extern void sub_8083E88(u32);
extern void sub_80854D4(void);
extern void sub_80855E4(void *);
extern void sub_8068FE0(struct DungeonEntity *, u32, u32);
extern void sub_8083EA8(u32, u32);
extern void sub_803E708(u32, u32);
extern void sub_8086448(void);
@ -331,12 +331,9 @@ extern void DisplayDungeonDialogue(u32 *);
extern void sub_803E708(u32, u32);
extern u8 HasRecruitedMon(u32);
extern u8 sub_806FD18(struct DungeonEntity *);
extern bool8 IsFanfareSEPlaying_2(u32);
extern void sub_8083F14();
extern void sub_80861D4(struct DungeonEntity *, u32, s32 direction);
extern void sub_806FDF4(struct DungeonEntity *, struct DungeonEntity *, struct DungeonEntity **);
extern u32 sub_80861F8(u32, struct DungeonEntity *, u32);
extern void sub_8083ED8(u32);
extern s32 GetCameraXPos();
extern s32 GetCameraYPos();
extern void sub_803F878(u32, s32);
@ -377,10 +374,8 @@ extern void sub_808BBA8(struct DungeonEntity * );
extern void sub_80855E4(void *);
extern void sub_8041888(u32);
extern void sub_80861B8(struct DungeonEntity *, u32, u32);
extern void sub_8083ED8(u32);
extern void sub_803E708(u32, u32);
extern void DisplayDungeonDialogue(u32 *r0);
extern void sub_8083E88(u32);
extern void SpriteShockEffect(struct DungeonEntity *);
extern u32 sub_80861F8(u32, struct DungeonEntity *, u32);
@ -411,7 +406,6 @@ extern void sub_803E46C(u32);
extern void sub_80866C4(u32 *);
extern void sub_808692C();
extern void sub_8083E58(u32);
extern void sub_80868F4();
extern void sub_8086910();
extern u32 sub_8085EC8(u32, u32, u32, u32 *, u32);
@ -449,7 +443,6 @@ void sub_80891F0(void);
void sub_8089294(void);
void GroudonScreenFlash2(void);
extern void sub_8083F14();
extern u8 sub_8086AE4(u32);
@ -466,8 +459,6 @@ extern void sub_8086738();
extern void sub_8086A54(struct DungeonEntity *);
extern void sub_8086764();
extern s32 GetCameraXPos();
extern s32 GetCameraYPos();
extern void sub_803F878(u32,s32);
void SceneGroudonMovement(struct DungeonEntity * param_1);
@ -613,7 +604,7 @@ void sub_80877E8(void)
LeaderEntity = xxx_call_GetLeaderEntity();
MoltresEntity = GetEntityFromClientType(9);
sub_8083E88(0x26);
DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE);
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_WEST);
@ -629,12 +620,12 @@ void sub_8087848(void)
struct DungeonEntity *LeaderEntity;
struct DungeonEntity *MoltresEntity;
u32 uVar4;
s32 iVar3;
u32 XPos;
s32 YPos;
LeaderEntity = xxx_call_GetLeaderEntity();
MoltresEntity = GetEntityFromClientType(9);
sub_8083E88(0x26);
DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE);
sub_80854D4();
sub_8085930(DIRECTION_WEST);
sub_80855E4(sub_8086A3C);
@ -647,9 +638,9 @@ void sub_8087848(void)
sub_8086A3C(MoltresEntity);
}
sub_8085860(LeaderEntity->posWorld.x - 5, LeaderEntity->posWorld.y);
uVar4 = GetCameraXPos();
iVar3 = GetCameraYPos();
sub_803F878(uVar4,iVar3 + -0x1000);
XPos = GetCameraXPos();
YPos = GetCameraYPos();
sub_803F878(XPos, YPos + -0x1000);
CopySpeciesNametoBuffer(gUnknown_202E038,SPECIES_MOLTRES);
}
@ -699,7 +690,7 @@ void MoltresPreFightDialogue(void)
sub_803E708(4,0x46);
sub_8085930(DIRECTION_NORTH);
PlaySoundEffect(0x2f2);
sub_8083F14();
DungeonStopBGM();
MoltresScreenDarken();
DisplayDungeonDialogue(&gMoltresPreFightDialogue_6);
sub_803E708(10,0x46);
@ -1024,7 +1015,7 @@ void sub_8087F54(void)
LeaderEntity = xxx_call_GetLeaderEntity();
ArticunoEntity = GetEntityFromClientType(0xd);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
@ -1040,7 +1031,7 @@ void sub_8087FB4(void)
struct DungeonEntity *ArticunoEntity;
ArticunoEntity = GetEntityFromClientType(0xd);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
@ -1096,7 +1087,7 @@ void ArticunoPreFightDialogue(void)
DisplayDungeonDialogue(&gArticunoPreFightDialogue_1);
sub_803E708(10,0x46);
sub_8086598();
sub_8083F14();
DungeonStopBGM();
DisplayDungeonDialogue(&gArticunoPreFightDialogue_2);
sub_803E708(10,0x46);
sub_80869E4(PartnerEntity,4,1,2);
@ -1273,9 +1264,9 @@ void sub_8088574(void)
void sub_80885A0(void)
{
sub_8083ED8(0x3c);
DungeonFadeOutBGM(0x3c);
sub_803E708(0x3c,0x46);
sub_8083F14();
DungeonStopBGM();
gDungeonGlobalData->unk7 = 1;
}
@ -1284,9 +1275,9 @@ void sub_80885C4(void)
struct DungeonEntity * LeaderEntity;
LeaderEntity = xxx_call_GetLeaderEntity();
sub_8083ED8(0x3c);
DungeonFadeOutBGM(0x3c);
sub_803E708(0x3c,0x46);
sub_8083F14();
DungeonStopBGM();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -1316,7 +1307,7 @@ void sub_808862C(void)
LeaderEntity = xxx_call_GetLeaderEntity();
AlakazamEntity = GetEntityFromClientType(10);
GroudonEntity = GetEntityFromClientType(0xe);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80867F4();
sub_8085374();
sub_80854D4();
@ -1337,8 +1328,8 @@ void sub_80886C4(void)
struct DungeonEntity * AlakazamEntity;
struct DungeonEntity * GroudonEntity;
u32 uVar4;
s32 iVar2;
u32 XPos;
s32 YPos;
LeaderEntity = xxx_call_GetLeaderEntity();
AlakazamEntity = GetEntityFromClientType(10);
@ -1352,9 +1343,9 @@ void sub_80886C4(void)
SetFacingDirection(GroudonEntity, DIRECTION_SOUTH);
sub_8086A3C(GroudonEntity);
sub_8085860(LeaderEntity->posWorld.x,LeaderEntity->posWorld.y);
uVar4 = GetCameraXPos();
iVar2 = GetCameraYPos();
sub_803F878(uVar4,iVar2 + -0x1000);
XPos = GetCameraXPos();
YPos = GetCameraYPos();
sub_803F878(XPos,YPos + -0x1000);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_GROUDON);
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_ALAKAZAM);
}
@ -1459,7 +1450,7 @@ void GroudonPreFightDialogue(void)
sub_803E708(0x3c,0x46);
DisplayDungeonDialogue(&GroudonPreFightDialogue_11);
sub_803E708(10,0x46);
sub_8083F14();
DungeonStopBGM();
GroudonScreenFlash2();
sub_803E708(0x1e,0x46);
DisplayDungeonDialogue(&GroudonPreFightDialogue_12);
@ -1501,7 +1492,7 @@ void GroudonReFightDialogue(void)
sub_803E708(10,0x46);
sub_808682C();
sub_803E708(0x3c,0x46);
sub_8083F14();
DungeonStopBGM();
PlaySoundEffect(0x1fa);
sub_8086738();
DisplayDungeonDialogue(&gGroudonReFightDialogue_4);
@ -1704,7 +1695,7 @@ void MagmaCavernMidDialogue(void)
// far already..
DisplayDungeonDialogue(&MagmaCavernMidDialogue_2);
sub_803E708(10,0x46);
sub_8083F14();
DungeonStopBGM();
sub_80855E4(sub_80868F4);
sub_808680C();
PlaySoundEffect(0x1c5);
@ -1713,7 +1704,7 @@ void MagmaCavernMidDialogue(void)
// Qu-quake!
DisplayDungeonDialogue(&MagmaCavernMidDialogue_3);
sub_803E708(0x78,0x46);
sub_8083E58(0x1c5);
StopSoundEffect(0x1c5);
sub_808682C();
sub_80855E4(sub_8086910);
sub_803E708(0x14,0x46);
@ -1901,7 +1892,7 @@ void sub_80892C8(void)
LeaderEntity = xxx_call_GetLeaderEntity();
RayquazaEntity = GetEntityFromClientType(0xf);
sub_8083E88(0x1a);
DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN);
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
@ -1919,7 +1910,7 @@ void sub_8089328(void)
LeaderEntity = xxx_call_GetLeaderEntity();
RayquazaEntity = GetEntityFromClientType(0xf);
sub_8083E88(0x1a);
DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -2088,7 +2079,7 @@ void sub_808970C(void)
struct DungeonEntity *LeaderEntity;
LeaderEntity = xxx_call_GetLeaderEntity();
sub_8083E88(0x7D);
DungeonStartNewBGM(MUS_TINY_WOODS);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -2210,7 +2201,7 @@ void sub_8089914(void)
LeaderEntity = xxx_call_GetLeaderEntity();
MewtwoEntity = GetEntityFromClientType(0x11);
sub_8083F14();
DungeonStopBGM();
gDungeonGlobalData->unk7 = 1;
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
@ -2228,12 +2219,12 @@ void sub_8089978(void)
LeaderEntity = xxx_call_GetLeaderEntity();
MewtwoEntity = GetEntityFromClientType(0x11);
sub_8083F14();
DungeonStopBGM();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
if(HasRecruitedMon(SPECIES_MEWTWO)){
sub_8083E88(0x23);
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
sub_8068FE0(MewtwoEntity,0x21c,0);
}
else {
@ -2263,7 +2254,7 @@ void MewtwoPreFightDialogue(void)
sub_8086448();
DisplayDungeonDialogue(&gMewtwoPreFightDialogue_1);
sub_803E708(10,0x46);
sub_8083E88(0x23);
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
sub_8086794();
sub_803E708(0x1e,0x46);
MewtwoDropInEffect(MewtwoEntity);
@ -2293,7 +2284,7 @@ void MewtwoReFightDialogue(void)
}
else {
DisplayDungeonDialogue(&gMewtwoReFightDialogue_1);
sub_8083E88(0x23);
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
sub_8086794();
MewtwoDropInEffect(MewtwoEntity);
sub_803E708(0x3c,0x46);
@ -2362,7 +2353,7 @@ void sub_8089C44(void)
LeaderEntity = xxx_call_GetLeaderEntity();
EnteiEntity = GetEntityFromClientType(0x12);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
SetFacingDirection(EnteiEntity, DIRECTION_SOUTH);
@ -2378,7 +2369,7 @@ void sub_8089C90(void)
LeaderEntity = xxx_call_GetLeaderEntity();
EnteiEntity = GetEntityFromClientType(0x12);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(SPECIES_ENTEI)) {
@ -2493,7 +2484,7 @@ void sub_8089EFC(void)
LeaderEntity = xxx_call_GetLeaderEntity();
RaikouEntity = GetEntityFromClientType(0x13);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
SetFacingDirection(RaikouEntity, DIRECTION_SOUTH);
@ -2509,7 +2500,7 @@ void sub_8089F44(void)
LeaderEntity = xxx_call_GetLeaderEntity();
RaikouEntity = GetEntityFromClientType(0x13);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
SetFacingDirection(RaikouEntity, DIRECTION_SOUTH);
@ -2525,7 +2516,7 @@ void sub_8089F8C(void)
LeaderEntity = xxx_call_GetLeaderEntity();
RaikouEntity = GetEntityFromClientType(0x13);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(SPECIES_RAIKOU)) {
@ -2649,7 +2640,7 @@ void sub_808A264(void)
LeaderEntity = xxx_call_GetLeaderEntity();
SuicuneEntity = GetEntityFromClientType(0x14);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -2666,7 +2657,7 @@ void sub_808A2C0(void)
LeaderEntity = xxx_call_GetLeaderEntity();
SuicuneEntity = GetEntityFromClientType(0x14);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH);
@ -2681,7 +2672,7 @@ void sub_808A308(void)
LeaderEntity = xxx_call_GetLeaderEntity();
SuicuneEntity = GetEntityFromClientType(0x14);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(SPECIES_SUICUNE)) {
@ -2824,7 +2815,7 @@ void sub_808A608(void)
LeaderEntity = xxx_call_GetLeaderEntity();
HoOhEntity = GetEntityFromClientType(0x15);
sub_8083E88(0x1c);
DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK);
sub_80867F4();
sub_8086838(0,0,0);
sub_80854D4();
@ -2842,7 +2833,7 @@ void sub_808A668(void)
LeaderEntity = xxx_call_GetLeaderEntity();
HoOhEntity = GetEntityFromClientType(0x15);
sub_8083E88(0x1c);
DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK);
sub_80867F4();
sub_8086838(0,0,0);
sub_80854D4();
@ -2894,7 +2885,7 @@ void HoOhPreFightDialogue(void)
PlaySoundEffect(0x1c5);
sub_803E708(0xfa,70);
HoOhDropInEffect(HoOhEntity);
sub_8083E58(0x1c5);
StopSoundEffect(0x1c5);
sub_808682C();
sub_80855E4(sub_8086910);
sub_8085930(DIRECTION_NORTH);
@ -3003,7 +2994,7 @@ void sub_808A9E4(void)
LeaderEntity = xxx_call_GetLeaderEntity();
LatiosEntity = GetEntityFromClientType(0x16);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -3019,7 +3010,7 @@ void sub_808AA3C(void)
LeaderEntity = xxx_call_GetLeaderEntity();
LatiosEntity = GetEntityFromClientType(0x16);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -3035,7 +3026,7 @@ void sub_808AA94(void)
LeaderEntity = xxx_call_GetLeaderEntity();
LatiosEntity = GetEntityFromClientType(0x16);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -3227,7 +3218,7 @@ void sub_808AE54(char param_1,char param_2,u32 *param_3)
if (sub_8098100(0x1d) == 0) {
xxx_init_itemslot_8090A8C(&auStack20,ITEM_ID_ROCK_PART,0);
sub_80464C8(GetLeaderEntity(),param_3,&auStack20);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
// Something fell from Regirock's body
// Regirock was apparently guarding this item
DisplayDungeonDialogue(&gRegirockPostFightDialogue_1);
@ -3250,7 +3241,7 @@ void sub_808AEC8(char param_1,char param_2,u32 *param_3)
if (sub_8098100(0x1d) == 0) {
xxx_init_itemslot_8090A8C(&auStack20,ITEM_ID_ICE_PART,0);
sub_80464C8(GetLeaderEntity(),param_3,&auStack20);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
// Something fell from Regice's body
// Regice was apparently guarding this item
DisplayDungeonDialogue(&gRegicePostFightDialogue_1);
@ -3272,7 +3263,7 @@ void sub_808AF3C(char param_1,char param_2,u32 *param_3)
if (sub_8098100(0x1d) == 0) {
xxx_init_itemslot_8090A8C(&auStack20,ITEM_ID_STEEL_PART,0);
sub_80464C8(GetLeaderEntity(),param_3, &auStack20);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
// Something fell from Registeel's body
// Registeel was apparently guarding this item
DisplayDungeonDialogue(&gRegisteelPostFightDialogue_1);
@ -3513,7 +3504,7 @@ void sub_808B2F4(void)
LeaderEntity = xxx_call_GetLeaderEntity();
JirachiEntity = GetEntityFromClientType(0x1a);
sub_8083E88(0x79);
DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST);
sub_808BCE4();
sub_8049ED4();
sub_80854D4();
@ -3532,7 +3523,7 @@ void sub_808B35C(void)
LeaderEntity = xxx_call_GetLeaderEntity();
JirachiEntity = GetEntityFromClientType(0x1a);
sub_8083E88(0x79);
DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -3678,11 +3669,11 @@ void sub_808B50C(void)
JirachiEntity->entityData->unk15C = 1;
JirachiEntity->entityData->unk15E = 0;
sub_80861B8(JirachiEntity,0xe,0);
sub_8083ED8(0x1e);
DungeonFadeOutBGM(0x1e);
sub_803E708(0x1e,70);
// Fwaaaahhhh
DisplayDungeonDialogue(&gUnknown_810554C);
sub_8083E88(0x79);
DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST);
// I think I had a dream, and I was fighting in it
// Did I imagine it?
// I'm sleepy so I'm going back to sleep.
@ -3724,7 +3715,7 @@ void JirachiWish(void)
sub_80861B8(JirachiEntity,0xe,0);
sub_80855E4(sub_80861A8);
gDungeonGlobalData->unk1356C = 1;
sub_8083ED8(0x1e);
DungeonFadeOutBGM(0x1e);
sub_803E708(0x1e,0x46);
DisplayDungeonDialogue(&gUnknown_8105668);
sub_803E708(10,0x46);
@ -3732,7 +3723,7 @@ void JirachiWish(void)
sub_803E708(0x96,0x46);
SpriteShockEffect(JirachiEntity);
DisplayDungeonDialogue(&gUnknown_8105674);
sub_8083E88(0x79);
DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST);
sub_803E708(10,0x46);
sub_80856E0(JirachiEntity, DIRECTION_SOUTH);
PlaySoundEffect(0x16a);
@ -3943,7 +3934,11 @@ void JirachiWishGrantFlash(void)
void sub_808BB3C(s16 *param_1)
{
#ifndef NONMATCHING
register s32 iVar1 asm("r0");
#else
s32 iVar1;
#endif
s32 uVar2;
u32 local_8;
@ -4103,12 +4098,12 @@ void sub_808BDEC(void)
LeaderEntity = xxx_call_GetLeaderEntity();
LugiaEntity = GetEntityFromClientType(0x1b);
sub_8083F14();
DungeonStopBGM();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
if (HasRecruitedMon(SPECIES_LUGIA)) {
sub_8083E88(0x23);
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
sub_8068FE0(LugiaEntity,0x21c,0);
}
else {
@ -4139,10 +4134,10 @@ void LugiaPreFightDialogue(void)
sub_80866C4(&gLugiaPreFightDialogue_8);
}
else {
sub_8083F14();
DungeonStopBGM();
sub_8086448();
DisplayDungeonDialogue(&gLugiaPreFightDialogue_1);
sub_8083EA8(0x23,0x3c);
DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c);
sub_808C0CC();
DisplayDungeonDialogue(&gLugiaPreFightDialogue_2);
LugiaScreenFlash();
@ -4158,12 +4153,12 @@ void LugiaPreFightDialogue(void)
DisplayDungeonDialogue(&gLugiaPreFightDialogue_6);
LugiaScreenFlash2();
SetDungeonBGColorRGB(0xffffff06,0xffffff06,0xffffff06,1,0);
sub_8083F14();
DungeonStopBGM();
sub_80861D4(LugiaEntity,7,0);
DisplayDungeonDialogue(&gLugiaPreFightDialogue_7);
LugiaScreenFlash();
SetupBossFightHP(LugiaEntity,800,0x20);
sub_8083E88(0x23);
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
ShiftCameraToPosition(&LeaderEntity->posPixel,0x10);
}
}
@ -4238,12 +4233,12 @@ void sub_808C10C(void)
struct DungeonEntity * LeaderEntity;
struct DungeonEntity * KyogreEntity;
u32 uVar3;
s32 iVar2;
u32 XPos;
s32 YPos;
LeaderEntity = xxx_call_GetLeaderEntity();
KyogreEntity = GetEntityFromClientType(0x1c);
sub_8083F14();
DungeonStopBGM();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
if (HasRecruitedMon(SPECIES_KYOGRE)) {
@ -4254,9 +4249,9 @@ void sub_808C10C(void)
SetFacingDirection(KyogreEntity, DIRECTION_SOUTH);
}
sub_8085860(LeaderEntity->posWorld.x,LeaderEntity->posWorld.y);
uVar3 = GetCameraXPos();
iVar2 = GetCameraYPos();
sub_803F878(uVar3,iVar2 + -0x1000);
XPos = GetCameraXPos();
YPos = GetCameraYPos();
sub_803F878(XPos,YPos + -0x1000);
CopySpeciesNametoBuffer(gUnknown_202E038,SPECIES_KYOGRE);
// TODO: gUnknown_202E088 doesn't match but gUnknown_202E038 + 0x50 does
CopySpeciesNametoBuffer(gUnknown_202E038 + 0x50, SPECIES_GROUDON);
@ -4266,7 +4261,7 @@ void sub_808C1A4(u8 param_1,u8 param_2)
{
if ((param_2 == 0x34) && (param_1 == 0x1C)) {
gDungeonGlobalData->unk2 = 1;
sub_8083E88(0x23);
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
}
}
@ -4277,9 +4272,9 @@ void KyogrePreFightDialogue(void)
LeaderEntity = xxx_call_GetLeaderEntity();
KyogreEntity = GetEntityFromClientType(0x1c);
sub_8083F14();
DungeonStopBGM();
if (HasRecruitedMon(SPECIES_KYOGRE)) {
sub_8083EA8(0x23,0x3c);
DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c);
SpriteLookAroundEffect(LeaderEntity);
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gKyogrePreFightDialogue_8);
@ -4296,7 +4291,7 @@ void KyogrePreFightDialogue(void)
// Gwwwwwooooooooh
DisplayDungeonDialogue(&gKyogrePreFightDialogue_3);
sub_803E708(10,0x46);
sub_8083EA8(0x23,0x3c);
DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c);
sub_808C360();
// My duels against {ARG_POKEMON_3} (Groudon) left us both exhausted
DisplayDungeonDialogue(&gKyogrePreFightDialogue_4);
@ -4313,7 +4308,7 @@ void KyogrePreFightDialogue(void)
DisplayDungeonDialogue(&gKyogrePreFightDialogue_7);
sub_803E708(10,0x46);
SetupBossFightHP(KyogreEntity,600,0xb);
sub_8083E88(0x23);
DungeonStartNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE);
ShiftCameraToPosition(&LeaderEntity->posPixel,0x10);
}
}
@ -4360,7 +4355,7 @@ void sub_808C3A0(void)
struct DungeonEntity * LeaderEntity;
LeaderEntity = xxx_call_GetLeaderEntity();
sub_8083F14();
DungeonStopBGM();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -4379,7 +4374,7 @@ void sub_808C414(u8 param_1,u8 param_2)
{
if ((param_2 == 0x35) && (param_1 == 0x1D)) {
gDungeonGlobalData->unk2 = 1;
sub_8083E88(0x1a);
DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN);
}
}
@ -4396,7 +4391,7 @@ void DeoxysPreFightDialogue(void)
}
else {
DisplayDungeonDialogue(&gDeoxysPreFightDialogue_1);
sub_8083EA8(0x1a,0x3c);
DungeonFadeInNewBGM(MUS_RAYQUAZAS_DOMAIN, 0x3c);
sub_808C550();
DisplayDungeonDialogue(&gDeoxysPreFightDialogue_2);
DeoxysScreenFlash();
@ -4462,19 +4457,19 @@ void sub_808C5C0(void)
struct DungeonEntity * LeaderEntity;
struct DungeonEntity * CelebiEntity;
u32 uVar3;
s32 iVar2;
u32 XPos;
s32 YPos;
LeaderEntity = xxx_call_GetLeaderEntity();
CelebiEntity = GetEntityFromClientType(0x1e);
sub_8083E88(0x7f);
DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
SetFacingDirection(CelebiEntity, DIRECTION_SOUTH);
sub_8085860(LeaderEntity->posWorld.x,LeaderEntity->posWorld.y);
uVar3 = GetCameraXPos();
iVar2 = GetCameraYPos();
sub_803F878(uVar3,iVar2 + 0xfffff000);
XPos = GetCameraXPos();
YPos = GetCameraYPos();
sub_803F878(XPos,YPos + 0xfffff000);
CopySpeciesNametoBuffer(gUnknown_202E038, SPECIES_CELEBI);
}
@ -4538,12 +4533,12 @@ void CelebiJoinDialogue(void)
sub_803E708(10,0x46);
if (menuChoice == 1)
{
sub_8083F14();
DungeonStopBGM();
PlaySoundEffect(0xcc);
while (IsFanfareSEPlaying_2(0xcc) != 0) {
sub_803E46C(0x46);
}
sub_8083E88(0x7f);
DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST);
PlaySoundEffect(0x1c7);
sub_80861D4(CelebiEntity,0xd,0);
sub_803E708(0x37,0x46);
@ -4554,7 +4549,7 @@ void CelebiJoinDialogue(void)
DisplayDungeonDialogue(&gCelebiJoinDialogue_4);
sub_803E708(10,0x46);
sub_806FDF4(LeaderEntity,CelebiEntity,&CelebiEntity);
sub_8083E88(0x7f);
DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST);
DisplayDungeonDialogue(&gCelebiJoinDialogue_5);
sub_803E708(10,0x46);
PlaySoundEffect(0x1c7);
@ -4600,7 +4595,7 @@ void CelebiJoinDialogue(void)
}
} while (state != 2);
}
sub_8083ED8(0x1e);
DungeonFadeOutBGM(0x1e);
sub_803E708(0x1e,0x46);
gDungeonGlobalData->unk2 = 1;
}
@ -4727,7 +4722,7 @@ void CelebiJoinDialogue(void)
"\tbl sub_803E708\n"
"\tcmp r4, 0x1\n"
"\tbne _0808C824\n"
"\tbl sub_8083F14\n"
"\tbl DungeonStopBGM\n"
"\tmovs r0, 0xCC\n"
"\tbl PlaySoundEffect\n"
"\tb _0808C76E\n"
@ -4745,7 +4740,7 @@ void CelebiJoinDialogue(void)
"\tcmp r0, 0\n"
"\tbne _0808C768\n"
"\tmovs r0, 0x7F\n"
"\tbl sub_8083E88\n"
"\tbl DungeonStartNewBGM\n"
"\tmov r0, r8\n"
"\tbl PlaySoundEffect\n"
"\tldr r0, [sp]\n"
@ -4775,7 +4770,7 @@ void CelebiJoinDialogue(void)
"\tmov r2, sp\n"
"\tbl sub_806FDF4\n"
"\tmovs r0, 0x7F\n"
"\tbl sub_8083E88\n"
"\tbl DungeonStartNewBGM\n"
"\tldr r0, _0808C81C\n"
"\tbl DisplayDungeonDialogue\n"
"\tmovs r0, 0xA\n"
@ -4868,7 +4863,7 @@ void CelebiJoinDialogue(void)
"\tb _0808C70E\n"
"_0808C8AC:\n"
"\tmovs r0, 0x1E\n"
"\tbl sub_8083ED8\n"
"\tbl DungeonFadeOutBGM\n"
"\tmovs r0, 0x1E\n"
"\tmovs r1, 0x46\n"
"\tbl sub_803E708\n"
@ -4954,7 +4949,7 @@ void sub_808C9C4(void)
LeaderEntity = xxx_call_GetLeaderEntity();
MedichamEntity = GetEntityFromClientType(7);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -5023,7 +5018,7 @@ void sub_808CB5C(void)
LeaderEntity = xxx_call_GetLeaderEntity();
MedichamEntity = GetEntityFromClientType(7);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_8068FE0(MedichamEntity, 0x21C, 0);
@ -5042,7 +5037,7 @@ void sub_808CBB0(void)
LeaderEntity = xxx_call_GetLeaderEntity();
SmeargleEntity = GetEntityFromClientType(0x1F);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);
@ -5114,7 +5109,7 @@ void sub_808CD44(void)
LeaderEntity = xxx_call_GetLeaderEntity();
SmeargleEntity = GetEntityFromClientType(0x1F);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
sub_80855E4(sub_8086A3C);

View File

@ -36,7 +36,7 @@ void sub_80522F4(struct DungeonEntity *r0, struct DungeonEntity *r1, const char
extern void sub_8042900(struct DungeonEntity *r0);
extern void sub_8042968(struct DungeonEntity *r0);
extern void sub_806ABAC(struct DungeonEntity *, struct DungeonEntity *);
extern void sub_8076090(struct DungeonEntity *, struct DungeonEntity *,u32,u32,u32);
extern void PausedStatusTarget(struct DungeonEntity *, struct DungeonEntity *,u32,u32,u32);
void sub_8041BBC(struct DungeonEntity *r0);
extern u8 sub_8045888(struct DungeonEntity *);
extern void sub_806A2BC(struct DungeonEntity *, u8);
@ -47,48 +47,48 @@ extern u8 sub_8092364(u8);
extern void sub_803E46C(u32);
extern void sub_803E708(u32 r0, u32 r1);
void sub_8069E0C(struct DungeonEntity *param_1)
void sub_8069E0C(struct DungeonEntity *pokemon)
{
s32 index;
struct DungeonEntityData *iVar4;
struct DungeonEntityData *entityData;
iVar4 = param_1->entityData;
if (HasAbility(param_1, ABILITY_FORECAST)) {
iVar4->types[0] = gUnknown_80F520C[GetWeather(param_1)].unk0;
iVar4->types[1] = TYPE_NONE;
entityData = pokemon->entityData;
if (HasAbility(pokemon, ABILITY_FORECAST)) {
entityData->types[0] = gUnknown_80F520C[GetWeather(pokemon)].unk0;
entityData->types[1] = TYPE_NONE;
}
else {
for(index = 0; index < 2; index++)
iVar4->types[index] = GetPokemonType(iVar4->entityID, index);
entityData->types[index] = GetPokemonType(entityData->entityID, index);
}
for(index = 0; index < 2; index++)
iVar4->abilities[index] = GetPokemonAbility(iVar4->entityID, index);
entityData->abilities[index] = GetPokemonAbility(entityData->entityID, index);
gDungeonGlobalData->unkC = 1;
}
void TriggerWeatherAbilities(void)
{
struct DungeonEntity *uVar4;
s32 iVar5;
struct DungeonEntity *entity;
s32 index;
if (gDungeonGlobalData->unkC != 0) {
gDungeonGlobalData->unkC = 0;
gDungeonGlobalData->negateWeatherEffects = FALSE;
for(iVar5 = 0; iVar5 < DUNGEON_MAX_POKEMON; iVar5++)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
uVar4 = gDungeonGlobalData->allPokemon[iVar5];
if (EntityExists(uVar4)) {
if (HasAbility(uVar4, ABILITY_DRIZZLE)) {
entity = gDungeonGlobalData->allPokemon[index];
if (EntityExists(entity)) {
if (HasAbility(entity, ABILITY_DRIZZLE)) {
gDungeonGlobalData->startingWeather[WEATHER_RAIN] = 1;
}
else if (HasAbility(uVar4, ABILITY_SAND_STREAM)) {
else if (HasAbility(entity, ABILITY_SAND_STREAM)) {
gDungeonGlobalData->startingWeather[WEATHER_SANDSTORM] = 1;
}
else if (HasAbility(uVar4, ABILITY_DROUGHT)) {
else if (HasAbility(entity, ABILITY_DROUGHT)) {
gDungeonGlobalData->startingWeather[WEATHER_SUNNY] = 1;
}
if ((HasAbility(uVar4, ABILITY_AIR_LOCK)) || (HasAbility(uVar4, ABILITY_CLOUD_NINE))) {
if ((HasAbility(entity, ABILITY_AIR_LOCK)) || (HasAbility(entity, ABILITY_CLOUD_NINE))) {
gDungeonGlobalData->negateWeatherEffects = TRUE;
}
}
@ -96,11 +96,11 @@ void TriggerWeatherAbilities(void)
}
}
s32 sub_8069F54(struct DungeonEntity *param_1, s16 param_2)
s32 sub_8069F54(struct DungeonEntity *pokemon, s16 param_2)
{
if ((((param_2 * 0x10000) + 0xfe880000U) >> 0x10) < 4) {
if (HasAbility(param_1, ABILITY_FORECAST)) {
return gUnknown_80F520C[GetWeather(param_1)].unk2;
if (HasAbility(pokemon, ABILITY_FORECAST)) {
return gUnknown_80F520C[GetWeather(pokemon)].unk2;
}
else {
return 0x178;
@ -109,14 +109,14 @@ s32 sub_8069F54(struct DungeonEntity *param_1, s16 param_2)
return param_2;
}
static inline u8 sub_8069F9C_sub(struct DungeonEntity *param_1)
static inline u8 sub_8069F9C_sub(struct DungeonEntity *pokemon)
{
u32 uVar3;
uVar3 = GetWeather(param_1);
return gUnknown_80F51E4[uVar3];
u32 weather;
weather = GetWeather(pokemon);
return gUnknown_80F51E4[weather];
}
void sub_8069F9C(struct DungeonEntity *param_1,struct DungeonEntity * param_2,struct PokemonMove *param_3)
void sub_8069F9C(struct DungeonEntity *pokemon,struct DungeonEntity * target,struct PokemonMove *move)
{
u8 type;
u8 ability;
@ -129,19 +129,19 @@ void sub_8069F9C(struct DungeonEntity *param_1,struct DungeonEntity * param_2,st
struct DungeonEntityData *iVar8;
u8 local_20 [4];
if (!EntityExists(param_1)) {
if (!EntityExists(pokemon)) {
return;
}
if (!EntityExists(param_2)) {
if (!EntityExists(target)) {
return;
}
if (param_1 == param_2) {
if (pokemon == target) {
return;
}
iVar7 = param_1->entityData;
iVar7 = pokemon->entityData;
iVar8 = iVar7;
iVar6 = param_2->entityData;
iVar6 = target->entityData;
abilityIndex = -1;
if (iVar6->abilities[0] == ABILITY_TRACE) {
abilityIndex = 0;
@ -171,112 +171,112 @@ void sub_8069F9C(struct DungeonEntity *param_1,struct DungeonEntity * param_2,st
}
iVar6->abilities[abilityIndex] = local_20[randomIndex];
gDungeonGlobalData->unkC = 1;
SetMessageArgument(gAvailablePokemonNames,param_2,0);
sub_80522F4(param_1,param_2,*gUnknown_80FCC7C);
sub_8042900(param_2);
sub_806ABAC(param_1,param_2);
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_80522F4(pokemon,target,*gUnknown_80FCC7C);
sub_8042900(target);
sub_806ABAC(pokemon,target);
}
}
_0806A068:
if (iVar6->unk15A != 0) {
iVar6->unk15A = 0;
if (HasAbility(param_2, ABILITY_COLOR_CHANGE)) {
type = GetMoveTypeForPokemon(param_1,param_3);
if (param_3->moveID == MOVE_WEATHER_BALL) {
type = sub_8069F9C_sub(param_1);
if (HasAbility(target, ABILITY_COLOR_CHANGE)) {
type = GetMoveTypeForPokemon(pokemon,move);
if (move->moveID == MOVE_WEATHER_BALL) {
type = sub_8069F9C_sub(pokemon);
}
if ((type != TYPE_NONE) && (!HasType(param_2,type))) {
if ((type != TYPE_NONE) && (!HasType(target,type))) {
iVar6->types[0] = type;
iVar6->types[1] = TYPE_NONE;
iVar6->isColorChanged = TRUE;
SetMessageArgument(gAvailablePokemonNames,param_2,0);
SetMessageArgument(gAvailablePokemonNames,target,0);
__src = GetUnformattedTypeString(iVar6->types[0]);
strcpy(gUnknown_202DE58,__src);
sub_80522F4(param_1,param_2,*gUnknown_80FCCAC);
sub_8042968(param_2);
sub_80522F4(pokemon,target,*gUnknown_80FCCAC);
sub_8042968(target);
}
}
}
}
void sub_806A120(struct DungeonEntity * param_1, struct DungeonEntity * param_2, struct PokemonMove* move)
void sub_806A120(struct DungeonEntity * pokemon, struct DungeonEntity * target, struct PokemonMove* move)
{
u32 uVar2_u32;
u8 uVar2;
const char *__src;
struct DungeonEntityData *iVar3;
u8 moveType;
const char *typeString;
struct DungeonEntityData *entityData;
if ((((EntityExists(param_1)) && (EntityExists(param_2))) && (param_1 != param_2))
&& (iVar3 = param_2->entityData, iVar3->protectionStatus == 0xC)) {
uVar2 = GetMoveTypeForPokemon(param_1, move);
uVar2_u32 = sub_8092364(uVar2);
if ((((EntityExists(pokemon)) && (EntityExists(target))) && (pokemon != target))
&& (entityData = target->entityData, entityData->protectionStatus == 0xC)) {
moveType = GetMoveTypeForPokemon(pokemon, move);
uVar2_u32 = sub_8092364(moveType);
if (uVar2_u32 != TYPE_NONE) {
iVar3->types[0] = uVar2_u32;
iVar3->types[1] = 0;
sub_8041BBC(param_2);
SetMessageArgument(gAvailablePokemonNames,param_2,0);
__src = GetUnformattedTypeString(uVar2_u32);
strcpy(gUnknown_202DE58,__src);
sub_80522F4(param_1,param_2,*gUnknown_80FDCC8);
entityData->types[0] = uVar2_u32;
entityData->types[1] = 0;
sub_8041BBC(target);
SetMessageArgument(gAvailablePokemonNames,target,0);
typeString = GetUnformattedTypeString(uVar2_u32);
strcpy(gUnknown_202DE58,typeString);
sub_80522F4(pokemon,target,*gUnknown_80FDCC8);
}
}
}
void sub_806A1B0(struct DungeonEntity *param_1)
void sub_806A1B0(struct DungeonEntity *pokemon)
{
if ((EntityExists(param_1)) && (HasAbility(param_1,0x2a))) {
sub_8076090(param_1,param_1,0,1,0);
if ((EntityExists(pokemon)) && (HasAbility(pokemon, ABILITY_TRUANT))) {
PausedStatusTarget(pokemon,pokemon,0,1,0);
}
}
void sub_806A1E8(struct DungeonEntity *param_1)
void sub_806A1E8(struct DungeonEntity *pokemon)
{
bool8 bVar3;
struct DungeonEntityData *iVar1;
struct DungeonEntityData *entityData;
bVar3 = FALSE;
if (EntityExists(param_1)) {
if (GetEntityType(param_1) == ENTITY_POKEMON) {
iVar1 = param_1->entityData;
bVar3 = (!iVar1->isEnemy);
if (EntityExists(pokemon)) {
if (GetEntityType(pokemon) == ENTITY_POKEMON) {
entityData = pokemon->entityData;
bVar3 = (!entityData->isEnemy);
}
if (gUnknown_203B46C->unk1 == '\0') {
bVar3 = FALSE;
}
if (bVar3 && (sub_8045888(param_1) == '\0')) {
sub_806A2BC(param_1,1);
if (bVar3 && (sub_8045888(pokemon) == '\0')) {
sub_806A2BC(pokemon,1);
}
}
}
void sub_806A240(struct DungeonEntity *param_1, struct DungeonEntity *param_2)
void sub_806A240(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
bool8 bVar3;
struct DungeonEntityData *iVar1;
bool8 isEnemy;
struct DungeonEntityData *entityData;
bVar3 = FALSE;
if (EntityExists(param_1)){
if (GetEntityType(param_1) == ENTITY_POKEMON) {
iVar1 = param_1->entityData;
bVar3 = (!iVar1->isEnemy);
isEnemy = FALSE;
if (EntityExists(pokemon)){
if (GetEntityType(pokemon) == ENTITY_POKEMON) {
entityData = pokemon->entityData;
isEnemy = (!entityData->isEnemy);
}
if (bVar3 && (sub_8045888(param_1) == '\0')) {
sub_806A2BC(param_1,1);
if (isEnemy && (sub_8045888(pokemon) == '\0')) {
sub_806A2BC(pokemon,1);
return;
}
else if (GetEntityType(param_2) == ENTITY_POKEMON) {
iVar1 = param_2->entityData;
bVar3 = (!iVar1->isEnemy);
else if (GetEntityType(target) == ENTITY_POKEMON) {
entityData = target->entityData;
isEnemy = (!entityData->isEnemy);
}
if (bVar3 && (sub_8045888(param_2) == '\0')) {
sub_806A2BC(param_2,1);
if (isEnemy && (sub_8045888(target) == '\0')) {
sub_806A2BC(target,1);
}
}
}
void sub_806A2BC(struct DungeonEntity *param_1, u8 param_2)
void sub_806A2BC(struct DungeonEntity *pokemon, u8 param_2)
{
if ((EntityExists(param_1)) && (GetEntityType(param_1) == ENTITY_POKEMON) && (gDungeonGlobalData->leader != param_1)) {
if ((EntityExists(pokemon)) && (GetEntityType(pokemon) == ENTITY_POKEMON) && (gDungeonGlobalData->leader != pokemon)) {
if (param_2 != '\0') {
sub_804178C(1);
while (gDungeonGlobalData->unk12 < 0x3c) {
@ -284,8 +284,8 @@ void sub_806A2BC(struct DungeonEntity *param_1, u8 param_2)
}
}
sub_803E708(4,0x44);
sub_803F508(param_1);
sub_804AC20(&param_1->posWorld);
sub_803F508(pokemon);
sub_804AC20(&pokemon->posWorld);
gDungeonGlobalData->unk12 = 0;
}
}

View File

@ -13,6 +13,7 @@
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "moves.h"
#include "move_effects_target.h"
#include "pokemon.h"
#include "status_checks_1.h"
@ -169,8 +170,6 @@ extern void SetMessageArgument(u8 *buffer, struct DungeonEntity *r1, u32);
extern void sub_80522F4(struct DungeonEntity *pokemon, struct DungeonEntity *r1, const char[]);
extern void DungeonEntityUpdateStatusSprites(struct DungeonEntity *);
extern void sub_8042A74(struct DungeonEntity *r0);
extern void sub_8076CB4(u32);
extern s32 GetMovementSpeed(struct DungeonEntity *);
extern void sub_807EC28(u32);
extern s32 sub_8069F54(struct DungeonEntity *param_1, s16 param_2);
extern u32 sub_80687D0(s16);
@ -178,7 +177,6 @@ extern void sub_806A898(struct DungeonEntity *, u32, u32);
extern void HealTargetHP(struct DungeonEntity *pokemon, struct DungeonEntity *r1, s16, s16, u32);
extern void sub_806CE68(struct DungeonEntity *, s32);
extern void sub_806F324(struct DungeonEntity *, s16, u32, u32);
extern void sub_8075C58(struct DungeonEntity *, struct DungeonEntity *, s32, s32);
extern void sub_806BFC0(struct DungeonEntityData *, u32);
extern void sub_80420C8(struct DungeonEntity *r0);
extern void nullsub_68(struct DungeonEntity *);
@ -322,7 +320,7 @@ void sub_8078F50(struct DungeonEntity * pokemon, struct DungeonEntity * target)
}
}
void sub_8078FDC(struct DungeonEntity * pokemon, struct DungeonEntity * target, s16 param_3)
void ExposeStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity * target, s16 param_3)
{
struct DungeonEntityData *entityData;
s32 param_3_s16;
@ -710,7 +708,7 @@ void sub_8079618(struct DungeonEntity *pokemon, struct DungeonEntity *target, u8
else if ((u8)(newStatus - 9) < 2) {
entityData->unkFF = 2;
}
if (newStatus == 1) {
if (newStatus == CHARGING_STATUS_BIDE) {
entityData->chargingStatusTurnsLeft = CalculateStatusTurns(target,gUnknown_80F4E9C, FALSE) + 1;
entityData->unkA0 = 0;
}
@ -1025,33 +1023,33 @@ void VitalThrowStatusTarget(struct DungeonEntity * pokemon, struct DungeonEntity
void sub_8079E34(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 param_3)
{
bool8 statChanged;
struct DungeonEntityData *iVar3;
struct DungeonEntityData *entityData;
s32 index;
statChanged = FALSE;
if (EntityExists(target)) {
iVar3 = target->entityData;
entityData = target->entityData;
for(index = 0; index < 2; index++)
{
if (iVar3->attackStages[index] != DEFAULT_STAT_STAGE) {
iVar3->attackStages[index] = DEFAULT_STAT_STAGE;
if (entityData->attackStages[index] != DEFAULT_STAT_STAGE) {
entityData->attackStages[index] = DEFAULT_STAT_STAGE;
statChanged = TRUE;
}
if (iVar3->defenseStages[index] != DEFAULT_STAT_STAGE) {
iVar3->defenseStages[index] = DEFAULT_STAT_STAGE;
if (entityData->defenseStages[index] != DEFAULT_STAT_STAGE) {
entityData->defenseStages[index] = DEFAULT_STAT_STAGE;
statChanged = TRUE;
}
if (iVar3->accuracyStages[index] != DEFAULT_STAT_STAGE) {
iVar3->accuracyStages[index] = DEFAULT_STAT_STAGE;
if (entityData->accuracyStages[index] != DEFAULT_STAT_STAGE) {
entityData->accuracyStages[index] = DEFAULT_STAT_STAGE;
statChanged = TRUE;
}
if (iVar3->attackMultipliers[index] != DEFAULT_STAT_MULTIPLIER) {
iVar3->attackMultipliers[index] = DEFAULT_STAT_MULTIPLIER;
if (entityData->attackMultipliers[index] != DEFAULT_STAT_MULTIPLIER) {
entityData->attackMultipliers[index] = DEFAULT_STAT_MULTIPLIER;
statChanged = TRUE;
}
if (iVar3->defenseMultipliers[index] != DEFAULT_STAT_MULTIPLIER) {
iVar3->defenseMultipliers[index] = DEFAULT_STAT_MULTIPLIER;
if (entityData->defenseMultipliers[index] != DEFAULT_STAT_MULTIPLIER) {
entityData->defenseMultipliers[index] = DEFAULT_STAT_MULTIPLIER;
statChanged = TRUE;
}
}
@ -1171,9 +1169,9 @@ void sub_807A0CC(struct DungeonEntity * pokemon, struct DungeonEntity * target)
void SendSleepEndMessage(struct DungeonEntity * pokemon, struct DungeonEntity * target, bool8 param_3, bool8 param_4)
{
struct DungeonEntityData *entityData;
bool8 bVar4;
bool8 isAsleep;
bVar4 = FALSE;
isAsleep = FALSE;
if (!EntityExists(target)) {
return;
}
@ -1184,30 +1182,30 @@ void SendSleepEndMessage(struct DungeonEntity * pokemon, struct DungeonEntity *
case 6:
break;
case SLEEP_STATUS_SLEEP:
bVar4 = TRUE;
isAsleep = TRUE;
sub_80522F4(pokemon,target,*gUnknown_80FA6E8);
break;
case SLEEP_STATUS_SLEEPLESS:
sub_80522F4(pokemon,target,*gUnknown_80FA708);
break;
case SLEEP_STATUS_NIGHTMARE:
bVar4 = TRUE;
isAsleep = TRUE;
sub_80522F4(pokemon,target,*gUnknown_80FA70C);
if (param_4) {
sub_806F324(target,gUnknown_80F4F78,8,0x20f);
}
break;
case SLEEP_STATUS_NAPPING:
bVar4 = TRUE;
isAsleep = TRUE;
sub_80522F4(pokemon,target,*gUnknown_80FA710);
HealTargetHP(pokemon,target,gUnknown_80F4F7A,0,0);
HealTargetHP(pokemon,target,gUnknown_80F4F7A, 0, FALSE);
entityData->sleepStatus = 0;
sub_8079F20(pokemon,target,1,1);
break;
case SLEEP_STATUS_YAWNING:
if (param_3) {
entityData->sleepStatus = SLEEP_STATUS_NONE;
sub_8075C58(pokemon,target,CalculateStatusTurns(target, gUnknown_80F4F2C, TRUE) + 1, 1);
sub_8075C58(pokemon,target,CalculateStatusTurns(target, gUnknown_80F4F2C, TRUE) + 1, TRUE);
return;
}
sub_80522F4(pokemon,target,*gUnknown_80FA734);
@ -1215,7 +1213,7 @@ void SendSleepEndMessage(struct DungeonEntity * pokemon, struct DungeonEntity *
}
entityData->sleepStatus = SLEEP_STATUS_NONE;
DungeonEntityUpdateStatusSprites(target);
if (bVar4) {
if (isAsleep) {
sub_806CE68(target,8);
}
}
@ -1251,10 +1249,10 @@ void SendNonVolatileEndMessage(struct DungeonEntity * pokemon, struct DungeonEnt
void SendImmobilizeEndMessage(struct DungeonEntity * pokemon, struct DungeonEntity *target)
{
bool8 bVar1;
bool8 isFrozen;
struct DungeonEntityData *entityData;
bVar1 = FALSE;
isFrozen = FALSE;
if (!EntityExists(target)) {
return;
}
@ -1266,7 +1264,7 @@ void SendImmobilizeEndMessage(struct DungeonEntity * pokemon, struct DungeonEnti
break;
case IMMOBILIZE_STATUS_FROZEN:
sub_80522F4(pokemon,target,*gUnknown_80FA8BC);
bVar1 = TRUE;
isFrozen = TRUE;
break;
case IMMOBILIZE_STATUS_SQUEEZED:
sub_80522F4(pokemon,target,*gUnknown_80FA820);
@ -1286,7 +1284,7 @@ void SendImmobilizeEndMessage(struct DungeonEntity * pokemon, struct DungeonEnti
}
entityData->immobilizeStatus = IMMOBILIZE_STATUS_NONE;
DungeonEntityUpdateStatusSprites(target);
if (bVar1) {
if (isFrozen) {
sub_8042A74(target);
}
}
@ -1410,7 +1408,7 @@ void SendWaitingEndMessage(struct DungeonEntity * pokemon, struct DungeonEntity
if (waitingStatus != WAITING_STATUS_SNATCH) {
SendMessage(target,*gUnknown_80FA7DC);
}
gDungeonGlobalData->unk17B30 = 0;
gDungeonGlobalData->snatchPokemon = NULL;
gDungeonGlobalData->unk17B3C = 0;
break;
case WAITING_STATUS_DECOY:
@ -1649,14 +1647,14 @@ void sub_807A9B0(struct DungeonEntity * pokemon)
void SendThawedMessage(struct DungeonEntity *pokemon, struct DungeonEntity *target)
{
struct DungeonEntityData *iVar2;
struct DungeonEntityData *entityData;
if (EntityExists(target)) {
iVar2 = target->entityData;
if (iVar2->immobilizeStatus == IMMOBILIZE_STATUS_FROZEN) {
iVar2->immobilizeStatus = IMMOBILIZE_STATUS_NONE;
iVar2->immobilizeStatusTurnsLeft = 0;
iVar2->immobilizeStatusDamageTimer = 0;
entityData = target->entityData;
if (entityData->immobilizeStatus == IMMOBILIZE_STATUS_FROZEN) {
entityData->immobilizeStatus = IMMOBILIZE_STATUS_NONE;
entityData->immobilizeStatusTurnsLeft = 0;
entityData->immobilizeStatusDamageTimer = 0;
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_80522F4(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out!
DungeonEntityUpdateStatusSprites(target);

View File

@ -1,10 +1,10 @@
#include "global.h"
#include "dungeon_global_data.h"
void sub_807FC3C(struct Position *param_1, u32 param_2, u32 param_3)
void sub_807FC3C(struct Position *pos, u32 param_2, u32 param_3)
{
gDungeonGlobalData->unk13574 = param_1->x;
gDungeonGlobalData->unk13576 = param_1->y;
gDungeonGlobalData->unk13574 = pos->x;
gDungeonGlobalData->unk13576 = pos->y;
gDungeonGlobalData->unk13578 = param_2;
gDungeonGlobalData->unk13579 = param_3;
gDungeonGlobalData->unk13570 = 1;

View File

@ -1,5 +1,6 @@
#include "global.h"
#include "dungeon_global_data.h"
#include "dungeon_music.h"
extern void SkarmoryPreFightDialogue();
extern void SkarmoryReFightDialogue();
@ -86,7 +87,6 @@ extern void sub_808C1A4(u32,u8,u8);
extern void sub_808C414(u32,u8,u8);
extern void nullsub_100(u32,u8,u8);
extern void sub_808C948(struct DungeonEntity *,u8);
extern void sub_8083E88(u32);
extern void sub_808AFB0(u8);
extern void sub_808B030(u8);
@ -145,6 +145,38 @@ extern void sub_808CBB0(void);
extern void sub_808CD44(void);
extern void sub_8097FF8(void);
extern u8 sub_8098100(u8);
extern void sub_8097FA8(void);
extern void sub_807E5E4(u32);
void sub_8084854(u8 *param_1)
{
if (gDungeonGlobalData->unk678 != 0) {
gDungeonGlobalData->unk3A0D = param_1[5];
}
else
{
if (sub_8098100(param_1[4]) != 0) {
gDungeonGlobalData->unk3A0D = param_1[5];
}
else
{
if (sub_8098100(param_1[2]) != 0) {
gDungeonGlobalData->unk3A0D = param_1[3];
}
else
{
gDungeonGlobalData->unk3A0D = param_1[1];
if (param_1[2] != 0x40) {
sub_8097FA8();
}
}
}
}
gDungeonGlobalData->unk675 = 1;
sub_807E5E4(0);
}
u32 sub_80848EC(void)
{
return 1;
@ -622,7 +654,7 @@ void sub_8084E00(struct DungeonEntity *param_1,char param_2,char param_3)
break;
}
if ((param_3 == '\0') && (gDungeonGlobalData->unk2 != '\0')) {
sub_8083E88(999);
DungeonStartNewBGM(999);
}
}
}

View File

@ -149,17 +149,17 @@ void sub_8086434(struct DungeonEntity *entity)
void sub_8086448(void)
{
s32 iVar1;
u32 retVar;
u32 retVar2;
u32 XPos;
u32 YPos;
sub_80855E4(sub_80862DC);
for(iVar1 = 0; iVar1 < 0x38; iVar1++)
{
retVar = GetCameraXPos();
retVar2 = GetCameraYPos();
retVar2 += (0x80 << 1);
sub_803F878(retVar, retVar2);
XPos = GetCameraXPos();
YPos = GetCameraYPos();
YPos += (0x80 << 1);
sub_803F878(XPos, YPos);
sub_80855E4(sub_8086410);
sub_803E46C(0x46);
}
@ -194,17 +194,17 @@ void sub_8086494(void)
void sub_8086500(void)
{
s32 iVar1;
u32 retVar;
u32 retVar2;
u32 XPos;
u32 YPos;
sub_80855E4(sub_8086348);
for(iVar1 = 0; iVar1 < 0x48; iVar1++)
{
retVar = GetCameraXPos();
retVar += (0x80 << 1);
retVar2 = GetCameraYPos();
sub_803F878(retVar, retVar2);
XPos = GetCameraXPos();
XPos += (0x80 << 1);
YPos = GetCameraYPos();
sub_803F878(XPos, YPos);
sub_80855E4(sub_8086434);
sub_803E46C(0x46);
}
@ -214,17 +214,17 @@ void sub_8086500(void)
void sub_808654C(void)
{
s32 iVar1;
u32 retVar;
u32 retVar2;
u32 XPos;
u32 YPos;
sub_80855E4(sub_8086384);
for(iVar1 = 0; iVar1 < 0x78; iVar1++)
{
retVar = GetCameraXPos();
retVar += (0x80 << 1);
retVar2 = GetCameraYPos();
sub_803F878(retVar, retVar2);
XPos = GetCameraXPos();
XPos += (0x80 << 1);
YPos = GetCameraYPos();
sub_803F878(XPos, YPos);
sub_80855E4(sub_8086434);
sub_803E46C(0x46);
}
@ -234,16 +234,16 @@ void sub_808654C(void)
void sub_8086598(void)
{
s32 iVar1;
u32 retVar;
u32 retVar2;
u32 XPos;
u32 YPos;
sub_80855E4(sub_80863B8);
for(iVar1 = 0; iVar1 < 0x18; iVar1++)
{
retVar = GetCameraXPos();
retVar2 = GetCameraYPos();
sub_803F878(retVar, retVar2 + (0xffffff00));
XPos = GetCameraXPos();
YPos = GetCameraYPos();
sub_803F878(XPos, YPos + (0xffffff00));
sub_80855E4(sub_8086410);
sub_803E46C(0x46);
}
@ -253,16 +253,16 @@ void sub_8086598(void)
void sub_80865E8(void)
{
s32 iVar1;
u32 retVar;
u32 retVar2;
u32 XPos;
u32 YPos;
sub_80855E4(sub_80863E8);
for(iVar1 = 0; iVar1 < 0xC; iVar1++)
{
retVar = GetCameraXPos();
retVar2 = GetCameraYPos();
sub_803F878(retVar, retVar2 + (0x80 << 2));
XPos = GetCameraXPos();
YPos = GetCameraYPos();
sub_803F878(XPos, YPos + (0x80 << 2));
sub_80855E4(sub_8086424);
sub_80855E4(sub_8086424);
sub_803E46C(0x46);
@ -273,16 +273,16 @@ void sub_80865E8(void)
void sub_808663C(void)
{
s32 iVar1;
u32 retVar;
u32 retVar2;
u32 XPos;
u32 YPos;
sub_80855E4(sub_80863E8);
for(iVar1 = 0; iVar1 < 0x10; iVar1++)
{
retVar = GetCameraXPos();
retVar2 = GetCameraYPos();
sub_803F878(retVar, retVar2 + (0x80 << 2));
XPos = GetCameraXPos();
YPos = GetCameraYPos();
sub_803F878(XPos, YPos + (0x80 << 2));
sub_80855E4(sub_8086424);
sub_80855E4(sub_8086424);
sub_803E46C(0x46);

View File

@ -1,7 +1,9 @@
#include "global.h"
#include "constants/bg_music.h"
#include "constants/direction.h"
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
#include "dungeon_music.h"
#include "pokemon.h"
#include "dungeon_util_1.h"
@ -13,7 +15,6 @@ extern void sub_8097FF8(void);
extern u8 sub_8044B28(void);
extern u8 HasRecruitedMon(u32);
extern u8 gUnknown_202E038[];
extern void sub_8083E88(u32);
extern void sub_8085374();
extern void sub_80854D4();
extern void sub_80855E4(void *);
@ -22,14 +23,12 @@ extern void sub_8097FA8(u32);
extern void DisplayDungeonDialogue(u8 *);
extern void sub_806CDD4(struct DungeonEntity *, u32, u32);
extern void sub_80869E4(struct DungeonEntity *, u32, u32, u32);
extern void sub_8083E88(u32);
extern void sub_803E708(u32, u32);
extern void sub_8086448(void);
extern void SpriteShockEffect(struct DungeonEntity *);
extern void SkarmoryEntry(struct DungeonEntity *);
extern void SpriteLookAroundEffect(struct DungeonEntity *);
extern void sub_8086A54(struct DungeonEntity *);
extern void PlaySoundEffect(u32);
extern void sub_808563C(void *);
extern u8 gSkarmoryPreFightDialogue_1;
@ -46,43 +45,43 @@ extern u8 gSkarmoryReFightDialogue_2;
extern u8 gSkarmoryReFightDialogue_3;
extern u8 gUnknown_8100D3C;
void sub_8086A3C(struct DungeonEntity *param_1)
void sub_8086A3C(struct DungeonEntity *pokemon)
{
param_1->entityData->unk15C = 1;
param_1->entityData->unk15E = 1;
pokemon->entityData->unk15C = 1;
pokemon->entityData->unk15E = 1;
}
void sub_8086A54(struct DungeonEntity *param_1)
void sub_8086A54(struct DungeonEntity *pokemon)
{
param_1->entityData->unk15C = 1;
param_1->entityData->unk15E = 0;
pokemon->entityData->unk15C = 1;
pokemon->entityData->unk15E = 0;
}
void SetupBossFightHP(struct DungeonEntity *param_1, s32 newHP, u16 param_3)
void SetupBossFightHP(struct DungeonEntity *pokemon, s32 newHP, u16 param_3)
{
// NOTE: needed two of these to match.. very dumb
struct DungeonEntityData *iVar1;
struct DungeonEntityData *iVar2;
struct DungeonEntityData *entityData;
struct DungeonEntityData *enityData_1;
iVar1 = param_1->entityData;
iVar2 = param_1->entityData;
entityData = pokemon->entityData;
enityData_1 = pokemon->entityData;
iVar1->isBoss = TRUE;
entityData->isBoss = TRUE;
// BUG: Source of the Reviver Seed Boss Glitch
//
// Video to demonstration:
// https://www.youtube.com/watch?v=rHu7EehrZ68
iVar1->originalHP = iVar1->maxHP;
entityData->originalHP = entityData->maxHP;
if (newHP != 0) {
iVar1->maxHP = newHP;
iVar1->HP = newHP;
entityData->maxHP = newHP;
entityData->HP = newHP;
}
gDungeonGlobalData->unk66A = param_3;
SetDefaultIQSkills(iVar2->IQSkillsSelected,iVar2->isBoss);
LoadIQSkills(param_1);
SetDefaultIQSkills(enityData_1->IQSkillsSelected, enityData_1->isBoss);
LoadIQSkills(pokemon);
}
void sub_8086AC0(void)
@ -111,7 +110,7 @@ void sub_8086B14(void)
LeaderEntity = xxx_call_GetLeaderEntity();
DiglettEntity = GetEntityFromClientType(4);
SkarmoryEntity = GetEntityFromClientType(3);
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);
@ -155,19 +154,19 @@ void SkarmoryPreFightDialogue(void)
struct DungeonEntity * DiglettEntity;
struct DungeonEntity * SkarmoryEntity;
struct Position32 local_1c;
struct Position32 local_20;
struct Position32 pos1;
struct Position32 pos2;
LeaderEntity = xxx_call_GetLeaderEntity(); // Player
PartnerEntity = GetPartnerEntity(); // Partner
DiglettEntity = GetEntityFromClientType(4); // Diglett
SkarmoryEntity = GetEntityFromClientType(3); // Skarmory
local_1c.x = DiglettEntity->posPixel.x;
local_1c.y = DiglettEntity->posPixel.y + 0x3000;
pos1.x = DiglettEntity->posPixel.x;
pos1.y = DiglettEntity->posPixel.y + 0x3000;
local_20.x = SkarmoryEntity->posPixel.x;
local_20.y = SkarmoryEntity->posPixel.y + 0x2000;
pos2.x = SkarmoryEntity->posPixel.x;
pos2.y = SkarmoryEntity->posPixel.y + 0x2000;
sub_8086448();
sub_803E708(10,0x46);
@ -175,16 +174,16 @@ void SkarmoryPreFightDialogue(void)
sub_803E708(0x20,0x46);
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_1);
ShiftCameraToPosition(&local_1c,0x40);
ShiftCameraToPosition(&pos1,0x40);
sub_803E708(0x40,0x46);
ShiftCameraToPosition(&local_20,0x30);
ShiftCameraToPosition(&pos2,0x30);
DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_2);
sub_803E708(10,0x46);
DiglettEntity->entityData->unk15D = 1;
ShiftCameraToPosition(&local_1c,0x30);
ShiftCameraToPosition(&pos1,0x30);
DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_3); // Diglett: ...I...\nI'm scared.
sub_803E708(10,0x46);
ShiftCameraToPosition(&local_20,0x20);
ShiftCameraToPosition(&pos2,0x20);
sub_803E708(0x20,0x46);
SkarmoryEntry(SkarmoryEntity);
DisplayDungeonDialogue(&gSkarmoryPreFightDialogue_4); // Skarmory: You!\nWhat do you think you're doing here?!
@ -204,7 +203,7 @@ void SkarmoryPreFightDialogue(void)
sub_80869E4(PartnerEntity,4,2,4);
sub_80869E4(LeaderEntity,4,1,4);
sub_803E708(10,0x46);
sub_8083E88(0xb);
DungeonStartNewBGM(MUS_BOSS_BATTLE);
ShiftCameraToPosition(&LeaderEntity->posPixel,0x10);
}
@ -212,16 +211,16 @@ void SkarmoryReFightDialogue(void)
{
struct DungeonEntity * LeaderEntity;
struct DungeonEntity * SkarmoryEntity;
struct Position32 local_14;
struct Position32 pos;
LeaderEntity = xxx_call_GetLeaderEntity();
SkarmoryEntity = GetEntityFromClientType(3);
local_14.x = SkarmoryEntity->posPixel.x;
local_14.y = SkarmoryEntity->posPixel.y + 0x2000;
pos.x = SkarmoryEntity->posPixel.x;
pos.y = SkarmoryEntity->posPixel.y + 0x2000;
sub_8086448();
sub_803E708(10,0x46);
SkarmoryEntry(SkarmoryEntity);
ShiftCameraToPosition(&local_14,0x10);
ShiftCameraToPosition(&pos,0x10);
DisplayDungeonDialogue(&gSkarmoryReFightDialogue_1);
sub_803E708(10,0x46);
DisplayDungeonDialogue(&gSkarmoryReFightDialogue_2);
@ -230,7 +229,7 @@ void SkarmoryReFightDialogue(void)
DisplayDungeonDialogue(&gSkarmoryReFightDialogue_3);
sub_803E708(10,0x46);
ShiftCameraToPosition(&LeaderEntity->posPixel,0x10);
sub_8083E88(0xb);
DungeonStartNewBGM(MUS_BOSS_BATTLE);
}
void sub_8086E40(void)
@ -255,7 +254,7 @@ void sub_8086E9C(void)
struct DungeonEntity * LeaderEntity;
LeaderEntity = xxx_call_GetLeaderEntity();
sub_8083E88(0x72);
DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT);
sub_8085374();
sub_80854D4();
sub_8085930(DIRECTION_NORTH);

View File

@ -42,7 +42,7 @@ u32 sub_80954CC(u8 *a, u32 b)
RestoreIntegerBits(&backup, &temp->unk0, 2);
RestoreIntegerBits(&backup, &temp->isLeader, 1);
RestoreIntegerBits(&backup, &temp->unkHasNextStage, 7);
RestoreDungeonLocation(&backup, &temp->unk4);
RestoreDungeonLocation(&backup, &temp->dungeonLocation);
RestoreIntegerBits(&backup, &temp->speciesNum, 9);
xxx_restore_poke_sub_c_808F410(&backup, &temp->unkC[0]);
xxx_restore_poke_sub_c_808F410(&backup, &temp->unkC[1]);
@ -84,7 +84,7 @@ u32 sub_8095624(u8 *a, u32 b)
SaveIntegerBits(&backup, &temp->unk0, 2);
SaveIntegerBits(&backup, &temp->isLeader, 1);
SaveIntegerBits(&backup, &temp->unkHasNextStage, 7);
SaveDungeonLocation(&backup, &temp->unk4);
SaveDungeonLocation(&backup, &temp->dungeonLocation);
SaveIntegerBits(&backup, &temp->speciesNum, 9);
xxx_save_poke_sub_c_808F41C(&backup, &temp->unkC[0]);
xxx_save_poke_sub_c_808F41C(&backup, &temp->unkC[1]);

View File

@ -6,40 +6,19 @@
#include "sub_8095228.h"
#include "wonder_mail.h"
#include "constants/wonder_mail.h"
struct subStruct_203B490
{
// size: 0xC
u8 unk0;
u8 unk1;
u32 unk4;
u32 unk8;
};
struct unkStruct_203B490
{
// size: 0x330?
u8 fill0[0x190];
u8 unk190[0x28];
u8 unk1B8[0x78];
struct subStruct_203B490 unk230[16];
u8 unk2F0[0x38];
u8 unk328;
};
#include "dungeon.h"
#include "code_80958E8.h"
extern bool8 sub_809095C(u8);
extern s32 GetDungeonFloorCount(u8);
extern bool8 sub_809017C(u8 *);
extern bool8 sub_809017C(struct DungeonLocation *);
extern s16 GetBaseSpecies(s16);
extern bool8 IsInvalidItemReward(u8);
extern u8 sub_803C1D0(u8 *, u8);
extern u8 sub_803C1D0(struct DungeonLocation *, u8);
extern bool8 IsNotMoneyOrUsedTMItem(u8);
extern u8 xxx_bit_lut_lookup_8091E50(u8 ,u8 );
extern u32 GetMaxItemCount(u8);
extern u8 sub_803C0DC(s16);
extern bool8 sub_803C0DC(s16);
extern void sub_8096040(u8);
extern void sub_80965B8(u8);
extern void sub_8096C3C(u8);
@ -82,7 +61,7 @@ void sub_8095900(void)
MemoryClear8(gUnknown_203B490->unk1B8, sizeof(gUnknown_203B490->unk1B8));
for(iVar2 = 0; iVar2 < 16; iVar2++)
{
gUnknown_203B490->unk230[iVar2].unk0 = 99;
gUnknown_203B490->unk230[iVar2].dungeon = 99;
gUnknown_203B490->unk230[iVar2].unk1 = 1;
gUnknown_203B490->unk230[iVar2].unk4 = 0;
gUnknown_203B490->unk230[iVar2].unk8 = 0;
@ -111,17 +90,17 @@ bool8 ValidateWonderMail(struct WonderMail *data)
return FALSE;
else
{
if(data->missionType == WONDER_MAIL_MISSION_TYPE_DELIVER_ITEM && GetMaxItemCount(data->dungeon) == 0)
if(data->missionType == WONDER_MAIL_MISSION_TYPE_DELIVER_ITEM && GetMaxItemCount(data->dungeon.dungeonIndex) == 0)
return FALSE;
if(data->unk2 > 9)
return FALSE;
if(sub_809095C(data->dungeon))
if(sub_809095C(data->dungeon.dungeonIndex))
return FALSE;
if(data->floor >= GetDungeonFloorCount(data->dungeon))
if(data->dungeon.dungeonFloor >= GetDungeonFloorCount(data->dungeon.dungeonIndex))
return FALSE;
if(sub_809017C(&(data->dungeon)))
if(sub_809017C(&data->dungeon))
return FALSE;
if(data->clientSpecies == SPECIES_NONE)
@ -130,14 +109,14 @@ bool8 ValidateWonderMail(struct WonderMail *data)
return FALSE;
if(data->clientSpecies != GetBaseSpecies(data->clientSpecies))
return FALSE;
if(sub_803C0DC(data->clientSpecies) == 0)
if(!sub_803C0DC(data->clientSpecies))
return FALSE;
if(data->targetSpecies > SPECIES_RAYQUAZA_CUTSCENE)
return FALSE;
if(data->targetSpecies != GetBaseSpecies(data->targetSpecies))
return FALSE;
if(sub_803C0DC(data->targetSpecies) == 0)
if(!sub_803C0DC(data->targetSpecies))
return FALSE;
// Item Delivery/Finding
@ -153,7 +132,7 @@ bool8 ValidateWonderMail(struct WonderMail *data)
return FALSE;
// Item finding
if(data->missionType == WONDER_MAIL_MISSION_TYPE_FIND_ITEM && xxx_bit_lut_lookup_8091E50(data->dungeon, data->targetItem) == 0)
if(data->missionType == WONDER_MAIL_MISSION_TYPE_FIND_ITEM && xxx_bit_lut_lookup_8091E50(data->dungeon.dungeonIndex, data->targetItem) == 0)
return FALSE;
if(data->rewardType == BLANK_4 || data->rewardType == END_REWARDS || data->rewardType > END_REWARDS)
@ -170,7 +149,7 @@ bool8 ValidateWonderMail(struct WonderMail *data)
{
if(GetFriendAreaUnlockCondition(data->friendAreaReward) != UNLOCK_WONDER_MAIL)
return FALSE;
if(sub_803C1D0(&(data->dungeon), data->missionType) == 0)
if(sub_803C1D0(&data->dungeon, data->missionType) == 0)
return FALSE;
}
return TRUE;

View File

@ -2,42 +2,21 @@
#include "pokemon.h"
#include "wonder_mail.h"
extern void SaveDungeonLocation(struct unkStruct_8094924*, struct DungeonLocation*);
extern void RestoreDungeonLocation(struct unkStruct_8094924*, struct DungeonLocation*);
extern void sub_80015C0(u32, u32);
extern u32 sub_8001784(u32, u32, u16);
struct unkStruct_8097270
{
u8 unk0;
u8 unk1;
u8 unk2;
struct DungeonLocation unk4;
u32 unk8;
u16 unkC;
u16 unkE;
u8 unk10;
u8 unk11;
u8 unk12;
u8 unk13;
};
struct subStruct_203B490
{
// size: 0xC
struct DungeonLocation unk0;
struct DungeonLocation dungeon;
u32 unk4;
u32 unk8;
};
struct unkStruct_203B490
{
// size: 0x330?
struct unkStruct_8097270 unk0[4];
struct unkStruct_8097270 unk50[8];
struct unkStruct_8097270 unkF0[8];
struct WonderMail unk0[4];
struct WonderMail unk50[8];
struct WonderMail unkF0[8];
u8 unk190[0x28];
u8 unk1B8[0x78];
struct subStruct_203B490 unk230[16];
@ -46,9 +25,15 @@ struct unkStruct_203B490
};
extern struct unkStruct_203B490 *gUnknown_203B490;
void sub_8097270(struct unkStruct_8094924 *a, struct unkStruct_8097270 *b);
void sub_80971EC(struct unkStruct_8094924 *a, struct unkStruct_8097270 *b);
void SaveWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b);
void RestoreWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b);
extern s32 sub_8096EB0(void);
extern void SaveDungeonLocation(struct unkStruct_8094924*, struct DungeonLocation*);
extern void RestoreDungeonLocation(struct unkStruct_8094924*, struct DungeonLocation*);
extern void sub_80015C0(u32, u32);
extern u32 sub_8001784(u32, u32, u16);
extern void sub_809674C();
extern void sub_800199C(u32, s32, u32, s32);
bool8 sub_8096F50(struct WonderMail *r0)
{
@ -62,8 +47,8 @@ bool8 sub_8096F50(struct WonderMail *r0)
for(index = 0; index < 0x10; index++)
{
temp = &gUnknown_203B490->unk230[index];
if(temp->unk0.dungeonIndex == r0->dungeon)
if(temp->unk0.dungeonFloor == r0->floor)
if(temp->dungeon.dungeonIndex == r0->dungeon.dungeonIndex)
if(temp->dungeon.dungeonFloor == r0->dungeon.dungeonFloor)
if(temp->unk4 == r0->unk8)
if(temp->unk8 == temp2)
return TRUE;
@ -80,15 +65,15 @@ u32 sub_8096FA0(u8 *r0, u32 size)
xxx_init_struct_8094924_restore_809485C(&backup, r0, size);
for(index = 0; index < 4; index++)
{
sub_80971EC(&backup, &gUnknown_203B490->unk0[index]);
RestoreWonderMail(&backup, &gUnknown_203B490->unk0[index]);
}
for(index = 0; index < 8; index++)
{
sub_80971EC(&backup, &gUnknown_203B490->unk50[index]);
RestoreWonderMail(&backup, &gUnknown_203B490->unk50[index]);
}
for(index = 0; index < 8; index++)
{
sub_80971EC(&backup, &gUnknown_203B490->unkF0[index]);
RestoreWonderMail(&backup, &gUnknown_203B490->unkF0[index]);
}
for(index = 0; index < 0x38; index++)
{
@ -110,7 +95,7 @@ u32 sub_8096FA0(u8 *r0, u32 size)
{
RestoreIntegerBits(&backup, &gUnknown_203B490->unk230[index].unk8, 0x20);
RestoreIntegerBits(&backup, &gUnknown_203B490->unk230[index].unk4, 0x18);
RestoreDungeonLocation(&backup, &gUnknown_203B490->unk230[index].unk0);
RestoreDungeonLocation(&backup, &gUnknown_203B490->unk230[index].dungeon);
}
nullsub_102(&backup);
return backup.unk8;
@ -125,15 +110,15 @@ u32 sub_80970D8(u8 *r0, u32 size)
xxx_init_struct_8094924_save_809486C(&backup, r0, size);
for(index = 0; index < 4; index++)
{
sub_8097270(&backup, &gUnknown_203B490->unk0[index]);
SaveWonderMail(&backup, &gUnknown_203B490->unk0[index]);
}
for(index = 0; index < 8; index++)
{
sub_8097270(&backup, &gUnknown_203B490->unk50[index]);
SaveWonderMail(&backup, &gUnknown_203B490->unk50[index]);
}
for(index = 0; index < 8; index++)
{
sub_8097270(&backup, &gUnknown_203B490->unkF0[index]);
SaveWonderMail(&backup, &gUnknown_203B490->unkF0[index]);
}
for(index = 0; index < 0x38; index++)
{
@ -154,40 +139,40 @@ u32 sub_80970D8(u8 *r0, u32 size)
{
SaveIntegerBits(&backup, &gUnknown_203B490->unk230[index].unk8, 0x20);
SaveIntegerBits(&backup, &gUnknown_203B490->unk230[index].unk4, 0x18);
SaveDungeonLocation(&backup, &gUnknown_203B490->unk230[index].unk0);
SaveDungeonLocation(&backup, &gUnknown_203B490->unk230[index].dungeon);
}
nullsub_102(&backup);
return backup.unk8;
}
void sub_80971EC(struct unkStruct_8094924 *a, struct unkStruct_8097270 *b)
void RestoreWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b)
{
RestoreIntegerBits(a, &b->unk0, 4);
RestoreIntegerBits(a, &b->unk1, 3);
RestoreIntegerBits(a, &b->mailType, 4);
RestoreIntegerBits(a, &b->missionType, 3);
RestoreIntegerBits(a, &b->unk2, 4);
RestoreIntegerBits(a, &b->unkC, 9);
RestoreIntegerBits(a, &b->unkE, 9);
RestoreIntegerBits(a, &b->unk10, 8);
RestoreIntegerBits(a, &b->unk11, 4);
RestoreIntegerBits(a, &b->unk12, 8);
RestoreIntegerBits(a, &b->unk13, 6);
RestoreIntegerBits(a, &b->clientSpecies, 9);
RestoreIntegerBits(a, &b->targetSpecies, 9);
RestoreIntegerBits(a, &b->targetItem, 8);
RestoreIntegerBits(a, &b->rewardType, 4);
RestoreIntegerBits(a, &b->itemReward, 8);
RestoreIntegerBits(a, &b->friendAreaReward, 6);
RestoreIntegerBits(a, &b->unk8, 0x18);
RestoreDungeonLocation(a, &b->unk4);
RestoreDungeonLocation(a, &b->dungeon);
}
void sub_8097270(struct unkStruct_8094924 *a, struct unkStruct_8097270 *b)
void SaveWonderMail(struct unkStruct_8094924 *a, struct WonderMail *b)
{
SaveIntegerBits(a, &b->unk0, 4);
SaveIntegerBits(a, &b->unk1, 3);
SaveIntegerBits(a, &b->mailType, 4);
SaveIntegerBits(a, &b->missionType, 3);
SaveIntegerBits(a, &b->unk2, 4);
SaveIntegerBits(a, &b->unkC, 9);
SaveIntegerBits(a, &b->unkE, 9);
SaveIntegerBits(a, &b->unk10, 8);
SaveIntegerBits(a, &b->unk11, 4);
SaveIntegerBits(a, &b->unk12, 8);
SaveIntegerBits(a, &b->unk13, 6);
SaveIntegerBits(a, &b->clientSpecies, 9);
SaveIntegerBits(a, &b->targetSpecies, 9);
SaveIntegerBits(a, &b->targetItem, 8);
SaveIntegerBits(a, &b->rewardType, 4);
SaveIntegerBits(a, &b->itemReward, 8);
SaveIntegerBits(a, &b->friendAreaReward, 6);
SaveIntegerBits(a, &b->unk8, 0x18);
SaveDungeonLocation(a, &b->unk4);
SaveDungeonLocation(a, &b->dungeon);
}
void sub_80972F4(void)
@ -218,3 +203,43 @@ s32 sub_8097318(s16 param_1)
}
return iVar1;
}
void sub_809733C(short param_1,u32 param_2)
{
s32 uVar2;
u8 param_2_u8;
u16 uVar2_u16;
uVar2 = param_1;
param_2_u8 = param_2;
if (uVar2 != 0xd) {
uVar2_u16 = uVar2;
if ((((sub_8001784(0,0x2c,uVar2_u16) == 0) && (sub_800199C(0,0x2b,uVar2_u16,param_2_u8), param_2_u8 != '\0')))){
switch(uVar2)
{
case 0xE:
case 0xF:
case 0x1C:
sub_809674C();
break;
}
}
}
}
bool32 sub_8097384(s16 param_1)
{
bool32 iVar1;
if (param_1 == 0xd) {
iVar1 = FALSE;
}
else {
iVar1 = sub_8001784(0,0x2c,param_1 & 0xffff);
if (iVar1 != 0) {
iVar1 = TRUE;
}
}
return iVar1;
}

View File

@ -21,40 +21,40 @@ extern const char gAvoidCaptureText[];
extern u8 sub_80A270C();
extern void sub_80015C0(u8, u8);
extern u8 sub_80A2728(s16);
extern u8 sub_8001D08(u32, u32 ,s32);
extern bool8 sub_8001D08(u32, u32 ,s32);
extern u32 sub_8001784(u32, u32, u16);
extern void sub_800199C(u32, u32, u32, u32);
extern u8 sub_80023E4(u32);
extern bool8 sub_80023E4(u32);
const u8 *sub_809747C(s16 r0)
const u8 *sub_809747C(s16 index)
{
if(r0 == 0xD)
if(index == 0xD)
{
return gDummyScenarioText;
}
else
{
return GetDungeonName1(sub_80A270C(r0));
return GetDungeonName1(sub_80A270C(index));
}
}
const u8 *sub_80974A0(s16 r0)
const u8 *sub_80974A0(s16 index)
{
if(r0 == 0xD)
if(index == 0xD)
{
return gDummyScenarioText;
}
else
{
return GetDungeonName1(sub_80A270C(r0));
return GetDungeonName1(sub_80A270C(index));
}
}
const u8 *GetCurrentMissionText(s16 r0)
const u8 *GetCurrentMissionText(s16 index)
{
if(r0 < 0x1F)
if(index < 0x1F)
{
struct MissionText *mt = &gStoryMissionText[r0];
struct MissionText *mt = &gStoryMissionText[index];
return mt->text;
}
else
@ -124,7 +124,7 @@ bool8 sub_8097504(s16 mazeIndex)
uVar3 = 6;
}
if (sub_80023E4(uVar3) == 0) {
if (!sub_80023E4(uVar3)) {
return FALSE;
}
else {
@ -150,9 +150,9 @@ void sub_80975A8(s16 param_1,u8 param_2)
sub_800199C(0,0x2e,param_1_u16,param_2);
}
const u8 *sub_80975C4(s16 r0)
const u8 *sub_80975C4(s16 index)
{
return GetDungeonName1(sub_80A2728(r0));
return GetDungeonName1(sub_80A2728(index));
}
const char *sub_80975DC(u32 r0)
@ -160,7 +160,7 @@ const char *sub_80975DC(u32 r0)
// TODO: slight hack but matches
r0 <<= 16;
if((0xffe90000 + r0) >> 16 < 2)
if(sub_8001D08(0x3, 0xE, -1) != 0)
if(sub_8001D08(0x3, 0xE, -1))
return gMeetNinetalesText;
else
return gAvoidCaptureText;
@ -170,24 +170,24 @@ const char *sub_80975DC(u32 r0)
bool8 HasCompletedAllMazes(void)
{
s32 iVar2;
for(iVar2 = 0; iVar2 < 17; iVar2++)
s32 index;
for(index = 0; index < 17; index++)
{
if(!(bool8)IsMazeCompleted(iVar2))
if(!(bool8)IsMazeCompleted(index))
return FALSE;
}
return TRUE;
}
u32 sub_8097640(void)
bool8 sub_8097640(void)
{
if(sub_8001784(0, 0x2E, 0x1F) == 0 && HasCompletedAllMazes())
{
sub_800199C(0, 0x2E, 0x1F, 1);
return 1;
return TRUE;
}
else
{
return 0;
return FALSE;
}
}

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "code_8092334.h"
#include "pokemon.h"
#include "exclusive_pokemon.h"
struct unkStruct_203B494
{
@ -23,10 +24,8 @@ extern struct unkStruct_203B494 *gUnknown_203B494;
extern void SaveDungeonLocation(struct unkStruct_8094924*, struct DungeonLocation*);
extern void RestoreDungeonLocation(struct unkStruct_8094924*, struct DungeonLocation*);
void ReadExclusivePokemon(struct unkStruct_8094924 *r0);
void ReadGameOptions(struct unkStruct_8094924 *param_1);
void ReadPlayTime(struct unkStruct_8094924 *r0);
void WriteExclusivePokemon(struct unkStruct_8094924 *r0);
void WriteGameOptions(struct unkStruct_8094924 *param_1);
void WritePlayTime(struct unkStruct_8094924 *r0);
@ -88,3 +87,13 @@ u32 sub_8097D98(u8 *r0, u32 size)
nullsub_102(&backup);
return backup.unk8;
}
bool8 sub_8097DD0(s32 *param_1, s32 *param_2)
{
if ((param_1[0] == param_2[0]) && (param_1[1] == param_2[1])) {
return TRUE;
}
else {
return FALSE;
}
}

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "code_80A26CC.h"
extern u8 sub_80023E4(u32);
extern bool8 sub_80023E4(u32);
extern u8 sub_80973F4(s16);
extern u8 sub_8097384(s16);
s16 sub_80A26B8(s16);
@ -13,6 +13,23 @@ extern s16 gUnknown_8116F9A[];
extern s16 gUnknown_8116F24[];
extern const u8 *gUnknown_8117000[];
extern void sub_809AC18(s32, s32);
extern void sub_809ABB4(s32, s32);
void sub_80A2584(s16 r0, s16 r1)
{
s32 iVar2 = r1;
s32 iVar1 = r0;
sub_809ABB4(iVar1, iVar2);
}
void sub_80A2598(s16 r0, s16 r1)
{
s32 iVar2 = r1;
s32 iVar1 = r0;
sub_809AC18(iVar1, iVar2);
}
u32 sub_80A25AC(u16 param_1)
{
if (sub_8098F88() != 0) {
@ -23,10 +40,10 @@ u32 sub_80A25AC(u16 param_1)
if (param_1 == 0x32) {
return 0x32;
}
else if (sub_80023E4(0xc) == 0) {
else if (!sub_80023E4(0xc)) {
return 999;
}
else if (sub_80023E4(0xd) != 0) {
else if (sub_80023E4(0xd)) {
return 0x13;
}
else if (param_1 != 1) {
@ -40,27 +57,27 @@ u32 sub_80A25AC(u16 param_1)
}
}
struct unkStruct_80A2608 *sub_80A2608(s16 r0)
struct unkStruct_80A2608 *sub_80A2608(s16 index)
{
return &gUnknown_81168A8[r0];
return &gUnknown_81168A8[index];
}
struct unkStruct_80A2608 *sub_80A2620(s16 r0)
struct unkStruct_80A2608 *sub_80A2620(s16 index)
{
u32 temp;
temp = sub_80A26B8(r0);
temp = sub_80A26B8(index);
return &gUnknown_81168A8[temp];
}
s16 sub_80A2644(u32 r0)
s16 sub_80A2644(u32 index)
{
return gUnknown_8116F24[r0];
return gUnknown_8116F24[index];
}
s16 sub_80A2654(s16 r0)
s16 sub_80A2654(s16 index)
{
struct unkStruct_80A2608 *temp;
temp = sub_80A2608(r0);
temp = sub_80A2608(index);
return temp->unkE;
}
@ -111,7 +128,7 @@ s16 sub_80A26CC(s16 r0)
}
s32 sub_80A26D8(u8 r0)
s32 sub_80A26D8(u8 index)
{
s32 counter;
s32 counter2;
@ -124,7 +141,7 @@ s32 sub_80A26D8(u8 r0)
temp = sub_80A2608(counter2);
if(temp->unk11 != 0)
{
if(temp->unkC == r0)
if(temp->dungeonIndex == index)
{
return counter2;
}
@ -133,29 +150,29 @@ s32 sub_80A26D8(u8 r0)
return -1;
}
u8 sub_80A270C(s16 r0)
u8 sub_80A270C(s16 index)
{
struct unkStruct_80A2608 *temp;
s32 temp_number;
s32 index_s32;
temp_number = r0; // forcing a shift before addressing
temp = sub_80A2608(gUnknown_8116F9A[temp_number]);
return temp->unkC;
index_s32 = index; // forcing a shift before addressing
temp = sub_80A2608(gUnknown_8116F9A[index_s32]);
return temp->dungeonIndex;
}
u8 sub_80A2728(s16 r0)
u8 sub_80A2728(s16 index)
{
struct unkStruct_80A2608 *temp;
s16 temp_number = (0xDC >> 2) + r0;
s16 temp_number = (0xDC >> 2) + index;
temp = sub_80A2608(temp_number);
return temp->unkC;
return temp->dungeonIndex;
}
u8 sub_80A2740(s32 r0)
u8 sub_80A2740(s32 index)
{
struct unkStruct_80A2608 *temp;
temp = sub_80A2608(r0);
return temp->unkC;
temp = sub_80A2608(index);
return temp->dungeonIndex;
}
s16 sub_80A2750(s16 r0)
@ -182,16 +199,16 @@ s16 sub_80A2750(s16 r0)
temp = sub_80A2608(temp_2);
if(temp->unkE == -1)
return 1;
if(sub_80023E4(5) != 0)
if(sub_80023E4(5))
return 1;
if(sub_80973F4(temp->unkE) == 0)
return 1;
if(sub_80023E4(1) == 0)
if(!sub_80023E4(1))
return 1;
return 2;
}
u8 sub_80A27CC(s16 r0)
bool8 sub_80A27CC(s16 r0)
{
s32 temp;
s32 temp2;
@ -203,38 +220,38 @@ u8 sub_80A27CC(s16 r0)
return_var = sub_80A2620(r0);
if(return_var->unk0 == -1)
return 0;
if(sub_80023E4(5) != 0)
return 0;
return FALSE;
if(sub_80023E4(5))
return FALSE;
if(sub_8097384(r0) != 0)
return 1;
if(sub_80023E4(1) == 0)
return 0;
return TRUE;
if(!sub_80023E4(1))
return FALSE;
if(sub_80973F4(temp) == 0)
return 0;
return 1;
return FALSE;
return TRUE;
}
u8 sub_80A2824(u8 r0)
bool8 sub_80A2824(u8 index)
{
s32 counter;
struct unkStruct_80A2608 *temp;
if(sub_80023E4(5) != 0)
return 0;
if(sub_80023E4(1) != 0)
if(sub_80023E4(5))
return FALSE;
if(sub_80023E4(1))
{
for(counter = 0; counter <= 0x2D; counter++)
{
temp = sub_80A2620(counter);
if(temp->unk11 != 0)
{
if(temp->unkC == r0)
if(temp->dungeonIndex == index)
{
if(sub_8097384(counter) != 0)
return 1;
return TRUE;
if(sub_80973F4(counter) != 0)
return 1;
return TRUE;
}
}
}
@ -245,16 +262,16 @@ u8 sub_80A2824(u8 r0)
{
temp = sub_80A2620(counter);
if(temp->unk11 != 0)
if(temp->unkC == r0)
if(temp->dungeonIndex == index)
if(sub_8097384(counter) != 0)
return 1;
return TRUE;
}
}
return 0;
return FALSE;
}
u32 sub_80A28B4(s16 r0)
bool8 sub_80A28B4(s16 r0)
{
struct unkStruct_80A2608 *temp;
@ -262,14 +279,14 @@ u32 sub_80A28B4(s16 r0)
if(temp->unk0 != -1)
{
if(sub_8097384(r0) == 0 && sub_80973F4(r0) == 0)
return 0;
return FALSE;
else
return 1;
return TRUE;
}
return 0;
return FALSE;
}
u32 sub_80A28F0(u8 r0)
bool8 sub_80A28F0(u8 index)
{
s32 counter;
struct unkStruct_80A2608 *temp;
@ -279,16 +296,16 @@ u32 sub_80A28F0(u8 r0)
temp = sub_80A2620(counter);
if(temp->unk11 != 0)
{
if(temp->unkC == r0)
if(temp->dungeonIndex == index)
{
if(sub_8097384(counter) != 0)
return 1;
return TRUE;
if(sub_80973F4(counter) != 0)
return 1;
return TRUE;
}
}
}
return 0;
return FALSE;
}
s32 sub_80A293C(u8 *param_1)
@ -315,7 +332,7 @@ s32 sub_80A293C(u8 *param_1)
iVar3 = sub_80A2620(index);
if ((iVar3->unk11 != 0) &&
(sub_8097384(index) != 0)) {
local_68[iVar3->unkC] = 1;
local_68[iVar3->dungeonIndex] = 1;
}
}
@ -356,13 +373,13 @@ s32 sub_80A29B0(u8 *param_1)
} while ((int)pcVar2 >= (int)local_68);
if (sub_80023E4(1) != 0) {
if (sub_80023E4(1)) {
for(index = 0; index < 0x2E; index++)
{
iVar3 = sub_80A2620(index);
if ((iVar3->unk11 != 0) &&
(sub_80973F4(index) != 0)) {
local_68[iVar3->unkC] = 1;
local_68[iVar3->dungeonIndex] = 1;
}
}
}
@ -399,13 +416,13 @@ s32 sub_80A2A5C(u8 *param_1)
pcVar2--;
} while ((s32)pcVar2 >= (s32)local_58);
if (sub_80023E4(1) != 0) {
if (sub_80023E4(1)) {
for(index = 0; index < 0x2E; index++)
{
iVar3 = sub_80A2620(index);
if ((iVar3->unk11 != 0) && ((sub_8097384(index) != 0) || (sub_80973F4(index) != 0)))
{
local_58[iVar3->unkC] = 1;
local_58[iVar3->dungeonIndex] = 1;
}
}
}
@ -415,7 +432,7 @@ s32 sub_80A2A5C(u8 *param_1)
iVar3 = sub_80A2620(index);
if ((iVar3->unk11 != 0) && (sub_8097384(index) != 0))
{
local_58[iVar3->unkC] = 1;
local_58[iVar3->dungeonIndex] = 1;
}
}
}

View File

@ -48,7 +48,7 @@ void sub_80A7784(void)
}
}
u8 sub_80A77A0(s16 r0, u32 r1)
u8 sub_80A77A0(s16 r0)
{
s32 temp;
s32 temp2;

View File

@ -1,9 +1,14 @@
#include "global.h"
#include "constants/friend_area.h"
#include "debug_menu.h"
#include "friend_area.h"
#include "input.h"
#include "main_menu.h"
#include "menu.h"
#include "memory.h"
#include "pokemon.h"
#include "save.h"
#include "text_util.h"
extern struct DebugMenu *gUnknown_203B3EC;
@ -58,6 +63,8 @@ extern void sub_803A3A0(void);
extern void SetMenuItems(void *menu, struct UnkTextStruct2 *, u32, const struct UnkTextStruct2 *, const struct MenuItem *entries, u32, u32, u32);
extern void sub_8035CF4(struct DebugMenu *, u32, u32);
extern void sub_8035CC0(struct UnkTextStruct2 *, u32);
extern void sub_808D1DC(u8 *);
extern void sub_808CFD0(u8 *, s32, u8 *, u32, u32 *, u16 *);
void CreateDebugMenu(void)
{
@ -148,3 +155,44 @@ void sub_803A3A0(void)
{
sub_8035CC0(gUnknown_203B3EC->unk140, 0);
}
void sub_803A3BC(void)
{
s32 speciesIndex;
u8 sp_0x8 [88];
u16 r7 [4]; // r7
u8 buffer [20]; // r6
u32 sp_0x7C;
s32 sp_0x80;
#ifndef NONMATCHING
register s32 index asm("r5");
register u32 r9 asm("r9");
#else
s32 index;
u32 r9;
#endif
index = 1;
do {
UnlockFriendArea(index);
index++;
} while (index < NUM_FRIEND_AREAS);
index = 0;
do {
r9 = 0;
sp_0x7C = 0x1006;
index = index + 1;
speciesIndex = index * 0x10000 >> 0x10; // dumb way to force s16
memset(r7,0,8);
r7[0] = 0x27;
CopySpeciesNametoBuffer(buffer, speciesIndex);
CopyStringtoBuffer(buffer, buffer);
buffer[0] = 0x40;
sub_808CFD0(sp_0x8,speciesIndex,buffer,0x43,&sp_0x7C,r7);
sub_808D1DC(sp_0x8);
} while (index < 300);
sp_0x80 = r9;
WriteSavetoPak(&sp_0x80,1);
}

View File

@ -161,7 +161,7 @@ void sub_803A504(u32 newState)
void sub_803A51C(void)
{
s32 iVar4;
s32 index;
sub_8006518(gUnknown_203B3F0->unkD8);
switch(gUnknown_203B3F0->state)
@ -173,9 +173,9 @@ void sub_803A51C(void)
gUnknown_203B3F0->unkD8[2] = gUnknown_80E7E4C;
break;
default:
for(iVar4 = 0; iVar4 < 4; iVar4++)
for(index = 0; index < 4; index++)
{
gUnknown_203B3F0->unkD8[iVar4] = gUnknown_80E7E34;
gUnknown_203B3F0->unkD8[index] = gUnknown_80E7E34;
}
break;
}
@ -185,7 +185,7 @@ void sub_803A51C(void)
void sub_803A5A0(void)
{
struct ItemSlot auStack8;
struct ItemSlot item;
switch(gUnknown_203B3F0->state) {
case 0:
@ -212,8 +212,8 @@ void sub_803A5A0(void)
sub_803A690();
break;
case 4:
xxx_init_itemslot_8090A8C(&auStack8,gUnknown_203B3F0->itemIndex,0);
sub_801B3C0(&auStack8);
xxx_init_itemslot_8090A8C(&item,gUnknown_203B3F0->itemIndex,0);
sub_801B3C0(&item);
break;
case 5:
break;

58
src/dungeon_2_1.c Normal file
View File

@ -0,0 +1,58 @@
#include "global.h"
#include "dungeon.h"
#include "constants/dungeon.h"
#include "code_800D090.h"
#include "pokemon.h"
#include "random.h"
#include "code_8092334.h"
extern u8 gUnknown_810A350[];
extern u8 gDungeonFloorCount[];
extern u8 *gUnknown_8108084[];
s32 sub_8091E94(s32 a1, s32 a2, s32 a3); // items.c
u32 sub_80908D8(struct DungeonLocation *dungeon)
{
if ((dungeon->dungeonIndex < DUNGEON_OUT_ON_RESCUE) && (dungeon->dungeonFloor < gDungeonFloorCount[dungeon->dungeonIndex])) {
return gUnknown_8108084[dungeon->dungeonIndex][dungeon->dungeonFloor];
}
else {
return 1;
}
}
u8 sub_8090910(struct DungeonLocation *dungeon, u32 param_2)
{
u32 rand1;
u32 rand2;
rand1 = RandomCapped(9999);
rand2 = RandomCapped(9999);
if ((dungeon->dungeonIndex < DUNGEON_OUT_ON_RESCUE) && (dungeon->dungeonFloor < gDungeonFloorCount[dungeon->dungeonIndex])) {
return sub_8091E94(param_2, rand1, rand2);
}
else {
return 0x46;
}
}
bool8 sub_809095C(u8 dungeon)
{
s32 counter;
if (dungeon >= DUNGEON_OUT_ON_RESCUE) {
return TRUE;
}
else
{
counter = 0;
if (gUnknown_810A350[0] != DUNGEON_OUT_ON_RESCUE) {
for(; gUnknown_810A350[counter] != DUNGEON_OUT_ON_RESCUE; counter++)
{
if (gUnknown_810A350[counter] == dungeon) return TRUE;
}
}
return FALSE;
}
}

View File

@ -1,9 +1,250 @@
#include "global.h"
#include "dungeon_action.h"
#include "constants/ability.h"
#include "constants/dungeon_action.h"
#include "dungeon_ai.h"
#include "dungeon_entity.h"
#include "dungeon_global_data.h"
#include "dungeon_leader.h"
#include "dungeon_util.h"
#include "dungeon_pokemon_attributes.h"
#include "pokemon.h"
#include "item.h"
#include "status_checks_1.h"
extern u8 *gUnknown_80F91EC[];
extern u8 *gUnknown_80F7C50[];
extern u8 gUnknown_80F697C[];
extern s16 gSpeedTurns[2][0x19];
struct ItemText
{
u8 *desc;
u8 *useText;
};
extern const struct ItemText gActions[];
extern void sub_8071B48(void);
extern void sub_8043ED0(u32);
extern u8 sub_8043D10(void);
extern bool8 sub_8044B28(void);
extern void sub_8086AC0(void);
extern void sub_8043ED0(u32);
extern void sub_807EAA0(u32, u32);
extern void UseAttack(u32);
extern void sub_8071B48(void);
extern void TriggerWeatherAbilities(void);
extern void sub_8074094(struct DungeonEntity *);
extern void sub_8071DA4(struct DungeonEntity *);
extern u8 sub_8072CF4(struct DungeonEntity *);
extern void TickStatusHeal(struct DungeonEntity *);
void sub_8044820(void)
{
s32 movSpeed;
struct DungeonEntityData *entityData;
struct DungeonEntityData *entityData2;
struct DungeonEntity * entity;
struct DungeonEntity * entity2;
s32 index;
for (index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) {
entity = gDungeonGlobalData->wildPokemon[index];
if (EntityExists(entity)) {
if (sub_8044B28()) break;
entityData = entity->entityData;
gDungeonGlobalData->unkB8 = entity;
TriggerWeatherAbilities();
if ((entityData->flags & MOVEMENT_FLAG_SWAPPED_PLACES_PETRIFIED) == 0) {
if ((u16)(entityData->flags & MOVEMENT_FLAG_UNK_14) != 0) {
entityData->flags &= ~(MOVEMENT_FLAG_UNK_14);
}
else
{
entityData->movingIntoTarget = FALSE;
movSpeed = GetMovementSpeed(entity);
if (gSpeedTurns[movSpeed][gDungeonGlobalData->speedTurnCounter] != 0) {
if (!entityData->attacking) {
entityData->flags &= ~(MOVEMENT_FLAG_UNK_14 | MOVEMENT_FLAG_SWAPPED_PLACES_PETRIFIED);
entityData->recalculateFollow = FALSE;
TickStatusHeal(entity);
if (EntityExists(entity)) {
sub_8071DA4(entity);
DecideAction(entity, 0);
if (sub_8044B28()) break;
sub_8072CF4(entity);
sub_8086AC0();
sub_8043ED0(0);
if (sub_8044B28()) break;
}
}
}
}
}
}
}
if (sub_8044B28() == 0) {
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
entity2 = gDungeonGlobalData->wildPokemon[index];
if ((EntityExists(entity2)) && (entityData2 = entity2->entityData, entityData2->movingIntoTarget))
{
sub_8074094(entity2);
if (EntityExists(entity2)) {
sub_8071DA4(entity2);
entityData2->movingIntoTarget = FALSE;
}
}
}
}
}
void CheckElectricAbilities(void)
{
struct DungeonEntityData * entityData;
struct DungeonEntityData * entityData2;
struct DungeonEntity *entity;
u32 isNotEnemy;
s32 index;
if (gSpeedTurns[1][gDungeonGlobalData->speedTurnCounter] != 0) {
sub_8071B48();
gDungeonGlobalData->hasPlus[0] = FALSE;
gDungeonGlobalData->hasPlus[1] = FALSE;
gDungeonGlobalData->hasMinus[0] = FALSE;
gDungeonGlobalData->hasMinus[1] = FALSE;
gDungeonGlobalData->lightningRodPokemon = NULL;
gDungeonGlobalData->unk17B38 = 2;
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeonGlobalData->allPokemon[index];
if (EntityExists(entity)) {
entityData = entity->entityData;
entityData2 = entityData;
entityData->attacking = FALSE;
if(entityData->isEnemy)
{
isNotEnemy = FALSE;
}
else {
isNotEnemy = TRUE;
}
if (HasAbility(entity, ABILITY_LIGHTNINGROD)) {
gDungeonGlobalData->lightningRodPokemon = entity;
gDungeonGlobalData->unk17B38 = entityData2->unk98;
}
if (HasAbility(entity, ABILITY_MINUS)) {
gDungeonGlobalData->hasMinus[isNotEnemy] = TRUE;
}
if (HasAbility(entity, ABILITY_PLUS)) {
gDungeonGlobalData->hasPlus[isNotEnemy] = TRUE;
}
}
}
sub_8043ED0(0);
}
}
void sub_8044AB4(void)
{
s32 index;
if (gSpeedTurns[1][gDungeonGlobalData->speedTurnCounter + 1] != 0) {
for (index = 0; index < DUNGEON_MAX_POKEMON; index++) {
if (EntityExists(gDungeonGlobalData->allPokemon[index])) {
UseAttack(0);
break;
}
}
sub_807EAA0(1,0);
sub_8086AC0();
sub_8043ED0(0);
}
}
bool8 sub_8044B28(void)
{
if (gDungeonGlobalData->unk4 == 0) {
if (GetLeaderEntity() == NULL) {
gDungeonGlobalData->unk654 = 1;
}
else if (gDungeonGlobalData->unk2 == 1) {
gDungeonGlobalData->unk654 = 2;
}
else if (gDungeonGlobalData->unk2 != 2) {
return FALSE;
}
else {
gDungeonGlobalData->unk654 = 2;
}
}
return TRUE;
}
bool8 sub_8044B84(void)
{
if(gDungeonGlobalData->unk10 != 0)
{
return TRUE;
}
else {
return sub_8044B28();
}
}
u8 *sub_8044BA8(u16 param_1, u8 itemIndex)
{
u32 uVar3;
u32 uVar4;
if ((param_1 == 0x26) && (sub_8043D10() == 2)) {
return *gUnknown_80F91EC;
}
else {
uVar3 = uVar4 = strcmp(gUnknown_80F7C50[param_1 << 1], gUnknown_80F697C);
if (uVar3 != 0) {
uVar4 = 1;
}
if ((u8)(uVar4) == 0) {
return gActions[GetItemCategory(itemIndex)].useText;
}
else
{
return gUnknown_80F7C50[param_1 << 1];
}
}
}
void sub_8044C10(u8 param_1)
{
struct DungeonEntityData * entityData = GetLeaderEntityData();
entityData->action.action = DUNGEON_ACTION_NONE;
if(param_1)
{
entityData->action.actionUseIndex = 0;
entityData->action.unkC = 0;
entityData->action.itemTargetPosition.x = -1;
entityData->action.itemTargetPosition.y = -1;
}
}
void sub_8044C50(u16 action)
{
struct DungeonEntityData * entityData = GetLeaderEntityData();
entityData->action.action = action;
entityData->action.actionUseIndex = 0;
entityData->action.unkC = 0;
entityData->action.itemTargetPosition.x = -1;
entityData->action.itemTargetPosition.y = -1;
}
void ResetAction(struct DungeonActionContainer *actionPointer)
{

View File

@ -5,17 +5,23 @@
#include "constants/dungeon_action.h"
#include "constants/direction.h"
#include "constants/iq_skill.h"
#include "constants/item.h"
#include "constants/status.h"
#include "constants/targeting.h"
#include "constants/type.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "dungeon_action.h"
#include "dungeon_ai_attack.h"
#include "dungeon_ai_items.h"
#include "dungeon_ai_movement.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_capabilities_1.h"
#include "dungeon_global_data.h"
#include "dungeon_items.h"
#include "dungeon_leader.h"
#include "dungeon_map_access.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
@ -25,27 +31,18 @@
#include "pokemon.h"
#include "status_checks.h"
#include "targeting.h"
#include "tile_types.h"
extern char gAvailablePokemonNames[];
extern char *gPtrCouldntBeUsedMessage;
extern char *gPtrItsaMonsterHouseMessage;
extern u8 *gUnknown_80FB380[];
extern u8 *gUnknown_80FB384[];
extern u8 *gUnknown_80FB338[];
extern u8 *gUnknown_80FB318[];
extern u8 *gUnknown_80FB35C[];
extern void DungeonEntityUpdateStatusSprites(struct DungeonEntity *);
extern void SetMessageArgument(char[], struct DungeonEntity*, u32);
extern u8 sub_8044B28(void);
extern void sub_807AB38(struct DungeonEntity *, u32);
extern void sub_8041888(u32);
extern u8 sub_803F428(s16 *);
extern void sub_803E708(u32, u32);
extern u8 sub_8075CFC(struct DungeonEntity *, struct DungeonEntity *, u32, u32);
extern void sub_8041AF4(struct DungeonEntity *);
extern void sub_80522F4(struct DungeonEntity *r1, struct DungeonEntity *r2, u8 *);
extern void sub_806CE68(struct DungeonEntity *, s32);
u32 sub_8075818(struct DungeonEntity *entity)
{
@ -162,7 +159,7 @@ void sub_8075900(struct DungeonEntity *pokemon, u8 r1)
}
}
void DecideAction(struct DungeonEntity *pokemon)
void DecideAction(struct DungeonEntity *pokemon, u32 unused)
{
struct DungeonEntityData *pokemonData = pokemon->entityData;
if (pokemonData->flags & MOVEMENT_FLAG_SWAPPED_PLACES_PETRIFIED)
@ -281,79 +278,3 @@ void DecideAction(struct DungeonEntity *pokemon)
}
}
}
void sub_8075BA4(struct DungeonEntity *param_1,char param_2)
{
struct DungeonEntityData * iVar2 = param_1->entityData;
if ((param_2 != '\0') && (iVar2->volatileStatus == VOLATILE_STATUS_COWERING)) {
iVar2->action.facingDir = (iVar2->action.facingDir + 4) & DIRECTION_MASK;
TargetTileInFront(param_1);
}
else if (iVar2->volatileStatus == VOLATILE_STATUS_CONFUSED) {
iVar2->action.facingDir = DungeonRandomCapped(NUM_DIRECTIONS);
TargetTileInFront(param_1);
}
}
u8 sub_8075BF4(struct DungeonEntity * pokemon, s32 sleepTurns)
{
struct DungeonEntityData *entityData;
u32 uVar4;
uVar4 = 0;
if (!EntityExists(pokemon)){
return uVar4;
}
else
{
entityData = pokemon->entityData;
if(entityData->sleepStatus != SLEEP_STATUS_NIGHTMARE && entityData->sleepStatus != SLEEP_STATUS_SLEEP)
{
entityData->sleepStatus = SLEEP_STATUS_SLEEP;
if ((sleepTurns != 0x7f) && HasAbility(pokemon, ABILITY_EARLY_BIRD) &&
(sleepTurns = sleepTurns / 2, sleepTurns < 1)) {
sleepTurns = 1;
}
entityData->sleepStatusTurnsLeft = sleepTurns;
}
else if(entityData->sleepStatus == SLEEP_STATUS_SLEEP)
uVar4 = 1;
else if(entityData->sleepStatus == SLEEP_STATUS_NIGHTMARE)
uVar4 = 2;
DungeonEntityUpdateStatusSprites(pokemon);
}
return uVar4;
}
void sub_8075C58(struct DungeonEntity * pokemon, struct DungeonEntity * target, s32 param_3, u8 param_4)
{
u8 sleepStatus;
u8 cVar2;
if (sub_8075CFC(pokemon,target,1,param_4) == '\0') {
sleepStatus = target->entityData->sleepStatus;
if (sleepStatus == SLEEP_STATUS_SLEEPLESS) {
if (param_4)
sub_80522F4(pokemon,target,*gUnknown_80FB380);
}
else if (sleepStatus == SLEEP_STATUS_NAPPING) {
if (param_4)
sub_80522F4(pokemon,target,*gUnknown_80FB384);
}
else {
sub_8041AF4(target);
cVar2 = sub_8075BF4(target,param_3);
sub_806CE68(target,8);
if (cVar2 == 1)
sub_80522F4(pokemon,target,*gUnknown_80FB338);
else if (cVar2 == 2)
sub_80522F4(pokemon,target,*gUnknown_80FB35C);
else
sub_80522F4(pokemon,target,*gUnknown_80FB318);
}
}
}

Some files were not shown because too many files have changed in this diff Show More