merge with master

This commit is contained in:
DizzyEggg 2024-11-18 12:00:41 +01:00
commit 361d20a623
246 changed files with 24094 additions and 16897 deletions

1
.gitignore vendored
View File

@ -43,3 +43,4 @@ build/
*.ss[0-9] *.ss[0-9]
*.pyc *.pyc
__pycache__/ __pycache__/
*.syms

View File

@ -3,7 +3,7 @@
.syntax unified .syntax unified
.text .text
thumb_func_start LoadTitleScreen thumb_func_start LoadTitleScreen
LoadTitleScreen: LoadTitleScreen:
@ -1262,7 +1262,7 @@ sub_8001064:
movs r0, 0x4 movs r0, 0x4
ldrsh r1, [r5, r0] ldrsh r1, [r5, r0]
adds r0, r4, 0 adds r0, r4, 0
bl CopyMonsterNametoBuffer bl CopyMonsterNameToBuffer
mov r0, sp mov r0, sp
adds r1, r4, 0 adds r1, r4, 0
bl CopyStringtoBuffer bl CopyStringtoBuffer
@ -1293,7 +1293,7 @@ _080010AE:
movs r0, 0x6 movs r0, 0x6
ldrsh r1, [r5, r0] ldrsh r1, [r5, r0]
adds r0, r4, 0 adds r0, r4, 0
bl CopyMonsterNametoBuffer bl CopyMonsterNameToBuffer
mov r0, sp mov r0, sp
adds r1, r4, 0 adds r1, r4, 0
bl CopyStringtoBuffer bl CopyStringtoBuffer

View File

@ -609,7 +609,7 @@ _0800FE3C:
lsls r0, 8 lsls r0, 8
str r0, [sp, 0x10] str r0, [sp, 0x10]
add r0, sp, 0xC add r0, sp, 0xC
bl sub_800A0B0 bl Atan2_4096
adds r2, r0, 0 adds r2, r0, 0
ldr r0, [sp, 0xC] ldr r0, [sp, 0xC]
cmp r0, 0 cmp r0, 0
@ -1294,7 +1294,7 @@ _08010392:
str r0, [sp, 0xC] str r0, [sp, 0xC]
str r3, [sp, 0x10] str r3, [sp, 0x10]
add r0, sp, 0xC add r0, sp, 0xC
bl sub_800A0B0 bl Atan2_4096
ldr r1, _08010474 ldr r1, _08010474
adds r3, r0, r1 adds r3, r0, r1
cmp r3, 0 cmp r3, 0

View File

@ -1728,7 +1728,7 @@ _08040E6E:
ldr r0, _08040ECC ldr r0, _08040ECC
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r1, 0xD2 movs r1, 0xD2
lsls r1, 1 lsls r1, 1
adds r0, r6, 0 adds r0, r6, 0
@ -2501,7 +2501,7 @@ _080414A0:
_080414A4: _080414A4:
adds r0, r4, 0 adds r0, r4, 0
adds r1, r5, 0 adds r1, r5, 0
bl MoveMatchesChargingStatus bl MoveMatchesBideClassStatus
adds r1, r0, 0 adds r1, r0, 0
lsls r1, 24 lsls r1, 24
lsrs r1, 24 lsrs r1, 24

View File

@ -1,75 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_8045064
sub_8045064:
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
movs r1, 0
ldr r0, _080450D4
mov r8, r0
ldr r0, [r0]
cmp r1, r0
bge _080450C8
mov r7, r8
ldr r2, _080450D8
mov r9, r2
ldr r0, _080450DC
mov r12, r0
_08045082:
adds r4, r1, 0x1
ldr r0, [r7]
adds r5, r4, 0
cmp r5, r0
bge _080450BE
lsls r0, r1, 2
mov r1, r12
adds r3, r0, r1
mov r6, r9
lsls r0, r5, 2
adds r2, r0, r1
_08045098:
ldrh r1, [r3]
lsls r1, 3
adds r1, r6
ldrh r0, [r2]
lsls r0, 3
adds r0, r6
ldr r1, [r1]
ldr r0, [r0]
cmp r1, r0
ble _080450B4
ldr r1, [r3]
ldr r0, [r2]
str r0, [r3]
str r1, [r2]
_080450B4:
adds r2, 0x4
adds r4, 0x1
ldr r0, [r7]
cmp r4, r0
blt _08045098
_080450BE:
adds r1, r5, 0
mov r2, r8
ldr r0, [r2]
cmp r1, r0
blt _08045082
_080450C8:
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080450D4: .4byte gUnknown_202EE6C
_080450D8: .4byte gUnknown_80F7C54
_080450DC: .4byte gUnknown_202EE44
thumb_func_end sub_8045064

View File

@ -1,785 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_80453AC
sub_80453AC:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
lsls r0, 16
asrs r0, 16
mov r8, r0
movs r0, 0x1
negs r0, r0
mov r9, r0
mov r0, r8
bl GetBodySize
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
movs r0, 0x6
subs r3, r0, r6
ldr r4, _080453D8
b _080453DE
.align 2, 0
_080453D8: .4byte gUnknown_202EE70
_080453DC:
adds r5, 0x1
_080453DE:
cmp r5, r3
bgt _08045400
movs r2, 0
cmp r2, r6
bge _080453FA
adds r1, r5, r4
b _080453F4
_080453EC:
adds r1, 0x1
adds r2, 0x1
cmp r2, r6
bge _080453FA
_080453F4:
ldrb r0, [r1]
cmp r0, 0
beq _080453EC
_080453FA:
cmp r2, r6
bne _080453DC
mov r9, r5
_08045400:
movs r0, 0x1
negs r0, r0
cmp r9, r0
beq _080454FC
movs r5, 0
ldr r7, _080454DC
_0804540C:
ldr r1, _080454E0
ldr r0, [r1]
lsls r1, r5, 2
ldr r2, _080454E4
adds r0, r2
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
lsrs r0, 24
mov r10, r0
cmp r0, 0
bne _080454F0
movs r0, 0x1
str r0, [r4]
adds r0, r4, 0
adds r0, 0x24
strb r5, [r0]
ldr r1, _080454E0
ldr r0, [r1]
adds r0, r7
str r0, [r4, 0x70]
mov r2, r8
strh r2, [r0, 0x2]
movs r0, 0
mov r1, r8
bl sub_8069F54
ldr r1, [r4, 0x70]
strh r0, [r1, 0x4]
ldr r0, [r4, 0x70]
movs r5, 0
strb r5, [r0, 0x6]
movs r0, 0
mov r1, r8
bl sub_8069F54
lsls r0, 16
asrs r0, 16
bl GetSpriteData
str r0, [r4, 0x64]
mov r1, r9
lsls r0, r1, 4
adds r0, 0x40
adds r1, r4, 0
adds r1, 0x68
strh r0, [r1]
adds r1, 0x2
movs r0, 0x7
strb r0, [r1]
adds r0, r4, 0
adds r0, 0x6C
movs r2, 0
strb r2, [r0]
adds r1, 0x1
movs r0, 0xFF
strb r0, [r1]
adds r0, r4, 0
adds r0, 0x6D
movs r5, 0x1
strb r5, [r0]
adds r0, 0x2
strb r5, [r0]
mov r0, r10
str r0, [r4, 0x1C]
bl sub_8045ACC
ldr r0, [r4, 0x70]
ldr r1, _080454E8
adds r0, r1
mov r2, r9
strb r2, [r0]
ldr r0, [r4, 0x70]
movs r5, 0xB4
lsls r5, 1
adds r0, r5
strb r6, [r0]
cmp r6, 0
beq _080454C6
ldr r3, _080454EC
movs r2, 0x1
adds r1, r6, 0
_080454B6:
mov r5, r9
adds r0, r5, r3
strb r2, [r0]
movs r0, 0x1
add r9, r0
subs r1, 0x1
cmp r1, 0
bne _080454B6
_080454C6:
ldr r1, _080454E0
ldr r0, [r1]
movs r2, 0xCD
lsls r2, 3
adds r0, r2
ldrh r2, [r0]
adds r1, r2, 0x1
strh r1, [r0]
strh r2, [r4, 0x26]
adds r0, r4, 0
b _080454FE
.align 2, 0
_080454DC: .4byte 0x0000069c
_080454E0: .4byte gDungeon
_080454E4: .4byte 0x0001357c
_080454E8: .4byte 0x00000167
_080454EC: .4byte gUnknown_202EE70
_080454F0:
movs r0, 0x82
lsls r0, 2
adds r7, r0
adds r5, 0x1
cmp r5, 0x3
ble _0804540C
_080454FC:
movs r0, 0
_080454FE:
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_80453AC
thumb_func_start sub_804550C
sub_804550C:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x8
lsls r0, 16
asrs r0, 16
mov r8, r0
movs r0, 0x1
negs r0, r0
mov r9, r0
mov r0, r8
bl GetBodySize
lsls r0, 24
lsrs r7, r0, 24
movs r5, 0
movs r0, 0x10
subs r3, r0, r7
ldr r4, _08045538
b _0804553E
.align 2, 0
_08045538: .4byte gUnknown_202EE76
_0804553C:
adds r5, 0x1
_0804553E:
cmp r5, r3
bgt _08045560
movs r2, 0
cmp r2, r7
bge _0804555A
adds r1, r5, r4
b _08045554
_0804554C:
adds r1, 0x1
adds r2, 0x1
cmp r2, r7
bge _0804555A
_08045554:
ldrb r0, [r1]
cmp r0, 0
beq _0804554C
_0804555A:
cmp r2, r7
bne _0804553C
mov r9, r5
_08045560:
movs r0, 0x1
negs r0, r0
cmp r9, r0
bne _0804556A
b _08045670
_0804556A:
movs r5, 0
movs r1, 0x1
mov r10, r1
ldr r2, _08045650
mov r3, r9
lsls r0, r3, 4
adds r0, 0xA0
str r0, [sp]
_0804557A:
ldr r1, _08045654
ldr r0, [r1]
lsls r1, r5, 2
ldr r3, _08045658
adds r0, r3
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
str r2, [sp, 0x4]
bl EntityExists
lsls r0, 24
lsrs r6, r0, 24
ldr r2, [sp, 0x4]
cmp r6, 0
bne _08045664
mov r0, r10
str r0, [r4]
adds r0, r4, 0
adds r0, 0x24
strb r5, [r0]
subs r0, 0x2
strb r6, [r0]
ldr r1, _08045654
ldr r0, [r1]
adds r0, r2
str r0, [r4, 0x70]
mov r2, r8
strh r2, [r0, 0x2]
movs r0, 0
mov r1, r8
bl sub_8069F54
ldr r1, [r4, 0x70]
strh r0, [r1, 0x4]
ldr r0, [r4, 0x70]
mov r3, r10
strb r3, [r0, 0x6]
movs r0, 0
mov r1, r8
bl sub_8069F54
lsls r0, 16
asrs r0, 16
bl GetSpriteData
str r0, [r4, 0x64]
adds r0, r4, 0
adds r0, 0x68
mov r5, sp
ldrh r5, [r5]
strh r5, [r0]
adds r1, r4, 0
adds r1, 0x6A
movs r0, 0x7
strb r0, [r1]
adds r0, r4, 0
adds r0, 0x6C
movs r1, 0
strb r1, [r0]
adds r1, r4, 0
adds r1, 0x6B
movs r0, 0xFF
strb r0, [r1]
adds r0, r4, 0
adds r0, 0x6D
mov r2, r10
strb r2, [r0]
adds r0, 0x2
strb r2, [r0]
str r6, [r4, 0x1C]
ldr r0, [r4, 0x70]
ldr r3, _0804565C
adds r0, r3
mov r5, r9
strb r5, [r0]
ldr r0, [r4, 0x70]
movs r1, 0xB4
lsls r1, 1
adds r0, r1
strb r7, [r0]
cmp r7, 0
beq _08045636
ldr r3, _08045660
movs r2, 0x1
adds r1, r7, 0
_08045626:
mov r5, r9
adds r0, r5, r3
strb r2, [r0]
movs r0, 0x1
add r9, r0
subs r1, 0x1
cmp r1, 0
bne _08045626
_08045636:
bl sub_8045ACC
ldr r1, _08045654
ldr r0, [r1]
movs r2, 0xCD
lsls r2, 3
adds r0, r2
ldrh r2, [r0]
adds r1, r2, 0x1
strh r1, [r0]
strh r2, [r4, 0x26]
adds r0, r4, 0
b _08045672
.align 2, 0
_08045650: .4byte 0x00000ebc
_08045654: .4byte gDungeon
_08045658: .4byte 0x0001358c
_0804565C: .4byte 0x00000167
_08045660: .4byte gUnknown_202EE76
_08045664:
movs r3, 0x82
lsls r3, 2
adds r2, r3
adds r5, 0x1
cmp r5, 0xF
ble _0804557A
_08045670:
movs r0, 0
_08045672:
add sp, 0x8
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_804550C
thumb_func_start sub_8045684
sub_8045684:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
mov r10, r1
lsls r0, 24
lsrs r0, 24
mov r8, r0
lsls r2, 24
lsrs r2, 24
mov r9, r2
movs r5, 0
ldr r7, _080456E4
ldr r6, _080456E8
_080456A2:
ldr r0, [r7]
lsls r1, r5, 2
ldr r2, _080456EC
adds r0, r2
adds r0, r1
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0
bne _080456F0
movs r0, 0x2
str r0, [r4]
ldr r0, [r7]
adds r0, r6
str r0, [r4, 0x70]
mov r2, r8
strb r2, [r0]
ldr r0, [r4, 0x70]
mov r2, r9
strb r2, [r0, 0x1]
str r1, [r4, 0x1C]
adds r0, r4, 0
adds r0, 0x22
strb r1, [r0]
mov r2, r10
ldr r0, [r2]
str r0, [r4, 0x4]
strh r1, [r4, 0x26]
adds r0, r4, 0
b _080456FA
.align 2, 0
_080456E4: .4byte gDungeon
_080456E8: .4byte 0x00003908
_080456EC: .4byte 0x0001371c
_080456F0:
adds r6, 0x4
adds r5, 0x1
cmp r5, 0x3F
ble _080456A2
movs r0, 0
_080456FA:
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8045684
thumb_func_start sub_8045708
sub_8045708:
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
mov r8, r0
ldr r1, _08045744
ldr r0, _08045748
ldr r0, [r0]
ldr r2, _0804574C
adds r0, r2
movs r3, 0
ldrsh r0, [r0, r3]
adds r0, r1
ldrb r0, [r0]
cmp r0, 0x1
bne _0804579C
mov r1, r8
movs r2, 0
ldrsh r0, [r1, r2]
movs r3, 0x2
ldrsh r1, [r1, r3]
bl GetTileSafe
ldrh r1, [r0]
movs r0, 0x3
ands r0, r1
cmp r0, 0x2
bne _0804579C
b _080457C4
.align 2, 0
_08045744: .4byte gDungeonWaterType
_08045748: .4byte gDungeon
_0804574C: .4byte 0x00003a0e
_08045750:
movs r0, 0x3
str r0, [r4]
ldr r0, _08045798
adds r1, r6, r0
mov r2, r9
ldr r0, [r2]
adds r0, r1
str r0, [r4, 0x70]
mov r3, r8
ldr r0, [r3]
str r0, [r4, 0x4]
movs r1, 0
ldrsh r0, [r3, r1]
lsls r1, r0, 1
adds r1, r0
lsls r1, 3
adds r1, 0x4
lsls r1, 8
movs r2, 0x2
ldrsh r0, [r3, r2]
lsls r2, r0, 1
adds r2, r0
lsls r2, 3
adds r2, 0x4
lsls r2, 8
adds r0, r4, 0
bl SetEntityPixelPos
movs r0, 0
strh r7, [r4, 0x26]
adds r1, r4, 0
adds r1, 0x22
strb r0, [r1]
str r7, [r4, 0x1C]
adds r0, r4, 0
b _080457C6
.align 2, 0
_08045798: .4byte 0x00003804
_0804579C:
movs r5, 0
ldr r3, _080457D4
mov r9, r3
_080457A2:
mov r1, r9
ldr r0, [r1]
lsls r6, r5, 2
ldr r2, _080457D8
adds r0, r2
adds r0, r6
ldr r4, [r0]
adds r0, r4, 0
bl EntityExists
lsls r0, 24
lsrs r7, r0, 24
cmp r7, 0
beq _08045750
adds r5, 0x1
cmp r5, 0x3F
ble _080457A2
_080457C4:
movs r0, 0
_080457C6:
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r1}
bx r1
.align 2, 0
_080457D4: .4byte gDungeon
_080457D8: .4byte 0x0001361c
thumb_func_end sub_8045708
thumb_func_start sub_80457DC
sub_80457DC:
push {r4-r6,lr}
adds r4, r0, 0
movs r0, 0x5
str r0, [r4]
movs r6, 0
movs r5, 0
strh r5, [r4, 0x4]
strh r5, [r4, 0x6]
adds r0, r4, 0
movs r1, 0
movs r2, 0
bl SetEntityPixelPos
strh r5, [r4, 0x26]
adds r4, 0x22
strb r6, [r4]
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_80457DC
thumb_func_start sub_8045804
sub_8045804:
push {r4-r6,lr}
adds r4, r0, 0
bl GetEntityType
cmp r0, 0x1
beq _0804581C
cmp r0, 0x1
bcc _08045880
cmp r0, 0x5
beq _08045880
_08045818:
movs r0, 0x1
b _08045882
_0804581C:
adds r0, r4, 0
adds r0, 0x20
ldrb r0, [r0]
cmp r0, 0
beq _08045880
ldr r0, _08045874
ldr r1, [r0]
ldr r0, _08045878
adds r2, r1, r0
ldr r5, [r2, 0x10]
ldr r3, [r4, 0x70]
ldrb r0, [r3, 0x6]
cmp r0, 0
beq _08045818
ldr r6, _0804587C
adds r0, r1, r6
ldrb r0, [r0]
cmp r0, 0
bne _0804584C
adds r0, r3, 0
adds r0, 0xE4
ldrb r0, [r0]
cmp r0, 0x1
beq _08045880
_0804584C:
adds r0, r2, 0
adds r0, 0x23
ldrb r0, [r0]
cmp r0, 0
bne _08045818
adds r0, r2, 0
adds r0, 0x25
ldrb r0, [r0]
cmp r0, 0
bne _08045818
cmp r5, 0
beq _08045880
adds r1, r4, 0x4
adds r0, r2, 0
bl IsPositionActuallyInSight
lsls r0, 24
lsrs r0, 24
b _08045882
.align 2, 0
_08045874: .4byte gDungeon
_08045878: .4byte 0x000181e8
_0804587C: .4byte 0x0001820f
_08045880:
movs r0, 0
_08045882:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_8045804
thumb_func_start sub_8045888
sub_8045888:
push {r4,r5,lr}
adds r4, r0, 0
adds r0, 0x20
ldrb r0, [r0]
cmp r0, 0
beq _08045988
ldr r1, [r4, 0xC]
cmp r1, 0
bge _0804589C
adds r1, 0xFF
_0804589C:
asrs r1, 8
ldr r0, _080458F0
ldr r2, [r0]
ldr r3, _080458F4
adds r0, r2, r3
movs r5, 0
ldrsh r0, [r0, r5]
subs r3, r1, r0
ldr r0, [r4, 0x10]
cmp r0, 0
bge _080458B4
adds r0, 0xFF
_080458B4:
asrs r0, 8
ldr r5, _080458F8
adds r1, r2, r5
movs r5, 0
ldrsh r1, [r1, r5]
subs r1, r0, r1
movs r0, 0x20
negs r0, r0
cmp r3, r0
blt _08045988
cmp r1, r0
blt _08045988
movs r0, 0x88
lsls r0, 1
cmp r3, r0
bgt _08045988
cmp r1, 0xC0
bgt _08045988
ldr r0, _080458FC
adds r5, r2, r0
adds r0, r4, 0
bl GetEntityType
cmp r0, 0x5
bhi _08045984
lsls r0, 2
ldr r1, _08045900
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_080458F0: .4byte gDungeon
_080458F4: .4byte 0x000181f0
_080458F8: .4byte 0x000181f2
_080458FC: .4byte 0x000181e8
_08045900: .4byte _08045904
.align 2, 0
_08045904:
.4byte _08045988
.4byte _08045934
.4byte _08045964
.4byte _0804591C
.4byte _08045984
.4byte _08045988
_0804591C:
adds r0, r5, 0
adds r0, 0x26
_08045920:
ldrb r0, [r0]
cmp r0, 0
bne _08045984
adds r0, r4, 0x4
bl sub_803F428
lsls r0, 24
_0804592E:
cmp r0, 0
bne _08045984
b _08045988
_08045934:
ldr r1, [r4, 0x70]
ldrb r0, [r1, 0x6]
cmp r0, 0
beq _08045984
ldr r0, _0804595C
ldr r0, [r0]
ldr r2, _08045960
adds r0, r2
ldrb r0, [r0]
cmp r0, 0
bne _08045954
adds r0, r1, 0
adds r0, 0xE4
ldrb r0, [r0]
cmp r0, 0x1
beq _08045988
_08045954:
adds r0, r5, 0
adds r0, 0x25
b _08045920
.align 2, 0
_0804595C: .4byte gDungeon
_08045960: .4byte 0x0001820f
_08045964:
ldr r0, _0804597C
ldr r0, [r0]
ldr r3, _08045980
adds r0, r3
ldrb r0, [r0]
cmp r0, 0
bne _08045984
adds r0, r4, 0
adds r0, 0x20
ldrb r0, [r0]
b _0804592E
.align 2, 0
_0804597C: .4byte gDungeon
_08045980: .4byte 0x0001820f
_08045984:
movs r0, 0x1
b _0804598A
_08045988:
movs r0, 0
_0804598A:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_8045888
.align 2, 0

View File

@ -65,7 +65,7 @@ _08045E1E:
ldr r0, _08045E38 ldr r0, _08045E38
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08045E3C ldr r0, _08045E3C
b _08046048 b _08046048
.align 2, 0 .align 2, 0
@ -278,7 +278,7 @@ _08045FAC:
_08045FD0: _08045FD0:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08045FF2 b _08045FF2
.align 2, 0 .align 2, 0
_08045FDC: .4byte 0x00ff0008 _08045FDC: .4byte 0x00ff0008
@ -288,7 +288,7 @@ _08045FE8:
ldr r0, _08045FFC ldr r0, _08045FFC
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08045FF2: _08045FF2:
ldrb r0, [r5, 0x2] ldrb r0, [r5, 0x2]
bl TryDisplayItemPickupTutorialMessage bl TryDisplayItemPickupTutorialMessage
@ -331,12 +331,12 @@ _0804602E:
ldr r0, _08046058 ldr r0, _08046058
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0804605C ldr r0, _0804605C
_08046048: _08046048:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080460E0 b _080460E0
.align 2, 0 .align 2, 0
_08046054: .4byte gFormatBuffer_Items _08046054: .4byte gFormatBuffer_Items
@ -374,12 +374,12 @@ _08046094:
ldr r0, _080460B8 ldr r0, _080460B8
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _080460BC ldr r0, _080460BC
_080460AC: _080460AC:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080460DA b _080460DA
.align 2, 0 .align 2, 0
_080460B8: .4byte gFormatBuffer_Monsters _080460B8: .4byte gFormatBuffer_Monsters
@ -394,7 +394,7 @@ _080460C0:
ldr r0, _080460F4 ldr r0, _080460F4
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_080460DA: _080460DA:
ldrb r0, [r5, 0x2] ldrb r0, [r5, 0x2]
bl TryDisplayItemPickupTutorialMessage bl TryDisplayItemPickupTutorialMessage
@ -442,7 +442,7 @@ _08046110:
ldrsh r0, [r5, r1] ldrsh r0, [r5, r1]
movs r2, 0x2 movs r2, 0x2
ldrsh r1, [r5, r2] ldrsh r1, [r5, r2]
bl GetTileSafe bl GetTileMut
str r4, [r0, 0x14] str r4, [r0, 0x14]
ldrh r1, [r0] ldrh r1, [r0]
movs r0, 0x20 movs r0, 0x20
@ -528,7 +528,7 @@ sub_80461C8:
ldrsh r0, [r2, r1] ldrsh r0, [r2, r1]
movs r3, 0x2 movs r3, 0x2
ldrsh r1, [r2, r3] ldrsh r1, [r2, r3]
bl GetTileSafe bl GetTileMut
adds r6, r0, 0 adds r6, r0, 0
ldr r5, [r6, 0x14] ldr r5, [r6, 0x14]
cmp r5, 0 cmp r5, 0
@ -996,7 +996,7 @@ sub_804652C:
ldr r0, _080465A4 ldr r0, _080465A4
ldr r1, [r0] ldr r1, [r0]
mov r0, r10 mov r0, r10
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
mov r0, r9 mov r0, r9
ldrb r1, [r0] ldrb r1, [r0]
movs r0, 0x1 movs r0, 0x1
@ -1297,7 +1297,7 @@ _080467BE:
adds r0, r7 adds r0, r7
str r0, [r2, 0x4] str r0, [r2, 0x4]
ldr r0, [sp, 0x10] ldr r0, [sp, 0x10]
bl sin_abs_4096 bl sin_4096
lsls r1, r0, 1 lsls r1, r0, 1
adds r1, r0 adds r1, r0
lsls r1, 2 lsls r1, 2
@ -1721,7 +1721,7 @@ _08046B0A:
ldr r4, _08046B38 ldr r4, _08046B38
add r4, sp add r4, sp
ldr r0, [r4] ldr r0, [r4]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08046C7C b _08046C7C
.align 2, 0 .align 2, 0
_08046B2C: .4byte 0x0000052c _08046B2C: .4byte 0x0000052c
@ -1734,7 +1734,7 @@ _08046B3C:
ldr r5, _08046B50 ldr r5, _08046B50
add r5, sp add r5, sp
ldr r0, [r5] ldr r0, [r5]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08046C7C b _08046C7C
.align 2, 0 .align 2, 0
_08046B4C: .4byte gItemLost _08046B4C: .4byte gItemLost
@ -1748,7 +1748,7 @@ _08046B54:
ldr r2, _08046C94 ldr r2, _08046C94
add r2, sp add r2, sp
ldr r0, [r2] ldr r0, [r2]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08046B68: _08046B68:
movs r3, 0 movs r3, 0
mov r9, r3 mov r9, r3
@ -1809,7 +1809,7 @@ _08046BAA:
adds r0, r4, 0 adds r0, r4, 0
bl IncreaseEntityPixelPos bl IncreaseEntityPixelPos
mov r0, r10 mov r0, r10
bl sin_abs_4096 bl sin_4096
add r2, sp, 0x20 add r2, sp, 0x20
adds r2, r5 adds r2, r5
lsls r1, r0, 1 lsls r1, r0, 1

