Merge pull request #197 from AnonymousRandomPerson/master

Moved Kermalis's decomped functions to C
This commit is contained in:
AnonymousRandomPerson
2024-07-20 13:03:46 -04:00
committed by GitHub
45 changed files with 6484 additions and 6496 deletions

File diff suppressed because it is too large Load Diff

2152
asm/code_800E9E4.s Normal file

File diff suppressed because it is too large Load Diff

2653
asm/code_800F990.s Normal file

File diff suppressed because it is too large Load Diff

938
asm/code_8010F28.s Normal file
View File

@@ -0,0 +1,938 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_8010F28
sub_8010F28:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x18
add r0, sp, 0x8
bl sub_8004E8C
add r1, sp, 0x8
ldr r0, _08011080
strh r0, [r1, 0x4]
movs r0, 0x80
lsls r0, 4
strh r0, [r1, 0xA]
ldr r6, _08011084
ldr r0, [r6]
ldr r2, _08011088
adds r1, r0, r2
ldr r1, [r1]
mov r8, r1
ldr r4, _0801108C
adds r0, r4
bl sub_80054BC
ldr r3, [r6]
adds r4, r3, r4
ldr r7, _08011090
adds r0, r3, r7
movs r2, 0
ldrsh r1, [r0, r2]
mov r7, r8
lsls r5, r7, 16
asrs r5, 16
subs r1, r5
ldr r2, _08011094
adds r0, r3, r2
movs r7, 0
ldrsh r2, [r0, r7]
mov r7, r8
asrs r0, r7, 16
subs r2, r0
ldr r0, _08011098
adds r3, r0
ldr r0, [r3]
str r0, [sp]
add r3, sp, 0x8
str r3, [sp, 0x4]
adds r0, r4, 0
movs r3, 0x3
bl DoAxFrame_800558C
movs r7, 0
mov r10, r6
ldr r6, _0801109C
mov r9, r5
_08010F98:
mov r4, r10
ldr r0, [r4]
adds r4, r0, r6
ldr r1, _080110A0
adds r0, r1
lsls r1, r7, 5
ldr r0, [r0]
adds r5, r0, r1
ldrb r0, [r4]
cmp r0, 0
beq _08010FD8
adds r4, 0x14
adds r0, r4, 0
bl sub_80054BC
movs r2, 0x4
ldrsh r1, [r5, r2]
mov r3, r9
subs r1, r3
movs r0, 0x6
ldrsh r2, [r5, r0]
mov r3, r8
asrs r0, r3, 16
subs r2, r0
movs r0, 0
str r0, [sp]
add r0, sp, 0x8
str r0, [sp, 0x4]
adds r0, r4, 0
movs r3, 0x1
bl DoAxFrame_800558C
_08010FD8:
adds r6, 0x50
adds r7, 0x1
cmp r7, 0x1F
ble _08010F98
movs r5, 0
ldr r1, _08011084
mov r9, r1
ldr r6, _080110A4
movs r2, 0
str r2, [sp, 0x14]
_08010FEC:
mov r3, r9
ldr r1, [r3]
ldr r4, [sp, 0x14]
adds r0, r4, r1
ldr r7, _080110A4
adds r0, r7
ldrh r0, [r0]
lsrs r0, 15
cmp r0, 0
beq _08011062
adds r0, r1, r6
bl sub_80054BC
ldr r0, _080110A8
ldrh r0, [r0]
movs r2, 0x80
lsls r2, 1
adds r1, r2, 0
ands r0, r1
cmp r0, 0
beq _0801101E
movs r0, 0x1
ands r0, r5
cmp r0, 0
beq _08011062
_0801101E:
mov r3, r9
ldr r4, [r3]
adds r0, r4, r6
ldr r1, _080110AC
lsls r3, r5, 2
adds r3, r1
movs r7, 0
ldrsh r1, [r3, r7]
ldr r7, _08011090
adds r2, r4, r7
movs r7, 0
ldrsh r2, [r2, r7]
adds r1, r2
mov r7, r8
lsls r2, r7, 16
asrs r2, 16
subs r1, r2
movs r7, 0x2
ldrsh r2, [r3, r7]
ldr r3, _08011094
adds r3, r4
movs r4, 0
ldrsh r3, [r3, r4]
adds r2, r3
mov r7, r8
asrs r3, r7, 16
subs r2, r3
movs r3, 0
str r3, [sp]
add r3, sp, 0x8
str r3, [sp, 0x4]
movs r3, 0x2
bl DoAxFrame_800558C
_08011062:
adds r6, 0x3C
ldr r4, [sp, 0x14]
adds r4, 0x3C
str r4, [sp, 0x14]
adds r5, 0x1
cmp r5, 0x7
ble _08010FEC
add sp, 0x18
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08011080: .4byte 0x0000f3ff
_08011084: .4byte gUnknown_203B0E4
_08011088: .4byte 0x00004dd4
_0801108C: .4byte 0x00004c10
_08011090: .4byte 0x00004dd8
_08011094: .4byte 0x00004dda
_08011098: .4byte 0x00004dd0
_0801109C: .4byte 0x00004018
_080110A0: .4byte 0x00004014
_080110A4: .4byte 0x00004a30
_080110A8: .4byte gRealInputs
_080110AC: .4byte gUnknown_80D40C4
thumb_func_end sub_8010F28
thumb_func_start sub_80110B0
sub_80110B0:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x4
ldr r0, _08011150
ldr r1, [r0]
ldr r2, _08011154
adds r1, r2
ldrh r1, [r1]
lsls r1, 16
asrs r6, r1, 19
adds r2, r6, 0
movs r3, 0
mov r10, r0
movs r0, 0x1F
mov r9, r0
_080110D4:
mov r1, r10
ldr r0, [r1]
ldr r1, _08011158
adds r0, r1
ldrh r0, [r0]
lsls r0, 16
asrs r4, r0, 19
lsls r1, r2, 7
adds r2, 0x1
mov r12, r2
adds r3, 0x1
mov r8, r3
movs r7, 0x1E
lsls r0, r4, 1
adds r5, r0, r1
_080110F2:
mov r2, r9
ands r4, r2
ands r6, r2
lsls r2, r4, 1
lsls r0, r6, 6
adds r2, r0
ldr r3, _0801115C
adds r3, r2, r3
str r3, [sp]
mov r0, r10
ldr r1, [r0]
ldr r3, _08011160
adds r0, r1, r3
adds r0, r5
ldrh r0, [r0]
ldr r3, [sp]
strh r0, [r3]
ldr r0, _08011164
adds r2, r0
adds r1, 0x14
adds r1, r5
ldrh r0, [r1]
strh r0, [r2]
adds r5, 0x2
adds r4, 0x1
subs r7, 0x1
cmp r7, 0
bge _080110F2
mov r2, r12
adds r6, 0x1
mov r3, r8
cmp r3, 0x14
ble _080110D4
movs r0, 0x2
bl sub_80098F8
movs r0, 0x3
bl sub_80098F8
add sp, 0x4
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08011150: .4byte gUnknown_203B0E4
_08011154: .4byte 0x00004dd6
_08011158: .4byte 0x00004dd4
_0801115C: .4byte gUnknown_202C038
_08011160: .4byte 0x00002014
_08011164: .4byte gUnknown_202C838
thumb_func_end sub_80110B0
thumb_func_start sub_8011168
sub_8011168:
push {r4,r5,lr}
movs r0, 0
movs r1, 0x1
movs r2, 0x1
bl sub_800641C
ldr r3, _080111B0
ldr r1, [r3]
ldr r2, _080111B4
adds r0, r1, r2
movs r2, 0
str r2, [r0]
ldr r4, _080111B8
adds r0, r1, r4
str r2, [r0]
adds r4, 0x4
adds r0, r1, r4
str r2, [r0]
ldr r0, _080111BC
adds r1, r0
str r2, [r1]
adds r5, r3, 0
ldr r4, _080111C0
movs r3, 0
movs r1, 0x7
_0801119A:
ldr r0, [r5]
adds r0, r2, r0
adds r0, r4
strh r3, [r0]
adds r2, 0x3C
subs r1, 0x1
cmp r1, 0
bge _0801119A
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_080111B0: .4byte gUnknown_203B0E4
_080111B4: .4byte 0x00004ddc
_080111B8: .4byte 0x00004de0
_080111BC: .4byte 0x00004de8
_080111C0: .4byte 0x00004a30
thumb_func_end sub_8011168
thumb_func_start sub_80111C4
sub_80111C4:
push {r4-r6,lr}
movs r3, 0
ldr r6, _08011238
ldr r0, [r6]
ldr r2, _0801123C
adds r1, r0, r2
ldr r2, [r1]
cmp r2, 0x1E
bgt _0801122E
ldr r0, [r0]
ldr r5, [r0, 0x4]
adds r0, r2, 0x1
str r0, [r1]
cmp r0, 0x1E
ble _080111E6
movs r0, 0x1F
str r0, [r1]
_080111E6:
movs r4, 0
_080111E8:
ldr r0, [r6]
ldr r1, _0801123C
adds r0, r1
ldr r2, [r0]
adds r0, r4, 0
adds r1, r5, 0
movs r3, 0
bl SetBGPaletteBufferColorRGB
adds r5, 0x4
adds r4, 0x1
cmp r4, 0xDF
ble _080111E8
ldr r0, _08011238
ldr r0, [r0]
ldr r0, [r0, 0x4]
ldr r5, [r0, 0x4]
movs r4, 0
_0801120C:
movs r2, 0x80
lsls r2, 1
adds r0, r4, r2
ldr r1, _08011238
ldr r1, [r1]
ldr r2, _0801123C
adds r1, r2
ldr r2, [r1]
adds r1, r5, 0
movs r3, 0
bl SetBGPaletteBufferColorRGB
adds r5, 0x4
adds r4, 0x1
cmp r4, 0xEF
ble _0801120C
movs r3, 0x1
_0801122E:
adds r0, r3, 0
pop {r4-r6}
pop {r1}
bx r1
.align 2, 0
_08011238: .4byte gUnknown_203B0E4
_0801123C: .4byte 0x00004dcc
thumb_func_end sub_80111C4
thumb_func_start sub_8011240
sub_8011240:
push {r4-r6,lr}
ldr r2, _08011264
ldr r0, [r2]
ldr r1, _08011268
adds r3, r0, r1
movs r4, 0
ldrsh r1, [r3, r4]
ldr r5, _0801126C
adds r4, r0, r5
movs r6, 0
ldrsh r0, [r4, r6]
subs r1, r0
adds r5, r2, 0
cmp r1, 0x2F
bgt _08011270
ldrh r0, [r3]
subs r0, 0x30
b _08011278
.align 2, 0
_08011264: .4byte gUnknown_203B0E4
_08011268: .4byte 0x00004dd8
_0801126C: .4byte 0x00004dd4
_08011270:
cmp r1, 0xC0
ble _0801127A
ldrh r0, [r3]
subs r0, 0xC0
_08011278:
strh r0, [r4]
_0801127A:
ldr r0, [r5]
ldr r1, _08011298
adds r3, r0, r1
movs r2, 0
ldrsh r1, [r3, r2]
ldr r4, _0801129C
adds r2, r0, r4
movs r6, 0
ldrsh r0, [r2, r6]
subs r1, r0
cmp r1, 0x2F
bgt _080112A0
ldrh r0, [r3]
subs r0, 0x30
b _080112A8
.align 2, 0
_08011298: .4byte 0x00004dda
_0801129C: .4byte 0x00004dd6
_080112A0:
cmp r1, 0x70
ble _080112AA
ldrh r0, [r3]
subs r0, 0x70
_080112A8:
strh r0, [r2]
_080112AA:
adds r3, r5, 0
ldr r0, [r3]
ldr r4, _080112F8
adds r1, r0, r4
movs r2, 0
ldrsh r0, [r1, r2]
cmp r0, 0
bge _080112BE
movs r0, 0
strh r0, [r1]
_080112BE:
ldr r0, [r3]
ldr r2, _080112FC
adds r1, r0, r2
movs r6, 0
ldrsh r0, [r1, r6]
cmp r0, 0
bge _080112D0
movs r0, 0
strh r0, [r1]
_080112D0:
ldr r0, [r3]
adds r1, r0, r4
movs r3, 0
ldrsh r0, [r1, r3]
cmp r0, 0xEF
ble _080112E0
movs r0, 0xEF
strh r0, [r1]
_080112E0:
ldr r0, [r5]
adds r2, r0, r2
movs r4, 0
ldrsh r0, [r2, r4]
cmp r0, 0x97
ble _080112F0
movs r0, 0x97
strh r0, [r2]
_080112F0:
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_080112F8: .4byte 0x00004dd4
_080112FC: .4byte 0x00004dd6
thumb_func_end sub_8011240
thumb_func_start sub_8011300
sub_8011300:
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
sub sp, 0xC
ldr r0, _08011388
ldr r2, [r0]
ldr r1, _0801138C
adds r0, r2, r1
ldr r1, [r0]
lsls r0, r1, 2
adds r0, r1
lsls r0, 4
ldr r3, _08011390
adds r0, r3
adds r2, r0
mov r9, r2
movs r4, 0
ldr r0, _08011394
mov r8, r0
movs r7, 0
mov r6, r8
movs r5, 0
_0801132E:
ldr r0, _08011388
ldr r2, [r0]
adds r0, r5, r2
add r0, r8
strh r7, [r0]
lsls r1, r4, 1
mov r0, r9
adds r0, 0x2
adds r1, r0, r1
movs r3, 0
ldrsh r0, [r1, r3]
cmp r0, 0
blt _08011370
lsls r1, r0, 2
adds r1, r0
lsls r1, 4
ldr r0, _08011390
adds r1, r0
adds r1, r2, r1
ldrb r0, [r1]
cmp r0, 0
beq _08011370
adds r0, r2, r6
ldr r1, [r2, 0x8]
adds r2, r4, 0x4
movs r3, 0x40
str r3, [sp]
str r7, [sp, 0x4]
movs r3, 0x1
str r3, [sp, 0x8]
movs r3, 0
bl sub_80053AC
_08011370:
adds r6, 0x3C
adds r5, 0x3C
adds r4, 0x1
cmp r4, 0x7
ble _0801132E
add sp, 0xC
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08011388: .4byte gUnknown_203B0E4
_0801138C: .4byte 0x00004a18
_08011390: .4byte 0x00004018
_08011394: .4byte 0x00004a30
thumb_func_end sub_8011300
thumb_func_start sub_8011398
sub_8011398:
push {r4-r6,lr}
sub sp, 0x12C
ldr r5, _080113F4
ldr r0, [r5]
ldr r2, _080113F8
adds r1, r0, r2
ldr r1, [r1]
ldr r3, _080113FC
adds r0, r3
lsls r1, 5
ldr r0, [r0]
adds r6, r0, r1
add r4, sp, 0xCC
adds r0, r4, 0
movs r1, 0
movs r2, 0x60
bl memset
movs r2, 0x3
str r2, [r4, 0x4]
movs r0, 0x7
strh r0, [r4, 0x8]
movs r1, 0x2
strh r1, [r4, 0xA]
movs r0, 0x15
strh r0, [r4, 0xC]
strh r1, [r4, 0xE]
strh r1, [r4, 0x10]
str r2, [r4, 0x1C]
str r2, [r4, 0x34]
str r2, [r4, 0x4C]
ldr r0, [r5]
ldr r2, _08011400
adds r1, r0, r2
movs r3, 0
ldrsh r1, [r1, r3]
subs r2, 0x4
adds r0, r2
movs r3, 0
ldrsh r0, [r0, r3]
subs r1, r0
cmp r1, 0x50
bgt _08011404
movs r0, 0x11
b _08011406
.align 2, 0
_080113F4: .4byte gUnknown_203B0E4
_080113F8: .4byte 0x00004a18
_080113FC: .4byte 0x00004014
_08011400: .4byte 0x00004dda
_08011404:
movs r0, 0x1
_08011406:
strh r0, [r4, 0xA]
adds r0, r4, 0
movs r1, 0x1
movs r2, 0x1
bl sub_800641C
movs r0, 0
bl sub_80073B8
ldr r1, _0801147C
ldr r2, [r6]
add r0, sp, 0x4
bl sprintfStatic
movs r0, 0
str r0, [sp]
movs r0, 0xC
movs r1, 0x2
add r2, sp, 0x4
movs r3, 0
bl xxx_format_and_draw
movs r0, 0
bl sub_80073E0
ldr r0, _08011480
ldr r1, [r0]
ldr r0, _08011484
adds r2, r1, r0
movs r3, 0x8
ldrsh r0, [r4, r3]
lsls r0, 3
subs r0, 0x5
str r0, [r2]
ldr r0, _08011488
adds r2, r1, r0
movs r3, 0xA
ldrsh r0, [r4, r3]
lsls r0, 3
adds r0, 0x5
str r0, [r2]
ldr r0, _0801148C
adds r2, r1, r0
movs r3, 0xC
ldrsh r0, [r4, r3]
lsls r0, 3
adds r0, 0xA
str r0, [r2]
ldr r0, _08011490
adds r1, r0
movs r2, 0xE
ldrsh r0, [r4, r2]
lsls r0, 3
adds r0, 0xA
str r0, [r1]
add sp, 0x12C
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_0801147C: .4byte gUnknown_80D40FC
_08011480: .4byte gUnknown_203B0E4
_08011484: .4byte 0x00004ddc
_08011488: .4byte 0x00004de0
_0801148C: .4byte 0x00004de4
_08011490: .4byte 0x00004de8
thumb_func_end sub_8011398
thumb_func_start sub_8011494
sub_8011494:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0xC8
ldr r0, _08011610
ldr r2, [r0]
ldr r1, _08011614
adds r0, r2, r1
ldr r0, [r0]
ldr r3, _08011618
adds r1, r2, r3
lsls r0, 5
ldr r1, [r1]
adds r1, r0
mov r8, r1
ldr r0, _0801161C
adds r7, r2, r0
add r4, sp, 0x64
adds r0, r4, 0
movs r1, 0
movs r2, 0x60
bl memset
movs r0, 0x6
str r0, [sp, 0x68]
add r1, sp, 0x6C
movs r0, 0x7
strh r0, [r1]
movs r2, 0x2
strh r2, [r1, 0x2]
add r1, sp, 0x70
movs r0, 0x15
strh r0, [r1]
mov r0, sp
adds r0, 0x72
strh r2, [r0]
add r0, sp, 0x74
strh r2, [r0]
add r5, sp, 0xC4
str r5, [sp, 0x78]
movs r1, 0x3
str r1, [sp, 0x80]
add r0, sp, 0x94
str r1, [r0, 0x4]
add r0, sp, 0xAC
str r1, [r0, 0x4]
add r0, sp, 0x4
adds r1, r4, 0
movs r2, 0x60
bl memcpy
movs r1, 0
mov r9, r1
movs r6, 0
mov r10, r5
_08011506:
mov r0, r8
adds r0, 0x8
adds r4, r0, r6
ldrb r0, [r4]
bl sub_800FFE8
lsls r0, 24
cmp r0, 0
beq _0801152A
ldr r0, _08011610
ldr r0, [r0]
ldr r2, _08011620
adds r0, r2
add r0, r9
ldrb r1, [r4]
strb r1, [r0]
movs r3, 0x1
add r9, r3
_0801152A:
adds r6, 0x1
cmp r6, 0x7
ble _08011506
ldr r5, _08011610
ldr r0, [r5]
ldr r1, _08011624
adds r0, r1
mov r2, r9
str r2, [r0]
movs r4, 0
movs r0, 0x1
mov r3, r10
strb r0, [r3]
add r0, sp, 0xC4
strb r4, [r0, 0x1]
movs r1, 0x12
strb r1, [r0, 0x2]
strb r4, [r0, 0x3]
strh r4, [r7, 0x18]
strh r2, [r7, 0x1A]
mov r0, r9
strh r0, [r7, 0x1C]
strh r4, [r7, 0x1E]
strh r4, [r7, 0x20]
strh r4, [r7, 0x4]
movs r0, 0x10
strh r0, [r7, 0x6]
str r4, [r7]
strh r4, [r7, 0xC]
strh r4, [r7, 0xE]
strh r4, [r7, 0x14]
strh r4, [r7, 0x16]
movs r0, 0x8
strh r0, [r7, 0x8]
strh r0, [r7, 0xA]
adds r0, r7, 0
adds r0, 0x28
bl sub_801317C
movs r1, 0x1C
ldrsh r0, [r7, r1]
movs r1, 0
bl sub_80095E4
adds r1, r0, 0
add r3, sp, 0x4
adds r2, r3, 0
adds r0, r1, 0x2
strh r0, [r2, 0xE]
strh r0, [r3, 0x10]
lsls r1, 3
adds r0, r7, 0
bl sub_80137B0
add r0, sp, 0x4
movs r1, 0x1
movs r2, 0x1
bl sub_800641C
ldr r1, [r5]
ldr r2, _08011628
adds r0, r1, r2
str r4, [r0]
ldr r3, _0801162C
adds r0, r1, r3
str r4, [r0]
adds r2, 0x8
adds r0, r1, r2
str r4, [r0]
adds r3, 0x8
adds r1, r3
str r4, [r1]
movs r0, 0
bl sub_80073B8
ldr r2, _08011630
str r4, [sp]
movs r0, 0x10
movs r1, 0
movs r3, 0
bl xxx_format_and_draw
movs r6, 0
cmp r6, r9
bge _08011678
add r0, sp, 0x64
mov r8, r0
ldr r1, _08011634
mov r10, r1
_080115DC:
adds r0, r7, 0
adds r1, r6, 0
bl sub_8013800
adds r4, r0, 0
ldr r2, _08011610
ldr r0, [r2]
ldr r3, _08011620
adds r0, r3
adds r0, r6
ldrb r5, [r0]
ldr r0, _08011638
adds r1, r5, 0
bl sub_80101F8
cmp r5, 0
bne _08011640
str r5, [sp]
movs r0, 0xC
adds r1, r4, 0
ldr r2, _0801163C
movs r3, 0
bl xxx_format_and_draw
b _08011672
.align 2, 0
_08011610: .4byte gUnknown_203B0E4
_08011614: .4byte 0x00004a18
_08011618: .4byte 0x00004014
_0801161C: .4byte 0x00004dfc
_08011620: .4byte 0x00004dec
_08011624: .4byte 0x00004df8
_08011628: .4byte 0x00004ddc
_0801162C: .4byte 0x00004de0
_08011630: .4byte gUnknown_80D4104
_08011634: .4byte gUnknown_202DE30
_08011638: .4byte gUnknown_202DE58
_0801163C: .4byte gUnknown_80D4120
_08011640:
ldr r1, _08011690
ldr r0, [r1]
ldr r2, _08011694
adds r0, r2
ldrb r2, [r0]
adds r0, r5, 0
mov r1, r8
bl sub_80926F8
mov r3, r8
movs r1, 0x2
ldrsh r0, [r3, r1]
mov r2, r10
str r0, [r2]
movs r1, 0
ldrsh r0, [r3, r1]
str r0, [r2, 0x4]
movs r0, 0
str r0, [sp]
movs r0, 0xC
adds r1, r4, 0
ldr r2, _08011698
movs r3, 0
bl xxx_format_and_draw
_08011672:
adds r6, 0x1
cmp r6, r9
blt _080115DC
_08011678:
movs r0, 0
bl sub_80073E0
add sp, 0xC8
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08011690: .4byte gUnknown_203B0E4
_08011694: .4byte 0x00004a2c
_08011698: .4byte gUnknown_80D4124
thumb_func_end sub_8011494
.align 2,0