View File

@ -410,7 +410,7 @@ _08047462:
ldr r0, _080474C4 ldr r0, _080474C4
adds r1, r4, 0 adds r1, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _080474C8 ldr r0, _080474C8
ldr r1, [sp, 0x214] ldr r1, [sp, 0x214]
bl sub_8045C08 bl sub_8045C08
@ -463,7 +463,7 @@ _080474E2:
ldr r0, _0804750C ldr r0, _0804750C
adds r1, r4, 0 adds r1, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08047510 ldr r0, _08047510
ldr r1, [sp, 0x214] ldr r1, [sp, 0x214]
bl sub_8045BF8 bl sub_8045BF8
@ -552,7 +552,7 @@ _08047596:
ldr r0, _080475C0 ldr r0, _080475C0
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_080475A8: _080475A8:
movs r3, 0x90 movs r3, 0x90
lsls r3, 2 lsls r3, 2
@ -755,7 +755,7 @@ _08047726:
adds r0, 0xFF adds r0, 0xFF
_08047732: _08047732:
asrs r0, 8 asrs r0, 8
bl sin_abs_4096 bl sin_4096
ldr r2, [sp, 0x30] ldr r2, [sp, 0x30]
adds r1, r0, 0 adds r1, r0, 0
muls r1, r2 muls r1, r2
@ -913,7 +913,7 @@ _0804786E:
ldr r0, _080478D4 ldr r0, _080478D4
adds r1, r5, 0 adds r1, r5, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
lsls r0, r6, 24 lsls r0, r6, 24
cmp r0, 0 cmp r0, 0
beq _080478DC beq _080478DC

9967
asm/code_804AFAC.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -69,7 +69,7 @@ _080516CA:
ldr r0, [r5] ldr r0, [r5]
adds r1, r4, 0 adds r1, r4, 0
str r2, [sp, 0xC] str r2, [sp, 0xC]
bl GetTileSafe bl GetTileMut
ldrh r1, [r0] ldrh r1, [r0]
ldr r2, [sp, 0xC] ldr r2, [sp, 0xC]
ands r1, r2 ands r1, r2
@ -102,7 +102,7 @@ _0805170A:
ldr r0, [r5, 0x8] ldr r0, [r5, 0x8]
adds r1, r4, 0 adds r1, r4, 0
str r2, [sp, 0xC] str r2, [sp, 0xC]
bl GetTileSafe bl GetTileMut
ldrh r1, [r0] ldrh r1, [r0]
ldr r2, [sp, 0xC] ldr r2, [sp, 0xC]
ands r1, r2 ands r1, r2
@ -148,7 +148,7 @@ _08051762:
ldr r1, [r5, 0x4] ldr r1, [r5, 0x4]
adds r0, r4, 0 adds r0, r4, 0
str r2, [sp, 0xC] str r2, [sp, 0xC]
bl GetTileSafe bl GetTileMut
ldrh r1, [r0] ldrh r1, [r0]
ldr r2, [sp, 0xC] ldr r2, [sp, 0xC]
ands r1, r2 ands r1, r2
@ -181,7 +181,7 @@ _080517A2:
ldr r1, [r5, 0xC] ldr r1, [r5, 0xC]
adds r0, r4, 0 adds r0, r4, 0
str r2, [sp, 0xC] str r2, [sp, 0xC]
bl GetTileSafe bl GetTileMut
ldrh r1, [r0] ldrh r1, [r0]
ldr r2, [sp, 0xC] ldr r2, [sp, 0xC]
ands r1, r2 ands r1, r2
@ -221,7 +221,7 @@ _080517EC:
adds r0, r7, 0 adds r0, r7, 0
adds r1, r5, 0 adds r1, r5, 0
str r3, [sp, 0x10] str r3, [sp, 0x10]
bl GetTileSafe bl GetTileMut
adds r2, r0, 0 adds r2, r0, 0
ldrh r1, [r2] ldrh r1, [r2]
movs r0, 0x20 movs r0, 0x20
@ -285,7 +285,7 @@ _08051864:
adds r0, r7, 0 adds r0, r7, 0
adds r1, r5, 0 adds r1, r5, 0
str r3, [sp, 0x10] str r3, [sp, 0x10]
bl GetTileSafe bl GetTileMut
adds r6, r0, 0 adds r6, r0, 0
ldrh r1, [r6] ldrh r1, [r6]
movs r0, 0x20 movs r0, 0x20
@ -361,7 +361,7 @@ sub_80518F0:
_080518F8: _080518F8:
adds r0, r5, 0 adds r0, r5, 0
movs r1, 0x1 movs r1, 0x1
bl GetTileSafe bl GetTileMut
adds r4, r0, 0 adds r4, r0, 0
bl ResetTile bl ResetTile
cmp r5, 0 cmp r5, 0
@ -375,7 +375,7 @@ _0805190E:
_08051914: _08051914:
adds r0, r5, 0 adds r0, r5, 0
movs r1, 0x1E movs r1, 0x1E
bl GetTileSafe bl GetTileMut
adds r4, r0, 0 adds r4, r0, 0
bl ResetTile bl ResetTile
cmp r5, 0 cmp r5, 0
@ -529,7 +529,7 @@ sub_8051A24:
mov r8, r3 mov r8, r3
adds r0, r4, 0 adds r0, r4, 0
adds r1, r5, 0 adds r1, r5, 0
bl GetTileSafe bl GetTileMut
adds r7, r0, 0 adds r7, r0, 0
lsls r4, 16 lsls r4, 16
lsls r5, 16 lsls r5, 16
@ -982,7 +982,7 @@ _08051E42:
_08051E46: _08051E46:
adds r0, r4, 0 adds r0, r4, 0
adds r1, r5, 0 adds r1, r5, 0
bl GetTileSafe bl GetTileMut
adds r2, r0, 0 adds r2, r0, 0
ldrb r0, [r2, 0xE] ldrb r0, [r2, 0xE]
cmp r0, 0xF cmp r0, 0xF
@ -1022,7 +1022,7 @@ sub_8051E7C:
movs r3, 0x6 movs r3, 0x6
ldrsh r1, [r2, r3] ldrsh r1, [r2, r3]
subs r1, 0x1 subs r1, 0x1
bl GetTileSafe bl GetTileMut
str r0, [sp, 0x8] str r0, [sp, 0x8]
ldrh r1, [r0] ldrh r1, [r0]
movs r0, 0x80 movs r0, 0x80
@ -1033,7 +1033,7 @@ sub_8051E7C:
ldr r0, _08051EB4 ldr r0, _08051EB4
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080520F6 b _080520F6
.align 2, 0 .align 2, 0
_08051EB4: .4byte gUnknown_80FDDF0 _08051EB4: .4byte gUnknown_80FDDF0
@ -1122,7 +1122,7 @@ _08051F10:
bge _08051FCA bge _08051FCA
adds r0, r5, 0 adds r0, r5, 0
adds r1, r6, 0 adds r1, r6, 0
bl GetTileSafe bl GetTileMut
adds r4, r0, 0 adds r4, r0, 0
ldrh r0, [r4] ldrh r0, [r4]
movs r3, 0x80 movs r3, 0x80
@ -1293,7 +1293,7 @@ _0805207A:
ldr r0, _080520E8 ldr r0, _080520E8
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x14 movs r0, 0x14
movs r1, 0x3C movs r1, 0x3C
bl sub_803E708 bl sub_803E708
@ -1314,7 +1314,7 @@ _080520EC:
ldr r0, _08052108 ldr r0, _08052108
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_080520F6: _080520F6:
add sp, 0x14 add sp, 0x14
pop {r3-r5} pop {r3-r5}

View File

@ -2171,7 +2171,7 @@ sub_8062B74:
ldr r0, _08062BD0 ldr r0, _08062BD0
mov r1, r10 mov r1, r10
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08062BD4 ldr r0, _08062BD4
ldr r2, [r0] ldr r2, [r0]
movs r0, 0 movs r0, 0
@ -2322,7 +2322,7 @@ sub_8062CA8:
ldr r0, _08062CF8 ldr r0, _08062CF8
adds r1, r4, 0 adds r1, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08062CFC ldr r0, _08062CFC
ldr r2, [r0] ldr r2, [r0]
movs r0, 0 movs r0, 0
@ -3429,7 +3429,7 @@ sub_8063578:
ldr r0, _080635FC ldr r0, _080635FC
ldr r1, [sp, 0x14] ldr r1, [sp, 0x14]
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
lsls r4, 3 lsls r4, 3
adds r4, 0xA adds r4, 0xA
ldr r0, _08063600 ldr r0, _08063600
@ -4122,7 +4122,7 @@ _08063AEC:
ldr r0, _08063B2C ldr r0, _08063B2C
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08063B3A b _08063B3A
.align 2, 0 .align 2, 0
_08063B1C: .4byte gDungeon _08063B1C: .4byte gDungeon
@ -4134,7 +4134,7 @@ _08063B30:
ldr r0, _08063B50 ldr r0, _08063B50
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08063B3A: _08063B3A:
movs r0, 0x78 movs r0, 0x78
movs r1, 0x1F movs r1, 0x1F
@ -4442,7 +4442,7 @@ _08063D70:
ldr r0, _08063DAC ldr r0, _08063DAC
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08063DBA b _08063DBA
.align 2, 0 .align 2, 0
_08063D98: .4byte gDungeon _08063D98: .4byte gDungeon
@ -4455,7 +4455,7 @@ _08063DB0:
ldr r0, _08063DD0 ldr r0, _08063DD0
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08063DBA: _08063DBA:
movs r0, 0x78 movs r0, 0x78
movs r1, 0x1F movs r1, 0x1F
@ -5474,7 +5474,7 @@ sub_806455C:
ldr r1, [r4, 0x14] ldr r1, [r4, 0x14]
add r0, sp, 0x4 add r0, sp, 0x4
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
str r5, [sp] str r5, [sp]
movs r0, 0x8 movs r0, 0x8
movs r1, 0x12 movs r1, 0x12

View File

@ -1010,7 +1010,7 @@ _080690A2:
adds r0, r2 adds r0, r2
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
b _08069484 b _08069484
.align 2, 0 .align 2, 0
_080690E4: .4byte gDungeon _080690E4: .4byte gDungeon
@ -1283,7 +1283,7 @@ _0806930A:
adds r0, r2 adds r0, r2
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
b _08069352 b _08069352
.align 2, 0 .align 2, 0
_0806932C: .4byte gUnknown_202EE70 _0806932C: .4byte gUnknown_202EE70
@ -1301,7 +1301,7 @@ _08069338:
adds r0, r3 adds r0, r3
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
_08069352: _08069352:
bl GetLeader bl GetLeader
cmp r0, 0 cmp r0, 0
@ -1489,7 +1489,7 @@ sub_80694C0:
mov r9, r3 mov r9, r3
adds r0, r7, 0 adds r0, r7, 0
mov r1, r8 mov r1, r8
bl GetTileSafe bl GetTileMut
mov r10, r0 mov r10, r0
ldr r5, [r4, 0x70] ldr r5, [r4, 0x70]
adds r6, r5, 0 adds r6, r5, 0
@ -1515,7 +1515,7 @@ _080694FC:
_0806950A: _0806950A:
adds r0, r4, 0 adds r0, r4, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendImmobilizeEndMessage bl EndFrozenClassStatus
_08069512: _08069512:
movs r0, 0x4 movs r0, 0x4
ldrsh r2, [r4, r0] ldrsh r2, [r4, r0]
@ -1536,7 +1536,7 @@ _08069522:
blt _08069552 blt _08069552
adds r1, r0, 0 adds r1, r0, 0
adds r0, r2, 0 adds r0, r2, 0
bl GetTileSafe bl GetTileMut
adds r1, r0, 0 adds r1, r0, 0
ldr r0, [r1, 0x10] ldr r0, [r1, 0x10]
cmp r0, r4 cmp r0, r4

View File

@ -135,7 +135,7 @@ _08066ECC:
_08066F1E: _08066F1E:
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08066F7E b _08066F7E
.align 2, 0 .align 2, 0
_08066F28: .4byte 0xffffff00 _08066F28: .4byte 0xffffff00
@ -167,7 +167,7 @@ _08066F46:
ldr r0, _08066F98 ldr r0, _08066F98
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
ldr r0, _08066F9C ldr r0, _08066F9C
ldr r0, [r0] ldr r0, [r0]
ldr r2, _08066FA0 ldr r2, _08066FA0
@ -314,7 +314,7 @@ _08067040:
_0806709E: _0806709E:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080670EE b _080670EE
.align 2, 0 .align 2, 0
_080670A8: .4byte gFormatBuffer_Items + 0x50 _080670A8: .4byte gFormatBuffer_Items + 0x50
@ -339,7 +339,7 @@ _080670CA:
ldr r0, _08067104 ldr r0, _08067104
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
ldr r0, _08067108 ldr r0, _08067108
ldr r0, [r0] ldr r0, [r0]
ldr r1, _0806710C ldr r1, _0806710C
@ -390,7 +390,7 @@ sub_8067110:
bl sub_80464AC bl sub_80464AC
adds r1, r0, 0 adds r1, r0, 0
adds r0, r5, 0 adds r0, r5, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
ldr r0, [r6] ldr r0, [r6]
str r0, [sp, 0x8] str r0, [sp, 0x8]
adds r0, r5, 0 adds r0, r5, 0
@ -498,7 +498,7 @@ _08067220:
_08067230: _08067230:
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x14 movs r0, 0x14
movs r1, 0x4C movs r1, 0x4C
bl sub_803E708 bl sub_803E708
@ -677,7 +677,7 @@ _08067384:
ldr r0, _080673B8 ldr r0, _080673B8
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080673C6 b _080673C6
.align 2, 0 .align 2, 0
_080673B0: .4byte gFormatBuffer_Items _080673B0: .4byte gFormatBuffer_Items
@ -687,7 +687,7 @@ _080673BC:
ldr r0, _080673F8 ldr r0, _080673F8
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_080673C6: _080673C6:
add r0, sp, 0x4 add r0, sp, 0x4
ldrb r0, [r0, 0x2] ldrb r0, [r0, 0x2]
@ -1198,7 +1198,7 @@ _080677B4:
ldr r0, _080677F0 ldr r0, _080677F0
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _080677F4 ldr r0, _080677F4
ldr r5, [r0] ldr r5, [r0]
ldr r0, _080677F8 ldr r0, _080677F8
@ -1380,7 +1380,7 @@ sub_8067904:
ldr r0, _08067944 ldr r0, _08067944
adds r1, r5, 0 adds r1, r5, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08067948 ldr r0, _08067948
b _08067962 b _08067962
.align 2, 0 .align 2, 0
@ -1396,12 +1396,12 @@ _0806794C:
ldr r0, _0806796C ldr r0, _0806796C
adds r1, r5, 0 adds r1, r5, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08067970 ldr r0, _08067970
_08067962: _08067962:
ldr r1, [r0] ldr r1, [r0]
adds r0, r5, 0 adds r0, r5, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08067A56 b _08067A56
.align 2, 0 .align 2, 0
_0806796C: .4byte gFormatBuffer_Monsters _0806796C: .4byte gFormatBuffer_Monsters
@ -1477,7 +1477,7 @@ _080679DE:
ldr r0, _08067A70 ldr r0, _08067A70
ldr r1, [r0] ldr r1, [r0]
adds r0, r5, 0 adds r0, r5, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08067A04: _08067A04:
ldrb r0, [r6, 0x7] ldrb r0, [r6, 0x7]
cmp r0, 0 cmp r0, 0

View File

@ -102,7 +102,7 @@ _0806A488:
movs r2, 0x6 movs r2, 0x6
ldrsh r1, [r6, r2] ldrsh r1, [r6, r2]
adds r1, r7 adds r1, r7
bl GetTileSafe bl GetTileMut
adds r4, r0, 0 adds r4, r0, 0
ldr r0, [r4, 0x10] ldr r0, [r4, 0x10]
cmp r0, 0 cmp r0, 0
@ -306,7 +306,7 @@ _0806A5CE:
bne _0806A608 bne _0806A608
adds r0, r6, 0 adds r0, r6, 0
adds r1, r6, 0 adds r1, r6, 0
bl SendImmobilizeEndMessage bl EndFrozenClassStatus
_0806A608: _0806A608:
movs r1, 0x2 movs r1, 0x2
ldrsh r0, [r4, r1] ldrsh r0, [r4, r1]
@ -346,7 +346,7 @@ _0806A650:
bne _0806A6D2 bne _0806A6D2
adds r0, r6, 0 adds r0, r6, 0
adds r1, r6, 0 adds r1, r6, 0
bl SendNonVolatileEndMessage bl EndBurnClassStatus
b _0806A6D2 b _0806A6D2
_0806A664: _0806A664:
cmp r1, 0 cmp r1, 0
@ -399,7 +399,7 @@ _0806A6C4:
beq _0806A6D2 beq _0806A6D2
adds r0, r6, 0 adds r0, r6, 0
mov r1, r8 mov r1, r8
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0806A6D2: _0806A6D2:
add sp, 0x4 add sp, 0x4
pop {r3} pop {r3}
@ -663,7 +663,7 @@ sub_806A898:
b _0806A8C8 b _0806A8C8
_0806A8C2: _0806A8C2:
adds r0, r4, 0 adds r0, r4, 0
bl MoveIfPossible bl AIMovement
_0806A8C8: _0806A8C8:
movs r0, 0xB6 movs r0, 0xB6
lsls r0, 1 lsls r0, 1
@ -817,7 +817,7 @@ _0806A9E0:
_0806A9E6: _0806A9E6:
ldr r1, [r0] ldr r1, [r0]
adds r0, r4, 0 adds r0, r4, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0806AA02 b _0806AA02
.align 2, 0 .align 2, 0
_0806A9F0: .4byte gPtrLinkMoveOneUseWarningMessage _0806A9F0: .4byte gPtrLinkMoveOneUseWarningMessage
@ -827,7 +827,7 @@ _0806A9F4:
ldr r0, _0806AA08 ldr r0, _0806AA08
ldr r1, [r0] ldr r1, [r0]
adds r0, r4, 0 adds r0, r4, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0806AA02: _0806AA02:
pop {r4,r5} pop {r4,r5}
pop {r0} pop {r0}
@ -1072,7 +1072,7 @@ sub_806ABAC:
bne _0806ABD4 bne _0806ABD4
adds r0, r6, 0 adds r0, r6, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendNonVolatileEndMessage bl EndBurnClassStatus
_0806ABD4: _0806ABD4:
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x40 movs r1, 0x40
@ -1087,7 +1087,7 @@ _0806ABD4:
bne _0806ABF4 bne _0806ABF4
adds r0, r6, 0 adds r0, r6, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendVolatileEndMessage bl EndCringeClassStatus
_0806ABF4: _0806ABF4:
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x42 movs r1, 0x42
@ -1102,7 +1102,7 @@ _0806ABF4:
bne _0806AC14 bne _0806AC14
adds r0, r6, 0 adds r0, r6, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendNonVolatileEndMessage bl EndBurnClassStatus
_0806AC14: _0806AC14:
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x29 movs r1, 0x29
@ -1117,7 +1117,7 @@ _0806AC14:
bne _0806AC34 bne _0806AC34
adds r0, r6, 0 adds r0, r6, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendVolatileEndMessage bl EndCringeClassStatus
_0806AC34: _0806AC34:
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x36 movs r1, 0x36
@ -1147,7 +1147,7 @@ _0806AC66:
adds r1, r4, 0 adds r1, r4, 0
movs r2, 0 movs r2, 0
movs r3, 0x1 movs r3, 0x1
bl SendSleepEndMessage bl EndSleepClassStatus
_0806AC72: _0806AC72:
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x41 movs r1, 0x41
@ -1162,7 +1162,7 @@ _0806AC72:
bne _0806AC92 bne _0806AC92
adds r0, r6, 0 adds r0, r6, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendImmobilizeEndMessage bl EndFrozenClassStatus
_0806AC92: _0806AC92:
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x45 movs r1, 0x45
@ -1180,7 +1180,7 @@ _0806AC92:
bhi _0806ACB8 bhi _0806ACB8
adds r0, r6, 0 adds r0, r6, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendNonVolatileEndMessage bl EndBurnClassStatus
_0806ACB8: _0806ACB8:
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x25 movs r1, 0x25
@ -1199,7 +1199,7 @@ _0806ACB8:
bne _0806ACE0 bne _0806ACE0
adds r0, r6, 0 adds r0, r6, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendProtectionEndMessage bl EndReflectClassStatus
_0806ACE0: _0806ACE0:
pop {r4-r6} pop {r4-r6}
pop {r0} pop {r0}
@ -3136,7 +3136,7 @@ sub_806BB6C:
str r6, [sp, 0xC] str r6, [sp, 0xC]
movs r0, 0 movs r0, 0
adds r1, r4, 0 adds r1, r4, 0
bl sub_8069F54 bl GetMonsterApparentID
lsls r0, 16 lsls r0, 16
adds r1, r7, 0 adds r1, r7, 0
adds r1, 0x22 adds r1, 0x22

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@ _080727A8:
movs r4, 0xC movs r4, 0xC
ldrsh r3, [r0, r4] ldrsh r3, [r0, r4]
mov r0, sp mov r0, sp
bl sub_808E0AC bl GetMovesLearnedAtLevel
adds r7, r0, 0 adds r7, r0, 0
add r4, sp, 0x20 add r4, sp, 0x20
movs r1, 0x8C movs r1, 0x8C
@ -359,7 +359,7 @@ _08072A0C:
ldr r0, _08072A44 ldr r0, _08072A44
mov r1, r9 mov r1, r9
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08072A48 ldr r0, _08072A48
add r1, sp, 0x40 add r1, sp, 0x40
bl strcpy bl strcpy
@ -417,7 +417,7 @@ _08072A92:
ldr r0, _08072AC0 ldr r0, _08072AC0
mov r1, r9 mov r1, r9
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08072AC4 ldr r0, _08072AC4
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9

View File

@ -4,7 +4,7 @@
.syntax unified .syntax unified
.text .text
thumb_func_start sub_80732F0 thumb_func_start sub_80732F0
sub_80732F0: sub_80732F0:
push {r4-r7,lr} push {r4-r7,lr}
@ -148,11 +148,11 @@ _080733FC:
ldr r0, _08073438 ldr r0, _08073438
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807343C ldr r0, _0807343C
ldr r1, [r0] ldr r1, [r0]
mov r0, r8 mov r0, r8
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x7 movs r0, 0x7
mov r1, r9 mov r1, r9
ands r1, r0 ands r1, r0
@ -360,11 +360,11 @@ _0807359C:
ldr r0, _08073600 ldr r0, _08073600
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08073604 ldr r0, _08073604
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x7 movs r0, 0x7
mov r1, r8 mov r1, r8
ands r1, r0 ands r1, r0

View File

@ -86,7 +86,7 @@ _0807ABC6:
adds r0, r4, 0 adds r0, r4, 0
adds r1, r6, 0 adds r1, r6, 0
str r2, [sp, 0x1A4] str r2, [sp, 0x1A4]
bl GetTileSafe bl GetTileMut
adds r1, r0, 0 adds r1, r0, 0
ldr r0, [r1, 0x10] ldr r0, [r1, 0x10]
ldr r2, [sp, 0x1A4] ldr r2, [sp, 0x1A4]
@ -176,7 +176,7 @@ _0807AC72:
adds r0, r4, 0 adds r0, r4, 0
adds r1, r6, 0 adds r1, r6, 0
str r2, [sp, 0x1A4] str r2, [sp, 0x1A4]
bl GetTileSafe bl GetTileMut
adds r1, r0, 0 adds r1, r0, 0
ldr r0, [r1, 0x10] ldr r0, [r1, 0x10]
ldr r2, [sp, 0x1A4] ldr r2, [sp, 0x1A4]

View File

@ -165,7 +165,7 @@ _0807D634:
ldr r2, _0807D650 ldr r2, _0807D650
add r2, sp add r2, sp
ldr r0, [r2] ldr r0, [r2]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807D9F4 b _0807D9F4
.align 2, 0 .align 2, 0
_0807D650: .4byte 0x00000d08 _0807D650: .4byte 0x00000d08
@ -485,7 +485,7 @@ _0807D8B0:
adds r0, r4, 0 adds r0, r4, 0
bl IncreaseEntityPixelPos bl IncreaseEntityPixelPos
mov r0, r10 mov r0, r10
bl sin_abs_4096 bl sin_4096
add r2, sp, 0x20 add r2, sp, 0x20
adds r2, r5 adds r2, r5
lsls r1, r0, 1 lsls r1, r0, 1
@ -585,7 +585,7 @@ _0807D996:
ldr r2, _0807D9C4 ldr r2, _0807D9C4
add r2, sp add r2, sp
ldr r0, [r2] ldr r0, [r2]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807D9EE b _0807D9EE
.align 2, 0 .align 2, 0
_0807D9B4: .4byte gUnknown_80F4468 _0807D9B4: .4byte gUnknown_80F4468
@ -605,7 +605,7 @@ _0807D9E0:
ldr r3, _0807DA0C ldr r3, _0807DA0C
add r3, sp add r3, sp
ldr r0, [r3] ldr r0, [r3]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807D9EE: _0807D9EE:
movs r0, 0x1 movs r0, 0x1
bl sub_807EC28 bl sub_807EC28
@ -647,7 +647,7 @@ sub_807DA14:
ldr r0, _0807DA48 ldr r0, _0807DA48
adds r1, r6, 0 adds r1, r6, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807DA4C ldr r0, _0807DA4C
b _0807DA5C b _0807DA5C
.align 2, 0 .align 2, 0
@ -818,7 +818,7 @@ _0807DB94:
_0807DBA0: _0807DBA0:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807DC54 b _0807DC54
.align 2, 0 .align 2, 0
_0807DBAC: .4byte gUnknown_80FD08C _0807DBAC: .4byte gUnknown_80FD08C
@ -831,7 +831,7 @@ _0807DBB6:
_0807DBB8: _0807DBB8:
adds r0, r4, 0 adds r0, r4, 0
adds r1, r5, 0 adds r1, r5, 0
bl GetTileSafe bl GetTileMut
adds r2, r0, 0 adds r2, r0, 0
ldrh r1, [r2] ldrh r1, [r2]
movs r0, 0x3 movs r0, 0x3
@ -878,7 +878,7 @@ _0807DBF4:
ldr r0, _0807DC2C ldr r0, _0807DC2C
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807DC3A b _0807DC3A
.align 2, 0 .align 2, 0
_0807DC24: .4byte 0x0000fffc _0807DC24: .4byte 0x0000fffc
@ -888,7 +888,7 @@ _0807DC30:
ldr r0, _0807DC60 ldr r0, _0807DC60
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807DC3A: _0807DC3A:
ldr r0, _0807DC64 ldr r0, _0807DC64
ldr r0, [r0] ldr r0, [r0]
@ -953,7 +953,7 @@ _0807DCAC:
_0807DCB8: _0807DCB8:
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807DF0E b _0807DF0E
.align 2, 0 .align 2, 0
_0807DCC4: .4byte gUnknown_80FD3D0 _0807DCC4: .4byte gUnknown_80FD3D0
@ -971,7 +971,7 @@ _0807DCD8:
movs r6, 0 movs r6, 0
adds r0, r5, 0 adds r0, r5, 0
adds r1, r4, 0 adds r1, r4, 0
bl GetTileSafe bl GetTileMut
adds r2, r0, 0 adds r2, r0, 0
ldrh r1, [r2] ldrh r1, [r2]
ldr r3, _0807DD6C ldr r3, _0807DD6C
@ -1094,7 +1094,7 @@ _0807DDC8:
_0807DDCA: _0807DDCA:
adds r0, r5, 0 adds r0, r5, 0
adds r1, r4, 0 adds r1, r4, 0
bl GetTileSafe bl GetTileMut
adds r2, r0, 0 adds r2, r0, 0
ldrh r1, [r2] ldrh r1, [r2]
movs r3, 0x80 movs r3, 0x80
@ -1141,7 +1141,7 @@ _0807DE1A:
beq _0807DE30 beq _0807DE30
adds r0, r5, 0 adds r0, r5, 0
adds r1, r4, 0 adds r1, r4, 0
bl GetTileSafe bl GetTileMut
ldrh r2, [r0] ldrh r2, [r0]
movs r1, 0x40 movs r1, 0x40
orrs r1, r2 orrs r1, r2
@ -1192,7 +1192,7 @@ _0807DE74:
ldr r0, _0807DF30 ldr r0, _0807DF30
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x28 movs r0, 0x28
movs r1, 0x2B movs r1, 0x2B
bl sub_803E708 bl sub_803E708
@ -1316,7 +1316,7 @@ _0807DF8E:
ldr r0, _0807DFB0 ldr r0, _0807DFB0
mov r1, r10 mov r1, r10
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
b _0807DFC2 b _0807DFC2
.align 2, 0 .align 2, 0
_0807DFA8: .4byte gDungeon _0807DFA8: .4byte gDungeon
@ -1346,7 +1346,7 @@ _0807DFD4:
ldr r0, _0807E184 ldr r0, _0807E184
mov r1, r10 mov r1, r10
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807E188 ldr r0, _0807E188
ldr r2, [r0] ldr r2, [r0]
ldr r0, [sp, 0x8] ldr r0, [sp, 0x8]
@ -1402,7 +1402,7 @@ _0807E014:
bgt _0807E112 bgt _0807E112
cmp r1, 0x1F cmp r1, 0x1F
bgt _0807E112 bgt _0807E112
bl GetTileSafe bl GetTileMut
mov r8, r0 mov r8, r0
ldr r0, [sp, 0x18] ldr r0, [sp, 0x18]
movs r2, 0 movs r2, 0

View File

@ -228,7 +228,7 @@ _0807E816:
ldr r0, _0807E884 ldr r0, _0807E884
ldr r1, [r0] ldr r1, [r0]
adds r0, r5, 0 adds r0, r5, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807E844: _0807E844:
movs r5, 0 movs r5, 0
_0807E846: _0807E846:
@ -421,7 +421,7 @@ _0807E9A4:
movs r0, 0x2 movs r0, 0x2
ldrsh r1, [r4, r0] ldrsh r1, [r4, r0]
adds r0, r5, 0 adds r0, r5, 0
bl sub_8069F54 bl GetMonsterApparentID
b _0807E9D8 b _0807E9D8
.align 2, 0 .align 2, 0
_0807E9D0: .4byte 0xfffffe88 _0807E9D0: .4byte 0xfffffe88
@ -494,7 +494,7 @@ MudWaterSportEffect:
bl GetLeader bl GetLeader
ldr r1, _0807EA68 ldr r1, _0807EA68
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807EA8C b _0807EA8C
.align 2, 0 .align 2, 0
_0807EA5C: .4byte gUnknown_80F4EAC _0807EA5C: .4byte gUnknown_80F4EAC
@ -514,7 +514,7 @@ _0807EA6C:
bl GetLeader bl GetLeader
ldr r1, _0807EA9C ldr r1, _0807EA9C
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807EA8C: _0807EA8C:
pop {r0} pop {r0}
bx r0 bx r0
@ -677,7 +677,7 @@ _0807EBA6:
bl GetLeader bl GetLeader
ldr r1, _0807EC1C ldr r1, _0807EC1C
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807EBD4: _0807EBD4:
ldr r4, _0807EC14 ldr r4, _0807EC14
ldr r0, [r4] ldr r0, [r4]
@ -697,7 +697,7 @@ _0807EBD4:
bl GetLeader bl GetLeader
ldr r1, _0807EC24 ldr r1, _0807EC24
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807EC00: _0807EC00:
ldr r0, [sp, 0x8] ldr r0, [sp, 0x8]
add sp, 0xC add sp, 0xC
@ -1621,7 +1621,7 @@ sub_807F33C:
bl GetLeader bl GetLeader
ldr r1, _0807F428 ldr r1, _0807F428
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r6, 0 movs r6, 0
_0807F360: _0807F360:
movs r5, 0 movs r5, 0
@ -1748,7 +1748,7 @@ sub_807F43C:
ldr r0, _0807F468 ldr r0, _0807F468
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807F46C ldr r0, _0807F46C
b _0807F694 b _0807F694
.align 2, 0 .align 2, 0
@ -1761,7 +1761,7 @@ _0807F470:
ldr r0, _0807F488 ldr r0, _0807F488
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807F48C ldr r0, _0807F48C
ldr r2, [r0] ldr r2, [r0]
mov r0, r8 mov r0, r8
@ -2046,7 +2046,7 @@ _0807F6A8:
ldr r0, _0807F860 ldr r0, _0807F860
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807F864 ldr r0, _0807F864
ldr r2, [r0] ldr r2, [r0]
ldr r0, [sp, 0xEC] ldr r0, [sp, 0xEC]
@ -2173,7 +2173,7 @@ _0807F794:
cmp r0, 0 cmp r0, 0
beq _0807F7E6 beq _0807F7E6
ldr r0, [sp, 0x100] ldr r0, [sp, 0x100]
bl sin_abs_4096 bl sin_4096
lsls r0, 5 lsls r0, 5
mov r3, r8 mov r3, r8
str r0, [r3, 0x1C] str r0, [r3, 0x1C]
@ -2468,7 +2468,7 @@ _0807FA1E:
_0807FA22: _0807FA22:
adds r0, r5, 0 adds r0, r5, 0
adds r1, r6, 0 adds r1, r6, 0
bl GetTileSafe bl GetTileMut
adds r4, r0, 0 adds r4, r0, 0
ldrh r1, [r4, 0x4] ldrh r1, [r4, 0x4]
movs r0, 0x4 movs r0, 0x4

View File

@ -206,7 +206,7 @@ _08080A26:
_08080A2E: _08080A2E:
ldr r1, [r0] ldr r1, [r0]
ldr r0, [sp, 0x14] ldr r0, [sp, 0x14]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08080A46 b _08080A46
.align 2, 0 .align 2, 0
_08080A38: .4byte gUnknown_80FDACC _08080A38: .4byte gUnknown_80FDACC
@ -214,7 +214,7 @@ _08080A3C:
ldr r0, _08080A58 ldr r0, _08080A58
ldr r1, [r0] ldr r1, [r0]
ldr r0, [sp, 0x14] ldr r0, [sp, 0x14]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08080A46: _08080A46:
add sp, 0x30 add sp, 0x30
pop {r3-r5} pop {r3-r5}

File diff suppressed because it is too large Load Diff

View File

@ -322,12 +322,12 @@ sub_8084448:
adds r1, r0, 0 adds r1, r0, 0
adds r0, r4, 0 adds r0, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r4, 0x50 adds r4, 0x50
adds r0, r4, 0 adds r0, r4, 0
adds r1, r5, 0 adds r1, r5, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r0, r5, 0 adds r0, r5, 0
bl sub_8070BC0 bl sub_8070BC0
lsls r0, 24 lsls r0, 24
@ -516,12 +516,12 @@ sub_80845E0:
adds r1, r0, 0 adds r1, r0, 0
adds r0, r4, 0 adds r0, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r4, 0x50 adds r4, 0x50
adds r0, r4, 0 adds r0, r4, 0
adds r1, r6, 0 adds r1, r6, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r0, r6, 0 adds r0, r6, 0
bl sub_8070BC0 bl sub_8070BC0
lsls r0, 24 lsls r0, 24
@ -585,7 +585,7 @@ _08084680:
ldr r0, _0808469C ldr r0, _0808469C
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r0, r7, 0 adds r0, r7, 0
bl sub_8070BC0 bl sub_8070BC0
lsls r0, 24 lsls r0, 24

View File

@ -400,7 +400,7 @@ _080987C0:
bl DeleteGroundEffects bl DeleteGroundEffects
bl sub_809C658 bl sub_809C658
bl nullsub_16 bl nullsub_16
bl sub_8097944 bl UpdateAdventureAchievements
cmp r7, r4 cmp r7, r4
beq _08098848 beq _08098848
adds r0, r7, 0 adds r0, r7, 0

View File

@ -3103,7 +3103,7 @@ _080A8F30:
ldrsh r1, [r0, r2] ldrsh r1, [r0, r2]
_080A8F34: _080A8F34:
adds r0, r4, 0 adds r0, r4, 0
bl CopyMonsterNametoBuffer bl CopyMonsterNameToBuffer
b _080A8F44 b _080A8F44
_080A8F3C: _080A8F3C:
ldr r1, _080A8F4C ldr r1, _080A8F4C

View File

@ -355,7 +355,7 @@ _080A184C:
bl sub_80A8BFC bl sub_80A8BFC
lsls r0, 16 lsls r0, 16
asrs r0, 16 asrs r0, 16
bl CanMove bl GetCanMoveFlag
b _080A171E b _080A171E
_080A185E: _080A185E:
lsls r0, r5, 16 lsls r0, r5, 16
@ -487,7 +487,7 @@ _080A195A:
movs r2, 0xA movs r2, 0xA
bl sub_80922B4 bl sub_80922B4
_080A1968: _080A1968:
bl sub_8097848 bl IncrementAdventureNumJoined
bl _080A236A bl _080A236A
.align 2, 0 .align 2, 0
_080A1970: .4byte gUnknown_8116710 _080A1970: .4byte gUnknown_8116710
@ -526,7 +526,7 @@ _080A1988:
bne _080A19C2 bne _080A19C2
b _080A1EBE b _080A1EBE
_080A19C2: _080A19C2:
bl sub_8097848 bl IncrementAdventureNumJoined
ldrh r1, [r4] ldrh r1, [r4]
movs r0, 0x2 movs r0, 0x2
orrs r0, r1 orrs r0, r1
@ -626,7 +626,7 @@ _080A1A70:
bl sub_808D2E8 bl sub_808D2E8
cmp r0, 0 cmp r0, 0
beq _080A1A9A beq _080A1A9A
bl sub_8097848 bl IncrementAdventureNumJoined
_080A1A9A: _080A1A9A:
movs r0, 0x92 movs r0, 0x92
movs r1, 0 movs r1, 0
@ -641,7 +641,7 @@ _080A1A9A:
bl sub_808D2E8 bl sub_808D2E8
cmp r0, 0 cmp r0, 0
beq _080A1ABC beq _080A1ABC
bl sub_8097848 bl IncrementAdventureNumJoined
_080A1ABC: _080A1ABC:
movs r0, 0x90 movs r0, 0x90
movs r1, 0 movs r1, 0
@ -660,7 +660,7 @@ _080A1ACC:
bne _080A1AE2 bne _080A1AE2
bl _080A236A bl _080A236A
_080A1AE2: _080A1AE2:
bl sub_8097848 bl IncrementAdventureNumJoined
bl _080A236A bl _080A236A
.align 2, 0 .align 2, 0
_080A1AEC: .4byte gUnknown_8116788 _080A1AEC: .4byte gUnknown_8116788
@ -1121,7 +1121,7 @@ _080A1EAC:
adds r2, 0x1 adds r2, 0x1
cmp r2, 0x9 cmp r2, 0x9
ble _080A1EAC ble _080A1EAC
bl sub_8097848 bl IncrementAdventureNumJoined
_080A1EBE: _080A1EBE:
movs r0, 0x1 movs r0, 0x1
b _080A236C b _080A236C
@ -1710,85 +1710,4 @@ _080A236C:
bx r1 bx r1
thumb_func_end sub_80A14E8 thumb_func_end sub_80A14E8
thumb_func_start GroundScript_Unlock
GroundScript_Unlock:
push {r4-r7,lr}
ldr r1, _080A241C
ldrb r0, [r1]
cmp r0, 0
beq _080A2414
movs r0, 0
strb r0, [r1]
movs r6, 0
_080A2390:
ldr r0, _080A2420
adds r7, r6, r0
ldrb r0, [r7]
cmp r0, 0
beq _080A240E
movs r0, 0x1
ldr r1, _080A2424
adds r2, r6, 0
bl Log
lsls r5, r6, 16
asrs r5, 16
adds r0, r5, 0
bl GroundMapNotifyAll
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
adds r0, r5, 0
bl GroundLivesNotifyAll
orrs r4, r0
lsls r4, 24
lsrs r4, 24
adds r0, r5, 0
bl GroundObjectsNotifyAll
orrs r4, r0
lsls r4, 24
lsrs r4, 24
adds r0, r5, 0
bl GroundEffectsNotifyAll
orrs r4, r0
lsls r4, 24
lsrs r4, 24
ldr r0, _080A2428
adds r5, r6, r0
ldrb r0, [r5]
cmp r0, 0
beq _080A240C
cmp r4, 0
beq _080A240E
movs r0, 0x80
adds r4, r6, 0
orrs r4, r0
lsls r4, 16
asrs r4, 16
adds r0, r4, 0
bl GroundMapNotifyAll
adds r0, r4, 0
bl GroundLivesNotifyAll
adds r0, r4, 0
bl GroundObjectsNotifyAll
adds r0, r4, 0
bl GroundEffectsNotifyAll
movs r0, 0
strb r0, [r5]
_080A240C:
strb r0, [r7]
_080A240E:
adds r6, 0x1
cmp r6, 0x80
ble _080A2390
_080A2414:
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080A241C: .4byte gAnyScriptLocked
_080A2420: .4byte gScriptLocks
_080A2424: .4byte gUnknown_8116848
_080A2428: .4byte gScriptLockConds
thumb_func_end GroundScript_Unlock
.align 2,0 .align 2,0

1145
asm/math.s

File diff suppressed because it is too large Load Diff

View File

@ -753,7 +753,7 @@ _0808FDB0:
movs r3, 0 movs r3, 0
ldrsh r1, [r2, r3] ldrsh r1, [r2, r3]
adds r0, r6, 0 adds r0, r6, 0
bl CopyMonsterNametoBuffer bl CopyMonsterNameToBuffer
ldr r1, _0808FEF4 ldr r1, _0808FEF4
mov r2, r10 mov r2, r10
movs r3, 0 movs r3, 0

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if [[ -d "$DEVKITARM/bin/" ]]; then if [[ -n "$DEVKITARM" ]]; then
OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump" OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump"
else else
OBJDUMP_BIN="arm-none-eabi-objdump" OBJDUMP_BIN="arm-none-eabi-objdump"

View File

@ -115,6 +115,7 @@
'”' = 7E 39 34 '”' = 7E 39 34
'•' = 95 '•' = 95
@ 96, 97 are not hyphens, 'er', and 're' superscripts in kanji_a @ 96, 97 are not hyphens, 'er', and 're' superscripts in kanji_a
INVALID_SEQUENCE_976C = 97 6C
'˜' = 98 '˜' = 98
'™' = 99 '™' = 99
'š' = 9A 'š' = 9A
@ -221,61 +222,259 @@
@ Shift JIS @ Shift JIS
' ' = 81 40 ' ' = 81 40
'、' = 81 41
'。' = 81 42
'' = 81 43
'' = 81 44
'・' = 81 45
'' = 81 46
'' = 81 47
'' = 81 48 '' = 81 48
'' = 81 49
'゛' = 81 4A '゛' = 81 4A
'゜' = 81 4B '゜' = 81 4B
'ー' = 81 5B
'' = 81 5E
'〜' = 81 60 '〜' = 81 60
'♪' = 81 F4 '…' = 81 63
'' = 82 60 '‥' = 81 64
'' = 82 61 @'' = 81 66 - same char as 92
'' = 82 62 @'“' = 81 67 - same char as ~93
'う' = 82 A4 @'”' = 81 68 - same char as ~94
'か' = 82 A9 '' = 81 69
'が' = 82 AA '' = 81 6A
'し' = 82 B5 '「' = 81 75
'す' = 82 B7 '」' = 81 76
'な' = 82 C8 '『' = 81 77
'に' = 82 C9 '』' = 81 78
'も' = 82 CC '' = 81 7B
'み' = 82 DC '' = 81 7C
'ま' = 82 DD @'×' = 81 7E - same char as D7
'の' = 82 E0 '' = 81 81
'よ' = 82 E6 '' = 81 83
'る' = 82 E9 '' = 81 84
'を' = 82 F0 '∞' = 81 87
'ん' = 82 F1 @'♂' = 81 89 - same char as BD
'カ' = 83 4A @'♀' = 81 8A - same char as BE
'ナ' = 83 69 '' = 81 90
'' = 81 93
UNK_ICON_81_69 = 81 69 '' = 81 94
UNK_ICON_81_6A = 81 6A '' = 81 95
RIGHT_ARROW = 81 A8 '' = 81 96
LEFT_ARROW = 81 A9 '' = 81 97
UP_ARROW = 81 AA '○' = 81 9B
'→' = 81 A8 '→' = 81 A8
'←' = 81 A9 '←' = 81 A9
'↑' = 81 AA '↑' = 81 AA
'↓' = 81 AB '↓' = 81 AB
'♪' = 81 F4
@ Inverted font block
'' = 82 4F
'' = 82 50
'' = 82 51
'' = 82 52
'' = 82 53
'' = 82 54
'' = 82 55
'' = 82 56
'' = 82 57
'' = 82 58
'' = 82 60 @ Not standard shift-jis
'' = 82 61
'' = 82 62
'あ' = 82 A0
'い' = 82 A2
'う' = 82 A4
'え' = 82 A6
'お' = 82 A8
'か' = 82 A9
'が' = 82 AA
'き' = 82 AB
'ぎ' = 82 AC
'く' = 82 AD
'ぐ' = 82 AE
'け' = 82 AF
'げ' = 82 B0
'こ' = 82 B1
'ご' = 82 B2
'さ' = 82 B3
'ざ' = 82 B4
'し' = 82 B5
'じ' = 82 B6
'す' = 82 B7
'ず' = 82 B8
'せ' = 82 B9
'ぜ' = 82 BA
'そ' = 82 BB
'ぞ' = 82 BC
'た' = 82 BD
'だ' = 82 BE
'ち' = 82 BF
'ぢ' = 82 C0
'つ' = 82 C2
'づ' = 82 C3
'て' = 82 C4
'で' = 82 C5
'と' = 82 C6
'ど' = 82 C7
'な' = 82 C8
'に' = 82 C9
'ぬ' = 82 CA
'ね' = 82 CB
'の' = 82 CC
'は' = 82 CD
'ば' = 82 CE
'ぱ' = 82 CF
'ひ' = 82 D0
'び' = 82 D1
'ぴ' = 82 D2
'ふ' = 82 D3
'ぶ' = 82 D4
'ぷ' = 82 D5
'へ' = 82 D6
'べ' = 82 D7
'ぺ' = 82 D8
'ほ' = 82 D9
'ぼ' = 82 DA
'ぽ' = 82 DB
'ま' = 82 DC
'み' = 82 DD
'む' = 82 DE
'め' = 82 DF
'も' = 82 E0
'や' = 82 E2
'ゆ' = 82 E4
'よ' = 82 E6
'ら' = 82 E7
'り' = 82 E8
'る' = 82 E9
'れ' = 82 EA
'ろ' = 82 EB
'わ' = 82 ED
'を' = 82 F0
'ん' = 82 F1
'ア' = 83 41
'イ' = 83 43
'ウ' = 83 45
'エ' = 83 47
'オ' = 83 49
'カ' = 83 4A
'ガ' = 83 4B
'キ' = 83 4C
'ギ' = 83 4D
'ク' = 83 4E
'グ' = 83 4F
'ケ' = 83 50
'ゲ' = 83 51
'コ' = 83 52
'ゴ' = 83 53
'サ' = 83 54
'ザ' = 83 55
'シ' = 83 56
'ジ' = 83 57
'ス' = 83 58
'ズ' = 83 59
'セ' = 83 5A
'ゼ' = 83 5B
'ソ' = 83 5C
'ゾ' = 83 5D
'タ' = 83 5E
'ダ' = 83 5F
'チ' = 83 60
'ヂ' = 83 61
'ッ' = 83 62
'ツ' = 83 63
'ヅ' = 83 64
'テ' = 83 65
'デ' = 83 66
'ト' = 83 67
'ド' = 83 68
'ナ' = 83 69
'ニ' = 83 6A
'ヌ' = 83 6B
'ネ' = 83 6C
'' = 83 6D
'ハ' = 83 6E
'バ' = 83 6F
'パ' = 83 70
'ヒ' = 83 71
'ビ' = 83 72
'ピ' = 83 73
'フ' = 83 74
'ブ' = 83 75
'プ' = 83 76
'ヘ' = 83 77
'ベ' = 83 78
'ペ' = 83 79
'ホ' = 83 7A
'ボ' = 83 7B
'ポ' = 83 7C
'マ' = 83 7D
'ミ' = 83 7E
'ム' = 83 80
'メ' = 83 81
'モ' = 83 82
'ヤ' = 83 84
'ユ' = 83 86
'ヨ' = 83 88
'ラ' = 83 89
'リ' = 83 8A
'ル' = 83 8B
'レ' = 83 8C
'ロ' = 83 8D
'ワ' = 83 8F
'ヲ' = 83 92
'ン' = 83 93
@'Α' = 83 9F @ inverted narrow fixedwidth 0-9
@'Β' = 83 A0
@'Γ' = 83 A1
@'Δ' = 83 A2
@'Ε' = 83 A3
@'Ζ' = 83 A4
@'Η' = 83 A5
@'Θ' = 83 A6
@'Ι' = 83 A7
@'Κ' = 83 A8
@ Symbol block, replaces greek
@'α' = 83 BF @ Po
@'β' = 83 C0 @ Opened mail
@'γ' = 83 C1 @ ?
@'δ' = 83 C2 @ Go
@'ε' = 83 C3 @ News
@'ζ' = 83 C4 @ Ke
@'η' = 83 C5 @ White dash?
@'θ' = 83 C6 @ X button
@'ι' = 83 C7 @ Y button
'κ' = 83 C8 @ Kappa wasn't replaced :P
POKE = 83 BF 83 C4 @ This is actually two characters which can render separately; may need to be split eventually. POKE = 83 BF 83 C4 @ This is actually two characters which can render separately; may need to be split eventually.
UNK_ICON_83_C0 = 83 C0 ENVELOPE_OPEN = 83 C0
UNK_ICON_83_C1 = 83 C1 THANK_YOU_MAIL = 83 C1
UNK_ICON_83_C2 = 83 C2 ICON_GO = 83 C2
UNK_ICON_83_C3 = 83 C3 ICON_NEWS = 83 C3
NDS_Y_BUTTON = 83 C7 NDS_Y_BUTTON = 83 C7
R_BUTTON = 84 86 R_BUTTON = 84 86
UNK_ICON_84_87 = 84 87 ENVELOPE_CLOSED = 84 87
UNK_ICON_40 = 87 40 ICON_BLANK = 87 40
@ = 87 41 @ E
STAR_BULLET = 87 42 STAR_BULLET = 87 42
@ = 87 43 @ Star with E
ICON_STICKY = 87 44
SPEECH_BUBBLE = 87 45 SPEECH_BUBBLE = 87 45
@ 87 46..49 - red hearts
@ 87 4a..4d - yellow hearts - appears in team list
TM = 87 4E TM = 87 4E
ORB = 87 4F ORB = 87 4F
A_BUTTON = 87 50 A_BUTTON = 87 50
B_BUTTON = 87 51 B_BUTTON = 87 51
DPAD = 87 52 DPAD = 87 52
START_BUTTON = 87 53 87 71 START_BUTTON = 87 53 87 71
@ 87 54 placeholder, some kanji character
@ 87 5F ?????
SELECT_BUTTON = 87 72 87 73 SELECT_BUTTON = 87 72 87 73
L_BUTTON = 87 74 L_BUTTON = 87 74

View File

@ -812,5 +812,12 @@ gUnknown_80F51EC: @ 80F51EC
.global gUnknown_80F520C .global gUnknown_80F520C
gUnknown_80F520C: @ 80F520C gUnknown_80F520C: @ 80F520C
@ replacing .incbin "baserom.gba", 0x000f520c, 0x20 @ replacing .incbin "baserom.gba", 0x000f520c, 0x20
.byte 0x01, 0x00, 0x78, 0x01, 0x02, 0x00, 0x7a, 0x01, 0x01, 0x00, 0x78, 0x01, 0x01, 0x00, 0x78, 0x01, 0x03, 0x00, 0x7b, 0x01, 0x06, 0x00, 0x79, 0x01, 0x03, 0x00, 0x7b, 0x01, 0x06, 0x00, 0x79, 0x01 .byte 0x01, 0x00, 0x78, 0x01
.byte 0x02, 0x00, 0x7a, 0x01
.byte 0x01, 0x00, 0x78, 0x01
.byte 0x01, 0x00, 0x78, 0x01
.byte 0x03, 0x00, 0x7b, 0x01
.byte 0x06, 0x00, 0x79, 0x01
.byte 0x03, 0x00, 0x7b, 0x01
.byte 0x06, 0x00, 0x79, 0x01