View File

@@ -528,289 +528,4 @@ _08042668:
bx r1
thumb_func_end sub_8042520
@ This func plays the appropriate ascend/descend SFX for stairs depending on the direction
@ https://decomp.me/scratch/Soyeh (kermalis 100%) `void sub_804267C(void)`
thumb_func_start sub_804267C
sub_804267C:
push {r4,lr}
ldr r4, _080426B8
bl sub_8043D10
lsls r0, 24
lsrs r0, 24
cmp r0, 0
beq _08042694
cmp r0, 0
blt _08042694
cmp r0, 0x2
ble _080426AC
_08042694:
ldr r0, _080426BC
ldr r0, [r0]
ldr r1, _080426C0
adds r0, r1
ldrb r0, [r0]
bl IsStairDirectionUp
lsls r0, 24
ldr r4, _080426C4
cmp r0, 0
beq _080426AC
subs r4, 0x1
_080426AC:
adds r0, r4, 0
bl PlaySoundEffect
pop {r4}
pop {r0}
bx r0
.align 2, 0
_080426B8: .4byte 0x000003e5
_080426BC: .4byte gDungeon
_080426C0: .4byte 0x00000644
_080426C4: .4byte 0x00000155
thumb_func_end sub_804267C
@ https://decomp.me/scratch/vilX5 (kermalis 100%) `void sub_80426C8(u32, u32)`
thumb_func_start sub_80426C8
sub_80426C8:
push {r4,r5,lr}
adds r5, r0, 0
adds r4, r1, 0
cmp r4, 0x3
bne _080426D8
movs r0, 0
bl DungeonStartNewBGM
_080426D8:
cmp r5, 0x4
beq _080426F0
ldr r0, _080426EC
lsls r1, r4, 1
adds r1, r0
ldrh r0, [r1]
bl PlaySoundEffect
b _080426FC
.align 2, 0
_080426EC: .4byte gUnknown_80F67DC
_080426F0:
ldr r0, _08042708
lsls r1, r4, 1
adds r1, r0
ldrh r0, [r1]
bl PlaySoundEffect
_080426FC:
adds r0, r5, 0
adds r1, r4, 0
movs r2, 0x80
bl sub_8042B34
b _08042712
.align 2, 0
_08042708: .4byte gUnknown_80F67E4
_0804270C:
movs r0, 0x46
bl sub_803E46C
_08042712:
bl sub_8042CC0
lsls r0, 24
cmp r0, 0
bne _0804270C
bl sub_8042D7C
bl sub_8040238
movs r0, 0x1
bl sub_8052210
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_80426C8
@ https://decomp.me/scratch/AJFhQ (kermalis 100%) `void sub_8042730(Entity *, void *)`
thumb_func_start sub_8042730
sub_8042730:
push {r4,r5,lr}
adds r4, r0, 0
movs r1, 0x8
movs r2, 0x8
bl sub_806CDD4
movs r5, 0
b _08042742
_08042740:
adds r5, 0x1
_08042742:
cmp r5, 0x63
bgt _08042760
movs r0, 0x51
bl sub_803E46C
ldr r0, [r4, 0x40]
movs r1, 0x3
ands r0, r1
cmp r0, 0
bne _08042760
adds r0, r4, 0
adds r0, 0x6B
ldrb r0, [r0]
cmp r0, 0x8
beq _08042740
_08042760:
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_8042730
@ https://decomp.me/scratch/2oNpD (kermalis 100%) `bool8 sub_8042768(Entity *)`
thumb_func_start sub_8042768
sub_8042768:
push {lr}
adds r1, r0, 0
adds r0, 0x20
ldrb r0, [r0]
cmp r0, 0
bne _08042778
_08042774:
movs r0, 0
b _080427A6
_08042778:
ldr r0, _08042794
ldr r2, [r0]
ldr r3, _08042798
adds r0, r2, r3
ldrb r0, [r0]
cmp r0, 0
beq _0804279C
subs r3, 0x12
adds r0, r2, r3
ldr r0, [r0]
cmp r0, r1
bne _08042774
movs r0, 0x1
b _080427A6
.align 2, 0
_08042794: .4byte gDungeon
_08042798: .4byte 0x0001820a
_0804279C:
adds r0, r1, 0
bl sub_8045888
lsls r0, 24
lsrs r0, 24
_080427A6:
pop {r1}
bx r1
thumb_func_end sub_8042768
@ https://decomp.me/scratch/uuAnf (kermalis 100%) `void sub_80427AC(void)`
thumb_func_start sub_80427AC
sub_80427AC:
push {r4-r6,lr}
movs r6, 0
_080427B0:
ldr r0, _08042808
ldr r0, [r0]
lsls r1, r6, 2
ldr r2, _0804280C
adds r0, r2
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _080427FA
ldr r5, [r4, 0x70]
adds r1, r5, 0
adds r1, 0xF3
ldrb r0, [r1]
cmp r0, 0
beq _080427FA
movs r0, 0
strb r0, [r1]
adds r0, r4, 0
bl sub_80429A0
ldrb r0, [r5, 0x6]
cmp r0, 0
bne _080427FA
ldr r0, _08042810
adds r1, r4, 0
movs r2, 0
bl SetMessageArgument
ldr r0, _08042814
ldr r1, [r0]
adds r0, r4, 0
bl sub_805239C
_080427FA:
adds r6, 0x1
cmp r6, 0x13
ble _080427B0
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08042808: .4byte gDungeon
_0804280C: .4byte 0x000135cc
_08042810: .4byte gAvailablePokemonNames
_08042814: .4byte gPtrFeralFoundItemMessage
thumb_func_end sub_80427AC
@ https://decomp.me/scratch/hzCAZ (kermalis 100%) `void sub_8042818(u8 a0, bool8 a1)`
thumb_func_start sub_8042818
sub_8042818:
push {r4-r7,lr}
lsls r0, 24
lsrs r5, r0, 24
lsls r1, 24
lsrs r7, r1, 24
ldr r0, _08042874
ldr r0, [r0]
ldr r1, _08042878
adds r0, r1
ldr r4, [r0]
cmp r4, 0
bne _08042836
bl GetLeader
adds r4, r0, 0
_08042836:
ldr r1, _0804287C
lsls r0, r5, 1
adds r2, r0, r1
ldrh r1, [r2]
ldr r0, _08042880
cmp r1, r0
beq _0804284A
adds r0, r4, 0
bl sub_80421C0
_0804284A:
ldr r0, _08042884
lsls r1, r5, 2
adds r0, r1, r0
ldr r5, [r0]
adds r6, r1, 0
cmp r5, 0
blt _08042896
cmp r7, 0
beq _08042888
bl IsBossFight
lsls r0, 24
cmp r0, 0
bne _08042888
adds r0, r4, 0
adds r1, r5, 0
movs r2, 0
bl sub_804151C
b _08042896
.align 2, 0
_08042874: .4byte gDungeon
_08042878: .4byte 0x000181f8
_0804287C: .4byte gUnknown_80F682C
_08042880: .4byte 0x000003e5
_08042884: .4byte gUnknown_80F67EC
_08042888:
ldr r0, _0804289C
adds r0, r6, r0
ldr r1, [r0]
adds r0, r4, 0
movs r2, 0
bl sub_804151C
_08042896:
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0804289C: .4byte gUnknown_80F680C
thumb_func_end sub_8042818
.align 2,0

35
include/code_800E9A8.h Normal file
View File

@@ -0,0 +1,35 @@
#ifndef GUARD_CODE_800E9A8_H
#define GUARD_CODE_800E9A8_H
struct unkStruct_203B0CC_sub
{
// size: 0xD0
u32 unk0;
s32 unk4;
u8 fill8[0x34 - 8];
u32 unk34;
u32 unk38;
u8 fill3C[0x4C - 0x3C];
u32 unk4C;
s32 unk50;
u8 unk54;
u8 fill55[0xB8 - 0x55];
u32 unkB8;
u8 fillBC[0xD0 - 0xBC];
};
struct unkStruct_203B0CC
{
// size: 0x1A18
struct unkStruct_203B0CC_sub unk0[0x20];
u32 unk1A00;
/* 0x1A04 */ u32 fileSelection;
u32 unk1A08;
u32 unk1A0C;
u32 unk1A10;
u8 fill1A14[0x1A18 - 0x1A14];
};
bool8 sub_800E9A8(s32 a0);
#endif

42
include/code_800F958.h Normal file
View File

@@ -0,0 +1,42 @@
#ifndef GUARD_CODE_800F958_H
#define GUARD_CODE_800F958_H
#include "structs/str_dungeon.h"
// size: 0x8
typedef struct DungeonPokemonStatusSprite
{
/* 0x0 */ u32 status;
/* 0x4 */ u32 frame;
} DungeonPokemonStatusSprite;
// size: 0x40
typedef struct DungeonPokemonSprite
{
/* 0x0 */ u8 exists;
/* 0x4 */ u32 id;
/* 0x8 */ u16 species; // Or sprite ID?
/* 0xA */ u16 unkA;
/* 0xC */ u32 status;
/* 0x10 */ u8 visible;
/* 0x11 */ u8 unk11;
/* 0x14 */ Position pos;
/* 0x18 */ Position statusOffsets[2];
/* 0x20 */ u32 unk20;
/* 0x24 */ u32 unk24;
/* 0x28 */ DungeonPokemonStatusSprite statusSprites[2];
/* 0x38 */ u8 unk38;
/* 0x3C */ u16 unk3C;
/* 0x3E */ u16 unk3E;
} DungeonPokemonSprite;
// size: 0x584
typedef struct DungeonPokemonSprites
{
/* 0x0 */ u32 frame;
/* 0x4 */ DungeonPokemonSprite sprites[22];
} DungeonPokemonSprites;
void sub_800F958(s32 dungeonSpriteID, Position *pos, Position *statusOffsets, u32 a3);
#endif

41
include/code_8010EF0.h Normal file
View File