View File

@ -308,8 +308,8 @@ gUnknown_80F6624: @ 80F6624
.byte 0xb9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 .byte 0xb9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00
.byte 0xbb, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 .byte 0xbb, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00
.global gStatusSpriteMasks_SleepStatus .global gStatusSpriteMasks_SleepClassStatus
gStatusSpriteMasks_SleepStatus: @ 80F669C gStatusSpriteMasks_SleepClassStatus: @ 80F669C
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte STATUS_SPRITE_SLEEP @ STATUS_SLEEP .4byte STATUS_SPRITE_SLEEP @ STATUS_SLEEP
.4byte STATUS_SPRITE_SLEEPLESS @ STATUS_SLEEPLESS .4byte STATUS_SPRITE_SLEEPLESS @ STATUS_SLEEPLESS
@ -317,16 +317,16 @@ gStatusSpriteMasks_SleepStatus: @ 80F669C
.4byte 0 @ STATUS_YAWNING .4byte 0 @ STATUS_YAWNING
.4byte STATUS_SPRITE_SLEEP @ STATUS_NAPPING .4byte STATUS_SPRITE_SLEEP @ STATUS_NAPPING
.global gStatusSpriteMasks_NonVolatileStatus .global gStatusSpriteMasks_BurnClassStatus
gStatusSpriteMasks_NonVolatileStatus: @ 80F66B4 gStatusSpriteMasks_BurnClassStatus: @ 80F66B4
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte STATUS_SPRITE_BURNED @ STATUS_BURN .4byte STATUS_SPRITE_BURNED @ STATUS_BURN
.4byte STATUS_SPRITE_POISONED @ STATUS_POISONED .4byte STATUS_SPRITE_POISONED @ STATUS_POISONED
.4byte STATUS_SPRITE_BADLY_POISONED @ STATUS_BADLY_POISONED .4byte STATUS_SPRITE_BADLY_POISONED @ STATUS_BADLY_POISONED
.4byte 0 @ STATUS_PARALYSIS .4byte 0 @ STATUS_PARALYSIS
.global gStatusSpriteMasks_ImmobilizeStatus .global gStatusSpriteMasks_FrozenClassStatus
gStatusSpriteMasks_ImmobilizeStatus: @ 80F66C8 gStatusSpriteMasks_FrozenClassStatus: @ 80F66C8
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte STATUS_SPRITE_FROZEN @ STATUS_FROZEN .4byte STATUS_SPRITE_FROZEN @ STATUS_FROZEN
.4byte 0 @ STATUS_SHADOW_HOLD .4byte 0 @ STATUS_SHADOW_HOLD
@ -336,8 +336,8 @@ gStatusSpriteMasks_ImmobilizeStatus: @ 80F66C8
.4byte 0 @ STATUS_PETRIFIED .4byte 0 @ STATUS_PETRIFIED
.4byte 0 @ STATUS_CONSTRICTION .4byte 0 @ STATUS_CONSTRICTION
.global gStatusSpriteMasks_VolatileStatus .global gStatusSpriteMasks_CringeClassStatus
gStatusSpriteMasks_VolatileStatus: @ 80F66E8 gStatusSpriteMasks_CringeClassStatus: @ 80F66E8
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte 0 @ STATUS_CRINGE .4byte 0 @ STATUS_CRINGE
.4byte STATUS_SPRITE_CONFUSED @ STATUS_CONFUSED .4byte STATUS_SPRITE_CONFUSED @ STATUS_CONFUSED
@ -347,8 +347,8 @@ gStatusSpriteMasks_VolatileStatus: @ 80F66E8
.4byte STATUS_SPRITE_ENCORE @ STATUS_ENCORE .4byte STATUS_SPRITE_ENCORE @ STATUS_ENCORE
.4byte 0 @ STATUS_INFATUATED .4byte 0 @ STATUS_INFATUATED
.global gStatusSpriteMasks_ChargingStatus .global gStatusSpriteMasks_BideClassStatus
gStatusSpriteMasks_ChargingStatus: @ 80F6708 gStatusSpriteMasks_BideClassStatus: @ 80F6708
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte 0 @ STATUS_BIDE .4byte 0 @ STATUS_BIDE
.4byte 0 @ STATUS_SOLARBEAM .4byte 0 @ STATUS_SOLARBEAM
@ -363,8 +363,8 @@ gStatusSpriteMasks_ChargingStatus: @ 80F6708
.4byte 0 @ STATUS_CHARGING .4byte 0 @ STATUS_CHARGING
.4byte 0 @ STATUS_ENRAGED .4byte 0 @ STATUS_ENRAGED
.global gStatusSpriteMasks_ProtectionStatus .global gStatusSpriteMasks_ReflectClassStatus
gStatusSpriteMasks_ProtectionStatus: @ 80F673C gStatusSpriteMasks_ReflectClassStatus: @ 80F673C
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_REFLECT .4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_REFLECT
.4byte STATUS_SPRITE_SHIELD_RED @ STATUS_SAFEGUARD .4byte STATUS_SPRITE_SHIELD_RED @ STATUS_SAFEGUARD
@ -381,42 +381,42 @@ gStatusSpriteMasks_ProtectionStatus: @ 80F673C
.4byte STATUS_SPRITE_SHIELD_GREEN @ STATUS_VITAL_THROW .4byte STATUS_SPRITE_SHIELD_GREEN @ STATUS_VITAL_THROW
.4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_MIST .4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_MIST
.global gStatusSpriteMasks_WaitingStatus .global gStatusSpriteMasks_CurseClassStatus
gStatusSpriteMasks_WaitingStatus: @ 80F6778 gStatusSpriteMasks_CurseClassStatus: @ 80F6778
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte STATUS_SPRITE_CURSED @ STATUS_CURSED .4byte STATUS_SPRITE_CURSED @ STATUS_CURSED
.4byte 0 @ STATUS_DECOY .4byte 0 @ STATUS_DECOY
.4byte STATUS_SPRITE_SNATCH @ STATUS_SNATCH .4byte STATUS_SPRITE_SNATCH @ STATUS_SNATCH
.global gStatusSpriteMasks_LinkedStatus .global gStatusSpriteMasks_LeechSeedClassStatus
gStatusSpriteMasks_LinkedStatus: @ 80F6788 gStatusSpriteMasks_LeechSeedClassStatus: @ 80F6788
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte 0 @ STATUS_LEECH_SEED .4byte 0 @ STATUS_LEECH_SEED
.4byte 0 @ STATUS_DESTINY_BOND .4byte 0 @ STATUS_DESTINY_BOND
.global gStatusSpriteMasks_MoveStatus .global gStatusSpriteMasks_SureShotClassStatus
gStatusSpriteMasks_MoveStatus: @ 80F6794 gStatusSpriteMasks_SureShotClassStatus: @ 80F6794
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte STATUS_SPRITE_SURE_SHOT @ STATUS_SURE_SHOT .4byte STATUS_SPRITE_SURE_SHOT @ STATUS_SURE_SHOT
.4byte STATUS_SPRITE_WHIFFER @ STATUS_WHIFFER .4byte STATUS_SPRITE_WHIFFER @ STATUS_WHIFFER
.4byte STATUS_SPRITE_SET_DAMAGE @ STATUS_SET_DAMAGE .4byte STATUS_SPRITE_SET_DAMAGE @ STATUS_SET_DAMAGE
.4byte STATUS_SPRITE_FOCUS_ENERGY @ STATUS_FOCUS_ENERGY .4byte STATUS_SPRITE_FOCUS_ENERGY @ STATUS_FOCUS_ENERGY
.global gStatusSpriteMasks_ItemStatus .global gStatusSpriteMasks_LongTossClassStatus
gStatusSpriteMasks_ItemStatus: @ 80F67A8 gStatusSpriteMasks_LongTossClassStatus: @ 80F67A8
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte 0 @ STATUS_LONG_TOSS .4byte 0 @ STATUS_LONG_TOSS
.4byte 0 @ STATUS_PIERCE .4byte 0 @ STATUS_PIERCE
.global gStatusSpriteMasks_TransformStatus .global gStatusSpriteMasks_InvisibleClassStatus
gStatusSpriteMasks_TransformStatus: @ 80F67B4 gStatusSpriteMasks_InvisibleClassStatus: @ 80F67B4
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte 0 @ STATUS_INVISIBLE .4byte 0 @ STATUS_INVISIBLE
.4byte 0 @ STATUS_TRANSFORMED .4byte 0 @ STATUS_TRANSFORMED
.4byte 0 @ STATUS_MOBILE .4byte 0 @ STATUS_MOBILE
.global gStatusSpriteMasks_EyesightStatus .global gStatusSpriteMasks_BlinkerClassStatus
gStatusSpriteMasks_EyesightStatus: @ 80F67C4 gStatusSpriteMasks_BlinkerClassStatus: @ 80F67C4
.4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_NONE
.4byte STATUS_SPRITE_BLINKER @ STATUS_BLINKER .4byte STATUS_SPRITE_BLINKER @ STATUS_BLINKER
.4byte STATUS_SPRITE_CROSS_EYED @ STATUS_CROSS_EYED .4byte STATUS_SPRITE_CROSS_EYED @ STATUS_CROSS_EYED
@ -465,7 +465,8 @@ gUnknown_80F683C: @ 80F683C
.global gUnknown_80F6850 .global gUnknown_80F6850
gUnknown_80F6850: @ 80F6850 gUnknown_80F6850: @ 80F6850
@ replacing .incbin "baserom.gba", 0xF6850, 0x10 @ replacing .incbin "baserom.gba", 0xF6850, 0x10
.byte 0x9e, 0x01, 0xa1, 0x01, 0xa2, 0x01, 0xa3, 0x01, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 .byte 0x9e, 0x01, 0xa1, 0x01, 0xa2, 0x01, 0xa3, 0x01
.byte 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.global gSpeedTurns .global gSpeedTurns
gSpeedTurns: @ 80F6860 gSpeedTurns: @ 80F6860
@ -521,14 +522,14 @@ gUnknown_80F69A8: @ 80F69A8
.byte 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64 .byte 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64
.byte 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00 .byte 0x69, 0x72, 0x30, 0x00, 0x70, 0x6b, 0x73, 0x64, 0x69, 0x72, 0x30, 0x00
.global gUnknown_80F69D4 .global gOtherOobTile
gUnknown_80F69D4: @ 80F69D4 gOtherOobTile: @ 80F69D4
@ replacing .incbin "baserom.gba", 0xF69D4, 0x18 @ replacing .incbin "baserom.gba", 0xF69D4, 0x18
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.global gUnknown_80F69EC .global gWaterOobTile
gUnknown_80F69EC: @ 80F69EC gWaterOobTile: @ 80F69EC
@ replacing .incbin "baserom.gba", 0xF69EC, 0x18 @ replacing .incbin "baserom.gba", 0xF69EC, 0x18
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

File diff suppressed because it is too large Load Diff

1523
data/data_8107224.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -275,7 +275,7 @@ MoveUseTextBide:
.global MoveNameBide2 .global MoveNameBide2
MoveNameBide2: MoveNameBide2:
.string "\0" .string "\0"
.align 2,0 .align 2,0
.global MoveDescriptionIsWatching .global MoveDescriptionIsWatching
@ -285,7 +285,7 @@ MoveDescriptionIsWatching:
.global MoveNameIsWatching .global MoveNameIsWatching
MoveNameIsWatching: MoveNameIsWatching:
.string "\0" .string "\0"
.align 2,0 .align 2,0
.global MoveUseTextRegularAttack .global MoveUseTextRegularAttack
@ -3280,5 +3280,5 @@ MoveDescriptionNone:
.global MoveNameNone .global MoveNameNone
MoveNameNone: MoveNameNone:
.string "\0" .string "\0"
.align 2,0 .align 2,0

View File

@ -29,7 +29,7 @@ $(LEARNSET_DATA): $(LEARNSET_DIR)/learnset_data.json
$(DUNGEONJSON) learnset pmd-red $< $(DUNGEONJSON) learnset pmd-red $<
data_learnset_ptrs: ${LEARNSET_DATA}; data_learnset_ptrs: ${LEARNSET_DATA};
echo '.4byte 0' >> $(LEARNSET_PTRS) echo '.4byte 0' > $(LEARNSET_PTRS)
echo '.4byte 0' >> $(LEARNSET_PTRS) echo '.4byte 0' >> $(LEARNSET_PTRS)
cat $(LEARNSET_DATA) | grep .global >> $(LEARNSET_PTRS) cat $(LEARNSET_DATA) | grep .global >> $(LEARNSET_PTRS)
ifeq ($(shell uname -s), Darwin) ifeq ($(shell uname -s), Darwin)

View File

@ -3,7 +3,7 @@
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move); bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move);
// checkCharge = Check for the move named Charge. // checkCharge = Check for the move named Charge.
bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge); bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge);

View File

@ -25,7 +25,7 @@ bool8 sub_800E9A8(s32);
void sub_800DAC0(u32); void sub_800DAC0(u32);
void sub_800DB7C(void); void sub_800DB7C(void);
void sub_800DBBC(void); void sub_800DBBC(void);
void sub_800E90C(Position *); void sub_800E90C(DungeonPos *);
void sub_800E8AC(s32 a0, void *a1, void *a2, s32 a3, void *a4); // a2 could be Position void sub_800E8AC(s32 a0, void *a1, void *a2, s32 a3, void *a4); // a2 could be DungeonPos
#endif // GUARD_CODE_800DAC0_H #endif // GUARD_CODE_800DAC0_H

8
include/code_800F958.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_CODE_800F958_H
#define GUARD_CODE_800F958_H
#include "structs/str_position.h"
void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32);
#endif // GUARD_CODE_800F958_H

8
include/code_803E724.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_CODE_803E724_H
#define GUARD_CODE_803E724_H
#include "structs/str_position.h"
bool8 sub_803F428(DungeonPos *pos);
#endif // GUARD_CODE_803E724_H

View File

@ -4,6 +4,7 @@
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
#include "structs/str_damage.h" #include "structs/str_damage.h"
void sub_80420E8(Entity *pokemon, struct DamageStruct *dmgStruct); void sub_80420E8(Entity *pokemon, DamageStruct *dmgStruct);
void sub_80421C0(Entity *pokemon, u16);
#endif #endif // GUARD_CODE_8041AD0_H

View File

@ -1,13 +1,14 @@
#ifndef GUARD_CODE_8044CC8_H #ifndef GUARD_CODE_8044CC8_H
#define GUARD_CODE_8044CC8_H #define GUARD_CODE_8044CC8_H
struct unkStruct_202EE44 // size: 0x4
typedef struct unkStruct_202EE44
{ {
u16 unk0; u16 unk0;
u8 unk2; u8 unk2;
bool8 unk3; bool8 unk3;
}; } unkStruct_202EE44;
extern struct unkStruct_202EE44 gUnknown_202EE44[10]; extern unkStruct_202EE44 gUnknown_202EE44[10];
#endif // GUARD_CODE_8044CC8_H #endif // GUARD_CODE_8044CC8_H

10
include/code_80450F8.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef GUARD_CODE_80227B8_H
#define GUARD_CODE_80227B8_H
#include "structs/dungeon_entity.h"
Entity *sub_8045684(u8 trapID, DungeonPos *pos, u8 c);
Entity *sub_8045708(DungeonPos *pos);
void sub_80457DC(Entity* ent);
#endif // GUARD_CODE_80227B8_H

View File

@ -3,6 +3,8 @@
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
void SetMessageArgument(u8 *buffer, Entity *entity, u32 param_3); void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3);
#endif // GUARD_CODE_8045A00_H void sub_8045ACC(void);
#endif // GUARD_CODE_8045A00_H

View File

@ -14,7 +14,7 @@ struct unkStruct_8069D4C_sub
struct unkStruct_8069D4C struct unkStruct_8069D4C
{ {
s16 id; s16 id;
Position pos; DungeonPos pos;
s16 HP; s16 HP;
struct unkStruct_8069D4C_sub offense; struct unkStruct_8069D4C_sub offense;
u16 level; u16 level;

View File

@ -35,13 +35,13 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target);
void VitalThrowStatusTarget(Entity * pokemon, Entity * target); void VitalThrowStatusTarget(Entity * pokemon, Entity * target);
void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4); void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4);
void sub_807A0CC(Entity * pokemon, Entity * target); void sub_807A0CC(Entity * pokemon, Entity * target);
void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4); void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4);
void SendNonVolatileEndMessage(Entity * pokemon, Entity * target); void EndBurnClassStatus(Entity * pokemon, Entity * target);
void SendImmobilizeEndMessage(Entity * pokemon, Entity *target); void EndFrozenClassStatus(Entity * pokemon, Entity *target);
void SendVolatileEndMessage(Entity * pokemon, Entity *target); void EndCringeClassStatus(Entity * pokemon, Entity *target);
void SendProtectionEndMessage(Entity * pokemon, Entity *target); void EndReflectClassStatus(Entity * pokemon, Entity *target);
void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus); void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus);
void SendLinkedEndMessage(Entity * pokemon, Entity * target); void EndLeechSeedClassStatus(Entity * pokemon, Entity * target);
void SendMoveEndMessage(Entity * pokemon, Entity * target); void SendMoveEndMessage(Entity * pokemon, Entity * target);
void SendTransformEndMessage(Entity * pokemon, Entity *target); void SendTransformEndMessage(Entity * pokemon, Entity *target);
void SendEyesightEndMessage(Entity * pokemon,Entity * target); void SendEyesightEndMessage(Entity * pokemon,Entity * target);

View File

@ -2,7 +2,7 @@
#define CODE_807CD9C_H #define CODE_807CD9C_H
void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction); void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction);
void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos); void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos);
void sub_807D3CC(Entity *param_1); void sub_807D3CC(Entity *param_1);
#endif /* ifndef CODE_807CD9C_H */ #endif /* ifndef CODE_807CD9C_H */

View File

@ -1,21 +1,12 @@
#ifndef GUARD_CODE_8092334_H #ifndef GUARD_CODE_8092334_H
#define GUARD_CODE_8092334_H #define GUARD_CODE_8092334_H
// size: 0x10? #include "data_serializer.h"
typedef struct unkStruct_8094924
{
u8 *unk0; // head?
u8 *unk4; // tail?
u32 unk8;
u32 unkC;
} unkStruct_8094924;
void nullsub_102(unkStruct_8094924 *); void FinishBitSerializer(DataSerializer *seri);
void RestoreIntegerBits(unkStruct_8094924 *, void *, s32 size); void InitBitReader(DataSerializer *seri, u8 *buffer, s32 bufLen);
void SaveIntegerBits(unkStruct_8094924 *, void *, s32 size); void InitBitWriter(DataSerializer *seri, u8 *buffer, s32 bufLen);
void xxx_init_struct_8094924_restore_809485C(unkStruct_8094924 *, u8 *, s32 size); void ReadBits(DataSerializer *seri, void *dst, s32 numBits);
void xxx_init_struct_8094924_save_809486C(unkStruct_8094924 *, u8 *, s32 size); void WriteBits(DataSerializer *seri, void *src, s32 numBits);
void sub_80948E4(unkStruct_8094924 *, u8 *, s32 size);
#endif // GUARD_CODE_8092334_H #endif // GUARD_CODE_8092334_H

View File

@ -46,7 +46,7 @@ u32 CountAllMail(void);
s32 sub_8095374(void); s32 sub_8095374(void);
s32 GetMailIndex(u8 mailType, u32); s32 GetMailIndex(u8 mailType, u32);
s32 GetFirstIndexofMailType(u8 mailType); s32 GetFirstIndexofMailType(u8 mailType);
void sub_8095824(struct unkStruct_8094924 *a, unkStruct_203B480 *b); void sub_8095824(DataSerializer *a, unkStruct_203B480 *b);
void sub_8095774(struct unkStruct_8094924 *a, unkStruct_203B480 *b); void sub_8095774(DataSerializer *a, unkStruct_203B480 *b);
#endif // GUARD_CODE_8094F88_H #endif // GUARD_CODE_8094F88_H

View File

@ -68,7 +68,7 @@ u8 *sub_8096DD8(void);
u8 *sub_8096DE8(void); u8 *sub_8096DE8(void);
u8 sub_8096E2C(void); u8 sub_8096E2C(void);
void sub_8096EEC(WonderMail *mail); void sub_8096EEC(WonderMail *mail);
void SaveWonderMail(unkStruct_8094924 *a, WonderMail *b); void WriteWonderMailBits(DataSerializer *a, WonderMail *b);
void RestoreWonderMail(unkStruct_8094924 *a, WonderMail *b); void ReadWonderMailBits(DataSerializer *a, WonderMail *b);
#endif // GUARD_CODE_80958E8_H #endif // GUARD_CODE_80958E8_H

View File

@ -3,21 +3,59 @@
#include "structs/str_dungeon.h" #include "structs/str_dungeon.h"
// See gAdventureLogText
enum AdventureAchievement
{
AA_HILL_OF_ANCIENTS,
AA_FUGITIVE,
AA_PREVENT_METEOR,
AA_BROKE_CURSE,
AA_TEAM_BASE_DONE,
AA_SMEARGLE,
AA_SPOTTED_MUNCHLAX,
AA_NUM_MOVES_LEARNED,
AA_NUM_FRIEND_RESCUE_SUCCESSES,
AA_NUM_POKEMON_EVOLVED,
AA_NUM_POKEMON_JOINED,
AA_NUM_THIEVING_SUCCESSES,
AA_NUM_FLOORS_EXPLORED,
AA_ALL_FRIEND_AREAS,
AA_ALL_POKEMON_LEADERS,
AA_ALL_POKEMON_JOINED,
AA_RECRUIT_MOLTRES,
AA_RECRUIT_ZAPDOS,
AA_RECRUIT_ARTICUNO,
AA_RECRUIT_DEOXYS,
AA_RECRUIT_ENTEI,
AA_RECRUIT_RAIKOU,
AA_RECRUIT_SUICUNE,
AA_RECRUIT_HO_OH,
AA_RECRUIT_KYOGRE,
AA_RECRUIT_GROUDON,
AA_RECRUIT_RAYQUAZA,
AA_RECRUIT_LUGIA,
AA_RECRUIT_CELEBI,
AA_RECRUIT_MEW,
AA_RECRUIT_MEWTWO,
AA_RECRUIT_JIRACHI,
AA_MAX
};
// size: 0xC4 // size: 0xC4
struct unkStruct_203B494 struct unkStruct_203B494
{ {
u32 unk0; // 32 bit bitfield, I think /* 0x0 */ u32 achievements; // Adventure achievement flags
/* 0x4 */ s32 numAdventures; /* 0x4 */ s32 numAdventures;
s32 unk8; /* 0x8 */ s32 friendRescueSuccesses;
s32 unkC; /* 0xC */ s32 numEvolved;
/* 0x10 */ DungeonLocation dungeonLocation; /* 0x10 */ DungeonLocation dungeonLocation;
s16 unk14; /* 0x14 */ s16 thievingSuccesses;
s16 unk16; /* 0x16 */ s16 numJoined;
s16 unk18; /* 0x18 */ s16 adventureMovesLearned;
u32 unk1C[14]; u32 unk1C[14];
u32 unk54[14]; u32 unk54[14];
u32 unk8C[13]; /* 0x8C */ u32 learnedMoves[13]; // Get with `learnedMoves[move / 32] & 1 << move % 32` ... Set with `learnedMoves[move / 32] |= 1 << move % 32`
s32 unkC0; /* 0xC0 */ s32 numFloorsExplored;
}; };
extern struct unkStruct_203B494 *gUnknown_203B494; extern struct unkStruct_203B494 *gUnknown_203B494;
@ -29,20 +67,20 @@ void ResetNumAdventures(void);
void sub_8097670(void); void sub_8097670(void);
struct unkStruct_203B494 *sub_8097680(void); struct unkStruct_203B494 *sub_8097680(void);
void sub_80976A8(void); void ResetAdventureInfo(void);
void sub_80976F8(u8); void SetAdventureAchievement(u8);
bool8 sub_8097710(u8); bool8 GetAdventureAchievement(u8);
void sub_8097790(void); void IncrementFriendRescueSuccesses(void);
s32 sub_80977B8(void); s32 GetFriendRescueSuccesses(void);
void sub_80977D0(void); void IncrementNumEvolved(void);
s32 sub_80977F8(void); s32 GetAdventureNumEvolved(void);
s16 sub_8097838(void); s16 GetThievingSuccesses(void);
void sub_8097848(void); void IncrementAdventureNumJoined(void);
s16 sub_8097870(void); s16 GetAdventureNumJoined(void);
s16 sub_8097880(void); s16 GetAdventureMovesLearned(void);
s16 sub_80978B8(void); s16 GetAdventureFloorsExplored(void);
void sub_8097944(void); void UpdateAdventureAchievements(void);
u32 sub_8097D60(u8 *r0, u32 size); u32 SaveAdventureData(u8 *r0, u32 size);
u32 sub_8097D98(u8 *r0, u32 size); u32 RestoreAdventureData(u8 *r0, u32 size);
#endif // GUARD_CODE_8097670_H #endif // GUARD_CODE_8097670_H

View File

@ -33,6 +33,6 @@ extern const u8* const gCommonKecleonBros[KECLEON_BROS_MODE_COUNT][KECLEON_DLG_M
extern const u8* const gCommonWigglytuff[WIGGLYTUFF_SHOP_MODE_COUNT][WIGGLY_DLG_MAX]; extern const u8* const gCommonWigglytuff[WIGGLYTUFF_SHOP_MODE_COUNT][WIGGLY_DLG_MAX];
extern const u8* const gCommonGulpin[GULPIN_SHOP_MODE_DIALOGUE_COUNT][GULPIN_DLG_MAX]; extern const u8* const gCommonGulpin[GULPIN_SHOP_MODE_DIALOGUE_COUNT][GULPIN_DLG_MAX];
extern const u8* const gCommonMakuhita[MAKUHITA_DOJO_MODE_COUNT][MAKUHITA_DLG_MAX]; extern const u8* const gCommonMakuhita[MAKUHITA_DOJO_MODE_COUNT][MAKUHITA_DLG_MAX];
extern const Hints gCommonHints[NUM_HINTS]; extern const Hints gCommonHints[HINT_MAX];
#endif // GUARD_COMMON_STRINGS_H #endif // GUARD_COMMON_STRINGS_H

View File

@ -8,6 +8,14 @@ typedef struct Hints
const u8 *body; const u8 *body;
} Hints; } Hints;
#define NUM_HINTS 5 enum HintKind
{
HINT_TOWN_CONTROLS_1,
HINT_TOWN_CONTROLS_2,
HINT_SAVING,
HINT_ADVENTURES_WITH_FRIENDS,
HINT_BUILDING_A_TEAM,
HINT_MAX
};
#endif // GUARD_COMMON_STRINGS_HINTS_H #endif // GUARD_COMMON_STRINGS_HINTS_H

View File

@ -24,9 +24,9 @@ enum KangaskhanStorageDialogue
KANG_DLG_WITHDRAW_CONFIRMATION, KANG_DLG_WITHDRAW_CONFIRMATION,
KANG_DLG_YOU_HAVE_NOTHING, KANG_DLG_YOU_HAVE_NOTHING,
KANG_DLG_YOU_ARE_FULL, KANG_DLG_YOU_ARE_FULL,
KANG_DLG_STORAGE_HAS_NOTHING, KANG_DLG_STORAGE_EMPTY,
KANG_DLG_DEPOSIT__INVALID_ITEM, KANG_DLG_DEPOSIT_INVALID_ITEM,
KANG_DLG_DEPOSIT__TOO_MANY_OF_ITEM, KANG_DLG_DEPOSIT_TOO_MANY_OF_ITEM,
KANG_DLG_STORAGE_FULL, KANG_DLG_STORAGE_FULL,
KANG_DLG_HOW_IT_WORKS, KANG_DLG_HOW_IT_WORKS,
KANG_DLG_MAX KANG_DLG_MAX

View File

@ -418,4 +418,6 @@
#define MOVE_MD1_2 0x19B // Unused #define MOVE_MD1_2 0x19B // Unused
#define MOVE_PIERCE 0x19C #define MOVE_PIERCE 0x19C
#define NUM_MOVE_IDS (MOVE_PIERCE + 1)
#endif #endif

View File

@ -17,15 +17,14 @@ enum NaturePersonalities
LONELY, LONELY,
QUIRKY, QUIRKY,
MISC, MISC,
}; };
#define NUM_PARTNERS 10 #define NUM_PARTNERS 10
#define NUM_QUIZ_QUESTIONS 55 #define NUM_QUIZ_QUESTIONS 55
#define MAX_ASKED_QUESTIONS 8 #define MAX_ASKED_QUESTIONS 8
#define NUM_PERSONALITIES MISC #define NUM_PERSONALITIES MISC
#define NUM_PERSONALITY_TEST_EFFECTS (NUM_PERSONALITIES+3) #define NUM_PERSONALITY_TEST_EFFECTS (NUM_PERSONALITIES + 3)
#define BRAVE_2B_TRIGGER 99 #define BRAVE_2B_TRIGGER 99
#endif // GUARD_CONSTANTS_PERSONALITY_TEST_H #endif // GUARD_CONSTANTS_PERSONALITY_TEST_H

View File

@ -1,7 +1,7 @@
#ifndef GUARD_CONSTANTS_STATUS_H #ifndef GUARD_CONSTANTS_STATUS_H
#define GUARD_CONSTANTS_STATUS_H #define GUARD_CONSTANTS_STATUS_H
// Sleep statuses // Sleep class statuses
#define STATUS_NONE 0 #define STATUS_NONE 0
#define STATUS_SLEEP 1 #define STATUS_SLEEP 1
#define STATUS_SLEEPLESS 2 #define STATUS_SLEEPLESS 2
@ -9,13 +9,13 @@
#define STATUS_YAWNING 4 #define STATUS_YAWNING 4
#define STATUS_NAPPING 5 #define STATUS_NAPPING 5
// Non-volatile statuses // Burn class statuses
#define STATUS_BURN 1 #define STATUS_BURN 1
#define STATUS_POISONED 2 #define STATUS_POISONED 2
#define STATUS_BADLY_POISONED 3 #define STATUS_BADLY_POISONED 3
#define STATUS_PARALYSIS 4 #define STATUS_PARALYSIS 4
// Immobilize statuses // Frozen class statuses
#define STATUS_FROZEN 1 #define STATUS_FROZEN 1
#define STATUS_SHADOW_HOLD 2 #define STATUS_SHADOW_HOLD 2
#define STATUS_WRAP 3 #define STATUS_WRAP 3
@ -24,7 +24,7 @@
#define STATUS_PETRIFIED 6 #define STATUS_PETRIFIED 6
#define STATUS_CONSTRICTION 7 #define STATUS_CONSTRICTION 7
// Volatile statuses // Cringe class statuses
#define STATUS_CRINGE 1 #define STATUS_CRINGE 1
#define STATUS_CONFUSED 2 #define STATUS_CONFUSED 2
#define STATUS_PAUSED 3 #define STATUS_PAUSED 3
@ -33,7 +33,7 @@
#define STATUS_ENCORE 6 #define STATUS_ENCORE 6
#define STATUS_INFATUATED 7 #define STATUS_INFATUATED 7
// Charging statuses // Bide class statuses
#define STATUS_BIDE 1 #define STATUS_BIDE 1
#define STATUS_SOLARBEAM 2 #define STATUS_SOLARBEAM 2
#define STATUS_SKY_ATTACK 3 #define STATUS_SKY_ATTACK 3
@ -47,7 +47,7 @@
#define STATUS_CHARGING 11 #define STATUS_CHARGING 11
#define STATUS_ENRAGED 12 #define STATUS_ENRAGED 12
// Protection statuses // ReflectClassStatus statuses
#define STATUS_REFLECT 1 #define STATUS_REFLECT 1
#define STATUS_SAFEGUARD 2 #define STATUS_SAFEGUARD 2
#define STATUS_LIGHT_SCREEN 3 #define STATUS_LIGHT_SCREEN 3
@ -63,31 +63,31 @@
#define STATUS_VITAL_THROW 13 #define STATUS_VITAL_THROW 13
#define STATUS_MIST 14 #define STATUS_MIST 14
// Waiting statuses // Curse class statuses
#define STATUS_CURSED 1 #define STATUS_CURSED 1
#define STATUS_DECOY 2 #define STATUS_DECOY 2
#define STATUS_SNATCH 3 #define STATUS_SNATCH 3
// Linked statuses // Leech Seed class statuses
#define STATUS_LEECH_SEED 1 #define STATUS_LEECH_SEED 1
#define STATUS_DESTINY_BOND 2 #define STATUS_DESTINY_BOND 2
// Move statuses // Sure Shot class statuses
#define STATUS_SURE_SHOT 1 #define STATUS_SURE_SHOT 1
#define STATUS_WHIFFER 2 #define STATUS_WHIFFER 2
#define STATUS_SET_DAMAGE 3 #define STATUS_SET_DAMAGE 3
#define STATUS_FOCUS_ENERGY 4 #define STATUS_FOCUS_ENERGY 4
// Item statuses // Long Toss class statuses
#define STATUS_LONG_TOSS 1 #define STATUS_LONG_TOSS 1
#define STATUS_PIERCE 2 #define STATUS_PIERCE 2
// Transform statuses // Invisible class statuses
#define STATUS_INVISIBLE 1 #define STATUS_INVISIBLE 1
#define STATUS_TRANSFORMED 2 #define STATUS_TRANSFORMED 2
#define STATUS_MOBILE 3 #define STATUS_MOBILE 3
// Eyesight statuses // Blinker class statuses
#define STATUS_BLINKER 1 #define STATUS_BLINKER 1
#define STATUS_CROSS_EYED 2 #define STATUS_CROSS_EYED 2
#define STATUS_EYEDROPS 3 #define STATUS_EYEDROPS 3

View File

@ -1,9 +1,9 @@
#ifndef GUARD_CONSTANTS_TARGETING_H #ifndef GUARD_CONSTANTS_TARGETING_H
#define GUARD_CONSTANTS_TARGETING_H #define GUARD_CONSTANTS_TARGETING_H
#define TARGETING_DECOY_NONE 0 #define DECOY_AI_NONE 0
#define TARGETING_DECOY_TEAM 1 #define DECOY_AI_TEAM 1
#define TARGETING_DECOY_WILD 2 #define DECOY_AI_WILD 2
#define TREATMENT_TREAT_AS_ALLY 0 #define TREATMENT_TREAT_AS_ALLY 0
#define TREATMENT_TREAT_AS_ENEMY 1 #define TREATMENT_TREAT_AS_ENEMY 1

13
include/data_serializer.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef GUARD_DATA_SERIALIZER_H
#define GUARD_DATA_SERIALIZER_H
// size: 0x10
typedef struct DataSerializer
{
u8 *stream;
u8 *end; // Exclusive end of the stream
u32 count; // Used to count bits between ReadBits functions, or count bytes between ReadBytes functions
u32 unkC; // Seems to be a temporary 32 bit storage
} DataSerializer;
#endif // GUARD_DATA_SERIALIZER_H

View File

@ -13,7 +13,7 @@ struct AIPossibleMove
s32 weight; s32 weight;
}; };
void DecideAttack(Entity *pokemon); void ChooseAIMove(Entity *pokemon);
s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move *move); s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move *move);
bool8 IsTargetInLineRange(Entity *user, Entity *target, s32 range); bool8 IsTargetInLineRange(Entity *user, Entity *target, s32 range);
s32 TryAddTargetToAITargetList(s32 numPotentialTargets, s32 targetingFlags, Entity *user, Entity *target, Move *move, u32 hasStatusChecker); s32 TryAddTargetToAITargetList(s32 numPotentialTargets, s32 targetingFlags, Entity *user, Entity *target, Move *move, u32 hasStatusChecker);

View File

@ -6,7 +6,7 @@
void AIDecideUseItem(Entity *pokemon); void AIDecideUseItem(Entity *pokemon);
void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item *item, bool8 ignoreRollChance); void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item *item, bool8 ignoreRollChance);
void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potentialTargets[], bool8 ignoreRollChance); void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, DungeonPos potentialTargets[], bool8 ignoreRollChance);
void TargetThrownItem(Entity *pokemon, Entity *targetPokemon, Item *item, s32 targetingFlags, bool8 ignoreRollChance); void TargetThrownItem(Entity *pokemon, Entity *targetPokemon, Item *item, s32 targetingFlags, bool8 ignoreRollChance);
#endif #endif

View File

@ -3,7 +3,7 @@
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect); void AIMovement(Entity *pokemon, bool8 showRunAwayEffect);
bool8 CanTakeItem(Entity *pokemon); bool8 CanTakeItem(Entity *pokemon);
bool8 ChooseTargetPosition(Entity *pokemon); bool8 ChooseTargetPosition(Entity *pokemon);
void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect); void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect);

View File

@ -114,9 +114,9 @@ void sub_808AC3C(void);
void sub_808ACC0(void); void sub_808ACC0(void);
void sub_808AD48(void); void sub_808AD48(void);
void sub_808ADCC(void); void sub_808ADCC(void);
void sub_808AE54(u8, u8, Position *pos); void sub_808AE54(u8, u8, DungeonPos *pos);
void sub_808AEC8(u8, u8, Position *pos); void sub_808AEC8(u8, u8, DungeonPos *pos);
void sub_808AF3C(u8, u8, Position *pos); void sub_808AF3C(u8, u8, DungeonPos *pos);
void sub_808AFB0(u8); void sub_808AFB0(u8);
void sub_808B030(u8); void sub_808B030(u8);
void sub_808B0B0(u8); void sub_808B0B0(u8);

View File

@ -3,13 +3,10 @@
#include "structs/map.h" #include "structs/map.h"
typedef struct unkStruct_202F190 const Tile *GetTile(s32 x, s32 y);
{ Tile *GetTileMut(s32 x, s32 y);
Tile *unk0[6];
} unkStruct_202F190;
Tile *GetTile(s32 x, s32 y); void sub_8049ED4(void);
Tile *GetTileSafe(s32 x, s32 y); void sub_804AC20(DungeonPos *pos);
void sub_804AC20(Position *pos);
#endif #endif // GUARD_DUNGEON_MAP_ACCESS_H

View File

@ -24,11 +24,11 @@ void sub_80521D0(void);
void sub_8052210(bool8 a0); void sub_8052210(bool8 a0);
// These functions display the string if certain conditions are met. The conditions differ depending on the function. The string is then saved to the message log. // These functions display the string if certain conditions are met. The conditions differ depending on the function. The string is then saved to the message log.
void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str); void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str);
void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str); void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str);
void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str); void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str);
void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str); void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str);
void TryDisplayDungeonLoggableMessage5(Entity *pokemon, Position *pos, const u8 *str); void TryDisplayDungeonLoggableMessage5(Entity *pokemon, DungeonPos *pos, const u8 *str);
// As opposed to the above - these always display the string and save it in the message log. False/True stand for an unknown argument. Not sure what the practical difference is between these. // As opposed to the above - these always display the string and save it in the message log. False/True stand for an unknown argument. Not sure what the practical difference is between these.
void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str); void DisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str);

View File

@ -7,13 +7,13 @@
extern u8 gWalkableTileToCrossableTerrain[8]; extern u8 gWalkableTileToCrossableTerrain[8];
u8 GetCrossableTerrain(s16 species); u8 GetCrossableTerrain(s16 species);
u8 sub_807034C(s16 id, struct Tile *tile); u8 sub_807034C(s16 id, const Tile *tile);
u8 sub_80703A0(Entity *pokemon, Position *pos); u8 sub_80703A0(Entity *pokemon, DungeonPos *pos);
bool8 CanCrossWalls(Entity *pokemon); bool8 CanCrossWalls(Entity *pokemon);
bool8 sub_807049C(Entity *pokemon, Position *pos); bool8 sub_807049C(Entity *pokemon, DungeonPos *pos);
bool8 sub_8070564(Entity *pokemon, Position *pos); bool8 sub_8070564(Entity *pokemon, DungeonPos *pos);
bool8 sub_80705F0(Entity *pokemon, Position *pos); bool8 sub_80705F0(Entity *pokemon, DungeonPos *pos);
bool8 sub_80706A4(Entity *pokemon, Position *pos); bool8 sub_80706A4(Entity *pokemon, DungeonPos *pos);
s32 CalcSpeedStage(Entity *pokemon); s32 CalcSpeedStage(Entity *pokemon);
#endif #endif

View File

@ -20,8 +20,8 @@ typedef struct DungeonPokemonSprite
/* 0xC */ u32 status; /* 0xC */ u32 status;
/* 0x10 */ u8 visible; /* 0x10 */ u8 visible;
/* 0x11 */ u8 unk11; /* 0x11 */ u8 unk11;
/* 0x14 */ Position pos; /* 0x14 */ DungeonPos pos;
/* 0x18 */ Position statusOffsets[2]; /* 0x18 */ DungeonPos statusOffsets[2];
/* 0x20 */ u32 unk20; /* 0x20 */ u32 unk20;
/* 0x24 */ u32 unk24; /* 0x24 */ u32 unk24;
/* 0x28 */ DungeonPokemonStatusSprite statusSprites[2]; /* 0x28 */ DungeonPokemonStatusSprite statusSprites[2];

View File

@ -3,8 +3,8 @@
#include "structs/str_position.h" #include "structs/str_position.h"
bool8 IsPositionActuallyInSight(Position *pos1, Position *pos2); bool8 IsPositionActuallyInSight(DungeonPos *pos1, DungeonPos *pos2);
bool8 IsPositionInSight(Position *pos1, Position *pos2); bool8 IsPositionInSight(DungeonPos *pos1, DungeonPos *pos2);
bool8 IsTargetTwoTilesAway(Position *pos1, Position *pos2); bool8 IsTargetTwoTilesAway(DungeonPos *pos1, DungeonPos *pos2);
#endif #endif

View File

@ -0,0 +1,11 @@
#ifndef GUARD_DUNGEON_SERIALIZER_H
#define GUARD_DUNGEON_SERIALIZER_H
#include "data_serializer.h"
void ReadDungeonState(u8 *buffer, u32 bufLen);
void SaveDungeonState(u8 *buffer, u32 bufLen);
void sub_8082B40(void);
#endif // GUARD_DUNGEON_SERIALIZER_H

View File

@ -5,19 +5,25 @@
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
#include "structs/str_position.h" #include "structs/str_position.h"
#include "structs/str_traps.h" #include "structs/str_traps.h"
#include "structs/map.h"
extern const Position gAdjacentTileOffsets[NUM_DIRECTIONS]; extern const DungeonPos gAdjacentTileOffsets[NUM_DIRECTIONS];
bool8 EntityExists(Entity *pokemon); bool8 EntityExists(Entity *pokemon);
u32 GetEntityType(Entity *entity); u32 GetEntityType(Entity *entity);
u8 GetEntityRoom(Entity *entity); u8 GetEntityRoom(Entity *entity);
Trap *GetTrapData(Entity *entity); Tile *GetTileAtEntitySafe(Entity *entity);
Trap* GetTrapData_1(Entity *entity); void sub_804535C(Entity *entity, PixelPos *pos);
Item *GetItemData(Entity *entity);
struct Tile *GetTileAtEntitySafe(Entity *entity);
Item *GetItemData_1(Entity *entity);
void sub_804535C(Entity *entity, Position32 *pos);
void SetEntityPixelPos(Entity *entity, s32 x, s32 y); void SetEntityPixelPos(Entity *entity, s32 x, s32 y);
void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y); void IncreaseEntityPixelPos(Entity *entity, s32 x, s32 y);
#endif static inline EntityInfo *GetEntInfo(Entity *entity)
{
return entity->axObj.info.monster;
}
Item *GetItemData(Entity *entity);
Item *GetItemData_1(Entity *entity);
Trap *GetTrapData(Entity *entity);
Trap* GetTrapData_1(Entity *entity);
#endif // GUARD_DUNGEON_UTIL_H

View File

@ -16,17 +16,17 @@ Entity *GetPartnerEntity(void);
void sub_80854D4(void); void sub_80854D4(void);
void sub_80855E4(DungeonCallback func); void sub_80855E4(DungeonCallback func);
void sub_808563C(DungeonCallback func); void sub_808563C(DungeonCallback func);
Entity *GetEntityFromClientType(u8 entityType); Entity *GetEntityFromMonsterBehavior(u8 entityType);
void sub_80856C8(Entity * pokemon, s32 x, s32 y); void sub_80856C8(Entity * pokemon, s32 x, s32 y);
void sub_80856E0(Entity * pokemon, s32 direction); void sub_80856E0(Entity * pokemon, s32 direction);
void sub_8085764(void); void sub_8085764(void);
void sub_8085860(s32 x, s32 y); void sub_8085860(s32 x, s32 y);
void sub_8085890(s32 x, s32 y); void sub_8085890(s32 x, s32 y);
void ShiftCameraToPosition(Position32 *posStruct, s32 cameraSteps); void ShiftCameraToPosition(PixelPos *posStruct, s32 cameraSteps);
void SetFacingDirection(Entity *pokemon, s32 direction); void SetFacingDirection(Entity *pokemon, s32 direction);
void sub_8085930(s32 direction); void sub_8085930(s32 direction);
void sub_80859F0(s32 direction); void sub_80859F0(s32 direction);
bool8 IsMovingClient(Entity *entity); bool8 ShouldRunMonsterAI(Entity *entity);
void sub_8085B0C(Entity *pokemon); void sub_8085B0C(Entity *pokemon);
void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3); void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3);
void sub_80857B8(void); void sub_80857B8(void);

View File

@ -6,7 +6,7 @@
bool8 CanSeeTarget(Entity *entity, Entity *targetEntity); bool8 CanSeeTarget(Entity *entity, Entity *targetEntity);
bool8 CanTargetEntity(Entity *entity, Entity *targetEntity); bool8 CanTargetEntity(Entity *entity, Entity *targetEntity);
bool8 sub_8045A70(Entity *entity, Entity *targetEntity); bool8 sub_8045A70(Entity *entity, Entity *targetEntity);
bool8 sub_8045AAC(Entity *entity, Position *pos); bool8 sub_8045AAC(Entity *entity, DungeonPos *pos);
bool8 CanTargetPosition(Entity *entity, Position *pos); bool8 CanTargetPosition(Entity *entity, DungeonPos *pos);
#endif #endif

View File

@ -57,7 +57,7 @@ void SetTutorialFlag(s32 param_1);
bool32 GetTutorialFlag(s32 param_1); bool32 GetTutorialFlag(s32 param_1);
bool8 IsExclusivePokemonUnlocked(s16 pokeID); bool8 IsExclusivePokemonUnlocked(s16 pokeID);
void UnlockExclusivePokemon(s16 pokeID); void UnlockExclusivePokemon(s16 pokeID);
void WriteExclusivePokemon(struct unkStruct_8094924 *r0); void WriteExclusivePokemon(DataSerializer *r0);
void ReadExclusivePokemon(struct unkStruct_8094924 *r0); void ReadExclusivePokemon(DataSerializer *r0);
#endif // GUARD_EXCLUSIVE_POKEMON_H #endif // GUARD_EXCLUSIVE_POKEMON_H

View File