@@ -0,0 +1,41 @@
#ifndef GUARD_CODE_8010EF0_H
#define GUARD_CODE_8010EF0_H
#include "file_system.h"
// size: 0x4
typedef struct RGB
{
// IDK which is R G B
u8 unk0;
u8 unk1;
u8 unk2;
} RGB;
// size: 0x18
typedef struct unkStruct_202EE8C
{
u32 unk0;
u16 unk4;
s16 unk6;
RGB *unk8;
RGB *unkC;
RGB *unk10;
RGB unk14;
} unkStruct_202EE8C;
// size: 0x4DD8
struct UnkBgStruct
{
OpenedFile *unk0[5];
u8 padding[0x4C4C - 0x14];
unkStruct_202EE8C unk4C4C[16];
u32 unk4DCC;
u32 unk4DD0;
/* 0x4DD4 */ s16 xoffset;
/* 0x4DD6 */ s16 yoffset;
};
void sub_8010EF0(void);
#endif

13
include/code_804267C.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef GUARD_CODE_804267C_H
#define GUARD_CODE_804267C_H
#include "structs/dungeon_entity.h"
void PlayStairsSound(void);
void sub_80426C8(u32 a0, u32 a1);
void sub_8042730(Entity *a0, void *unused);
bool8 sub_8042768(Entity* pokemon);
void sub_80427AC(void);
void sub_8042818(u8 a0, bool8 a1);
#endif

8
include/code_8045A00.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef GUARD_CODE_8045A00_H
#define GUARD_CODE_8045A00_H
#include "structs/dungeon_entity.h"
void SetMessageArgument(char buffer[], Entity *entity, u32 param_3);
#endif // GUARD_CODE_8045A00_H

View File

@@ -38,6 +38,7 @@ extern DungeonName gDungeonNames[];
s32 GetDungeonFloorCount(u8 dungeon);
const u8 *GetDungeonName1(u8 dungeon);
bool8 IsStairDirectionUp(u8 dungeon);
u32 GetMaxItemsAllowed(u8 dungeon);
s8 GetRescuesAllowed(u8 dungeon);
bool8 HasCheckpoint(u8 dungeon);

View File

@@ -2,6 +2,7 @@
#define GUARD_DUNGEON_MOVEMENT
#include "structs/dungeon_entity.h"
#include "structs/map.h"
u8 GetCrossableTerrain(s16 species);
u8 sub_807034C(s16 id, struct Tile *tile);

View File

@@ -1,6 +1,8 @@
#ifndef GUARD_MOVE_EFFECTS_TARGET_H
#define GUARD_MOVE_EFFECTS_TARGET_H
#include "structs/dungeon_entity.h"
u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns);
void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage);
bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage);

View File

@@ -3,6 +3,7 @@
#include "structs/dungeon_entity.h"
void SetMessageArgument_2(char buffer[], EntityInfo *param_2, s32 colorNum);
bool8 HasNegativeStatus(Entity *pokemon);
bool8 IsSleeping(Entity *pokemon);
bool8 HasLowHealth(Entity *pokemon);

View File