@ -57,8 +57,8 @@ typedef struct ScriptData
/* 0x2C */ u16 unk2C; /* 0x2C */ u16 unk2C;
// padding // padding
/* 0x30 */ s32 unk30; /* 0x30 */ s32 unk30;
/* 0x34 */ Position32 pos1; /* 0x34 */ PixelPos pos1;
/* 0x3C */ Position32 pos2; /* 0x3C */ PixelPos pos2;
/* 0x44 */ u8 unk44[4]; /* 0x44 */ u8 unk44[4];
/* 0x48 */ s32 unk48; /* 0x48 */ s32 unk48;
/* 0x4C */ u8 unk4C; /* 0x4C */ u8 unk4C;
@ -78,14 +78,14 @@ typedef struct CallbackData
// padding // padding
// All callbacks take the parentObject as first parameter // All callbacks take the parentObject as first parameter
/* 0x04 */ s16 (*getIndex)(void*); // id related /* 0x04 */ s16 (*getIndex)(void*); // id related
/* 0x08 */ void (*getSize)(void*, Position32 *out); /* 0x08 */ void (*getSize)(void*, PixelPos *out);
/* 0x0C */ void (*getHitboxCenter)(void*, Position32 *out); /* 0x0C */ void (*getHitboxCenter)(void*, PixelPos *out);
/* 0x10 */ void (*getPosHeightAndUnk)(void*, u32 *height, u32 *unk); /* 0x10 */ void (*getPosHeightAndUnk)(void*, u32 *height, u32 *unk);
/* 0x14 */ void (*getDirection)(void*, s8 *dir); /* 0x14 */ void (*getDirection)(void*, s8 *dir);
/* 0x18 */ void (*getFlags)(void*, u32 *flags); /* 0x18 */ void (*getFlags)(void*, u32 *flags);
/* 0x1C */ void (*setHitboxPos)(void*, Position32 *posOrNull); /* 0x1C */ void (*setHitboxPos)(void*, PixelPos *posOrNull);
/* 0x20 */ void (*setPositionBounds)(void*, Position32 *from, Position32 *to); /* 0x20 */ void (*setPositionBounds)(void*, PixelPos *from, PixelPos *to);
/* 0x24 */ bool8 (*moveReal)(void*, Position32*); /* 0x24 */ bool8 (*moveReal)(void*, PixelPos*);
/* 0x28 */ void (*setPosHeight)(void*, u32 height); /* 0x28 */ void (*setPosHeight)(void*, u32 height);
/* 0x2C */ void (*setDirection)(void*, s8 dir); // direction must be signed char! /* 0x2C */ void (*setDirection)(void*, s8 dir); // direction must be signed char!
/* 0x30 */ void (*setEventIndex)(void*, u16); /* 0x30 */ void (*setEventIndex)(void*, u16);
@ -94,7 +94,7 @@ typedef struct CallbackData
/* 0x3C */ void (*setFlags)(void*, u32 bits); /* 0x3C */ void (*setFlags)(void*, u32 bits);
/* 0x40 */ void (*clearFlags)(void*, u32 bits); /* 0x40 */ void (*clearFlags)(void*, u32 bits);
/* 0x44 */ void (*func44_livesOnlySpriteRelated)(void*, u32); /* 0x44 */ void (*func44_livesOnlySpriteRelated)(void*, u32);
/* 0x48 */ void (*moveRelative)(void*, Position32*); /* 0x48 */ void (*moveRelative)(void*, PixelPos*);
/* 0x4C */ bool8 (*func4C_spriteRelatedCheck)(void*); /* 0x4C */ bool8 (*func4C_spriteRelatedCheck)(void*);
/* 0x50 */ bool8 (*func50_spriteRelated)(void*); /* 0x50 */ bool8 (*func50_spriteRelated)(void*);
} CallbackData; } CallbackData;
@ -135,14 +135,8 @@ typedef struct ScriptRef
extern const ScriptRef gFunctionScriptTable[]; extern const ScriptRef gFunctionScriptTable[];
struct CompactPos {
u8 xTiles;
u8 yTiles;
u8 xFlags;
u8 yFlags;
};
struct GroundLink { struct GroundLink {
struct CompactPos pos; CompactPos pos;
u8 width; u8 width;
u8 height; u8 height;
u8 ret; u8 ret;
@ -153,7 +147,7 @@ typedef struct GroundLivesData {
u8 unk1; u8 unk1;
u8 width; u8 width;
u8 height; u8 height;
struct CompactPos pos; CompactPos pos;
const ScriptCommand *scripts[4]; const ScriptCommand *scripts[4];
} GroundLivesData; } GroundLivesData;
typedef struct GroundObjectData { typedef struct GroundObjectData {
@ -161,7 +155,7 @@ typedef struct GroundObjectData {
u8 unk1; u8 unk1;
u8 width; u8 width;
u8 height; u8 height;
struct CompactPos pos; CompactPos pos;
const ScriptCommand *scripts[4]; const ScriptCommand *scripts[4];
} GroundObjectData; } GroundObjectData;
typedef struct GroundEffectData { typedef struct GroundEffectData {
@ -169,7 +163,7 @@ typedef struct GroundEffectData {
u8 unk1; u8 unk1;
u8 width; u8 width;
u8 height; u8 height;
struct CompactPos pos; CompactPos pos;
const ScriptCommand *script; const ScriptCommand *script;
} GroundEffectData; } GroundEffectData;
typedef struct GroundEventData { typedef struct GroundEventData {
@ -177,7 +171,7 @@ typedef struct GroundEventData {
u8 unk1; u8 unk1;
u8 width; u8 width;
u8 height; u8 height;
struct CompactPos pos; CompactPos pos;
const ScriptRef *script; const ScriptRef *script;
} GroundEventData; } GroundEventData;

View File

@ -68,10 +68,10 @@ bool8 IsInvalidItemReward(u8 itemID);
bool8 HasGummiItem(void); bool8 HasGummiItem(void);
void GetGummiItemStatBoost(PokemonStruct1* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi); void GetGummiItemStatBoost(PokemonStruct1* pokemon, u8 id, bool8 checkBoostFlags, Gummi *gummi);
void RestoreHeldItem(unkStruct_8094924 *, BulkItem *); void ReadHeldItemBits(DataSerializer *, BulkItem *);
void SaveHeldItem(unkStruct_8094924 *, BulkItem *); void WriteHeldItemBits(DataSerializer *, BulkItem *);
void RestoreItemSlot(unkStruct_8094924 *, Item *); void ReadItemSlotBits(DataSerializer *, Item *);
void SaveItemSlot(unkStruct_8094924 *, Item *); void WriteItemSlotBits(DataSerializer *, Item *);
s32 RestoreTeamInventory(u8 *, u32 size); s32 RestoreTeamInventory(u8 *, u32 size);
s32 SaveTeamInventory(u8 *, u32 size); s32 SaveTeamInventory(u8 *, u32 size);

View File

@ -2,33 +2,19 @@
#define GUARD_MATH_H #define GUARD_MATH_H
#include "gba/types.h" #include "gba/types.h"
#include "number_util.h"
/** /**
* This type represents a signed 24.8 fixed-point number, where the 24 most * This function computes the cosine of of `x` using a lookup table. The period of
* significant bits are the integer part and the 8 least significant bits are * the function is `4096`, and the range is `[-256, 256]`.
* the fractional part.
*/
typedef s32 s24_8;
/**
* This type represents an unsigned 24.8 fixed-point number, where the 24 most
* significant bits are the integer part and the 8 least significant bits are
* the fractional part.
*/
typedef u32 u24_8;
/**
* This function computes a value modulo 3, using a lookup table for values less
* than 0x100.
* *
* @warning This function performs an invalid memory access if x < 0. * @note Mathematically, `cos(abs(t)) = cos(t)`, unlike the case in `sin_4096()` above.
* Hopefully it's never actually used.
* *
* @param[in] x The value to get modulo 3. Must be non-negative. * @param[in] x The value to get the cosine of.
* *
* @return The value of x modulo 3. * @return `floor(256 * cos(pi * x / 2048))` as a signed 32-bit integer.
*/ */
u32 fast_mod_3(s32 x); s32 cos_4096(s32 x);
/** /**
* This function computes the sine of the absolute value of `x` using a lookup * This function computes the sine of the absolute value of `x` using a lookup
@ -38,36 +24,7 @@ u32 fast_mod_3(s32 x);
* *
* @return `floor(256 * sin(pi * abs(x) / 2048))` as a signed 32-bit integer. * @return `floor(256 * sin(pi * abs(x) / 2048))` as a signed 32-bit integer.
*/ */
s32 sin_abs_4096(s32 x); s32 sin_4096(s32 x);
/**
* This function computes the cosine of of `x` using a lookup table. The period of
* the function is `4096`, and the range is `[-256, 256]`.
*
* @note Mathematically, `cos(abs(t)) = cos(t)`, unlike the case in `sin_abs_4096()` above.
*
* @param[in] x The value to get the cosine of.
*
* @return `floor(256 * cos(pi * x / 2048))` as a signed 32-bit integer.
*/
s32 cos_4096(s32 x);
/**
* This function lexicographically compares two pairs of u32s.
*
* @note The call signature of this might change if it makes sense to pack the
* inputs into a struct representing, say, a 64-bit unsigned integer. Doing
* so does affect the generated assembly; the current approach is the simplest
* match.
*
* @param[in] x_hi The high 32 bits of the first pair.
* @param[in] x_lo The low 32 bits of the first pair.
* @param[in] y_hi The high 32 bits of the second pair.
* @param[in] y_lo The low 32 bits of the second pair.
*
* @return `TRUE` if `x < y`, `FALSE` otherwise.
*/
bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo);
/** /**
* This function multiplies two signed 24.8 fixed-point numbers. * This function multiplies two signed 24.8 fixed-point numbers.
@ -79,35 +36,50 @@ bool8 u32_pair_less_than(u32 x_hi, u32 x_lo, u32 y_hi, u32 y_lo);
*/ */
s24_8 s24_8_mul(s24_8 x, s24_8 y); s24_8 s24_8_mul(s24_8 x, s24_8 y);
/** bool8 F48_16_IsZero(s48_16 *a);
* This function divides two signed 24.8 fixed-point numbers. void F48_16_SDiv(s48_16 *dst, s48_16 *a, s48_16 *b);
* void F48_16_SMul(s48_16 *dst, s48_16 *a, s48_16 *b);
* @param[in] x The dividend.
* @param[in] y The divisor.
*
* @returns The quotient `x/y` as a signed 24.8 fixed-point number.
*/
s32 s24_8_div(s32 x, s32 y);
/** s24_8 FP24_8_Hypot(s24_8 x, s24_8 y);
* This function multiplies two unsigned 24.8 fixed-point numbers. void FP48_16_FromS32(s48_16 *dst, s32 src);
* u32 FP48_16_ToS32(s48_16 *a);
* @param[in] x The first factor. void FP48_16_FromF248(s48_16 *a, s24_8 b);
* @param[in] y The second factor. bool8 FP48_16_SLessThan(s48_16 *a, s48_16 *b);
* void FP48_16_Add(s48_16 *dst, s48_16 *a, s48_16 *b);
* @return The product `x*y` as an unsigned 24.8 fixed-point number. void FP48_16_Subtract(s48_16 *dst, s48_16 *a, s48_16 *b);
*/
u24_8 u24_8_mul(u24_8 x, u24_8 y);
/** //static inline bool8 F248Equal(s24_8 x, s24_8 y) {
* This function divides two unsigned 24.8 fixed-point numbers. // return x.raw == y.raw;
* //}
* @param[in] x The first factor.
* @param[in] y The second factor.
*
* @return The quotient `x/y` as an unsigned 24.8 fixed-point number.
*/
u24_8 u24_8_div(u24_8 x, u24_8 y);
#define F248LessThanInt(x, y) (x.raw < 0x100 * y)
#define F248LessThanFloat(x, y) (x.raw < (int)(y * 0x100))
#define FloatLessThanF248(x, y) ((int)(x * 0x100) < y.raw)
//static inline bool8 F248LessThanOne(s24_8 x) {
// return x.raw < 0x100;
//}
#define F248LessThan(x, y) (x.raw < y.raw)
#define F248GreaterThan(x, y) (x.raw > y.raw)
#define F248Equal(x, y) (x.raw == y.raw)
#define F248EqualsInt(x, y) (x.raw == 0x100 * y)
//static inline bool8 F248LessThan(s24_8 x, s24_8 y) {
// return x.raw < y.raw;
//}
#define F248_AddInt(x, y) ((s24_8){x.raw + 0x100 * y})
#define F248_SubInt(x, y) ((s24_8){x.raw - 0x100 * y})
static inline s24_8 F248_Add(s24_8 x, s24_8 y) {
return (s24_8){x.raw + y.raw};
}
static inline s24_8 F248_Sub(s24_8 x, s24_8 y) {
return (s24_8){x.raw - y.raw};
}
static inline s24_8 F248_MulInt(s24_8 x, s32 y) {
return (s24_8){x.raw * y};
}
#endif // GUARD_MATH_H #endif // GUARD_MATH_H

View File

@ -3,7 +3,7 @@
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns); u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns);
void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage); void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage);
bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage); bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage);
void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns); void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns);

View File

@ -6,7 +6,7 @@
u32 sub_8057144(Entity * pokemon); u32 sub_8057144(Entity * pokemon);
bool8 sub_80571F0(Entity * pokemon, Move *move); bool8 sub_80571F0(Entity * pokemon, Move *move);
bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance); bool8 sub_805727C(Entity * pokemon, Entity * target, s32 chance);
bool8 sub_8057308(Entity *pokemon, s32 chance); bool8 RollSecondaryEffect(Entity *pokemon, s32 chance);
bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker); bool8 CanAIUseMove(Entity *pokemon, s32 moveIndex, bool8 hasPPChecker);
bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker); bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker);

View File

@ -51,8 +51,8 @@ void LoadWazaParameters(void);
bool8 MoveCannotHitFrozen(Move *move); bool8 MoveCannotHitFrozen(Move *move);
bool8 MoveIgnoresTaunted(Move *move); bool8 MoveIgnoresTaunted(Move *move);
void RemoveLinkSequenceFromMoves8(Move *moves, s32 index); void RemoveLinkSequenceFromMoves8(Move *moves, s32 index);
void RestorePokemonMoves(struct unkStruct_8094924 *, Move *moveSet); void ReadPoke1MovesBits(DataSerializer *, Move *moveSet);
void SavePokemonMoves(struct unkStruct_8094924 *, Move *moveSet); void WritePoke1MovesBits(DataSerializer *, Move *moveSet);
bool8 ToggleMoveEnabled(s32 index, Move *moves); bool8 ToggleMoveEnabled(s32 index, Move *moves);
bool8 ToggleSetMove(s32 index, Move *moves); bool8 ToggleSetMove(s32 index, Move *moves);
bool8 TryLinkMovesAfter(s32 index, Move *moves); bool8 TryLinkMovesAfter(s32 index, Move *moves);
@ -86,8 +86,8 @@ bool8 sub_8093318(s32, Move *moves);
bool8 sub_809333C(s32, Move *moves); bool8 sub_809333C(s32, Move *moves);
s32 sub_80935B8(Move *moves, s32 index); s32 sub_80935B8(Move *moves, s32 index);
void sub_8094060(Move *srcMoves, Move *destMoves); void sub_8094060(Move *srcMoves, Move *destMoves);
void sub_8094184(struct unkStruct_8094924 *, struct Moves *); void WritePoke2MovesBits(DataSerializer *, struct Moves *);
void sub_80941FC(struct unkStruct_8094924 *, struct Moves *); void ReadPoke2MovesBits(DataSerializer *, struct Moves *);
static inline bool8 MoveFlagExists(Move *move) static inline bool8 MoveFlagExists(Move *move)
{ {

View File

@ -1,17 +1,44 @@
#ifndef GUARD_NUMBER_UTIL_H #ifndef GUARD_NUMBER_UTIL_H
#define GUARD_NUMBER_UTIL_H #define GUARD_NUMBER_UTIL_H
/**
* This type represents a decimal, signed fixed-point number, where the first
* 16-bit field is the integer part and the second 16-bit field is the fraction,
* expressed in thousandths.
*/
typedef struct FixedPoint typedef struct FixedPoint
{ {
s16 unk0; s16 unk0;
s16 unk2; s16 unk2;
} FixedPoint; } FixedPoint;
struct unkStruct_80943A8 /**
* This type represents a signed 24.8 fixed-point number, where the 24 most
* significant bits are the integer part and the 8 least significant bits are
* the fractional part.
*/
typedef struct s24_8 {
// It's almost certainly not an actual struct, but keep it as one until we decomp all structures that include it
s32 raw;
} s24_8;
#define F248_ZERO ((s24_8){})
#define F248_ONE ((s24_8){0x100})
#define F248_MAX ((s24_8){0x7FFFFFFF})
/**
* This type represents a signed 48.16 fixed-point number, where the 48 most
* significant bits are the integer part and the 16 least significant bits are
* the fractional part.
*/
typedef struct s48_16
{ {
s32 s0; s32 hi;
s32 s4; u32 lo; // some math.c funcs require this to be a u32, but other funcs check if it's negative (aka >= INT32_MAX)
} unkStruct_80943A8; } s48_16;
#define F4816_ZERO ((s48_16){})
#define F4816_ONE ((s48_16){0, 0x10000})
#define F4816_MAX ((s48_16){0x7FFFFFFF, 0xFFFFFFFF})
FixedPoint FixedPoint_Add(FixedPoint a, FixedPoint b); FixedPoint FixedPoint_Add(FixedPoint a, FixedPoint b);
FixedPoint FixedPoint_Subtract(FixedPoint a, FixedPoint b); FixedPoint FixedPoint_Subtract(FixedPoint a, FixedPoint b);
@ -19,8 +46,23 @@ FixedPoint FixedPoint_Min(FixedPoint a, FixedPoint b);
FixedPoint FixedPoint_Max(FixedPoint a, FixedPoint b); FixedPoint FixedPoint_Max(FixedPoint a, FixedPoint b);
FixedPoint sub_8094370(FixedPoint param_1, FixedPoint param_2); FixedPoint sub_8094370(FixedPoint param_1, FixedPoint param_2);
FixedPoint IntToFixedPoint(s32 a); FixedPoint IntToFixedPoint(s32 a);
FixedPoint FixedPoint_SetFromUnk(struct unkStruct_80943A8* param_1); FixedPoint FixedPoint_SetFromUnk(s48_16* param_1);
FixedPoint FixedPoint_Div(FixedPoint a, FixedPoint b); FixedPoint FixedPoint_Div(FixedPoint a, FixedPoint b);
s32 FixedPointToInt(FixedPoint a); // Always rounded up s32 FixedPointToInt(FixedPoint a); // Always rounded up
#define IntToF248_2(x) ((s24_8){x * 0x100})
#define FloatToF248_2(x) ((s24_8){(int)(x * 0x100)})
static inline s24_8 IntToF248(s32 x) {
return (s24_8){x * 256};
}
static inline s24_8 FloatToF248(float x) {
return (s24_8){(int)(x * 256)};
}
static inline s32 F248ToInt(s24_8 x) {
return x.raw / 256;
}
#endif #endif

View File

@ -11,7 +11,9 @@
enum PokemonUnk0Flags enum PokemonUnk0Flags
{ {
FLAG_ON_TEAM = 2, FLAG_NONE = 0,
FLAG_UNK_1 = 1,
FLAG_ON_TEAM = 2, // Mon is not on "standby"
}; };
// size: 0x1A4 // size: 0x1A4
@ -34,12 +36,12 @@ void LoadMonsterParameters(void);
unkStruct_203B45C *GetRecruitedPokemon(void); unkStruct_203B45C *GetRecruitedPokemon(void);
void InitializeRecruitedPokemon(void); void InitializeRecruitedPokemon(void);
// These two need to be overridden in status_actions.c // This needs to be overridden in status_actions.c
// Uncomment when fixed // Uncomment when fixed
//u8 GetBodySize(s16 index); //u8 GetBodySize(s16 index);
void CopyMonsterNametoBuffer(u8 * buffer, s16 index); void CopyMonsterNameToBuffer(u8 * buffer, s16 index);
void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index); void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index);
void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum); void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum);
void sub_808D930(u8 *buffer, s32 index); void sub_808D930(u8 *buffer, s32 index);
@ -56,7 +58,7 @@ char * GetMonSpecies(s16 index);
s32 GetMovementSpeed(s16 index); s32 GetMovementSpeed(s16 index);
u8 GetMovementType(s16 index); u8 GetMovementType(s16 index);
u8 GetRegenSpeed(s16 index); u8 GetRegenSpeed(s16 index);
bool8 CanMove(s16 index); bool8 GetCanMoveFlag(s16 index);
u8 GetChanceAsleep(s16 index); u8 GetChanceAsleep(s16 index);
u32 GetWeight(s16 index); u32 GetWeight(s16 index);
u32 GetSize(s16 index); u32 GetSize(s16 index);
@ -83,8 +85,8 @@ s32 GetUnownIndex(s16 index);
void GenerateHiddenPower(HiddenPower *); void GenerateHiddenPower(HiddenPower *);
s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *); s32 GetEvolutionSequence(PokemonStruct1 *pokemon, EvolveStage *);
void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 *, PokemonStruct1 *, s32); void xxx_pokemonstruct_to_pokemon2_808DE50(PokemonStruct2 *, PokemonStruct1 *, s32);
void SavePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *pokemon); void WritePoke1Bits(DataSerializer *, PokemonStruct1 *pokemon);
void RestorePokemonStruct(unkStruct_8094924 *, PokemonStruct1 *); void ReadPoke1Bits(DataSerializer *, PokemonStruct1 *);
s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon); s32 sub_808E218(unkStruct_808E218_arg *, PokemonStruct1 *pokemon);
void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID); void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID);
void sub_808D0D8(PokemonStruct1 *pokemon); void sub_808D0D8(PokemonStruct1 *pokemon);
@ -100,12 +102,12 @@ extern s32 sub_808D580(s32 *);
static inline bool8 PokemonFlag1(PokemonStruct1 *mon) static inline bool8 PokemonFlag1(PokemonStruct1 *mon)
{ {
return ((mon->unk0 & 1)); return (mon->unk0 >> (FLAG_UNK_1 - 1)) & 1;
} }
static inline bool8 PokemonFlag2(PokemonStruct1 *mon) static inline bool8 PokemonFlag2(PokemonStruct1 *mon)
{ {
return (((mon->unk0 >> (FLAG_ON_TEAM - 1)) & 1)); return (mon->unk0 >> (FLAG_ON_TEAM - 1)) & 1;
} }
static inline void SetPokemonFlag2(PokemonStruct1 *mon) static inline void SetPokemonFlag2(PokemonStruct1 *mon)

View File

@ -3,7 +3,7 @@
#include "structs/str_position.h" #include "structs/str_position.h"
s32 GetDirectionTowardsPosition(Position *originPos, Position *targetPos); s32 GetDirectionTowardsPosition(DungeonPos *originPos, DungeonPos *targetPos);
s32 GetDistance(Position *pos1, Position *pos2); s32 GetDistance(DungeonPos *pos1, DungeonPos *pos2);
#endif #endif

View File

@ -34,7 +34,7 @@ void BlinkSavingIcon(void);
void CopySpritesToOam(void); void CopySpritesToOam(void);
void InitSprites(void); void InitSprites(void);
void ResetSprites(bool8); void ResetSprites(bool8);
void SetSavingIconCoords(Position *); void SetSavingIconCoords(DungeonPos *);
void sub_8004E8C(unkStruct_2039DB0 *); void sub_8004E8C(unkStruct_2039DB0 *);
void sub_8005180(void); void sub_8005180(void);
void sub_8005304(void); void sub_8005304(void);

View File

@ -2,6 +2,7 @@
#define GUARD_STATUS_H #define GUARD_STATUS_H
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
#include "number_util.h"
#define FLASH_FIRE_STATUS_NONE 0 #define FLASH_FIRE_STATUS_NONE 0
#define FLASH_FIRE_STATUS_MAXED 1 #define FLASH_FIRE_STATUS_MAXED 1
@ -9,8 +10,8 @@
u8 GetFlashFireStatus(Entity *pokemon); u8 GetFlashFireStatus(Entity *pokemon);
void UpdateFlashFireBoost(Entity * pokemon, Entity *target); void UpdateFlashFireBoost(Entity * pokemon, Entity *target);
void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s32 param_4, bool8 displayMessage); void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage);
void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s32 param_4, bool8 displayMessage); void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage, s24_8 param_4, bool8 displayMessage);
void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage); void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage);
void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, bool8 displayMessage); void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, bool8 displayMessage);
void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage); void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage);

View File

@ -5,6 +5,6 @@
extern const s16 gConfusedAttackChance; extern const s16 gConfusedAttackChance;
bool8 HasStatusAffectingActions(Entity *pokemon); bool8 HasStatusThatPreventsActing(Entity *pokemon);
#endif #endif

View File

@ -33,7 +33,7 @@ struct MonPortraitMsg
{ {
OpenedFile *faceFile; OpenedFile *faceFile;
struct PortraitGfx *faceData; struct PortraitGfx *faceData;
Position pos; DungeonPos pos;
u8 spriteId; // Which mon's sprite to use. For example Kecleon has multiple sprites depending on whether it's green or purple. u8 spriteId; // Which mon's sprite to use. For example Kecleon has multiple sprites depending on whether it's green or purple.
bool8 flip; // Whether the mon's sprite is flipped. bool8 flip; // Whether the mon's sprite is flipped.
u8 unkE; u8 unkE;

View File

@ -14,9 +14,9 @@ typedef struct UnkSpriteMem
// size: 0x20 // size: 0x20
typedef struct axdata1 typedef struct axdata1
{ {
/* 0x0 */ Position pos; /* 0x0 */ DungeonPos pos;
/* 0x4 */ Position offset; /* 0x4 */ DungeonPos offset;
/* 0x8 */ Position shadow; /* 0x8 */ DungeonPos shadow;
u32 unkC; u32 unkC;
u32 unk10; u32 unk10;
/* 0x14 */ s16 vramTileOrMaybeAnimTimer; /* 0x14 */ s16 vramTileOrMaybeAnimTimer;
@ -43,8 +43,8 @@ typedef struct ax_anim
/* 0x0 */ u8 frames; /* 0x0 */ u8 frames;
/* 0x1 */ u8 unkFlags; /* 0x1 */ u8 unkFlags;
/* 0x2 */ s16 poseId; /* 0x2 */ s16 poseId;
/* 0x4 */ Position offset; /* 0x4 */ DungeonPos offset;
/* 0x8 */ Position shadow; /* 0x8 */ DungeonPos shadow;
} ax_anim; } ax_anim;
// size: 0x3C // size: 0x3C
@ -84,7 +84,12 @@ struct axObject
u8 unk45_orientation; u8 unk45_orientation;
u8 unk46; u8 unk46;
u8 unk47; u8 unk47;
/* 0x48 */ struct EntityInfo* info; /* 0x48 */ union
{
struct Item* item;
struct EntityInfo* monster;
struct Trap* trap;
} info;
}; };
// size: 0x80? (assuming it's the last sub-struct of GroundLives) // size: 0x80? (assuming it's the last sub-struct of GroundLives)

View File

@ -1,19 +1,20 @@
#ifndef GUARD_DUNGEON_ENTITY_H #ifndef GUARD_DUNGEON_ENTITY_H
#define GUARD_DUNGEON_ENTITY_H #define GUARD_DUNGEON_ENTITY_H
#include "constants/dungeon_action.h"
#include "constants/global.h" #include "constants/global.h"
#include "structs/str_position.h" #include "constants/status.h"
#include "sprite.h" #include "structs/axdata.h"
#include "structs/str_items.h" #include "structs/str_items.h"
#include "structs/str_moves.h" #include "structs/str_moves.h"
#include "structs/axdata.h" #include "structs/str_position.h"
#include "math.h"
#include "number_util.h" #include "number_util.h"
#include "sprite.h"
#define MAX_STAT_STAGE 20 #define MAX_STAT_STAGE 20
#define STAT_MULTIPLIER_THRESHOLD 63 #define STAT_MULTIPLIER_THRESHOLD 0.249 // one tick less than 0.25
#define DEFAULT_STAT_STAGE 10 #define DEFAULT_STAT_STAGE 10
#define DEFAULT_STAT_MULTIPLIER 256
#define MAX_SPEED_STAGE 4 #define MAX_SPEED_STAGE 4
#define MAX_STOCKPILE_STAGE 3 #define MAX_STOCKPILE_STAGE 3
#define NUM_SPEED_COUNTERS 5 #define NUM_SPEED_COUNTERS 5
@ -26,10 +27,13 @@
#define STAT_STAGE_ACCURACY 0 #define STAT_STAGE_ACCURACY 0
#define STAT_STAGE_EVASION 1 #define STAT_STAGE_EVASION 1
#define NUM_PICKED_IQ_SKILLS 3
// size: 0x8
typedef struct unkStruct_8044CC8 typedef struct unkStruct_8044CC8
{ {
u8 actionUseIndex; /* 0x0 */ u8 actionUseIndex;
Position lastItemThrowPosition; /* 0x4 */ DungeonPos lastItemThrowPosition;
} unkStruct_8044CC8; } unkStruct_8044CC8;
// size: 0x18 // size: 0x18
@ -37,25 +41,28 @@ typedef struct ActionContainer
{ {
/* 0x0 */ u16 action; /* 0x0 */ u16 action;
/* 0x2 */ u8 direction; /* 0x2 */ u8 direction;
u8 fill3; u8 unk3;
// Additional parameter alongside actionIndex. Used for things like indicating which move a Pokémon should use from its moveset. // Additional parameter alongside actionIndex. Used for things like indicating which move a Pokémon should use from its moveset.
/* 0x4 */ unkStruct_8044CC8 unk4[2]; /* 0x4 */ unkStruct_8044CC8 unk4[2];
// Position of the target that the Pokémon wants throw an item at. // Position of the target that the Pokémon wants throw an item at.
/* 0x14 */ Position itemTargetPosition; /* 0x14 */ DungeonPos itemTargetPosition;
} ActionContainer; } ActionContainer;
// size: 0x4
typedef struct HiddenPower typedef struct HiddenPower
{ {
/* 0x0 */ s16 hiddenPowerBasePower; /* 0x0 */ s16 hiddenPowerBasePower;
/* 0x2 */ u8 hiddenPowerType; /* 0x2 */ u8 hiddenPowerType;
} HiddenPower; } HiddenPower;
// size: 0x4
typedef struct JoinedAt typedef struct JoinedAt
{ {
/* 0x0 */ u8 joinedAt; /* 0x0 */ u8 joinedAt;
/* 0x1 */ u8 unk1; /* 0x1 */ u8 unk1;
} JoinedAt; } JoinedAt;
// size: 0x14
typedef struct AITarget typedef struct AITarget
{ {
/* 0x0 */ u8 aiObjective; /* 0x0 */ u8 aiObjective;
@ -65,114 +72,127 @@ typedef struct AITarget
/* 0x4 */ u16 aiTargetSpawnGenID; /* 0x4 */ u16 aiTargetSpawnGenID;
/* 0x8 */ struct Entity *aiTarget; /* 0x8 */ struct Entity *aiTarget;
/* 0xC */ u32 unkC; /* 0xC */ u32 unkC;
/* 0x10 */ Position aiTargetPos; /* 0x10 */ DungeonPos aiTargetPos;
} AITarget; } AITarget;
typedef struct Sleep // size: 0x4
typedef struct SleepClassStatus
{ {
/* 0x0 */ u8 sleep; /* 0x0 */ u8 status;
/* 0x1 */ u8 sleepTurns; /* 0x1 */ u8 turns;
} Sleep; } SleepClassStatus;
typedef struct NonVolatile // size: 0x4
typedef struct BurnClassStatus
{ {
/* 0x0 */ u8 nonVolatileStatus; /* 0x0 */ u8 status;
/* 0x1 */ u8 nonVolatileStatusTurns; /* 0x1 */ u8 turns;
/* 0x2 */ u8 nonVolatileStatusDamageCountdown; /* 0x2 */ u8 damageCountdown;
/* 0x3 */ u8 unk4; /* 0x3 */ u8 unk4;
} NonVolatile; } BurnClassStatus;
typedef struct Immobilize // size: 0xC
typedef struct FrozenClassStatus
{ {
/* 0x0 */ u8 immobilizeStatus; /* 0x0 */ u8 status;
/* 0x4 */ s32 unk4; /* 0x4 */ s32 unk4;
/* 0x8 */ u8 immobilizeStatusTurns; /* 0x8 */ u8 turns;
/* 0x9 */ u8 immobilizeStatusDamageCountdown; /* 0x9 */ u8 damageCountdown;
} Immobilize; } FrozenClassStatus;
typedef struct Volatile // size: 0x4
typedef struct CringeClassStatus
{ {
/* 0x0 */ u8 volatileStatus; /* 0x0 */ u8 status;
/* 0x1 */ u8 volatileStatusTurns; /* 0x1 */ u8 turns;
} Volatile; } CringeClassStatus;
typedef struct Charging // size: 0x4
typedef struct BideClassStatus
{ {
/* 0x0 */ u8 chargingStatus; /* 0x0 */ u8 status;
/* 0x1 */ u8 chargingStatusTurns; /* 0x1 */ u8 turns;
/* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the Pokémon's moveset that triggered the status. /* 0x2 */ u8 moveSlot; // The position of the move in the Pokémon's moveset that triggered the status.
} Charging; } BideClassStatus;
typedef struct Protection // size: 0x4
typedef struct ReflectClassStatus
{ {
/* 0x0 */ u8 protectionStatus; /* 0x0 */ u8 status;
/* 0x1 */ u8 protectionStatusTurns; /* 0x1 */ u8 turns;
} Protection; } ReflectClassStatus;
typedef struct Waiting // size: 0x8
typedef struct CurseClassStatus
{ {
/* 0xC8 */ u8 waitingStatus; /* 0x0 */ u8 status;
/* 0xC9 */ bool8 enemyDecoy; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon). /* 0x1 */ bool8 applierNonTeamMemberFlag; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon).
u8 unkCA; /* 0x2 */ bool8 unk2;
/* 0xCB */ u8 waitingStatusTurns; /* 0x3 */ u8 turns;
/* 0xCC */ u8 curseDamageCountdown; /* 0x4 */ u8 damageCountdown;
} Waiting; } CurseClassStatus;
typedef struct Linked // size: 0xC
typedef struct LeechSeedClassStatus
{ {
/* 0xD0 */ u8 linkedStatus; /* 0x0 */ u8 status;
/* 0xD4 */ u32 unkD4; /* 0x4 */ u32 unk4;
/* 0xD8 */ u8 unkD8; /* 0x8 */ u8 unk8;
/* 0xD9 */ u8 linkedStatusTurns; /* 0x9 */ u8 turns;
/* 0xDA */ u8 linkedStatusDamageCountdown; /* 0xA */ u8 damageCountdown;
} Linked; } LeechSeedClassStatus;
// size: 0x4
typedef struct MoveStatus typedef struct SureShotClassStatus
{ {
/* 0xDC */ u8 moveStatus; /* 0x0 */ u8 status;
/* 0xDD */ u8 moveStatusTurns; /* 0x1 */ u8 turns;
} MoveStatus; } SureShotClassStatus;
typedef struct ItemStatus // size: 0x4
typedef struct LongTossClassStatus
{ {
/* 0xE0 */ u8 itemStatus; /* 0x0 */ u8 status;
} ItemStatus; } LongTossClassStatus;
typedef struct TransformStatus // size: 0x4
typedef struct InvisibleClassStatus
{ {
/* 0xE4 */ u8 transformStatus; /* 0x0 */ u8 status;
/* 0xE5 */ u8 transformStatusTurns; /* 0x1 */ u8 turns;
} TransformStatus; } InvisibleClassStatus;
typedef struct EyesightStatus // size: 0x4
typedef struct BlinkerClassStatus
{ {
/* 0xE8 */ u8 eyesightStatus; /* 0x0 */ u8 status;
/* 0xE9 */ u8 eyesightStatusTurns; /* 0x1 */ u8 turns;
} EyesightStatus; } BlinkerClassStatus;
// size: 0x4
typedef struct Muzzled typedef struct Muzzled
{ {
/* 0xEC */ bool8 muzzled; /* 0x0 */ bool8 muzzled;
/* 0xED */ u8 muzzledTurns; /* 0x1 */ u8 turns;
} Muzzled; } Muzzled;
// size: 0x1C
typedef struct Unk_Entity_x184 typedef struct Unk_Entity_x184
{ {
/* 0x184 - 0x0 */ Position previousTargetMovePosition1; /* 0x184 - 0x0 */ DungeonPos previousTargetMovePosition1;
/* 0x188 - 0x4 */ Position32 previousTargetMovePosition2; /* 0x188 - 0x4 */ PixelPos previousTargetMovePosition2;
/* 0x190 - 0xC */ s32 lastMoveDirection; // The last direction that the Pokémon moved in. /* 0x190 - 0xC */ s32 lastMoveDirection; // The last direction that the Pokémon moved in.
// Number of tiles that the Pokémon moved last, multiplied by 0x100. // Number of tiles that the Pokémon moved last, multiplied by 0x100.
/* 0x194 - 0x10*/ Position32 lastMoveIncrement; /* 0x194 - 0x10*/ PixelPos lastMoveIncrement;
/* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the Pokémon starts moving, and counts down until the Pokémon's walk animation stops. /* 0x19C - 0x18 */ s16 walkAnimFramesLeft; // Set when the Pokémon starts moving, and counts down until the Pokémon's walk animation stops.
/* 0x19e - 0x1a */ u8 unk1A; /* 0x19e - 0x1a */ u8 unk1A;
} Unk_Entity_x184 ; } Unk_Entity_x184;
// size: 0x24
typedef struct Moves typedef struct Moves
{ {
/* 0x118 */ Move moves[MAX_MON_MOVES]; /* 0x0 */ Move moves[MAX_MON_MOVES];
/* 0x138 */ u8 struggleMoveFlags; /* 0x20 */ u8 struggleMoveFlags;
} Moves; } Moves;
// size: 0x208 // size: 0x208
@ -196,10 +216,8 @@ typedef struct EntityInfo
/* 0x10 */ s16 maxHPStat; /* 0x10 */ s16 maxHPStat;
// Bosses have higher HP than normal for their level. This is the max HP they would normally have given their level. // Bosses have higher HP than normal for their level. This is the max HP they would normally have given their level.
/* 0x12 */ s16 originalHP; /* 0x12 */ s16 originalHP;
/* 0x14 */ u8 atk; /* 0x14 */ u8 atk[2]; // Index 0 is Attack. Index 1 is Special Attack.
/* 0x15 */ u8 spAtk; /* 0x16 */ u8 def[2]; // Index 0 is Defense. Index 1 is Special Defense.
/* 0x16 */ u8 def;
/* 0x17 */ u8 spDef;
/* 0x18 */ u32 exp; /* 0x18 */ u32 exp;
// Temporary stat boosts/drops from effects like Growl or Swords Dance. // Temporary stat boosts/drops from effects like Growl or Swords Dance.
// These start at 10 and are in the range [1, 19]. // These start at 10 and are in the range [1, 19].
@ -213,9 +231,9 @@ typedef struct EntityInfo
/* 0x28 */ s16 flashFireBoost; /* 0x28 */ s16 flashFireBoost;
// These start at 0x1000, and are halved by certain moves like Screech to lower the corresponding stat. // These start at 0x1000, and are halved by certain moves like Screech to lower the corresponding stat.
// Index 0 is Attack. Index 1 is Special Attack. // Index 0 is Attack. Index 1 is Special Attack.
/* 0x2C */ s32 offensiveMultipliers[2]; /* 0x2C */ s24_8 offensiveMultipliers[2];
// Index 0 is Defense. Index 1 is Special Defense. // Index 0 is Defense. Index 1 is Special Defense.
/* 0x34 */ s32 defensiveMultipliers[2]; /* 0x34 */ s24_8 defensiveMultipliers[2];
/* 0x3C */ HiddenPower hiddenPower; /* 0x3C */ HiddenPower hiddenPower;
/* 0x40 */ JoinedAt joinedAt; // Uses the dungeon index in dungeon.h. /* 0x40 */ JoinedAt joinedAt; // Uses the dungeon index in dungeon.h.
/* 0x44 */ ActionContainer action; /* 0x44 */ ActionContainer action;
@ -223,32 +241,34 @@ typedef struct EntityInfo
/* 0x5E */ u8 abilities[2]; /* 0x5E */ u8 abilities[2];
/* 0x60 */ Item heldItem; /* 0x60 */ Item heldItem;
/* 0x64 */ u8 unk64; /* 0x64 */ u8 unk64;
/* 0x68 */ Position prevPos[NUM_PREV_POS]; /* 0x68 */ DungeonPos prevPos[NUM_PREV_POS];
/* 0x78 */ AITarget aiTarget; /* 0x78 */ AITarget aiTarget;
// Bitwise flags corresponding to selected IQ skills. // Bitwise flags corresponding to selected IQ skills.
/* 0x8C */ u8 IQSkillMenuFlags[4]; // IQ skills selected in the IQ skills menu. /* 0x8C */ u8 IQSkillMenuFlags[NUM_PICKED_IQ_SKILLS]; // IQ skills selected in the IQ skills menu.
/* 0x90 */ u8 IQSkillFlags[4]; u8 padding8F;
/* 0x90 */ u8 IQSkillFlags[NUM_PICKED_IQ_SKILLS];
u8 padding93;
/* 0x94 */ u8 tactic; /* 0x94 */ u8 tactic;
u8 fill95[0x98 - 0x95]; u8 fill95[0x98 - 0x95];
/* 0x98 */ u32 unk98; /* 0x98 */ u32 unk98;
/* 0x9C */ u32 unk9C; /* 0x9C */ u32 unk9C;
/* 0xA0 */ s32 unkA0; /* 0xA0 */ s32 unkA0;
/* 0xA4 */ u8 clientType; /* 0xA4 */ u8 monsterBehavior;
u8 fillA5[0xA8 - 0xA5]; u8 fillA5[0xA8 - 0xA5];
// Statuses are split into groups based on which ones can't overlap. // Statuses are split into groups based on which ones can't overlap.
// See status.h for which statuses are in each group. // See status.h for which statuses are in each group.
/* 0xA8 */ Sleep sleep; /* 0xA8 */ SleepClassStatus sleepClassStatus;
/* 0xAC */ NonVolatile nonVolatile; /* 0xAC */ BurnClassStatus burnClassStatus;
/* 0xB0 */ Immobilize immobilize; /* 0xB0 */ FrozenClassStatus frozenClassStatus;
/* 0xBC */ Volatile volatileStatus; /* 0xBC */ CringeClassStatus cringeClassStatus;
/* 0xC0 */ Charging charging; /* 0xC0 */ BideClassStatus bideClassStatus;
/* 0xC4 */ Protection protection; /* 0xC4 */ ReflectClassStatus reflectClassStatus;
/* 0xC8 */ Waiting waitingStruct; /* 0xC8 */ CurseClassStatus curseClassStatus;
/* 0xD0 */ Linked linked; /* 0xD0 */ LeechSeedClassStatus leechSeedClassStatus;
/* 0xDC */ MoveStatus moveStatus; /* 0xDC */ SureShotClassStatus sureShotClassStatus;
/* 0xE0 */ ItemStatus itemStatus; /* 0xE0 */ LongTossClassStatus longTossClassStatus;
/* 0xE4 */ TransformStatus transformStatus; /* 0xE4 */ InvisibleClassStatus invisibleClassStatus;
/* 0xE8 */ EyesightStatus eyesightStatus; /* 0xE8 */ BlinkerClassStatus blinkerClassStatus;
/* 0xEC */ Muzzled muzzled; /* 0xEC */ Muzzled muzzled;
/* 0xF0 */ bool8 powerEars; /* 0xF0 */ bool8 powerEars;
/* 0xF1 */ bool8 scanning; /* 0xF1 */ bool8 scanning;
@ -268,7 +288,7 @@ typedef struct EntityInfo
/* 0xFD */ u8 perishSongTurns; // When this reaches 0, the Pokémon faints from Perish Song. Doubles as a bool for whether the Pokémon is afflicted by Perish Song. /* 0xFD */ u8 perishSongTurns; // When this reaches 0, the Pokémon faints from Perish Song. Doubles as a bool for whether the Pokémon is afflicted by Perish Song.
u8 unkFE; u8 unkFE;
u8 unkFF; u8 unkFF;
/* 0x100 */ u8 targetingDecoy; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon. /* 0x100 */ u8 decoyAITracker; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon.
/* 0x104 */ s32 speedStage; /* 0x104 */ s32 speedStage;
// The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the Pokémon is affected by multiple // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the Pokémon is affected by multiple
// speed-up/slow effects at once, like using Agility twice. // speed-up/slow effects at once, like using Agility twice.
@ -282,7 +302,7 @@ typedef struct EntityInfo
/* 0x118 */ Moves moves; /* 0x118 */ Moves moves;
/* 0x13C */ FixedPoint belly; /* 0x13C */ FixedPoint belly;
/* 0x140 */ FixedPoint maxBelly; /* 0x140 */ FixedPoint maxBelly;
/* 0x144 */ bool8 aiNextToTarget; // True if an AI Pokémon is following another Pokémon and is already adjacent to them. /* 0x144 */ bool8 aiAllySkip; // True if an AI Pokémon is following another Pokémon and is already adjacent to them.
/* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other Pokémon have moved. /* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other Pokémon have moved.
/* 0x146 */ u8 unk146; /* 0x146 */ u8 unk146;
/* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn. /* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn.
@ -316,9 +336,9 @@ typedef struct EntityInfo
/* 0x167 */ u8 unk167; /* 0x167 */ u8 unk167;
/* 0x168 */ u8 unk168; /* 0x168 */ u8 unk168;
/* 0x169 */ u8 turnsSinceWarpScarfActivation; /* 0x169 */ u8 turnsSinceWarpScarfActivation;
/* 0x16C */ Position targetPos; /* 0x16C */ DungeonPos targetPos;
/* 0x170 */ Position pixelPos; /* 0x170 */ DungeonPos pixelPos;
u32 unk174; s24_8 unk174;
u16 abilityEffectFlags; // See enum AbilityEffectFlags u16 abilityEffectFlags; // See enum AbilityEffectFlags
/* 0x17A */ u16 mimicMoveIDs[MAX_MON_MOVES]; // All moves that Mimic has copied (not sure on size...) /* 0x17A */ u16 mimicMoveIDs[MAX_MON_MOVES]; // All moves that Mimic has copied (not sure on size...)
// Previous value of targetPosition for movement, 1 and 2 moves ago. // Previous value of targetPosition for movement, 1 and 2 moves ago.
@ -336,12 +356,12 @@ typedef struct EntityInfo
typedef struct Entity typedef struct Entity
{ {
/* 0x0 */ u32 type; /* 0x0 */ u32 type;
/* 0x4 */ Position pos; /* 0x4 */ DungeonPos pos;
/* 0x8 */ Position prevPos; /* 0x8 */ DungeonPos prevPos;
// The center of the entity acccording to pixel-space coordinates, using the same origin as posWorld. // The center of the entity acccording to pixel-space coordinates, using the same origin as posWorld.
// X = (posWorld * 24 + 16) * 256, while Y = (posWorld * 24 + 12) * 256. // X = (posWorld * 24 + 16) * 256, while Y = (posWorld * 24 + 12) * 256.
/* 0xC */ Position32 pixelPos; /* 0xC */ PixelPos pixelPos;
/* 0x14 */ Position32 prevPixelPos; /* 0x14 */ PixelPos prevPixelPos;
s32 unk1C; s32 unk1C;
/* 0x20 */ bool8 isVisible; // Turned off when a Pokémon faints. /* 0x20 */ bool8 isVisible; // Turned off when a Pokémon faints.
u8 fill21; u8 fill21;
@ -409,13 +429,45 @@ enum AIObjective
AI_TAKE_ITEM AI_TAKE_ITEM
}; };
enum ClientType enum MonsterBehavior
{ {
CLIENT_TYPE_NONE, BEHAVIOR_FIXED_ENEMY,
CLIENT_TYPE_CLIENT, // Used for mission clients that need rescuing. BEHAVIOR_RESCUE_TARGET, // Used for mission clients that need rescuing.
CLIENT_TYPE_PARTNER, BEHAVIOR_ALLY,
// 3 BEHAVIOR_SKARMORY,
CLIENT_TYPE_DONT_MOVE = 4 // Used for Diglett in the Skarmory boss fight. BEHAVIOR_DIGLETT, // Used for Diglett in the Skarmory boss fight.
BEHAVIOR_5, // 5 and 6 are probably Gengar and Ekans, but not sure which is which.
BEHAVIOR_6,
BEHAVIOR_MEDICHAM,
BEHAVIOR_ZAPDOS,
BEHAVIOR_MOLTRES,
BEHAVIOR_ALAKAZAM_1,
BEHAVIOR_GROUDON_1,
BEHAVIOR_ALAKAZAM_2,
BEHAVIOR_ARTICUNO,
BEHAVIOR_GROUDON_2,
BEHAVIOR_RAYQUAZA,
BEHAVIOR_16,
BEHAVIOR_MEWTWO,
BEHAVIOR_ENTEI,
BEHAVIOR_RAIKOU,
BEHAVIOR_SUICUNE,
BEHAVIOR_HO_OH,
BEHAVIOR_LATIOS,
BEHAVIOR_REGIROCK,
BEHAVIOR_REGICE,
BEHAVIOR_REGISTEEL,
BEHAVIOR_JIRACHI,
BEHAVIOR_LUGIA,
BEHAVIOR_KYOGRE,
BEHAVIOR_29,
BEHAVIOR_CELEBI,
BEHAVIOR_SMEARGLE,
BEHAVIOR_32,
BEHAVIOR_33,
BEHAVIOR_34,
BEHAVIOR_35,
BEHAVIOR_36,
}; };
enum VisualFlag enum VisualFlag
@ -450,9 +502,4 @@ static inline void SetExpMultplier(EntityInfo *info)
SetRegularExpMultiplier(info); SetRegularExpMultiplier(info);
} }
static inline EntityInfo *GetEntInfo(Entity *ent)
{
return ent->axObj.info;
}
#endif #endif

View File

@ -72,7 +72,7 @@ typedef struct RoomData
u8 unk0; u8 unk0;
u8 unk1; u8 unk1;
// All coordinates are inclusive. // All coordinates are inclusive.
// These are not aligned properly to use the Position struct. // These are not aligned properly to use the DungeonPos struct.
/* 0x2 */ s16 bottomRightCornerX; /* 0x2 */ s16 bottomRightCornerX;
/* 0x4 */ s16 bottomRightCornerY; /* 0x4 */ s16 bottomRightCornerY;
/* 0x6 */ s16 topLeftCornerX; /* 0x6 */ s16 topLeftCornerX;

View File

@ -25,11 +25,11 @@ typedef struct MenuInputStruct
s32 unk0; s32 unk0;
u16 unk4; u16 unk4;
s16 unk6; s16 unk6;
Position unk8; // Maybe Position DungeonPos unk8; // Maybe DungeonPos
s16 unkC; // Maybe Position s16 unkC; // Maybe DungeonPos
s16 unkE; s16 unkE;
u32 unk10; u32 unk10;
Position unk14; // Maybe Position DungeonPos unk14; // Maybe DungeonPos
/* 0x18 */ s16 menuIndex; /* 0x18 */ s16 menuIndex;
s16 unk1A; s16 unk1A;
s16 unk1C; s16 unk1C;

View File

@ -1,7 +1,8 @@
#ifndef GUARD_STR_DAMAGE_H #ifndef GUARD_STR_DAMAGE_H
#define GUARD_STR_DAMAGE_H #define GUARD_STR_DAMAGE_H
struct DamageStruct // size: 0x10
typedef struct DamageStruct
{ {
s32 dmg; s32 dmg;
s32 residualDmgType; s32 residualDmgType;
@ -9,7 +10,7 @@ struct DamageStruct
u8 type; u8 type;
bool8 isCrit; bool8 isCrit;
u8 unkE; u8 unkE;
u8 unkF; bool8 tookNoDamage;
}; } DamageStruct;
#endif #endif // GUARD_STR_DAMAGE_H

View File