@@ -66,7 +66,7 @@ typedef struct AITarget
} AITarget;
typedef struct Sleep
typedef struct Sleep
{
/* 0x0 */ u8 sleep;
/* 0x1 */ u8 sleepTurns;
@@ -77,7 +77,7 @@ typedef struct NonVolatile
/* 0x0 */ u8 nonVolatileStatus;
/* 0x1 */ u8 nonVolatileStatusTurns;
/* 0x2 */ u8 nonVolatileStatusDamageCountdown;
/* 0x3 */ u8 unk4;
/* 0x3 */ u8 unk4;
} NonVolatile;
typedef struct Immobilize
@@ -107,7 +107,7 @@ typedef struct Protection
/* 0x1 */ u8 protectionStatusTurns;
} Protection;
typedef struct Waiting
typedef struct Waiting
{
/* 0xC8 */ u8 waitingStatus;
/* 0xC9 */ bool8 enemyDecoy; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon).
@@ -116,7 +116,7 @@ typedef struct Waiting
/* 0xCC */ u8 curseDamageCountdown;
} Waiting;
typedef struct Linked
typedef struct Linked
{
/* 0xD0 */ u8 linkedStatus;
/* 0xD4 */ u32 unkD4;
@@ -126,7 +126,7 @@ typedef struct Linked
} Linked;
typedef struct MoveStatus
typedef struct MoveStatus
{
/* 0xDC */ u8 moveStatus;
/* 0xDD */ u8 moveStatusTurns;
@@ -143,13 +143,13 @@ typedef struct TransformStatus
/* 0xE5 */ u8 transformStatusTurns;
} TransformStatus;
typedef struct EyesightStatus
typedef struct EyesightStatus
{
/* 0xE8 */ u8 eyesightStatus;
/* 0xE9 */ u8 eyesightStatusTurns;
} EyesightStatus;
typedef struct Muzzled
typedef struct Muzzled
{
/* 0xEC */ bool8 muzzled;
/* 0xED */ u8 muzzledTurns;
@@ -234,7 +234,7 @@ typedef struct EntityInfo
/* 0xF0 */ bool8 powerEars;
/* 0xF1 */ bool8 scanning;
/* 0xF2 */ bool8 stairSpotter;
u8 fillF3;
/* 0xF3 */ bool8 unkF3;
/* 0xF4 */ bool8 grudge;
/* 0xF5 */ bool8 exposed;
/* 0xF6 */ bool8 isColorChanged;

View File

@@ -85,6 +85,12 @@ SECTIONS {
src/code_800D090_1.o(.text);
src/code_800DAC0.o(.text);
asm/code_800DAC0.o(.text);
src/code_800E9A8.o(.text);
asm/code_800E9E4.o(.text);
src/code_800F958.o(.text);
asm/code_800F990.o(.text);
src/code_8010EF0.o(.text);
asm/code_8010F28.o(.text);
src/code_80118A4.o(.text);
src/debug.o(.text);
src/save.o(.text);
@@ -198,8 +204,8 @@ SECTIONS {
asm/code_8040094.o(.text);
src/code_8041AD0.o(.text);
asm/code_8041AD0.o(.text);
src/code_80428A0.o(.text);
asm/code_80428A0.o(.text);
src/code_804267C.o(.text);
asm/code_8042B34.o(.text);
src/dungeon_engine.o(.text);
asm/code_8044210.o(.text);
src/dungeon_action.o(.text);

24
src/code_800E9A8.c Normal file
View File

@@ -0,0 +1,24 @@
#include "global.h"
#include "code_800E9A8.h"
struct unkStruct_203B0CC *gUnknown_203B0CC;
bool8 sub_800E9A8(s32 a0)
{
s32 i;
struct unkStruct_203B0CC_sub *ptr;
if (a0 == -1)
return FALSE;
ptr = gUnknown_203B0CC->unk0;
for (i = 0; i < 32; i++, ptr++) {
if (ptr->unk4 == a0) {
if (ptr->unk54 != 0)
return FALSE;
return TRUE;
}
}
return FALSE;
}

23
src/code_800F958.c Normal file
View File

@@ -0,0 +1,23 @@
#include "global.h"
#include "code_800F958.h"
extern DungeonPokemonSprites *gDungeonPokemonSprites;
extern DungeonPokemonSprite* GetDungeonPokemonSprite(s32 id);
void sub_800F958(s32 dungeonSpriteID, Position *pos, Position *statusOffsets, u32 a3)
{
DungeonPokemonSprite *dSprite;
if (gDungeonPokemonSprites == NULL)
return;
dSprite = GetDungeonPokemonSprite(dungeonSpriteID);
if (dSprite == NULL)
return;
dSprite->pos = *pos;
dSprite->unk11 = a3;
dSprite->statusOffsets[0] = statusOffsets[0];
dSprite->statusOffsets[1] = statusOffsets[3];
}

15
src/code_8010EF0.c Normal file
View File

@@ -0,0 +1,15 @@
#include "global.h"
#include "code_8010EF0.h"
extern struct UnkBgStruct *gUnknown_203B0E4;
extern void CloseFile(OpenedFile *);
void sub_8010EF0(void)
{
CloseFile(gUnknown_203B0E4->unk0[4]);
CloseFile(gUnknown_203B0E4->unk0[2]);
CloseFile(gUnknown_203B0E4->unk0[3]);
CloseFile(gUnknown_203B0E4->unk0[0]);
CloseFile(gUnknown_203B0E4->unk0[1]);
}

View File

@@ -1,5 +1,6 @@
#include "global.h"
#include "code_806CD90.h"
#include "code_804267C.h"
#include "constants/direction.h"
#include "constants/status.h"
#include "constants/type.h"
@@ -49,7 +50,6 @@ extern u32 gStatusSpriteMasks_MuzzledStatus[];
extern void sub_803ED30(u8, Entity *pokemon, u8, u8);
extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2);
extern bool8 sub_8042768(Entity *pokemon);
extern u32 sub_806F62C(u32);
extern void PlaySoundEffect(u32);
extern u8 sub_803F428(Position *pos);
@@ -78,7 +78,7 @@ s32 sub_80416E0(Position32 *pos, u32 param_2, bool8 param_3);
s32 sub_80416A4(Position *pos_1, u32 param_2, bool8 param_3)
{
Position32 pos;
pos.x = pos_1->x * 0x1800 + 0xc00;
pos.y = pos_1->y * 0x1800 + 0x1000;
return sub_80416E0(&pos, param_2, param_3);
@@ -97,7 +97,7 @@ s32 sub_80416E0(Position32 *pos, u32 param_2, bool8 param_3)
auStack_10.x = pos->x / 256;
auStack_10.y = pos->y / 256;
auStack_10.unk14 = -1;
auStack_10.unk10 = 0;
auStack_10.unk12 = 0;
@@ -128,7 +128,7 @@ void sub_804178C(u8 param_1)
{
u32 temp;
s32 counter;
counter = 0;
gDungeon->unk18204 = 0;
if (sub_800E9FC(param_1) != 0) {
@@ -198,7 +198,7 @@ void EntityUpdateStatusSprites(Entity *entity)
EntityInfo *entityInfo;
u32 spriteStatus;
u8 temp;
if (EntityExists(entity)) {
entityInfo = entity->info;
spriteStatus = 0;
@@ -206,7 +206,7 @@ void EntityUpdateStatusSprites(Entity *entity)
if (entityInfo->id == 0xb9) {
// NOTE: clean this up sometime
temp = entityInfo->sleep.sleepTurns;
temp = entityInfo->sleep.sleepTurns;
flag = 0x7f;
temp ^= flag;
flag = (temp) != 0;
@@ -214,7 +214,7 @@ void EntityUpdateStatusSprites(Entity *entity)
if (flag) {
spriteStatus = gStatusSpriteMasks_SleepStatus[entityInfo->sleep.sleep];
}
spriteStatus = spriteStatus |
spriteStatus = spriteStatus |
gStatusSpriteMasks_NonVolatileStatus[entityInfo->nonVolatile.nonVolatileStatus] |
gStatusSpriteMasks_ImmobilizeStatus[entityInfo->immobilize.immobilizeStatus] |
gStatusSpriteMasks_VolatileStatus[entityInfo->volatileStatus.volatileStatus] |
@@ -247,15 +247,15 @@ void EntityUpdateStatusSprites(Entity *entity)
if ((gDungeon->itemHoldersIdentified) && (entityInfo->heldItem.flags & ITEM_FLAG_EXISTS)) {
spriteStatus = spriteStatus | STATUS_SPRITE_LOWHP;
}
if ( (entityInfo->offensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) ||
if ( (entityInfo->offensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) ||
(entityInfo->offensiveMultipliers[1] < DEFAULT_STAT_MULTIPLIER) ||
(entityInfo->defensiveMultipliers[0] < DEFAULT_STAT_MULTIPLIER) ||
(entityInfo->defensiveMultipliers[1] < DEFAULT_STAT_MULTIPLIER) ||
(entityInfo->offensiveStages[0] < DEFAULT_STAT_STAGE) ||
(entityInfo->offensiveStages[1] < DEFAULT_STAT_STAGE) ||
(entityInfo->defensiveStages[0] < DEFAULT_STAT_STAGE) ||
(entityInfo->defensiveStages[0] < DEFAULT_STAT_STAGE) ||
(entityInfo->defensiveStages[1] < DEFAULT_STAT_STAGE) ||
(entityInfo->hitChanceStages[0]) < DEFAULT_STAT_STAGE ||
(entityInfo->hitChanceStages[0]) < DEFAULT_STAT_STAGE ||
(entityInfo->hitChanceStages[1] < DEFAULT_STAT_STAGE)) {
spriteStatus = spriteStatus | STATUS_SPRITE_STAT_DOWN;
}

320
src/code_804267C.c Normal file
View File

@@ -0,0 +1,320 @@
#include "global.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "code_806CD90.h"
#include "dungeon.h"
#include "dungeon_engine.h"
#include "dungeon_leader.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "structs/str_dungeon.h"
extern u8 gAvailablePokemonNames[]; // 202DF98
extern const u16 gUnknown_80F67DC[4];
extern const u16 gUnknown_80F67E4[4];
extern const s32 gUnknown_80F67EC[8];
extern const u32 gUnknown_80F680C[8];
extern const u16 gUnknown_80F682C[8];
extern const u8 *gPtrFeralFoundItemMessage[];
extern void sub_803E46C(u32);
extern void sub_803E708(u32 r0, u32 r1);
extern void sub_8040238(void);
extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2);
extern void sub_804178C(u32);
extern void sub_80416A4(Position *r0, u32 r1, bool8 r2);
extern void sub_80421C0(Entity *pokemon, u16 r1);
extern void sub_80429A0(Entity *);
extern void sub_8042B34(u32, u32, u32);
extern bool8 sub_8042CC0(void);
extern void sub_8042D7C(void);
extern u8 sub_8043D10(void);
extern bool8 sub_8045888(Entity *);
extern void sub_8052210(u32);
extern void sub_805239C(Entity *, const u8 *);
// This func plays the appropriate ascend/descend SFX for stairs depending on the direction
void PlayStairsSound(void)
{
u32 songIndex;
songIndex = 997;
switch (sub_8043D10()) {
case 0:
default:
songIndex = IsStairDirectionUp(gDungeon->dungeonLocation.id) ? 340 : 341;
break;
case 1:
case 2:
break;
}
PlaySoundEffect(songIndex);
}
void sub_80426C8(u32 a0, u32 a1)
{
if (a1 == 3)
DungeonStartNewBGM(0);
if (a0 != 4)
PlaySoundEffect(gUnknown_80F67DC[a1]);
else
PlaySoundEffect(gUnknown_80F67E4[a1]);
sub_8042B34(a0, a1, 0x80);
while (sub_8042CC0())
sub_803E46C(0x46);
sub_8042D7C();
sub_8040238();
sub_8052210(1);
}
void sub_8042730(Entity *a0, void *unused)
{
s32 i;
sub_806CDD4(a0, 8, 8);
for (i = 0; i < 100; i++) {
sub_803E46C(0x51);
if ((a0->spriteInfo.unk18 & 3) != 0 || a0->unk6B != 8)
break;
}
}
bool8 sub_8042768(Entity* pokemon)
{
if (!pokemon->isVisible)
return FALSE;
if (gDungeon->blinded) {
if (gDungeon->cameraTarget == pokemon)
return TRUE;
else
return FALSE;
}
return sub_8045888(pokemon);
}
void sub_80427AC(void)
{
Entity *entity;
EntityInfo *enInfo;
s32 i;
for (i = 0; i < 20; i++) {
entity = gDungeon->allPokemon[i];
if (EntityExists(entity)) {
enInfo = entity->info;
if (enInfo->unkF3) {
enInfo->unkF3 = FALSE;
sub_80429A0(entity);
if (!enInfo->isNotTeamMember) {
SetMessageArgument(gAvailablePokemonNames, entity, 0);
sub_805239C(entity, *gPtrFeralFoundItemMessage);
}
}
}
}
}
void sub_8042818(u8 a0, bool8 a1)
{
Entity *en;
en = gDungeon->cameraTarget;
if (en == NULL)
en = GetLeader();
if (gUnknown_80F682C[a0] != 997)
sub_80421C0(en, gUnknown_80F682C[a0]);
if (gUnknown_80F67EC[a0] < 0)
return;
if (a1 && !IsBossFight())
sub_804151C(en, gUnknown_80F67EC[a0], 0);
else
sub_804151C(en, gUnknown_80F680C[a0], 0);
}
void sub_80428A0(Entity *r0)
{
sub_804151C(r0, 0x29, 1);
}
void sub_80428B0(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_80428C4(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_80428D8(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_80428EC(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_8042900(Entity *r0)
{
sub_804151C(r0, 0xD4 << 1, 0);
}
void ShowVisualFlags(Entity *r0)
{
sub_804151C(r0, 0x29, 0);
}
void sub_8042920(Entity *r0)
{
sub_804151C(r0, 0x48, 0);
}
void sub_8042930(Entity *r0)
{
sub_804151C(r0, 0xD3 << 1, 1);
}
void sub_8042940(Entity *r0)
{
sub_804151C(r0, 0xC7 << 1, 0);
}
void sub_8042950(Entity *r0)
{
sub_804151C(r0, 0xD8 << 1, 1);
sub_803E708(0xA, 0x42);
}
void sub_8042968(Entity *r0)
{
sub_804151C(r0, 0xD4 << 1, 0);
}
void sub_8042978(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_804298C(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_80429A0(Entity *r0)
{
sub_804151C(r0, 0x199, 0);
}
void sub_80429B4(Entity *r0)
{
sub_804151C(r0, 0x1ab, 0);
}
void sub_80429C8(Entity *r0)
{
sub_804151C(r0, 0x4, 1);
}
void sub_80429D8(Entity *r0)
{
sub_804151C(r0, 0x8F << 1, 1);
}
void sub_80429E8(Entity *r0)
{
sub_804151C(r0, 0x11d, 1);
}
void sub_80429FC(Position *r0)
{
sub_80416A4(r0, 0x19E, TRUE);
sub_80421C0(NULL, 0xD4);
}
void sub_8042A14(Position *r0)
{
sub_80416A4(r0, 0x36, TRUE);
}
void sub_8042A24(Entity *r0)
{
sub_804151C(r0, 0x15, 1);
}
void sub_8042A34(Position *r0)
{
sub_80416A4(r0, 0x13E, FALSE);
}
void sub_8042A44(Entity *r0)
{
sub_804151C(r0, 0xDA << 1, 1);
}
void sub_8042A54(Position *r0)
{
sub_80416A4(r0, 0x37, TRUE);
}
void sub_8042A64(Position *r0)
{
sub_80416A4(r0, 0x29, TRUE);
}
void sub_8042A74(Entity *r0)
{
sub_804151C(r0, 0x18, 1);
}
void sub_8042A84(s16 param_1, Entity *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)) {
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->pixelPos.y - iVar2;
if (iVar3 < 0) {
iVar3 += 0xff;
}
} while (-8 <= (iVar3 >> 8) - gDungeon->cameraPixelPos.y);
entity->isVisible = 0;
sub_804178C(0);
}
}
void sub_8042B0C(Entity *entity)
{
sub_8042A84(0x13e, entity, 5);
}
void sub_8042B20(Entity *entity)
{
sub_8042A84(0x1BC, entity, 0xE);
}

View File

@@ -1,190 +0,0 @@
#include "global.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
extern void sub_804151C(Entity *r0, u32 r1, u8 r2);
extern void sub_803E708(u32 r0, u32 r1);
extern void sub_80416A4(Position *r0, u32 r1, bool8 r2);
extern void sub_80421C0(Entity *r0, u16 r1);
extern bool8 sub_8042768(Entity *pokemon);
extern void sub_804178C(u32);
extern void sub_804151C(Entity *pokemon, u32 r1, u8 r2);
extern void sub_803E46C(u32);
void sub_80428A0(Entity *r0)
{
sub_804151C(r0, 0x29, 1);
}
void sub_80428B0(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_80428C4(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_80428D8(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_80428EC(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_8042900(Entity *r0)
{
sub_804151C(r0, 0xD4 << 1, 0);
}
void ShowVisualFlags(Entity *r0)
{
sub_804151C(r0, 0x29, 0);
}
void sub_8042920(Entity *r0)
{
sub_804151C(r0, 0x48, 0);
}
void sub_8042930(Entity *r0)
{
sub_804151C(r0, 0xD3 << 1, 1);
}
void sub_8042940(Entity *r0)
{
sub_804151C(r0, 0xC7 << 1, 0);
}
void sub_8042950(Entity *r0)
{
sub_804151C(r0, 0xD8 << 1, 1);
sub_803E708(0xA, 0x42);
}
void sub_8042968(Entity *r0)
{
sub_804151C(r0, 0xD4 << 1, 0);
}
void sub_8042978(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_804298C(Entity *r0)
{
sub_804151C(r0, 0x1a9, 0);
}
void sub_80429A0(Entity *r0)
{
sub_804151C(r0, 0x199, 0);
}
void sub_80429B4(Entity *r0)
{
sub_804151C(r0, 0x1ab, 0);
}
void sub_80429C8(Entity *r0)
{
sub_804151C(r0, 0x4, 1);
}
void sub_80429D8(Entity *r0)
{
sub_804151C(r0, 0x8F << 1, 1);
}
void sub_80429E8(Entity *r0)
{
sub_804151C(r0, 0x11d, 1);
}
void sub_80429FC(Position *r0)
{
sub_80416A4(r0, 0x19E, TRUE);
sub_80421C0(NULL, 0xD4);
}
void sub_8042A14(Position *r0)
{
sub_80416A4(r0, 0x36, TRUE);
}
void sub_8042A24(Entity *r0)
{
sub_804151C(r0, 0x15, 1);
}
void sub_8042A34(Position *r0)
{
sub_80416A4(r0, 0x13E, FALSE);
}
void sub_8042A44(Entity *r0)
{
sub_804151C(r0, 0xDA << 1, 1);
}
void sub_8042A54(Position *r0)
{
sub_80416A4(r0, 0x37, TRUE);
}
void sub_8042A64(Position *r0)
{
sub_80416A4(r0, 0x29, TRUE);
}
void sub_8042A74(Entity *r0)
{
sub_804151C(r0, 0x18, 1);
}
void sub_8042A84(s16 param_1, Entity *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)) {
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->pixelPos.y - iVar2;
if (iVar3 < 0) {
iVar3 += 0xff;
}
} while (-8 <= (iVar3 >> 8) - gDungeon->cameraPixelPos.y);
entity->isVisible = 0;
sub_804178C(0);
}
}
void sub_8042B0C(Entity *entity)
{
sub_8042A84(0x13e, entity, 5);
}
void sub_8042B20(Entity *entity)
{
sub_8042A84(0x1BC, entity, 0xE);
}

View File

@@ -1,11 +1,13 @@
#include "global.h"
#include "code_8045A00.h"
#include "constants/item.h"
#include "structs/str_dungeon.h"
#include "dungeon_map_access.h"
#include "dungeon_util.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "items.h"
#include "status_checks_1.h"
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "trap.h"
extern u8 *gUnknown_80FE6F4[];
@@ -13,7 +15,6 @@ extern struct unkStruct_8090F58 gUnknown_80F699C;
extern struct unkStruct_8090F58 gUnknown_80F69A8;
extern struct unkStruct_8090F58 gUnknown_80F6990;
extern void SetMessageArgument_2(u8 *, EntityInfo *, u32);
extern bool8 IsNotSpecialItem(u8 id);
void sub_8045BF8(u8 *, Item *);
void sub_8046CE4(void *param_1,u32 param_2);
@@ -25,7 +26,7 @@ void sub_8045ACC(void)
Entity *entity;
s32 index;
s32 pokeCount;
pokeCount = 0;
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
@@ -64,7 +65,7 @@ s32 GetTeamMemberEntityIndex(Entity *pokemon)
return -1;
}
void SetMessageArgument(char *buffer, Entity *entity, u32 param_3)
void SetMessageArgument(char buffer[], Entity *entity, u32 param_3)
{
switch(GetEntityType(entity))
{
@@ -102,7 +103,7 @@ void sub_8045C28(Item *Item, u8 itemID, u32 param_3)
{
bool8 stickyFlag;
u32 total;
xxx_init_itemslot_8090A8C(Item,itemID,0);
stickyFlag = FALSE;
if (IsNotSpecialItem(itemID)) {
@@ -145,7 +146,7 @@ void sub_8045CB0(void)
Item item;
Position pos;
u32 flag;
x = DungeonRandInt(DUNGEON_MAX_SIZE_X);
y = DungeonRandInt(DUNGEON_MAX_SIZE_Y);
gDungeon->unk3904 = 0;

View File

@@ -1,27 +1,28 @@
#include "global.h"
#include "constants/dungeon.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "constants/dungeon_action.h"
#include "constants/dungeon.h"
#include "constants/iq_skill.h"
#include "constants/status.h"
#include "constants/type.h"
#include "dungeon_action.h"
#include "structs/dungeon_entity.h"
#include "dungeon_capabilities.h"
#include "dungeon_items.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "structs/str_dungeon.h"
#include "move_effects_target.h"
#include "dungeon_capabilities.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "number_util.h"
#include "dungeon_util.h"
#include "move_effects_target.h"
#include "moves.h"
#include "code_8077274_1.h"
#include "code_80521D0.h"
#include "code_808417C.h"
#include "number_util.h"
#include "pokemon.h"
#include "structs/str_position.h"
#include "status.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "structs/str_position.h"
extern u8 gAvailablePokemonNames[];
extern u8 gUnknown_202DE58[];
@@ -108,7 +109,6 @@ extern u8 sub_8072938(Entity *, u16);
extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, Position *r3);
extern void sub_8072008(Entity *pokemon, Entity *r1, u32 r2, u8 r3, u32);
extern void LevelDownTarget(Entity *pokemon, Entity *r1, u32 r2);
extern void SetMessageArgument(u8 *buffer, Entity *r1, u32);
extern void sub_80522F4(Entity *pokemon, Entity *r1, const u8[]);
extern void sub_806F370(Entity *pokemon, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
extern void sub_8078A58(Entity *, Entity *, s16, u32);

View File

@@ -1,24 +1,25 @@
#include "global.h"
#include "code_8045A00.h"
#include "code_806CD90.h"
#include "code_80869E4.h"
#include "constants/bg_music.h"
#include "constants/direction.h"
#include "constants/friend_area.h"
#include "constants/weather.h"
#include "structs/str_dungeon.h"
#include "structs/dungeon_entity.h"
#include "dungeon_leader.h"
#include "dungeon_map_access.h"
#include "dungeon_music.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "dungeon_util_1.h"
#include "dungeon_util.h"
#include "exclusive_pokemon.h"
#include "friend_area.h"
#include "items.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "pokemon.h"
#include "position_util.h"
#include "exclusive_pokemon.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
extern u32 gUnknown_202EDC8;
extern u8 gUnknown_202E038[0x50];
@@ -385,7 +386,6 @@ extern u8 JirachiFriendAreaSearch(void);
extern u8 sub_80860A8(u32);
extern void sub_8049ED4();
extern void sub_8052D44(s16 *, Entity *, Entity *);
extern void SetMessageArgument(u8 *, Entity *, u32);
extern void sub_80421C0(Entity *, u32);
extern void sub_8046D20();
extern void sub_808B1CC(u8);

View File

@@ -1,9 +1,10 @@
#include "global.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "dungeon_util.h"
#include "dungeon_map_access.h"
#include "dungeon_music.h"
#include "dungeon_movement.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "items.h"
extern u8 gUnknown_202DE58[];
@@ -28,7 +29,6 @@ extern u8 *gUnknown_80F8DE0[];
extern u8 *gUnknown_80F8E04[];
extern u8 *gUnknown_80F8E28[];
extern void SetMessageArgument(u8 *, Entity *, u32);
extern Item *sub_8044D90(Entity *, s32, u32);
void sub_8045BF8(u8 *, Item *);
u8 sub_80460F8(Position *, Item *, u32);

View File

@@ -1,19 +1,20 @@
#include "global.h"
#include "code_8045A00.h"
#include "constants/ability.h"
#include "constants/move_id.h"
#include "constants/status.h"
#include "constants/type.h"
#include "constants/weather.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "game_options.h"
#include "move_effects_target.h"
#include "pokemon.h"
#include "weather.h"
#include "game_options.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "text_util.h"
#include "weather.h"
struct unkStruct_80F520C
{
@@ -31,7 +32,6 @@ extern u8 *gUnknown_80FCC7C[];
extern u8 *gUnknown_80FCCAC[];
extern u8 *gUnknown_80FDCC8[];
extern void SetMessageArgument(char[], Entity*, u32);
void sub_80522F4(Entity *r0, Entity *r1, const char r2[]);
extern void sub_8042900(Entity *r0);
extern void sub_8042968(Entity *r0);

View File

@@ -1,10 +1,11 @@
#include "global.h"
#include "code_8045A00.h"
#include "constants/dungeon.h"
#include "structs/str_dungeon.h"
#include "dungeon_map_access.h"
#include "dungeon_util.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "dungeon.h"
#include "structs/str_dungeon.h"
struct unkStruct_806B7F8
{
@@ -24,7 +25,6 @@ extern s16 gUnknown_80F4DAA;
extern s16 gUnknown_80F4DAC;
extern u8 *gUnknown_80FED68[];
extern void SetMessageArgument(char[], struct Entity*, u32);
extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8);
extern void sub_805239C(struct Entity *r0, const char r1[]);
extern void sub_8042920(struct Entity *r0);
@@ -45,7 +45,7 @@ void sub_8071B48(void)
s32 level;
struct Dungeon *dungeon; // feels like a hack
struct unkStruct_806B7F8 local_2c;
entityPtr = NULL;
dungeon = gDungeon;
if ((dungeon->unk664 != 0) &&
@@ -69,10 +69,10 @@ void sub_8071B48(void)
entityPtr = entity2;
}
}
dungeon->unk662 = 0;
dungeon->unk17B34 = NULL;
counter = 0;
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{
@@ -90,7 +90,7 @@ void sub_8071B48(void)
}
}
else
{
{
if (counter >= gUnknown_80F4DA8) {
return;
}
@@ -150,7 +150,7 @@ void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp)
s32 newExp;
s32 expDiff;
EntityInfo *info;
info = target->info;
if (info->level != 100) {
if (!JoinLocationCannotUseItems(info)) {

View File

@@ -9,6 +9,7 @@
#include "code_806CD90.h"
#include "moves.h"
#include "pokemon_mid.h"
#include "status_checks_1.h"
extern u8 gAvailablePokemonNames[];
extern u8 gUnknown_202DFE8[];
@@ -18,7 +19,7 @@ extern u8 *gUnknown_80FE2EC[];
struct unkStruct_806B7F8
{
u16 species;
u8 unk2;
u8 unk2;
u32 unk4;
u16 level;
u8 fillA[0xC - 0xA];
@@ -30,7 +31,6 @@ extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8);
extern void sub_806BFC0(EntityInfo *, u32);
void sub_8069E0C(Entity *pokemon);
void sub_80522F4(Entity *r0, Entity *r1, const char r2[]);
extern void SetMessageArgument_2(u8 *, EntityInfo *, u32);
void sub_8042A44(Entity *r0);
void sub_8083D78(void);
extern bool8 sub_803D930(u32);
@@ -47,7 +47,7 @@ void sub_8072AC8(s16 *param_1, s16 species, s32 param_3)
s32 index;
species_s32 = species;
for(index = 0; index < MAX_MON_MOVES; index++) {
param_1[index] = MOVE_NOTHING;
}
@@ -109,7 +109,7 @@ void sub_8072B78(Entity *pokemon, Entity *target, s16 id)
EntityInfo *entityInfo;
LevelData levelData;
struct unkStruct_806B7F8 local_2c;
id_s32 = id;
entityInfo = target->info;
SetMessageArgument_2(gAvailablePokemonNames,entityInfo,0);

View File

@@ -1,4 +1,5 @@
#include "global.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_805D8C8.h"
#include "code_806CD90.h"
@@ -8,17 +9,17 @@
#include "constants/item.h"
#include "constants/status.h"
#include "constants/type.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
#include "dungeon_items.h"
#include "dungeon_movement.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "moves.h"
#include "move_effects_target.h"
#include "moves.h"
#include "pokemon.h"
#include "status_checks_1.h"
#include "structs/dungeon_entity.h"
#include "structs/str_dungeon.h"
extern u8 gAvailablePokemonNames[0x58];
extern u8 gUnknown_202DFE8[0x58];
@@ -167,7 +168,6 @@ extern u8 *gUnknown_80FBF84[];
extern void sub_8049ED4();
extern void sub_8040A84();
extern void sub_803E46C(u32);
extern void SetMessageArgument(u8 *buffer, Entity *r1, u32);
extern void sub_80522F4(Entity *pokemon, Entity *r1, const char[]);
extern void EntityUpdateStatusSprites(Entity *);
extern void sub_8042A74(Entity *r0);

View File

@@ -1,15 +1,16 @@
#include "global.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "constants/ability.h"
#include "constants/type.h"
#include "structs/str_dungeon.h"
#include "dungeon_leader.h"
#include "dungeon_util.h"
#include "code_80521D0.h"
#include "dungeon_ai.h"
#include "dungeon_leader.h"
#include "dungeon_pokemon_attributes.h"
#include "moves.h"
#include "dungeon_util.h"
#include "move_util.h"
#include "moves.h"
#include "structs/str_dungeon.h"
extern u8 UseAttack(Entity *);
extern void sub_805E804(void);
@@ -19,7 +20,6 @@ extern void sub_80426C8(u32, u32);
extern void sub_8068FE0(Entity *, u32, Entity *r2);
extern void nullsub_93(Position *);
extern void sub_80522F4(Entity *, Entity *, u8 *);
extern void SetMessageArgument(char[], Entity*, u32);
extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
extern void sub_80694C0(Entity *, s32, s32, u32);
extern void sub_804535C(Entity *, u32);
@@ -74,7 +74,7 @@ void sub_807E254(Entity *pokemon,Entity *target)
{
Position pokemonPos;
Position targetPos;
if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) {
SetMessageArgument(gAvailablePokemonNames,pokemon,0);
@@ -83,7 +83,7 @@ void sub_807E254(Entity *pokemon,Entity *target)
else if(HasAbility(target, ABILITY_SUCTION_CUPS))
{
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_80522F4(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places
sub_80522F4(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places
}
else
{
@@ -122,7 +122,7 @@ void sub_807E378(void)
{
u16 uVar2;
Entity *leader;
leader = GetLeader();
if (EntityExists(leader)) {

View File

@@ -1,35 +1,36 @@
#include "global.h"
#include "dungeon_ai.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "constants/ability.h"
#include "constants/dungeon_action.h"
#include "constants/direction.h"
#include "constants/dungeon_action.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.h"
#include "structs/str_dungeon.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"
#include "dungeon_util_1.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "structs/map.h"
#include "pokemon.h"
#include "status_checks.h"
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "targeting.h"
#include "tile_types.h"
@@ -37,7 +38,6 @@ extern char gAvailablePokemonNames[];
extern char *gPtrCouldntBeUsedMessage;
extern char *gPtrItsaMonsterHouseMessage;
extern void SetMessageArgument(char[], Entity*, u32);
extern u8 sub_8044B28(void);
extern void sub_807AB38(Entity *, u32);
extern void sub_8041888(u32);

View File

@@ -1,7 +1,10 @@
#include "global.h"
#include "code_806CD90.h"
#include "code_80521D0.h"
#include "dungeon_ai_attack.h"
#include "charge_move.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_806CD90.h"
#include "constants/direction.h"
#include "constants/dungeon_action.h"
#include "constants/iq_skill.h"
@@ -10,12 +13,10 @@
#include "constants/tactic.h"
#include "constants/targeting.h"
#include "constants/type.h"
#include "charge_move.h"
#include "dungeon_action.h"
#include "dungeon_ai.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_ai.h"
#include "dungeon_capabilities.h"
#include "structs/str_dungeon.h"
#include "dungeon_engine.h"
#include "dungeon_map_access.h"
#include "dungeon_pokemon_attributes.h"
@@ -23,14 +24,15 @@
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "items.h"
#include "move_checks.h"
#include "move_util.h"
#include "moves.h"
#include "move_checks.h"
#include "position_util.h"
#include "status_checks.h"
#include "status_checks_1.h"
#include "targeting.h"
#include "status_checks.h"
#include "structs/str_dungeon.h"
#include "targeting_flags.h"
#include "targeting.h"
#include "type_effectiveness.h"
#define REGULAR_ATTACK_INDEX 4
@@ -59,7 +61,6 @@ extern void sub_806A1B0(Entity *);
extern Item *sub_8044D90(Entity *, s32, u32);
extern bool8 sub_8044D40(ActionContainer *, u32);
extern bool8 sub_8055FA0(struct Entity *, u32, u32, u32, u32, struct Move *);
extern void SetMessageArgument(u8 *buffer, struct Entity *r1, u32);
extern void sub_8045BF8(u8 *, struct Item *);
extern void sub_8044DF0(struct Entity *, u32, u32);
extern void sub_8071DA4(struct Entity *);

View File

@@ -1,26 +1,28 @@
#include "global.h"
#include "dungeon_ai_leader.h"
#include "charge_move.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "constants/dungeon_action.h"
#include "constants/dungeon.h"
#include "constants/item.h"
#include "constants/iq_skill.h"
#include "constants/item.h"
#include "constants/move_id.h"
#include "constants/status.h"
#include "constants/targeting.h"
#include "constants/dungeon_action.h"
#include "code_80521D0.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_capabilities.h"
#include "dungeon_items.h"
#include "dungeon_leader.h"
#include "dungeon_visibility.h"
#include "dungeon_util.h"
#include "dungeon_capabilities.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_movement.h"
#include "charge_move.h"
#include "pokemon.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "pokemon_3.h"
#include "code_8077274_1.h"
#include "pokemon.h"
extern u8 gUnknown_202F221;
extern u8 gUnknown_202F222;
@@ -47,7 +49,6 @@ void sub_8085140(void);
void sub_807360C(void);
void sub_805EFB4(Entity *, u8);
void sub_8074FB0(Entity *, u8, Position *);
extern void SetMessageArgument(u8 *buffer, Entity *r1, u32);
void HandlePlaceItemAction(Entity *);
void HandlePickUpPlayerAction(Entity *);
@@ -58,7 +59,6 @@ void sub_807FD84(Entity *);
void sub_8066BD4(Entity*);
void HandleTalkFieldAction(Entity *);
void HandleUseMovePlayerAction(Entity *);
void sub_804267C(void);
void HandleUseOrbAction(Entity *);
void sub_8067904(Entity *, u32);
void HandleGiveItemAction(Entity *);
@@ -125,7 +125,7 @@ bool8 sub_8072CF4(Entity *entity)
gUnknown_203B434 = 1;
info = entity->info;
info->useHeldItem = FALSE;
info->fillF3 = 0;
info->unkF3 = FALSE;
gDungeon->unkB8 = entity;
if (gUnknown_80F58F4[(info->action).action][0] != 0) {
if (info->isTeamLeader) {
@@ -175,19 +175,19 @@ bool8 sub_8072CF4(Entity *entity)
case ACTION_WALK:
if(info->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD)
{
goto _282;
goto _282;
}
else if(info->immobilize.immobilizeStatus == STATUS_CONSTRICTION)
{
goto _282;
goto _282;
}
else if(info->immobilize.immobilizeStatus == STATUS_INGRAIN)
{
goto _282;
goto _282;
}
else if(info->immobilize.immobilizeStatus == STATUS_WRAP)
{
goto _282;
goto _282;
}
else if(info->immobilize.immobilizeStatus == STATUS_WRAPPED)
{
@@ -232,7 +232,7 @@ bool8 sub_8072CF4(Entity *entity)
}
else
{
sub_804267C();
PlayStairsSound();
gDungeon->unk2 = 1;
gUnknown_202F32C = (info->action).direction;
}
@@ -297,7 +297,7 @@ bool8 sub_8072CF4(Entity *entity)
break;
case ACTION_STRUGGLE:
sub_8067904(entity, MOVE_STRUGGLE);
break;
break;
case ACTION_REGULAR_ATTACK:
sub_8067904(entity, MOVE_REGULAR_ATTACK);
break;
@@ -312,7 +312,7 @@ bool8 sub_8072CF4(Entity *entity)
break;
case ACTION_THROW_ITEM_AI:
HandleThrowItemAIAction(entity);
break;
break;
case ACTION_SECOND_THOUGHTS:
SetMessageArgument(gAvailablePokemonNames,entity,0);
SendMessage(entity,*gUnknown_80FE478);

View File

@@ -1,12 +1,14 @@
#include "global.h"
#include "code_80869E4.h"
#include "dungeon_items.h"
#include "code_8045A00.h"
#include "code_80869E4.h"
#include "dungeon_capabilities.h"
#include "structs/str_dungeon.h"
#include "dungeon_leader.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "pokemon.h"
#include "structs/str_dungeon.h"
extern u8 gAvailablePokemonNames[];
extern s32 gUnknown_810A3F0[];
@@ -22,7 +24,6 @@ extern void sub_80861A8(void);
extern void PrintFieldMessage(u32, u8 *, u32);
extern void sub_803E708(u32, u32);
extern void sub_80416E0(Position32 *r0, u32, bool8);
extern void SetMessageArgument(u8 *r0, Entity *r1, u32);
extern void sub_80421C0(Entity *, u32);
extern void sub_80855E4(void *);
extern void PlaySoundEffect(u32);

View File

@@ -1,6 +1,7 @@
#include "global.h"
#include "dungeon_pokemon_attributes.h"
#include "code_8045A00.h"
#include "constants/ability.h"
#include "constants/dungeon.h"
#include "constants/iq_skill.h"
@@ -8,13 +9,13 @@
#include "constants/status.h"
#include "constants/tactic.h"
#include "constants/type.h"
#include "structs/str_dungeon.h"
#include "dungeon_items.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "moves.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "pokemon.h"
#include "structs/str_dungeon.h"
const s16 gItemMasterMinWildLevel[] = {16};
@@ -23,7 +24,6 @@ extern u32 gUnknown_80FC31C;
extern u32 gUnknown_80FCEFC;
extern u32 gUnknown_80FC2FC;
extern bool8 sub_805744C(Entity *, Move *, u32);
extern void SetMessageArgument(char[], Entity*, u32);
extern void sub_80522F4(Entity *r1, Entity *r2, u32);
bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage)

View File

@@ -1,13 +1,14 @@
#include "global.h"
#include "charge_move.h"
#include "code_8045A00.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "constants/ability.h"
#include "constants/status.h"
#include "constants/targeting.h"
#include "constants/type.h"
#include "constants/weather.h"
#include "charge_move.h"
#include "number_util.h"
#include "structs/str_dungeon.h"
#include "structs/dungeon_entity.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_items.h"
#include "dungeon_map_access.h"
@@ -15,16 +16,16 @@
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "structs/map.h"
#include "moves.h"
#include "move_effects_target.h"
#include "moves.h"
#include "number_util.h"
#include "pokemon.h"
#include "status.h"
#include "status_actions.h"
#include "status_checks_1.h"
#include "status.h"
#include "structs/dungeon_entity.h"
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "tile_types.h"
#include "weather.h"
@@ -205,7 +206,6 @@ extern void sub_8045C28(Item *, u8 , u8);
extern void sub_805A7D4(Entity *, Entity *, Item *, Position *);
extern void MudWaterSportEffect(u32);
extern void sub_807D148(Entity *pokemon, Entity *target, u32 r2, Position *r3);
extern void SetMessageArgument_2(u8 *buffer, EntityInfo *r1, u32);
extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);
extern void sub_806A6E8(Entity *);
@@ -225,7 +225,6 @@ bool8 sub_8057308(Entity *pokemon, s32 chance);
bool8 sub_80571F0(Entity * pokemon, Move *move);
extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32);
extern void SetMessageArgument(char[], Entity*, u32);
extern u32 sub_8055640(Entity *, Entity *, Move *, u32, u32);
u8 sub_8057620(u32 param_1);
extern s16 sub_8094828(u16, u8);

View File

@@ -1,35 +1,38 @@
#include "global.h"
#include "move_effects_target.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "constants/ability.h"
#include "constants/dungeon_action.h"
#include "constants/direction.h"
#include "constants/dungeon_action.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.h"
#include "structs/str_dungeon.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"
#include "dungeon_util_1.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "structs/map.h"
#include "move_effects_target.h"
#include "pokemon.h"
#include "status_checks.h"
#include "status_checks_1.h"
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "targeting.h"
#include "tile_types.h"
@@ -139,8 +142,6 @@ extern void sub_8041EE8(Entity *);
extern void sub_8041EC8(Entity *);
extern void sub_8041ED8(Entity *);
extern void EntityUpdateStatusSprites(Entity *);
extern void SetMessageArgument(char[], Entity*, u32);
extern void SetMessageArgument_2(char[], EntityInfo*, u32);
extern void sub_8041AF4(Entity *);
extern void sub_80522F4(Entity *r1, Entity *r2, u8 *);
extern void nullsub_91(Entity *);
@@ -228,7 +229,7 @@ void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, u8 displayMessage
}
bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage)
{
{
if ((!EntityExists(target)) ||
((SetMessageArgument(gAvailablePokemonNames,target,0), param_3 != 0 &&
(HasSafeguardStatus(pokemon,target,displayMessage))))) {
@@ -265,7 +266,7 @@ void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns)
{
bool8 hasNightmare;
EntityInfo *entityInfo;
hasNightmare = FALSE;
if (!CannotSleep(pokemon, target, 1, TRUE)) {
entityInfo = target->info;
@@ -302,7 +303,7 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns)
{
bool8 isSleeping;
EntityInfo *entityInfo;
isSleeping = FALSE;
if (!CannotSleep(pokemon, target, 0, TRUE)) {
entityInfo = target->info;
@@ -338,7 +339,7 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns)
void YawnedStatusTarget(Entity * pokemon, Entity * target, s32 turns)
{
EntityInfo *entityInfo;
if (CannotSleep(pokemon,target,1,TRUE)) {
return;
}
@@ -369,7 +370,7 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target)
{
EntityInfo *entityInfo;
bool8 isAsleep;
isAsleep = FALSE;
if (!EntityExists(target)) {
return;
@@ -403,7 +404,7 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target)
void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns, bool8 displayMessage)
{
EntityInfo *entityInfo;
if (!EntityExists(target)) {
return;
}
@@ -438,7 +439,7 @@ void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns
void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage)
{
EntityInfo *entityInfo;
if (EntityExists(target)) {
entityInfo = target->info;
@@ -476,7 +477,7 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis
struct Tile *tile_2;
Entity *entity;
s32 index;
if (!EntityExists(target)) {
return;
}
@@ -563,7 +564,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag
struct Tile *tile;
Entity *entity;
s32 index;
if (!EntityExists(target)) {
return;
}
@@ -605,7 +606,7 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag
sub_806CE94(target, 8);
}
else
{
{
sub_80522F4(pokemon,target,*gUnknown_80FB5D4);
}
}
@@ -652,7 +653,7 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM
struct Tile *tile;
Entity *entity;
s32 index;
if (!EntityExists(target)) {
return;
}
@@ -730,7 +731,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage)
{
EntityInfo *entityInfo;
struct Tile *tile;
if (!EntityExists(target)) {
return;
}
@@ -779,7 +780,7 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32
EntityInfo *entityInfo;
s32 param_3_s32 = param_3;
bool8 displayMessage_u8 = displayMessage;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage_u8))) {
entityInfo = target->info;
if ((u8)(entityInfo->immobilize.immobilizeStatus - 3U) < 2) {
@@ -809,7 +810,7 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32
void ImmobilizedStatusTarget(Entity * pokemon, Entity * target)
{
EntityInfo *entityInfo;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
entityInfo = target->info;
if ((u8)(entityInfo->immobilize.immobilizeStatus - 3U) < 2) {
@@ -839,7 +840,7 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target)
{
EntityInfo *entityInfo;
EntityInfo *entityInfo2;
if (EntityExists(target)) {
entityInfo = target->info;
entityInfo2 = entityInfo;
@@ -867,7 +868,7 @@ void WrapTarget(Entity * pokemon, Entity * target)
s32 *piVar3;
s32 *iVar5;
EntityInfo * pokemonEntityData;
if (!EntityExists(target)) {
return;
}
@@ -948,7 +949,7 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target)
EntityInfo * entityInfo;
Entity * entity;
s32 index;
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
sub_8041C08(target);
targetEntityInfo = target->info;
@@ -994,7 +995,7 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de
{
EntityInfo *entityInfo;
s32 attackStage = decrement;
if (!EntityExists(target)) {
return;
}
@@ -1049,7 +1050,7 @@ void LowerDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 d
{
EntityInfo *entityInfo;
s32 defenseStage = decrement;
if (!EntityExists(target)) {
return;
}
@@ -1089,7 +1090,7 @@ void RaiseAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 in
{
EntityInfo *entityInfo;
s32 attackStage = increment;
if (!EntityExists(target)) {
return;
}
@@ -1129,7 +1130,7 @@ void RaiseDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 i
{
EntityInfo *entityInfo;
s32 defenseStage = increment;
if (!EntityExists(target)) {
return;
}

View File

@@ -1,21 +1,24 @@
#include "global.h"
#include "status.h"
#include "code_8045A00.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "constants/ability.h"
#include "constants/status.h"
#include "constants/type.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_ai_movement.h"
#include "structs/str_dungeon.h"
#include "dungeon_map_access.h"
#include "dungeon_util.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_items.h"
#include "code_808417C.h"
#include "code_8077274_1.h"
#include "dungeon_map_access.h"
#include "dungeon_movement.h"
#include "structs/map.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "math.h"
#include "status_checks_1.h"
#include "structs/map.h"
#include "structs/str_dungeon.h"
extern u8 gAvailablePokemonNames[];
extern u8 gUnknown_202DE58[];
@@ -161,8 +164,6 @@ extern void sub_8041FD8(Entity *r0, u32 r1);
extern void sub_80522F4(Entity *r1, Entity *r2, u8 *);
extern void sub_804201C(Entity *r0, u32 r1);
extern void sub_8041FFC(Entity *r0, u32 r1);
extern void SetMessageArgument(char[], Entity*, u32);
extern void SetMessageArgument_2(char[], EntityInfo*, u32);
extern void sub_8041C58(Entity *r0);
extern void EntityUpdateStatusSprites(Entity *);
extern void sub_8042040(Entity *, s32);

View File

@@ -1,31 +1,32 @@
#include "global.h"
#include "status_actions.h"
#include "code_806CD90.h"
#include "charge_move.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "code_808417C.h"
#include "charge_move.h"
#include "constants/ability.h"
#include "constants/move_id.h"
#include "constants/status.h"
#include "constants/type.h"
#include "constants/weather.h"
#include "dungeon_engine.h"
#include "dungeon_ai_targeting.h"
#include "structs/str_dungeon.h"
#include "dungeon_engine.h"
#include "dungeon_items.h"
#include "dungeon_map_access.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "structs/map.h"
#include "moves.h"
#include "move_util.h"
#include "moves.h"
#include "number_util.h"
#include "pokemon.h"
#include "status.h"
#include "status_checks_1.h"
#include "status.h"
#include "structs/map.h"
#include "structs/str_dungeon.h"
#include "text_util.h"
#include "tile_types.h"
#include "trap.h"
@@ -52,7 +53,6 @@ extern u32 sub_8055864(Entity *pokemon, Entity *target, Move *param_3, s32 param
extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, Position *r3);
extern void sub_807FE04(Position *, u32);
extern void sub_807DB74(Entity *);
extern void SetMessageArgument(char[], Entity*, u32);
extern void HandleLuminousOrbAction(Entity *pokemon);
extern void sub_807D510(Entity *, Entity *);
extern void sub_807DA14(Entity *, Entity *, s32);

View File

@@ -1,12 +1,13 @@
#include "global.h"
#include "status_checks.h"
#include "charge_move.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "constants/direction.h"
#include "constants/dungeon_action.h"
#include "constants/status.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "charge_move.h"
#include "dungeon_action.h"
#include "dungeon_ai_attack.h"
#include "dungeon_capabilities.h"
@@ -24,8 +25,6 @@ extern u8 gAvailablePokemonNames[];
extern u8 *gUnknown_80F95EC[];
extern char *gPtrMoveInterruptedMessage[];
extern void SetMessageArgument(char[], Entity*, u32);
bool8 HasStatusAffectingActions(Entity *pokemon)
{
EntityInfo *pokemonInfo = pokemon->info;
@@ -116,7 +115,7 @@ bool8 sub_80701A4(Entity *pokemon)
s32 index_1;
EntityInfo * pokemonInfo;
u8 *r7;
pokemonInfo = pokemon->info;
flag = FALSE;
SetMessageArgument(gAvailablePokemonNames, pokemon, 0);
@@ -177,7 +176,7 @@ bool8 sub_80701A4(Entity *pokemon)
index_1 = index;
r7 = &pokemonInfo->action.unk4[1].actionUseIndex;
if((index > 0) && (move->moveFlags & MOVE_FLAG_SUBSEQUENT_IN_LINK_CHAIN))
{
{
do {
move2 = &pokemonInfo->moves[index_1 + 1];
move2--, index_1--;
@@ -195,7 +194,7 @@ bool8 sub_80701A4(Entity *pokemon)
}
}
sub_8079764(pokemon);
}
}
return FALSE;
}
}

View File

@@ -55,7 +55,7 @@ s32 sub_8070828(Entity *pokemon, bool8 displayMessage)
}
}
void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum)
void SetMessageArgument_2(char buffer[], EntityInfo *param_2, s32 colorNum)
{
if (((gDungeon->blinded ||
gDungeon->hallucinating) ||

View File

@@ -1,21 +1,22 @@
#include "global.h"
#include "constants/type.h"
#include "constants/trap.h"
#include "structs/str_dungeon.h"
#include "trap.h"
#include "status.h"
#include "code_80521D0.h"
#include "items.h"
#include "moves.h"
#include "code_808417C.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_808417C.h"
#include "constants/trap.h"
#include "constants/type.h"
#include "dungeon_engine.h"
#include "dungeon_items.h"
#include "dungeon_random.h"
#include "dungeon_map_access.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "structs/map.h"
#include "items.h"
#include "move_effects_target.h"
#include "moves.h"
#include "status.h"
#include "structs/map.h"
#include "structs/str_dungeon.h"
extern u8 gAvailablePokemonNames[];
extern u8 gUnknown_202DE58[];
@@ -72,7 +73,6 @@ bool8 sub_8045888(Entity *);
void SetTrap(Tile *, u32);
void sub_803E708(u32, u32);
u8 sub_8043D10(void);
void SetMessageArgument(u8 *, Entity *, u32);
void sub_8068FE0(Entity *, u32, Entity *);
void sub_805239C(Entity *, u8 *);
void sub_8045C28(Item *, u8 , u8);

View File

@@ -257,7 +257,7 @@ void sub_8080E0C(unkStruct_8094924 *param_1,Entity *param_2)
bool8 *pbStack_58;
bool8 *pbStack_54;
bool8 *pbStack_50;
u8 *puStack_4c;
bool8 *puStack_4c;
bool8 *pbStack_48;
bool8 *pbStack_44;
bool8 *pbStack_40;
@@ -351,7 +351,7 @@ void sub_8080E0C(unkStruct_8094924 *param_1,Entity *param_2)
pbStack_58 = &info->powerEars;
pbStack_54 = &info->scanning;
pbStack_50 = &info->stairSpotter;
puStack_4c = &info->fillF3;
puStack_4c = &info->unkF3;
pbStack_48 = &info->grudge;
puStack_34 = &info->unkFB;
pbStack_44 = &info->exposed;
@@ -483,7 +483,7 @@ void sub_8081454(unkStruct_8094924 *param_1)
for(iVar4 = 0; iVar4 < 8; iVar4++)
{
SavePosition(param_1,&gDungeon->unkE220[iVar4]);
}
}
sub_80830F8(param_1,&gDungeon->unkE240);
sub_80830F8(param_1,&gDungeon->unkE250);
sub_808312C(param_1,&gDungeon->unkE260);