@ -7,6 +7,7 @@
#include "structs/map.h" #include "structs/map.h"
#include "structs/rgb.h" #include "structs/rgb.h"
#include "structs/str_position.h" #include "structs/str_position.h"
#include "structs/str_traps.h"
#include "sprite.h" #include "sprite.h"
#define DUNGEON_MAX_SIZE_X 56 #define DUNGEON_MAX_SIZE_X 56
@ -24,17 +25,17 @@ typedef struct DungeonLocation
/* 0x1 */ u8 floor; /* 0x1 */ u8 floor;
} DungeonLocation; } DungeonLocation;
// size: 0x18
typedef struct Weather typedef struct Weather
{ {
/* 0xE264 */ u8 weather; // Uses the weather constants in weather.h. /* 0x0 */ u8 weather; // Uses the weather constants in weather.h.
u8 unkE265; // Uses the weather constants in weather.h /* 0x1 */ u8 unkE265; // Uses the weather constants in weather.h
/* 0xE266 */ u8 weatherDamageCounter; // Timer for applying sandstorm/hail damage periodically. /* 0x2 */ u8 weatherDamageCounter; // Timer for applying sandstorm/hail damage periodically.
/* 0xE267 */ u8 unkE267[8]; /* 0x3 */ u8 unkE267[8];
/* 0xE26F */ u8 naturalWeather[8]; // The weather at the start of the floor. If the weather changes, then expires, revert back to the starting weather. /* 0xB */ u8 naturalWeather[8]; // The weather at the start of the floor. If the weather changes, then expires, revert back to the starting weather.
/* 0xE277 */ u8 mudSportTurns; /* 0x13 */ u8 mudSportTurns;
/* 0xE278 */ u8 waterSportTurns; /* 0x14 */ u8 waterSportTurns;
/* 0xE279 */ bool8 nullifyWeather; // Air Lock and Cloud Nine toggle this to disable weather effects /* 0x15 */ bool8 nullifyWeather; // Air Lock and Cloud Nine toggle this to disable weather effects
} Weather; } Weather;
// size: 0x30 // size: 0x30
@ -66,6 +67,8 @@ typedef struct DungeonMusicPlayer
/* 0x0 */ u32 state; /* 0x0 */ u32 state;
/* 0x4 */ u32 fadeOutSpeed; /* 0x4 */ u32 fadeOutSpeed;
/* 0x8 */ u16 fadeInSpeed; /* 0x8 */ u16 fadeInSpeed;
// dungeon_serializer.c refers to these 3 as s16, but they are almost always handled as u16
/* 0xA */ u16 songIndex; /* 0xA */ u16 songIndex;
/* 0xC */ u16 pastSongIndex; /* 0xC */ u16 pastSongIndex;
/* 0xE */ u16 queuedSongIndex; /* 0xE */ u16 queuedSongIndex;
@ -74,10 +77,10 @@ typedef struct DungeonMusicPlayer
// Size unknown? // Size unknown?
typedef struct UnkDungeonGlobal_unk181E8_sub typedef struct UnkDungeonGlobal_unk181E8_sub
{ {
/* 0x181E8 */ Position cameraPos; // x0 /* 0x181E8 */ DungeonPos cameraPos; // x0
/* 0x181EC */ Position cameraPosMirror; // x4 /* 0x181EC */ DungeonPos cameraPosMirror; // x4
/* 0x181F0 */ Position cameraPixelPos; // x8 /* 0x181F0 */ DungeonPos cameraPixelPos; // x8
/* 0x181F4 */ Position cameraPixelPosMirror; // xC /* 0x181F4 */ DungeonPos cameraPixelPosMirror; // xC
/* 0x181F8 */ Entity *cameraTarget; // x10 /* 0x181F8 */ Entity *cameraTarget; // x10
u32 unk181FC; // x14 u32 unk181FC; // x14
u32 unk18200; // x18 u32 unk18200; // x18
@ -85,15 +88,15 @@ typedef struct UnkDungeonGlobal_unk181E8_sub
u8 unk18208; // x20 u8 unk18208; // x20
/* 0x18209 */ u8 visibilityRange; // x21 Dungeon light level. /* 0x18209 */ u8 visibilityRange; // x21 Dungeon light level.
/* 0x1820A */ bool8 blinded; // x22 Blacks out the screen when the player has the Blinker status. /* 0x1820A */ bool8 blinded; // x22 Blacks out the screen when the player has the Blinker status.
u8 unk1820B; // x23 bool8 unk1820B; // x23
u8 unk1820C; // x24 bool8 unk1820C; // x24
u8 unk1820D; // x25 bool8 unk1820D; // x25
u8 unk1820E; // x26 bool8 unk1820E; // x26
u8 unk1820F; // x27 bool8 unk1820F; // x27
/* 0x18210 */ bool8 hallucinating; // x28 Displays Substitute and flower sprites when the player has the Cross-Eyed status. /* 0x18210 */ bool8 hallucinating; // x28 Displays Substitute and flower sprites when the player has the Cross-Eyed status.
u8 unk18211; // x29 bool8 unk18211; // x29
u8 unk18212; // x2A u8 unk18212; // x2A
u8 unk18213; // x2B bool8 unk18213; // x2B
u8 unk18214; // x2C u8 unk18214; // x2C
u8 unk18215; // x2D u8 unk18215; // x2D
u8 unk18216; // x2E u8 unk18216; // x2E
@ -170,7 +173,7 @@ struct unkStruct_Dungeon134_sub
u32 unk150; u32 unk150;
u32 unk154; u32 unk154;
u32 unk158; u32 unk158;
u32 unk15C; s24_8 unk15C;
u8 unk160; u8 unk160;
u8 unk161; u8 unk161;
u8 unk162; u8 unk162;
@ -199,12 +202,13 @@ struct unkStruct_Dungeon5C4_sub
Entity *unkC; Entity *unkC;
}; };
struct unkStruct_Dungeon64C // size: 0x8
typedef struct unkStruct_Dungeon64C
{ {
u8 unk0; u8 unk0;
u8 unk1; u8 unk1;
u32 unk4; u32 unk4;
}; } unkStruct_Dungeon64C;
#define UNK_1BBD4_STR_COUNT 10 #define UNK_1BBD4_STR_COUNT 10
@ -242,6 +246,63 @@ struct MinMaxPosition
s32 maxY; s32 maxY;
}; };
// size: 0x58
typedef struct unkDungeon644
{
/* 0x0 */ DungeonLocation dungeonLocation;
/* 0x4 */ DungeonLocation dungeonLocation2;
/* 0x8 */ unkStruct_Dungeon64C unk8;
/* 0x10 */ u8 unk10;
/* 0x11 */ u8 fill11[3];
/* 0x14 */ u8 unk14;
/* 0x15 */ u8 unk15;
/* 0x16 */ u8 unk16;
/* 0x17 */ u8 unk17;
/* 0x18 */ u8 unk18;
/* 0x19 */ u8 unk19;
/* 0x1A */ u8 fill1A[2];
/* 0x1C */ s16 fractionalTurn; // Handles turn order when Pokémon have different movement speeds.
/* 0x1E */ s16 unk1E;
/* 0x20 */ s16 unk20;
/* 0x22 */ s16 windTurns; // Turns remaining before getting swept out of the dungeon.
/* 0x24 */ u16 unk24;
/* 0x26 */ u16 bossSongIndex;
/* 0x28 */ u8 unk28;
/* 0x29 */ u8 unk29;
/* 0x2A */ u8 unk2A;
/* 0x2B */ u8 unk2B;
/* 0x2C */ u8 unk2C;
/* 0x2D */ bool8 monsterHouseTriggered;
/* 0x2E */ bool8 monsterHouseTriggeredEvent;
/* 0x2F */ u8 unk2F;
/* 0x30 */ u8 unk30;
/* 0x31 */ u8 unk31;
/* 0x32 */ bool8 itemHoldersIdentified;
/* 0x33 */ u8 fill33;
/* 0x34 */ u8 unk34;
/* 0x35 */ u8 unk35;
/* 0x36 */ u8 unk36;
/* 0x37 */ s8 unk37;
/* 0x38 */ u32 unk38;
/* 0x3C */ u32 unk3C;
/* 0x40 */ s16 unk40;
/* 0x42 */ s16 unk42;
/* 0x44 */ s16 unk44;
/* 0x46 */ u8 unk46;
/* 0x48 */ s32 unk48;
/* 0x4C */ s32 unk4C;
/* 0x50 */ s32 unk50;
/* 0x54 */ u8 unk54;
/* 0x55 */ u8 unk55;
} unkDungeon644;
// size: 0x4
typedef struct unkDungeonE260
{
/* 0x0 */ u16 unk0;
/* 0x2 */ u16 unk2;
} unkDungeonE260;
// size: 0x1CEDC // size: 0x1CEDC
typedef struct Dungeon typedef struct Dungeon
{ {
@ -276,58 +337,10 @@ typedef struct Dungeon
/* 0x5C0 */ s32 unk5C0; /* 0x5C0 */ s32 unk5C0;
/* 0x5C4 */ struct unkStruct_Dungeon5C4_sub unk5C4[3]; /* 0x5C4 */ struct unkStruct_Dungeon5C4_sub unk5C4[3];
/* 0x5F4 */ u8 faintStringBuffer[80]; /* 0x5F4 */ u8 faintStringBuffer[80];
/* 0x644 */ DungeonLocation dungeonLocation; unkDungeon644 unk644;
/* 0x648 */ DungeonLocation dungeonLocation2; EntityInfo unk69C[MAX_TEAM_MEMBERS];
struct unkStruct_Dungeon64C unk64C; EntityInfo unkEBC[DUNGEON_MAX_WILD_POKEMON_BODY_SIZE];
u8 unk654; u8 fill2F3C[0x343C - 0x2F3C];
u8 fill655;
u8 fill656;
u8 fill657;
u8 unk658;
u8 unk659;
u8 unk65A;
u8 unk65B;
u8 unk65C;
u8 unk65D;
u8 fill65e[0x660 - 0x65e];
/* 0x660 */ s16 fractionalTurn; // Handles turn order when Pokémon have different movement speeds.
s16 unk662;
s16 unk664;
/* 0x666 */ s16 windTurns; // Turns remaining before getting swept out of the dungeon.
/* 0x668 */ u16 unk668;
u16 bossSongIndex;
u8 unk66C;
u8 unk66D;
/* 0x66E */ u8 unk66E;
u8 unk66F;
u8 unk670;
/* 0x671 */ bool8 monsterHouseTriggered;
/* 0x672 */ bool8 monsterHouseTriggeredEvent;
u8 unk673;
u8 unk674;
u8 unk675;
/* 0x676 */ bool8 itemHoldersIdentified;
u8 unk677;
u8 unk678;
u8 unk679;
u8 unk67A;
s8 unk67B;
u32 unk67C;
u32 unk680;
s16 unk684;
s16 unk686;
s16 unk688;
/* 0x68A */ u8 unk68A;
u8 fill68B;
s32 unk68C;
s32 unk690;
s32 unk694;
u8 unk698;
u8 unk699;
u8 fill69A[0x69C - 0x69A];
EntityInfo unk69C[4];
EntityInfo unkEBC[1]; // Unsure about the size... See sub_8082A08()
u8 fill10C4[0x343C - 0x10C4];
/* 0x343C */ UnkDungeonGlobal_unk1CD98 unk343C[32]; /* 0x343C */ UnkDungeonGlobal_unk1CD98 unk343C[32];
u8 fill353C[0x363c-0x353c]; u8 fill353C[0x363c-0x353c];
/* 0x363C */ u8 expYieldRankings[NUM_MONSTERS]; /* 0x363C */ u8 expYieldRankings[NUM_MONSTERS];
@ -339,18 +352,19 @@ typedef struct Dungeon
/* 0x37F4 */ s32 unk37F4; /* 0x37F4 */ s32 unk37F4;
/* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team /* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team /* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FC */ bool8 decoyActive; /* 0x37FC */ bool8 decoyIsActive;
/* 0x37FD */ u8 unk37FD; /* 0x37FD */ bool8 unk37FD;
/* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave /* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave
/* 0x37FE */ u8 unk37FF; /* 0x37FE */ bool8 unk37FF;
s16 unk3800; // dungeon_serializer.c refers to this as a u16 but elsewhere it's handled as a s16
u8 fill3802[0x3904 - 0x3802]; /* 0x3800 */ s16 deoxysForm;
Item unk3804[DUNGEON_MAX_ITEMS];
/* 0x3904 */ s16 numItems; /* 0x3904 */ s16 numItems;
u8 fill3906[0x3A08 - 0x3906]; Trap unk3908[DUNGEON_MAX_TRAPS];
/* 0x3A08 */ bool8 forceMonsterHouse; // Forces the current floor to have monster house /* 0x3A08 */ bool8 forceMonsterHouse; // Forces the current floor to have monster house
/* 0x3A09 */ u8 unk3A09; /* 0x3A09 */ bool8 unk3A09;
/* 0x3A0A */ u8 unk3A0A; /* 0x3A0A */ bool8 unk3A0A;
/* 0x3A0B */ u8 unk3A0B; /* 0x3A0B */ bool8 unk3A0B;
/* 0x3A0C */ u8 monsterHouseRoom; // room index of monster house /* 0x3A0C */ u8 monsterHouseRoom; // room index of monster house
/* 0x3A0D */ u8 unk3A0D; /* 0x3A0D */ u8 unk3A0D;
/* 0x3A0E */ s16 tileset; /* 0x3A0E */ s16 tileset;
@ -359,12 +373,12 @@ typedef struct Dungeon
/* 0x3A14 */ s16 fixedRoomId; /* 0x3A14 */ s16 fixedRoomId;
/* 0x3A16 */ s16 unk3A16; /* 0x3A16 */ s16 unk3A16;
/* 0x3A18 */ Tile tiles[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X]; /* 0x3A18 */ Tile tiles[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X];
/* 0xEA18 */ Position playerSpawn; /* 0xEA18 */ DungeonPos playerSpawn;
Position stairsSpawn; // stairs location DungeonPos stairsSpawn; // stairs location
Position unkE220[8]; DungeonPos unkE220[8];
struct MinMaxPosition kecleonShopPos; struct MinMaxPosition kecleonShopPos;
struct MinMaxPosition unkE250; struct MinMaxPosition unkE250;
Position unkE260; unkDungeonE260 unkE260;
/* 0xE264 */ Weather weather; // Uses the weather constants in weather.h. /* 0xE264 */ Weather weather; // Uses the weather constants in weather.h.
/* 0xE27C */ Tile unkE27C[8][8]; /* 0xE27C */ Tile unkE27C[8][8];
/* 0xE87C */ u8 unkE87C[8][8]; /* 0xE87C */ u8 unkE87C[8][8];
@ -373,7 +387,7 @@ typedef struct Dungeon
u8 unk104C0; u8 unk104C0;
/* 0x104C4 */ RoomData roomData[MAX_ROOM_COUNT]; /* 0x104C4 */ RoomData roomData[MAX_ROOM_COUNT];
/* 0x10844 */ s16 naturalJunctionListCounts[MAX_ROOM_COUNT]; /* 0x10844 */ s16 naturalJunctionListCounts[MAX_ROOM_COUNT];
/* 0x10884 */ Position naturalJunctionList[MAX_ROOM_COUNT][MAX_ROOM_COUNT]; // Arrays of room exits for each room. /* 0x10884 */ DungeonPos naturalJunctionList[MAX_ROOM_COUNT][MAX_ROOM_COUNT]; // Arrays of room exits for each room.
u16 unk11884[250][9]; u16 unk11884[250][9];
u16 unk12A18[20][9]; u16 unk12A18[20][9];
u16 unk12B80[9]; u16 unk12B80[9];
@ -388,13 +402,13 @@ typedef struct Dungeon
u8 fill1356D[0x13570 - 0x1356D]; u8 fill1356D[0x13570 - 0x1356D];
/* 0x13570 */ u8 unk13570; /* 0x13570 */ u8 unk13570;
u8 fill13571[0x13574 - 0x13571]; u8 fill13571[0x13574 - 0x13571];
/* 0x13574 */ Position trapPos; /* 0x13574 */ DungeonPos trapPos;
/* 0x13578 */ u8 trapID; /* 0x13578 */ u8 trapID;
/* 0x13579 */ u8 unk13579; /* 0x13579 */ u8 unk13579;
u8 fill1357A[0x1357C - 0x1357A]; u8 fill1357A[0x1357C - 0x1357A];
/* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS]; /* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS];
/* 0x1358C */ Entity *wildPokemon[DUNGEON_MAX_WILD_POKEMON]; /* 0x1358C */ Entity *wildPokemon[DUNGEON_MAX_WILD_POKEMON];
/* 0x135CC */ Entity *allPokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon /* 0x135CC */ Entity *activePokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon
/* 0x1361C */ Entity *items[DUNGEON_MAX_ITEMS]; /* 0x1361C */ Entity *items[DUNGEON_MAX_ITEMS];
/* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS]; /* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS];
/* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS]; /* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS];

View File

@ -23,7 +23,7 @@ typedef struct unkPokeSubStruct_C
// size: 0x58 // size: 0x58
typedef struct PokemonStruct1 typedef struct PokemonStruct1
{ {
u16 unk0; // Probably a union: Sometimes ldrh and sometimes ldrb. Recruited?? u16 unk0; // Probably a union: Sometimes ldrh and sometimes ldrb. Recruited?? "sub_80954CC" only loads 2 bits of info
/* 0x2 */ bool8 isTeamLeader; /* 0x2 */ bool8 isTeamLeader;
/* 0x3 */ u8 level; /* 0x3 */ u8 level;
/* 0x4 */ DungeonLocation dungeonLocation; /* 0x4 */ DungeonLocation dungeonLocation;
@ -71,8 +71,8 @@ typedef struct PokemonStruct2
/* 0x18 */ u32 currExp; /* 0x18 */ u32 currExp;
/* 0x1C */ Moves moves; /* 0x1C */ Moves moves;
/* 0x40 */ Item itemSlot; // heldItem /* 0x40 */ Item itemSlot; // heldItem
FixedPoint belly; // some struct /* 0x44 */ FixedPoint belly;
FixedPoint maxBelly; // some struct (same type as 44) /* 0x48 */ FixedPoint maxBelly;
/* 0x4C */ u32 IQSkills; // unk20 /* 0x4C */ u32 IQSkills; // unk20
/* 0x50 */ u8 tacticIndex; /* 0x50 */ u8 tacticIndex;
/* 0x54 */ HiddenPower hiddenPower; /* 0x54 */ HiddenPower hiddenPower;

View File

@ -2,17 +2,34 @@
#define GUARD_STR_POSITION_H #define GUARD_STR_POSITION_H
// size: 0x4 // size: 0x4
typedef struct Position typedef struct DungeonPos
{ {
/* 0x0 */ s16 x; /* 0x0 */ s16 x;
/* 0x2 */ s16 y; /* 0x2 */ s16 y;
} Position; } DungeonPos;
/**
* Precise position expressed in pixel units, as s24_8 fixpoint.
* This type has subpixel precision to 1/256th of a pixel.
*/
// size: 0x8 // size: 0x8
typedef struct Position32 typedef struct PixelPos
{ {
/* 0x0 */ s32 x; /* 0x0 */ s32 x; // TODO: convert to s24_8 across the codebase
/* 0x4 */ s32 y; /* 0x4 */ s32 y;
} Position32; } PixelPos;
#endif // GUARD_STR_POSITION_H /**
* Currently only used in script data, for entities and GroundLink data.
* DungeonPos expressed in terms of *graphics* tiles, 8 pixels per unit.
* Flags allow expressing half-tile offsets and allow using a current/default coordinate.
*/
// size: 0x4
typedef struct CompactPos {
u8 xTiles;
u8 yTiles;
u8 xFlags;
u8 yFlags;
} CompactPos;
#endif // GUARD_STR_POSITION_H

View File

@ -3,10 +3,11 @@
#include "constants/trap.h" #include "constants/trap.h"
typedef struct Trap // size: 0x4
typedef struct Trap
{ {
/* 0x0 */ u8 id; /* 0x0 */ u8 id;
/* 0x1 */ u8 unk1; /* 0x1 */ u8 unk1;
} Trap; } Trap;
#endif // GUARD_STR_TRAPS_H #endif // GUARD_STR_TRAPS_H

View File

@ -64,8 +64,8 @@ typedef struct unkStruct_203B480
u32 unk10; u32 unk10;
u16 unk10_u16; u16 unk10_u16;
} unk10; } unk10;
/* 0x14 */ u8 playerName[0x20 - 0x14]; /* 0x14 */ u8 playerName[10];
Item item; /* 0x20 */ Item item;
u32 unk24; u32 unk24;
u32 unk28; u32 unk28;
/* 0x2C */ s8 rescuesAllowed; /* 0x2C */ s8 rescuesAllowed;

View File

@ -7,10 +7,10 @@
#define DUNGEON_WATER_TYPE_LAVA 1 #define DUNGEON_WATER_TYPE_LAVA 1
#define DUNGEON_WATER_TYPE_WATER 2 #define DUNGEON_WATER_TYPE_WATER 2
extern const u8 gDungeonWaterType[]; extern const u8 gDungeonWaterType[76];
void sub_804AE84(Position *pos); void sub_804AE84(DungeonPos *pos);
bool8 IsTileGround(Tile *tile); bool8 IsTileGround(Tile *tile);
bool8 IsWaterTileset(); bool8 IsWaterTileset();
#endif #endif // GUARD_TILE_TYPES_H

View File

@ -5,17 +5,17 @@
#include "structs/map.h" #include "structs/map.h"
#include "structs/str_position.h" #include "structs/str_position.h"
bool8 CanLayTrap(Position *pos); bool8 CanLayTrap(DungeonPos *pos);
bool8 LayTrap(Position *pos, u8 trapID, u8 param_3); bool8 LayTrap(DungeonPos *pos, u8 trapID, u8 param_3);
bool8 sub_807FD84(Entity *entity); bool8 sub_807FD84(Entity *entity);
bool8 sub_807FE04(Position *pos, char param_2); bool8 sub_807FE04(DungeonPos *pos, char param_2);
bool8 sub_807FE44(Position *pos, char param_2); bool8 sub_807FE44(DungeonPos *pos, char param_2);
void GetTrapName(u8 *buffer, u8 trapIndex); void GetTrapName(u8 *buffer, u8 trapIndex);
void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4); void sub_807FE9C(Entity *pokemon, DungeonPos *pos, int param_3, char param_4);
void HandleMudTrap(Entity *pokemon, Entity *target); void HandleMudTrap(Entity *pokemon, Entity *target);
void HandleStickyTrap(Entity *pokemon, Entity *target); void HandleStickyTrap(Entity *pokemon, Entity *target);
void HandleGrimyTrap(Entity *pokemon, Entity *target); void HandleGrimyTrap(Entity *pokemon, Entity *target);
void HandleSummonTrap(Entity *pokemon, Position *pos); void HandleSummonTrap(Entity *pokemon, DungeonPos *pos);
void HandlePitfallTrap(Entity *pokemon,Entity *target,Tile *tile); void HandlePitfallTrap(Entity *pokemon,Entity *target,Tile *tile);
void HandleWarpTrap(Entity *pokemon, Entity *target); void HandleWarpTrap(Entity *pokemon, Entity *target);
void HandleSpinTrap(Entity *pokemon, Entity *target); void HandleSpinTrap(Entity *pokemon, Entity *target);
@ -30,7 +30,7 @@ void HandleWonderTile(Entity *pokemon, Entity *target);
// code_807FCD4.s // code_807FCD4.s
extern void HandleSealTrap(Entity *pokemon, Entity *target); extern void HandleSealTrap(Entity *pokemon, Entity *target);
extern void HandleWhirlwindTrap(Entity *entity, Entity *target); extern void HandleWhirlwindTrap(Entity *entity, Entity *target);
extern void HandlePokemonTrap(Entity *pokemon, Position *pos); extern void HandlePokemonTrap(Entity *pokemon, DungeonPos *pos);
// trap_1.c // trap_1.c
void HandleTripTrap(Entity *pokemon, Entity *target); void HandleTripTrap(Entity *pokemon, Entity *target);

View File

@ -69,7 +69,6 @@ SECTIONS {
src/code_8009804.o(.text); src/code_8009804.o(.text);
asm/code_8009804.o(.text); asm/code_8009804.o(.text);
src/math.o(.text); src/math.o(.text);
asm/math.o(.text);
src/file_system.o(.text); src/file_system.o(.text);
src/decompress.o(.text); src/decompress.o(.text);
src/main.o(.text); src/main.o(.text);
@ -216,9 +215,8 @@ SECTIONS {
asm/code_8044210.o(.text); asm/code_8044210.o(.text);
src/dungeon_action.o(.text); src/dungeon_action.o(.text);
src/code_8044CC8.o(.text); src/code_8044CC8.o(.text);
asm/code_8044CC8.o(.text);
src/dungeon_util.o(.text); src/dungeon_util.o(.text);
asm/code_80450F8.o(.text); src/code_80450F8.o(.text);
src/dungeon_visibility.o(.text); src/dungeon_visibility.o(.text);
src/code_8045A00.o(.text); src/code_8045A00.o(.text);
asm/code_8045A00.o(.text); asm/code_8045A00.o(.text);
@ -248,7 +246,6 @@ SECTIONS {
src/code_806CD90.o(.text); src/code_806CD90.o(.text);
src/type_effectiveness.o(.text); src/type_effectiveness.o(.text);
src/code_806E8B0.o(.text); src/code_806E8B0.o(.text);
asm/code_806E8B0.o(.text);
src/code_806FDF4.o(.text); src/code_806FDF4.o(.text);
src/status_checks.o(.text); src/status_checks.o(.text);
src/dungeon_movement.o(.text); src/dungeon_movement.o(.text);
@ -280,8 +277,7 @@ SECTIONS {
src/trap.o(.text); src/trap.o(.text);
asm/code_807FCD4.o(.text); asm/code_807FCD4.o(.text);
src/trap_1.o(.text); src/trap_1.o(.text);
asm/code_8080CF0.o(.text); src/dungeon_serializer.o(.text);
src/code_8083288.o(.text);
src/dungeon_range.o(.text); src/dungeon_range.o(.text);
src/code_808333C.o(.text); src/code_808333C.o(.text);
src/dungeon_leader.o(.text); src/dungeon_leader.o(.text);
@ -526,6 +522,12 @@ SECTIONS {
src/load_screen.o(.rodata); src/load_screen.o(.rodata);
src/wonder_mail_main_menu.o(.rodata); src/wonder_mail_main_menu.o(.rodata);
src/debug_menu1.o(.rodata); src/debug_menu1.o(.rodata);
src/debug_unused1.o(.rodata);
src/debug_unused2.o(.rodata);
src/debug_unused3.o(.rodata);
src/debug_unused4.o(.rodata);
src/debug_unused5.o(.rodata);
src/debug_unused6.o(.rodata);
src/debug_menu2.o(.rodata); src/debug_menu2.o(.rodata);
src/debug_menu3.o(.rodata); src/debug_menu3.o(.rodata);
src/debug_menu4.o(.rodata); src/debug_menu4.o(.rodata);
@ -559,6 +561,8 @@ SECTIONS {
src/dungeon_capabilities.o(.rodata); src/dungeon_capabilities.o(.rodata);
src/dungeon_ai_targeting.o(.rodata); src/dungeon_ai_targeting.o(.rodata);
data/data_8107010.o(.rodata); data/data_8107010.o(.rodata);
src/dungeon_serializer.o(.rodata);
data/data_8107224.o(.rodata);
src/game_options.o(.rodata); src/game_options.o(.rodata);
data/data_8109964.o(.rodata); data/data_8109964.o(.rodata);
src/code_80972F4.o(.rodata); src/code_80972F4.o(.rodata);

View File

@ -87,8 +87,7 @@ static void DisplayAdventureLog(void)
s32 i; s32 i;
s32 r4; // r4 s32 r4; // r4
s32 r6; // r6 s32 r6; // r6
u8 temp; u8 aa;
s32 v1, v2, v3, v4, v5, v6;
CallPrepareTextbox_8008C54(sAdventureLog->s0.unk34); CallPrepareTextbox_8008C54(sAdventureLog->s0.unk34);
sub_80073B8(sAdventureLog->s0.unk34); sub_80073B8(sAdventureLog->s0.unk34);
@ -102,42 +101,49 @@ static void DisplayAdventureLog(void)
sub_8012BC4(r6, 0, sAdventureLog->s0.input.unk1E + 1, 1, 7, sAdventureLog->s0.unk34); sub_8012BC4(r6, 0, sAdventureLog->s0.input.unk1E + 1, 1, 7, sAdventureLog->s0.unk34);
for (i = 0; i < sAdventureLog->s0.input.unk1A; i++) { for (i = 0; i < sAdventureLog->s0.input.unk1A; i++) {
temp = (sAdventureLog->s0.input.unk1E * sAdventureLog->s0.input.unk1C) + i; aa = (sAdventureLog->s0.input.unk1E * sAdventureLog->s0.input.unk1C) + i;
if (sub_8097710(temp)) { if (GetAdventureAchievement(aa)) {
switch (temp) { switch (aa) {
case 12: case AA_NUM_FLOORS_EXPLORED: {
v1 = sub_80978B8(); s32 v1 = GetAdventureFloorsExplored();
gFormatArgs[0] = (s16)v1; gFormatArgs[0] = (s16)v1;
PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0);
break; break;
case 7: }
v2 = sub_8097880(); case AA_NUM_MOVES_LEARNED: {
s32 v2 = GetAdventureMovesLearned();
gFormatArgs[0] = (s16)v2; gFormatArgs[0] = (s16)v2;
PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0);
break; break;
case 11: }
v3 = sub_8097838(); case AA_NUM_THIEVING_SUCCESSES: {
s32 v3 = GetThievingSuccesses();
gFormatArgs[0] = (s16)v3; gFormatArgs[0] = (s16)v3;
PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0);
break; break;
case 8: }
v4 = sub_80977B8(); case AA_NUM_FRIEND_RESCUE_SUCCESSES: {
s32 v4 = GetFriendRescueSuccesses();
gFormatArgs[0] = v4; gFormatArgs[0] = v4;
PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0);
break; break;
case 9: }
v5 = sub_80977F8(); case AA_NUM_POKEMON_EVOLVED: {
s32 v5 = GetAdventureNumEvolved();
gFormatArgs[0] = v5; gFormatArgs[0] = v5;
PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0);
break; break;
case 10: }
v6 = sub_8097870(); case AA_NUM_POKEMON_JOINED: {
s32 v6 = GetAdventureNumJoined();
gFormatArgs[0] = (s16)v6; gFormatArgs[0] = (s16)v6;
// fallthrough // fallthrough
default: }
PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(temp), sAdventureLog->s0.unk34, 0); default: {
PrintFormattedStringOnWindow(8, sub_8013800(&sAdventureLog->s0.input, i), GetAdventureLogLine(aa), sAdventureLog->s0.unk34, 0);
break; break;
}
} }
} }
else else
@ -145,4 +151,4 @@ static void DisplayAdventureLog(void)
} }
sub_80073E0(sAdventureLog->s0.unk34); sub_80073E0(sAdventureLog->s0.unk34);
} }

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