Merge pull request #313 from SethBarberee/jan_2025
Some checks failed
GithubCI / build (push) Has been cancelled

Jan 2025
This commit is contained in:
Seth Barberee
2025-02-09 21:21:09 -08:00
committed by GitHub
59 changed files with 3062 additions and 6332 deletions

View File

@@ -223,198 +223,4 @@ _08002904: .4byte 0x3f800000
_08002908: .4byte 0x43800000
thumb_func_end sub_800282C
thumb_func_start sub_800290C
sub_800290C:
push {lr}
ldr r3, [r0]
cmp r3, r1
ble _08002918
str r1, [r0]
b _08002920
_08002918:
negs r2, r1
cmp r3, r2
bge _08002920
str r2, [r0]
_08002920:
ldr r2, [r0, 0x4]
cmp r2, r1
bgt _0800292C
negs r1, r1
cmp r2, r1
bge _0800292E
_0800292C:
str r1, [r0, 0x4]
_0800292E:
pop {r0}
bx r0
thumb_func_end sub_800290C
thumb_func_start sub_8002934
sub_8002934:
push {r4-r6,lr}
mov r6, r10
mov r5, r9
mov r4, r8
push {r4-r6}
mov r10, r0
adds r6, r1, 0
mov r8, r2
adds r4, r3, 0
ldr r5, [sp, 0x1C]
adds r0, r4, r5
mov r9, r0
ldr r0, [r6]
muls r0, r4
ldr r1, [r2]
muls r1, r5
adds r0, r1
mov r1, r9
bl __divsi3
mov r1, r10
str r0, [r1]
ldr r0, [r6, 0x4]
muls r0, r4
mov r2, r8
ldr r1, [r2, 0x4]
muls r1, r5
adds r0, r1
mov r1, r9
bl __divsi3
mov r1, r10
str r0, [r1, 0x4]
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_8002934
thumb_func_start sub_8002984
sub_8002984:
push {r4,lr}
lsls r0, 24
asrs r4, r0, 24
lsls r1, 24
lsrs r1, 24
subs r0, r1, 0x1
cmp r0, 0x8
bhi _08002A68
lsls r0, 2
ldr r1, _080029A0
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_080029A0: .4byte _080029A4
.align 2, 0
_080029A4:
.4byte _080029C8
.4byte _080029D0
.4byte _080029D8
.4byte _080029E0
.4byte _080029E8
.4byte _080029F4
.4byte _08002A34
.4byte _08002A4E
.4byte _08002A5E
_080029C8:
cmp r4, 0
blt _08002A68
adds r4, 0x7
b _080029EE
_080029D0:
cmp r4, 0
blt _08002A68
adds r4, 0x1
b _080029EE
_080029D8:
cmp r4, 0
blt _08002A68
adds r4, 0x6
b _080029EE
_080029E0:
cmp r4, 0
blt _08002A68
adds r4, 0x2
b _080029EE
_080029E8:
cmp r4, 0
blt _08002A68
adds r4, 0x4
_080029EE:
movs r0, 0x7
ands r4, r0
b _08002A68
_080029F4:
movs r0, 0x1
ands r0, r4
cmp r0, 0
beq _08002A18
movs r0, 0x2
bl OtherRandInt
adds r1, r4, 0x7
lsls r0, 1
adds r1, r0
adds r0, r1, 0
cmp r1, 0
bge _08002A10
adds r0, r1, 0x7
_08002A10:
asrs r0, 3
lsls r0, 3
subs r0, r1, r0
b _08002A64
_08002A18:
movs r0, 0x3
bl OtherRandInt
adds r1, r4, 0x6
lsls r0, 1
adds r1, r0
adds r0, r1, 0
cmp r1, 0
bge _08002A2C
adds r0, r1, 0x7
_08002A2C:
asrs r0, 3
lsls r0, 3
subs r0, r1, r0
b _08002A64
_08002A34:
movs r0, 0x3
bl OtherRandInt
adds r1, r4, 0x7
adds r1, r0
adds r0, r1, 0
cmp r1, 0
bge _08002A46
adds r0, r1, 0x7
_08002A46:
asrs r0, 3
lsls r0, 3
subs r0, r1, r0
b _08002A64
_08002A4E:
movs r0, 0x8
bl OtherRandInt
movs r2, 0x2
negs r2, r2
adds r1, r2, 0
ands r0, r1
b _08002A64
_08002A5E:
movs r0, 0x8
bl OtherRandInt
_08002A64:
lsls r0, 24
asrs r4, r0, 24
_08002A68:
adds r0, r4, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8002984
.align 2, 0 @ Don't pad with nop.

View File

@@ -1,497 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_8002B5C
sub_8002B5C:
push {lr}
lsls r0, 24
asrs r2, r0, 24
lsls r1, 24
asrs r1, 24
movs r0, 0x1
negs r0, r0
cmp r1, r0
beq _08002BAE
adds r0, r2, 0
subs r0, 0x8
subs r1, r0
adds r0, r1, 0
cmp r1, 0
bge _08002B7C
adds r0, r1, 0x7
_08002B7C:
asrs r0, 3
lsls r0, 3
subs r0, r1, r0
cmp r0, 0
beq _08002BAE
cmp r0, 0x3
bgt _08002B98
adds r1, r2, 0x2
adds r0, r1, 0
cmp r1, 0
bge _08002BA4
adds r0, r2, 0
adds r0, 0x9
b _08002BA4
_08002B98:
adds r1, r2, 0x6
adds r0, r1, 0
cmp r1, 0
bge _08002BA4
adds r0, r2, 0
adds r0, 0xD
_08002BA4:
asrs r0, 3
lsls r0, 3
subs r0, r1, r0
lsls r0, 24
asrs r2, r0, 24
_08002BAE:
movs r0, 0x6
ands r2, r0
adds r0, r2, 0
pop {r1}
bx r1
thumb_func_end sub_8002B5C
thumb_func_start SetVecFromDirectionSpeed
SetVecFromDirectionSpeed:
push {r4,r5,lr}
lsls r1, 24
asrs r1, 21
ldr r3, _08002BD8
adds r1, r3
ldr r5, [r1]
adds r3, r5, 0
muls r3, r2
ldr r1, [r1, 0x4]
adds r4, r1, 0
muls r4, r2
str r3, [r0]
str r4, [r0, 0x4]
pop {r4,r5}
pop {r2}
bx r2
.align 2, 0
_08002BD8: .4byte gVectorDirections
thumb_func_end SetVecFromDirectionSpeed
thumb_func_start VecDirection8Sign
VecDirection8Sign:
push {lr}
ldr r1, [r0]
cmp r1, 0
bge _08002BFA
ldr r0, [r0, 0x4]
cmp r0, 0
bge _08002BEE
movs r0, 0x5
b _08002C2A
_08002BEE:
cmp r0, 0
ble _08002BF6
movs r0, 0x7
b _08002C2A
_08002BF6:
movs r0, 0x6
b _08002C2A
_08002BFA:
cmp r1, 0
ble _08002C14
ldr r0, [r0, 0x4]
cmp r0, 0
bge _08002C08
movs r0, 0x3
b _08002C2A
_08002C08:
cmp r0, 0
ble _08002C10
movs r0, 0x1
b _08002C2A
_08002C10:
movs r0, 0x2
b _08002C2A
_08002C14:
ldr r0, [r0, 0x4]
cmp r0, 0
bge _08002C1E
movs r0, 0x4
b _08002C2A
_08002C1E:
cmp r0, 0
bgt _08002C28
movs r0, 0x1
negs r0, r0
b _08002C2A
_08002C28:
movs r0, 0
_08002C2A:
pop {r1}
bx r1
thumb_func_end VecDirection8Sign
thumb_func_start VecDirection4SignYX
VecDirection4SignYX:
push {lr}
ldr r1, [r0, 0x4]
cmp r1, 0
bge _08002C3C
movs r0, 0x4
b _08002C5A
_08002C3C:
cmp r1, 0
ble _08002C44
movs r0, 0
b _08002C5A
_08002C44:
ldr r0, [r0]
cmp r0, 0
bge _08002C4E
movs r0, 0x6
b _08002C5A
_08002C4E:
cmp r0, 0
bgt _08002C58
movs r0, 0x1
negs r0, r0
b _08002C5A
_08002C58:
movs r0, 0x2
_08002C5A:
pop {r1}
bx r1
thumb_func_end VecDirection4SignYX
thumb_func_start VecDirection8Radial
VecDirection8Radial:
push {r4,r5,lr}
adds r4, r0, 0
ldr r0, [r4]
cmp r0, 0
bge _08002C6C
negs r0, r0
_08002C6C:
adds r1, r0, 0
ldr r3, [r4, 0x4]
adds r5, r3, 0
cmp r3, 0
bge _08002C78
negs r5, r3
_08002C78:
adds r2, r5, 0
ldr r4, [r4]
cmp r4, 0
bge _08002CA8
cmp r3, 0
bge _08002C94
lsls r0, 1
cmp r2, r0
bgt _08002CD8
lsls r0, r5, 1
cmp r1, r0
bgt _08002CA0
movs r0, 0x5
b _08002CE8
_08002C94:
lsls r0, 1
cmp r2, r0
bgt _08002CE6
lsls r0, r5, 1
cmp r1, r0
ble _08002CA4
_08002CA0:
movs r0, 0x6
b _08002CE8
_08002CA4:
movs r0, 0x7
b _08002CE8
_08002CA8:
cmp r4, 0
ble _08002CD4
cmp r3, 0
bge _08002CC0
lsls r0, 1
cmp r2, r0
bgt _08002CD8
lsls r0, r5, 1
cmp r1, r0
bgt _08002CCC
movs r0, 0x3
b _08002CE8
_08002CC0:
lsls r0, 1
cmp r2, r0
bgt _08002CE6
lsls r0, r5, 1
cmp r1, r0
ble _08002CD0
_08002CCC:
movs r0, 0x2
b _08002CE8
_08002CD0:
movs r0, 0x1
b _08002CE8
_08002CD4:
cmp r3, 0
bge _08002CDC
_08002CD8:
movs r0, 0x4
b _08002CE8
_08002CDC:
cmp r3, 0
bgt _08002CE6
movs r0, 0x1
negs r0, r0
b _08002CE8
_08002CE6:
movs r0, 0
_08002CE8:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end VecDirection8Radial
thumb_func_start VecDirection4Radial
VecDirection4Radial:
push {r4,lr}
adds r4, r0, 0
ldr r3, [r4]
cmp r3, 0
bge _08002CFC
negs r3, r3
_08002CFC:
adds r1, r3, 0
ldr r3, [r4, 0x4]
adds r0, r3, 0
cmp r3, 0
bge _08002D08
negs r0, r3
_08002D08:
adds r2, r0, 0
ldr r0, [r4]
cmp r0, 0
bge _08002D22
cmp r3, 0
bge _08002D1A
cmp r2, r1
bgt _08002D3C
b _08002D1E
_08002D1A:
cmp r2, r1
bgt _08002D4A
_08002D1E:
movs r0, 0x6
b _08002D4C
_08002D22:
cmp r0, 0
ble _08002D38
cmp r3, 0
bge _08002D30
cmp r2, r1
bgt _08002D3C
b _08002D34
_08002D30:
cmp r2, r1
bgt _08002D4A
_08002D34:
movs r0, 0x2
b _08002D4C
_08002D38:
cmp r3, 0
bge _08002D40
_08002D3C:
movs r0, 0x4
b _08002D4C
_08002D40:
cmp r3, 0
bgt _08002D4A
movs r0, 0x1
negs r0, r0
b _08002D4C
_08002D4A:
movs r0, 0
_08002D4C:
pop {r4}
pop {r1}
bx r1
thumb_func_end VecDirection4Radial
thumb_func_start SizedDeltaDirection4
SizedDeltaDirection4:
push {r4,r5,lr}
sub sp, 0x8
adds r4, r1, 0
adds r5, r3, 0
ldr r3, [r2]
ldr r1, [r0]
subs r3, r1
str r3, [sp]
ldr r1, [r2, 0x4]
ldr r0, [r0, 0x4]
subs r1, r0
str r1, [sp, 0x4]
adds r2, r3, 0
cmp r2, 0
blt _08002D8A
adds r2, 0x1
ldr r0, [r4]
ldr r1, [r5]
adds r0, r1
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
subs r2, r0
str r2, [sp]
cmp r2, 0
bge _08002DA4
b _08002DA0
_08002D8A:
subs r2, r3, 0x1
ldr r0, [r4]
ldr r1, [r5]
adds r0, r1
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
adds r2, r0
str r2, [sp]
cmp r2, 0
ble _08002DA4
_08002DA0:
movs r0, 0
str r0, [sp]
_08002DA4:
ldr r2, [sp, 0x4]
cmp r2, 0
blt _08002DC2
adds r2, 0x1
ldr r0, [r4, 0x4]
ldr r1, [r5, 0x4]
adds r0, r1
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
subs r2, r0
str r2, [sp, 0x4]
cmp r2, 0
bge _08002DDC
b _08002DD8
_08002DC2:
subs r2, 0x1
ldr r0, [r4, 0x4]
ldr r1, [r5, 0x4]
adds r0, r1
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
adds r2, r0
str r2, [sp, 0x4]
cmp r2, 0
ble _08002DDC
_08002DD8:
movs r0, 0
str r0, [sp, 0x4]
_08002DDC:
mov r0, sp
bl VecDirection4Radial
lsls r0, 24
asrs r0, 24
add sp, 0x8
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end SizedDeltaDirection4
thumb_func_start SizedDeltaDirection8
SizedDeltaDirection8:
push {r4,r5,lr}
sub sp, 0x8
adds r4, r1, 0
adds r5, r3, 0
ldr r3, [r2]
ldr r1, [r0]
subs r3, r1
str r3, [sp]
ldr r1, [r2, 0x4]
ldr r0, [r0, 0x4]
subs r1, r0
str r1, [sp, 0x4]
adds r2, r3, 0
cmp r2, 0
blt _08002E26
adds r2, 0x1
ldr r0, [r4]
ldr r1, [r5]
adds r0, r1
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
subs r2, r0
str r2, [sp]
cmp r2, 0
bge _08002E40
b _08002E3C
_08002E26:
subs r2, r3, 0x1
ldr r0, [r4]
ldr r1, [r5]
adds r0, r1
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
adds r2, r0
str r2, [sp]
cmp r2, 0
ble _08002E40
_08002E3C:
movs r0, 0
str r0, [sp]
_08002E40:
ldr r2, [sp, 0x4]
cmp r2, 0
blt _08002E5E
adds r2, 0x1
ldr r0, [r4, 0x4]
ldr r1, [r5, 0x4]
adds r0, r1
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
subs r2, r0
str r2, [sp, 0x4]
cmp r2, 0
bge _08002E78
b _08002E74
_08002E5E:
subs r2, 0x1
ldr r0, [r4, 0x4]
ldr r1, [r5, 0x4]
adds r0, r1
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
adds r2, r0
str r2, [sp, 0x4]
cmp r2, 0
ble _08002E78
_08002E74:
movs r0, 0
str r0, [sp, 0x4]
_08002E78:
mov r0, sp
bl VecDirection8Radial
lsls r0, 24
asrs r0, 24
add sp, 0x8
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end SizedDeltaDirection8
.align 2, 0 @ Don't pad with nop.

View File

@@ -1441,263 +1441,4 @@ _0800E7CA:
bx r1
thumb_func_end sub_800E790
thumb_func_start sub_800E7D0
sub_800E7D0:
push {r4-r6,lr}
sub sp, 0x10
adds r4, r0, 0
movs r6, 0
ldrh r0, [r4]
bl sub_800ECB8
movs r1, 0
ldrsh r0, [r0, r1]
str r0, [sp]
ldrh r0, [r4]
bl sub_800ECB8
movs r1, 0x2
ldrsh r0, [r0, r1]
str r0, [sp, 0x4]
ldrh r0, [r4]
bl sub_800ECB8
movs r1, 0x4
ldrsh r0, [r0, r1]
str r0, [sp, 0x8]
ldrh r0, [r4]
bl sub_800ECB8
movs r1, 0x6
ldrsh r0, [r0, r1]
str r0, [sp, 0xC]
movs r5, 0
mov r4, sp
b _0800E812
_0800E80E:
adds r4, 0x4
adds r5, 0x1
_0800E812:
cmp r5, 0x3
bgt _0800E82C
ldr r0, [r4]
bl sub_800ECA4
movs r1, 0
ldr r0, [r0]
cmp r0, 0x4
bne _0800E826
movs r1, 0x1
_0800E826:
adds r6, r1, 0
cmp r6, 0
beq _0800E80E
_0800E82C:
adds r0, r6, 0
add sp, 0x10
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_800E7D0
thumb_func_start sub_800E838
sub_800E838:
push {r4,r5,lr}
sub sp, 0x10
adds r4, r0, 0
adds r5, r1, 0
ldrh r0, [r4]
bl sub_800ECB8
movs r1, 0
ldrsh r0, [r0, r1]
str r0, [sp]
ldrh r0, [r4]
bl sub_800ECB8
movs r1, 0x2
ldrsh r0, [r0, r1]
str r0, [sp, 0x4]
ldrh r0, [r4]
bl sub_800ECB8
movs r1, 0x4
ldrsh r0, [r0, r1]
str r0, [sp, 0x8]
ldrh r0, [r4]
bl sub_800ECB8
movs r1, 0x6
ldrsh r0, [r0, r1]
str r0, [sp, 0xC]
lsls r5, 2
mov r1, sp
adds r0, r1, r5
ldr r0, [r0]
bl sub_800ECA4
movs r1, 0
ldr r0, [r0]
cmp r0, 0x4
bne _0800E886
movs r1, 0x1
_0800E886:
adds r0, r1, 0
add sp, 0x10
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_800E838
thumb_func_start sub_800E890
sub_800E890:
push {r4,lr}
adds r4, r0, 0
ldr r0, [r4]
bl sub_800E900
str r0, [r4, 0x14]
movs r0, 0x7
adds r1, r4, 0
bl sub_800E208
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_800E890
thumb_func_start sub_800E8AC
sub_800E8AC:
push {r4-r7,lr}
adds r4, r1, 0
adds r5, r2, 0
adds r6, r3, 0
ldr r7, [sp, 0x14]
bl sub_800E2C0
adds r1, r0, 0
movs r0, 0x1
negs r0, r0
cmp r1, r0
beq _0800E8F2
ldr r2, _0800E8F8
movs r0, 0xD0
muls r1, r0
ldr r0, [r2]
adds r1, r0, r1
cmp r4, 0
beq _0800E8D6
ldr r0, [r4]
str r0, [r1, 0x18]
_0800E8D6:
cmp r5, 0
beq _0800E8DE
ldr r0, [r5]
str r0, [r1, 0x1C]
_0800E8DE:
ldr r0, _0800E8FC
cmp r6, r0
beq _0800E8E6
str r6, [r1, 0x24]
_0800E8E6:
cmp r7, 0
beq _0800E8F2
adds r1, 0x28
adds r0, r7, 0
ldm r0!, {r2-r4}
stm r1!, {r2-r4}
_0800E8F2:
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0800E8F8: .4byte gUnknown_203B0CC
_0800E8FC: .4byte 0x0000ffff
thumb_func_end sub_800E8AC
thumb_func_start sub_800E900
sub_800E900:
push {lr}
bl sub_800ECA4
ldr r0, [r0, 0x1C]
pop {r1}
bx r1
thumb_func_end sub_800E900
thumb_func_start sub_800E90C
sub_800E90C:
push {r4-r7,lr}
adds r5, r0, 0
movs r7, 0
ldr r0, _0800E938
ldr r4, [r0]
movs r6, 0x1F
_0800E918:
ldr r1, [r4, 0x4]
movs r0, 0x1
negs r0, r0
cmp r1, r0
beq _0800E960
ldr r0, [r4, 0x10]
cmp r0, 0
bgt _0800E94A
ldr r0, [r4, 0x34]
cmp r0, 0x4
bne _0800E93C
adds r0, r4, 0
adds r1, r5, 0
bl sub_800DE8C
b _0800E944
.align 2, 0
_0800E938: .4byte gUnknown_203B0CC
_0800E93C:
adds r0, r4, 0
adds r1, r5, 0
bl sub_800DD0C
_0800E944:
ldr r0, [r4, 0x10]
cmp r0, 0
ble _0800E94E
_0800E94A:
subs r0, 0x1
str r0, [r4, 0x10]
_0800E94E:
adds r0, r4, 0
bl sub_800DCD0
adds r0, r4, 0
adds r0, 0x54
ldrb r0, [r0]
cmp r0, 0
bne _0800E960
movs r7, 0x1
_0800E960:
subs r6, 0x1
adds r4, 0xD0
cmp r6, 0
bge _0800E918
adds r0, r7, 0
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_800E90C
thumb_func_start sub_800E970
sub_800E970:
push {r4,r5,lr}
ldr r0, _0800E9A4
ldr r4, [r0]
movs r5, 0x1F
_0800E978:
ldr r1, [r4, 0x4]
movs r0, 0x1
negs r0, r0
cmp r1, r0
beq _0800E994
ldr r0, [r4, 0x10]
cmp r0, 0
bgt _0800E994
ldr r0, [r4, 0x34]
cmp r0, 0x4
beq _0800E994
adds r0, r4, 0
bl sub_800DE38
_0800E994:
subs r5, 0x1
adds r4, 0xD0
cmp r5, 0
bge _0800E978
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_0800E9A4: .4byte gUnknown_203B0CC
thumb_func_end sub_800E970
.align 2,0

File diff suppressed because it is too large Load Diff

View File

@@ -1,304 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
@ SpriteOAM memes. Same as sub_8013F84 except instead of a 0x60 it's a 0x80
thumb_func_start sub_8013E54
sub_8013E54:
push {r4-r6,lr}
sub sp, 0x8
ldr r6, _08013F60
movs r0, 0
movs r1, 0
str r0, [sp]
str r1, [sp, 0x4]
mov r0, sp
ldrh r0, [r0]
ldr r1, _08013F64
ands r1, r0
ldr r3, _08013F68
ldr r0, [sp]
ands r0, r3
orrs r0, r1
str r0, [sp]
mov r1, sp
ldrh r1, [r1]
adds r2, r3, 0
ands r2, r0
orrs r2, r1
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _08013F6C
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r5, _08013F70
adds r0, r5, 0
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _08013F74
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _08013F78
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
movs r4, 0x80
lsls r4, 7
mov r0, sp
ldrh r1, [r0]
ldr r0, _08013F7C
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
orrs r4, r0
ands r3, r1
orrs r3, r4
str r3, [sp]
mov r3, sp
movs r2, 0xFC
lsls r2, 2
ldrh r1, [r3, 0x4]
movs r0, 0xFC
lsls r0, 8
ands r0, r1
orrs r0, r2
ands r0, r5
movs r2, 0xF
movs r1, 0xF0
lsls r1, 8
ldr r4, _08013F80
ands r0, r4
orrs r0, r1
strh r0, [r3, 0x4]
movs r1, 0x2
ldrsh r0, [r6, r1]
lsls r0, 3
adds r0, 0x80
ands r0, r4
lsls r0, 4
ldrh r1, [r3, 0x6]
ands r2, r1
orrs r2, r0
strh r2, [r3, 0x6]
movs r0, 0x70
strh r0, [r3, 0x2]
movs r1, 0x80
lsls r1, 1
mov r0, sp
movs r2, 0
movs r3, 0
bl AddSprite
add sp, 0x8
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08013F60: .4byte gUnknown_2027370
_08013F64: .4byte 0x0000feff
_08013F68: .4byte 0xffff0000
_08013F6C: .4byte 0x0000fdff
_08013F70: .4byte 0x0000f3ff
_08013F74: .4byte 0x0000efff
_08013F78: .4byte 0x0000dfff
_08013F7C: .4byte 0x00003fff
_08013F80: .4byte 0x00000fff
thumb_func_end sub_8013E54
@ SpriteOAM memes https://decomp.me/scratch/GROyH
thumb_func_start sub_8013F84
sub_8013F84:
push {r4-r6,lr}
sub sp, 0x8
ldr r6, _08014090
movs r0, 0
movs r1, 0
str r0, [sp]
str r1, [sp, 0x4]
mov r0, sp
ldrh r0, [r0]
ldr r1, _08014094
ands r1, r0
ldr r3, _08014098
ldr r0, [sp]
ands r0, r3
orrs r0, r1
str r0, [sp]
mov r1, sp
ldrh r1, [r1]
adds r2, r3, 0
ands r2, r0
orrs r2, r1
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _0801409C
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r5, _080140A0
adds r0, r5, 0
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _080140A4
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _080140A8
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
movs r4, 0x80
lsls r4, 7
mov r0, sp
ldrh r1, [r0]
ldr r0, _080140AC
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
orrs r4, r0
ands r3, r1
orrs r3, r4
str r3, [sp]
mov r3, sp
movs r2, 0xFC
lsls r2, 2
ldrh r1, [r3, 0x4]
movs r0, 0xFC
lsls r0, 8
ands r0, r1
orrs r0, r2
ands r0, r5
movs r2, 0xF
movs r1, 0xF0
lsls r1, 8
ldr r4, _080140B0
ands r0, r4
orrs r0, r1
strh r0, [r3, 0x4]
movs r1, 0x2
ldrsh r0, [r6, r1]
lsls r0, 3
adds r0, 0x60
ands r0, r4
lsls r0, 4
ldrh r1, [r3, 0x6]
ands r2, r1
orrs r2, r0
strh r2, [r3, 0x6]
movs r0, 0x70
strh r0, [r3, 0x2]
movs r1, 0x80
lsls r1, 1
mov r0, sp
movs r2, 0
movs r3, 0
bl AddSprite
add sp, 0x8
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08014090: .4byte gUnknown_2027370
_08014094: .4byte 0x0000feff
_08014098: .4byte 0xffff0000
_0801409C: .4byte 0x0000fdff
_080140A0: .4byte 0x0000f3ff
_080140A4: .4byte 0x0000efff
_080140A8: .4byte 0x0000dfff
_080140AC: .4byte 0x00003fff
_080140B0: .4byte 0x00000fff
thumb_func_end sub_8013F84
.align 2,0

View File

@@ -159,373 +159,4 @@ _08042384:
bx r0
thumb_func_end sub_804225C
thumb_func_start sub_8042390
sub_8042390:
push {r4-r6,lr}
sub sp, 0x18
adds r5, r0, 0
adds r4, r1, 0
bl sub_8042768
lsls r0, 24
cmp r0, 0
beq _08042454
ldrb r1, [r4]
movs r0, 0x8
ands r0, r1
movs r6, 0
cmp r0, 0
bne _080423B0
ldrb r6, [r4, 0x2]
_080423B0:
adds r0, r6, 0
movs r1, 0
bl sub_800EF40
bl sub_800EF64
movs r0, 0x4
movs r1, 0x42
bl sub_803E708
ldr r0, [r5, 0xC]
cmp r0, 0
bge _080423CC
adds r0, 0xFF
_080423CC:
lsls r0, 8
lsrs r0, 16
ldr r1, _08042428
ldr r2, [sp, 0x14]
ands r2, r1
orrs r2, r0
str r2, [sp, 0x14]
ldr r0, [r5, 0x10]
cmp r0, 0
bge _080423E2
adds r0, 0xFF
_080423E2:
lsls r0, 8
lsrs r0, 16
lsls r0, 16
ldr r4, _0804242C
ands r4, r2
orrs r4, r0
str r4, [sp, 0x14]
asrs r4, 16
ldr r0, _08042430
ldr r0, [r0]
ldr r1, _08042434
adds r0, r1
movs r1, 0
ldrsh r0, [r0, r1]
subs r4, r0
lsrs r0, r4, 31
adds r4, r0
asrs r4, 1
adds r4, 0x1
adds r1, r5, 0
adds r1, 0x28
add r0, sp, 0x4
bl sub_8005700
add r1, sp, 0x14
str r4, [sp]
adds r0, r6, 0
add r2, sp, 0x4
movs r3, 0
bl sub_800E49C
adds r5, r0, 0
movs r4, 0
ldr r6, _08042438
b _0804243E
.align 2, 0
_08042428: .4byte 0xffff0000
_0804242C: .4byte 0x0000ffff
_08042430: .4byte gDungeon
_08042434: .4byte 0x000181f2
_08042438: .4byte 0x000003e7
_0804243C:
adds r4, 0x1
_0804243E:
cmp r4, r6
bgt _08042454
movs r0, 0x42
bl sub_803E46C
adds r0, r5, 0
bl sub_800E9A8
lsls r0, 24
cmp r0, 0
bne _0804243C
_08042454:
add sp, 0x18
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_8042390
thumb_func_start sub_804245C
sub_804245C:
push {r4-r6,lr}
sub sp, 0x18
adds r5, r0, 0
adds r4, r1, 0
bl sub_8042768
lsls r0, 24
cmp r0, 0
beq _08042518
ldrb r1, [r4]
movs r0, 0x8
ands r0, r1
movs r6, 0
cmp r0, 0
bne _0804247C
ldrb r6, [r4, 0x2]
_0804247C:
bl sub_800EF64
movs r0, 0x4
movs r1, 0x42
bl sub_803E708
ldr r0, [r5, 0xC]
cmp r0, 0
bge _08042490
adds r0, 0xFF
_08042490:
lsls r0, 8
lsrs r0, 16
ldr r1, _080424EC
ldr r2, [sp, 0x14]
ands r2, r1
orrs r2, r0
str r2, [sp, 0x14]
ldr r0, [r5, 0x10]
cmp r0, 0
bge _080424A6
adds r0, 0xFF
_080424A6:
lsls r0, 8
lsrs r0, 16
lsls r0, 16
ldr r4, _080424F0
ands r4, r2
orrs r4, r0
str r4, [sp, 0x14]
asrs r4, 16
ldr r0, _080424F4
ldr r0, [r0]
ldr r1, _080424F8
adds r0, r1
movs r1, 0
ldrsh r0, [r0, r1]
subs r4, r0
lsrs r0, r4, 31
adds r4, r0
asrs r4, 1
adds r4, 0x1
adds r1, r5, 0
adds r1, 0x28
add r0, sp, 0x4
bl sub_8005700
add r1, sp, 0x14
str r4, [sp]
adds r0, r6, 0
add r2, sp, 0x4
movs r3, 0x1
bl sub_800E49C
adds r5, r0, 0
movs r4, 0
ldr r6, _080424FC
b _08042502
.align 2, 0
_080424EC: .4byte 0xffff0000
_080424F0: .4byte 0x0000ffff
_080424F4: .4byte gDungeon
_080424F8: .4byte 0x000181f2
_080424FC: .4byte 0x000003e7
_08042500:
adds r4, 0x1
_08042502:
cmp r4, r6
bgt _08042518
movs r0, 0x42
bl sub_803E46C
adds r0, r5, 0
bl sub_800E9A8
lsls r0, 24
cmp r0, 0
bne _08042500
_08042518:
add sp, 0x18
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_804245C
@ https://decomp.me/scratch/nTem0 (kermalis 89.31%) `s32 sub_8042520(Entity *)`
thumb_func_start sub_8042520
sub_8042520:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x3C
adds r4, r0, 0
bl sub_8045888
lsls r0, 24
cmp r0, 0
bne _0804253A
b _08042664
_0804253A:
ldr r0, [r4, 0x70]
adds r0, 0x46
ldrb r5, [r0]
ldr r0, [r4, 0xC]
cmp r0, 0
bge _08042548
adds r0, 0xFF
_08042548:
lsls r0, 8
lsrs r0, 16
ldr r1, _0804264C
ldr r2, [sp, 0x2C]
ands r2, r1
orrs r2, r0
str r2, [sp, 0x2C]
ldr r0, [r4, 0x10]
cmp r0, 0
bge _0804255E
adds r0, 0xFF
_0804255E:
lsls r0, 8
lsrs r0, 16
lsls r0, 16
ldr r1, _08042650
ands r1, r2
orrs r1, r0
str r1, [sp, 0x2C]
asrs r1, 16
ldr r0, _08042654
ldr r0, [r0]
ldr r2, _08042658
adds r0, r2
movs r2, 0
ldrsh r0, [r0, r2]
subs r1, r0
lsrs r0, r1, 31
adds r1, r0
asrs r7, r1, 1
ldr r0, _0804265C
str r0, [sp, 0x4]
movs r2, 0
str r2, [sp, 0x8]
str r5, [sp, 0xC]
add r1, sp, 0x4
add r4, sp, 0x2C
ldrh r0, [r4]
strh r0, [r1, 0xC]
ldr r0, [sp, 0x2C]
asrs r0, 16
strh r0, [r1, 0xE]
adds r0, r1, 0
strh r2, [r0, 0x10]
strh r2, [r0, 0x12]
movs r0, 0x1
negs r0, r0
str r0, [sp, 0x18]
str r7, [sp, 0x1C]
add r0, sp, 0x20
bl sub_8004E8C
add r0, sp, 0x4
movs r1, 0
bl sub_8041764
adds r6, r0, 0
mov r10, r4
lsls r1, r5, 2
mov r0, sp
adds r0, 0x30
str r0, [sp, 0x38]
ldr r0, _08042660
adds r5, r1, r0
movs r1, 0x5
mov r8, r1
mov r9, r10
_080425CC:
movs r0, 0
str r0, [sp]
adds r0, r6, 0
adds r1, r4, 0
movs r2, 0
adds r3, r7, 0
bl sub_800E8AC
movs r0, 0x42
bl sub_803E46C
movs r2, 0
ldrsh r0, [r5, r2]
lsls r0, 2
mov r1, r9
ldrh r1, [r1]
adds r0, r1
mov r2, r9
strh r0, [r2]
movs r0, 0x2
ldrsh r1, [r5, r0]
lsls r1, 2
ldrh r0, [r4, 0x2]
adds r0, r1
strh r0, [r4, 0x2]
movs r2, 0x2
ldrsh r1, [r4, r2]
ldr r0, _08042654
ldr r0, [r0]
ldr r2, _08042658
adds r0, r2
movs r2, 0
ldrsh r0, [r0, r2]
subs r1, r0
lsrs r0, r1, 31
adds r1, r0
asrs r7, r1, 1
movs r0, 0x1
negs r0, r0
add r8, r0
mov r1, r8
cmp r1, 0
bge _080425CC
bl sub_800DBBC
mov r2, r10
movs r1, 0
ldrsh r0, [r2, r1]
lsls r0, 8
str r0, [sp, 0x30]
add r0, sp, 0x2C
movs r2, 0x2
ldrsh r0, [r0, r2]
lsls r0, 8
ldr r1, [sp, 0x38]
str r0, [r1, 0x4]
movs r1, 0xD0
lsls r1, 1
ldr r0, [sp, 0x38]
movs r2, 0x1
bl sub_80416E0
adds r6, r0, 0
b _08042668
.align 2, 0
_0804264C: .4byte 0xffff0000
_08042650: .4byte 0x0000ffff
_08042654: .4byte gDungeon
_08042658: .4byte 0x000181f2
_0804265C: .4byte 0x00000165
_08042660: .4byte gAdjacentTileOffsets
_08042664:
movs r6, 0x1
negs r6, r6
_08042668:
adds r0, r6, 0
add sp, 0x3C
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8042520
.align 2,0

View File

@@ -5,40 +5,6 @@
.text
thumb_func_start sub_8047158
sub_8047158:
push {r4-r6,lr}
movs r3, 0
ldr r5, _0804718C
movs r6, 0x1
movs r4, 0x4
_08047162:
lsls r1, r3, 2
ldr r0, [r5]
adds r2, r0, r1
ldrb r1, [r2]
adds r0, r6, 0
ands r0, r1
cmp r0, 0
beq _08047180
adds r0, r4, 0
ands r0, r1
cmp r0, 0
beq _08047180
movs r0, 0xFB
ands r0, r1
strb r0, [r2]
_08047180:
adds r3, 0x1
cmp r3, 0x13
ble _08047162
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_0804718C: .4byte gTeamInventoryRef
thumb_func_end sub_8047158
thumb_func_start sub_8047190
sub_8047190:
push {r4-r7,lr}

File diff suppressed because it is too large Load Diff

View File

@@ -2593,554 +2593,4 @@ _080682F6:
bx r0
thumb_func_end sub_806806C
thumb_func_start sub_8068310
sub_8068310:
push {r4-r6,lr}
movs r4, 0
ldr r6, _08068340
cmp r4, r0
bge _08068338
movs r5, 0x80
lsls r5, 8
adds r3, r1, 0
adds r2, r0, 0
_08068322:
ldr r0, [r3]
ldrh r1, [r0]
adds r0, r5, 0
ands r0, r1
cmp r0, 0
beq _08068330
adds r4, 0x1
_08068330:
adds r3, 0x4
subs r2, 0x1
cmp r2, 0
bne _08068322
_08068338:
str r4, [r6]
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08068340: .4byte gUnknown_202F310
thumb_func_end sub_8068310
thumb_func_start sub_8068344
sub_8068344:
push {r4-r6,lr}
mov r6, r9
mov r5, r8
push {r5,r6}
sub sp, 0x8
ldr r0, _08068494
ldr r0, [r0]
movs r1, 0x8
ands r0, r1
cmp r0, 0
bne _0806835C
b _08068486
_0806835C:
ldr r0, _08068498
mov r9, r0
movs r0, 0
movs r1, 0
str r0, [sp]
str r1, [sp, 0x4]
mov r0, sp
ldrh r0, [r0]
ldr r1, _0806849C
ands r1, r0
ldr r3, _080684A0
ldr r0, [sp]
ands r0, r3
orrs r0, r1
str r0, [sp]
mov r1, sp
ldrh r1, [r1]
adds r2, r3, 0
ands r2, r0
orrs r2, r1
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _080684A4
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r6, _080684A8
mov r8, r6
mov r0, r8
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _080684AC
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _080684B0
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
movs r4, 0x80
lsls r4, 7
mov r0, sp
ldrh r1, [r0]
ldr r6, _080684B4
adds r0, r6, 0
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
orrs r4, r0
ands r3, r1
orrs r3, r4
str r3, [sp]
movs r1, 0x80
lsls r1, 6
mov r5, sp
ldrh r0, [r5, 0x2]
ldr r2, _080684B8
ands r2, r0
orrs r2, r1
ands r2, r6
movs r3, 0xFC
lsls r3, 2
ldrh r1, [r5, 0x4]
movs r0, 0xFC
lsls r0, 8
ands r0, r1
orrs r0, r3
mov r1, r8
ands r0, r1
movs r3, 0xF
movs r1, 0xF0
lsls r1, 8
ldr r4, _080684BC
ands r0, r4
orrs r0, r1
strh r0, [r5, 0x4]
mov r6, r9
movs r1, 0x2
ldrsh r0, [r6, r1]
lsls r0, 3
adds r0, 0x8
ands r0, r4
lsls r0, 4
ldrh r1, [r5, 0x6]
ands r3, r1
orrs r3, r0
strh r3, [r5, 0x6]
movs r3, 0
ldrsh r0, [r6, r3]
lsls r0, 3
adds r0, 0x40
ldr r1, _080684C0
ands r0, r1
movs r1, 0xFE
lsls r1, 8
ands r2, r1
orrs r2, r0
strh r2, [r5, 0x2]
movs r1, 0x80
lsls r1, 1
mov r0, sp
movs r2, 0
movs r3, 0
bl AddSprite
_08068486:
add sp, 0x8
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08068494: .4byte gUnknown_202EDCC
_08068498: .4byte gUnknown_2027370
_0806849C: .4byte 0x0000feff
_080684A0: .4byte 0xffff0000
_080684A4: .4byte 0x0000fdff
_080684A8: .4byte 0x0000f3ff
_080684AC: .4byte 0x0000efff
_080684B0: .4byte 0x0000dfff
_080684B4: .4byte 0x00003fff
_080684B8: .4byte 0x0000c1ff
_080684BC: .4byte 0x00000fff
_080684C0: .4byte 0x000001ff
thumb_func_end sub_8068344
thumb_func_start sub_80684C4
sub_80684C4:
push {r4-r6,lr}
sub sp, 0x8
ldr r0, _080685E8
ldr r0, [r0]
movs r1, 0x8
ands r0, r1
cmp r0, 0
bne _080684D6
b _080685DE
_080684D6:
ldr r6, _080685EC
movs r0, 0
movs r1, 0
str r0, [sp]
str r1, [sp, 0x4]
mov r0, sp
ldrh r0, [r0]
ldr r1, _080685F0
ands r1, r0
ldr r3, _080685F4
ldr r0, [sp]
ands r0, r3
orrs r0, r1
str r0, [sp]
mov r1, sp
ldrh r1, [r1]
adds r2, r3, 0
ands r2, r0
orrs r2, r1
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _080685F8
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r5, _080685FC
adds r0, r5, 0
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _08068600
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
mov r0, sp
ldrh r1, [r0]
ldr r0, _08068604
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
adds r2, r3, 0
ands r2, r1
orrs r2, r0
str r2, [sp]
movs r4, 0x80
lsls r4, 7
mov r0, sp
ldrh r1, [r0]
ldr r0, _08068608
ands r0, r1
adds r1, r3, 0
ands r1, r2
orrs r1, r0
str r1, [sp]
mov r0, sp
ldrh r0, [r0]
orrs r4, r0
ands r3, r1
orrs r3, r4
str r3, [sp]
mov r3, sp
movs r2, 0xFC
lsls r2, 2
ldrh r1, [r3, 0x4]
movs r0, 0xFC
lsls r0, 8
ands r0, r1
orrs r0, r2
ands r0, r5
movs r2, 0xF
movs r1, 0xF0
lsls r1, 8
ldr r4, _0806860C
ands r0, r4
orrs r0, r1
strh r0, [r3, 0x4]
movs r1, 0x2
ldrsh r0, [r6, r1]
lsls r0, 3
adds r0, 0x70
ands r0, r4
lsls r0, 4
ldrh r1, [r3, 0x6]
ands r2, r1
orrs r2, r0
strh r2, [r3, 0x6]
movs r1, 0
ldrsh r0, [r6, r1]
lsls r0, 3
adds r0, 0x40
ldr r1, _08068610
ands r0, r1
strh r0, [r3, 0x2]
subs r1, 0xFF
mov r0, sp
movs r2, 0
movs r3, 0
bl AddSprite
_080685DE:
add sp, 0x8
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_080685E8: .4byte gUnknown_202EDCC
_080685EC: .4byte gUnknown_2027370
_080685F0: .4byte 0x0000feff
_080685F4: .4byte 0xffff0000
_080685F8: .4byte 0x0000fdff
_080685FC: .4byte 0x0000f3ff
_08068600: .4byte 0x0000efff
_08068604: .4byte 0x0000dfff
_08068608: .4byte 0x00003fff
_0806860C: .4byte 0x00000fff
_08068610: .4byte 0x000001ff
thumb_func_end sub_80684C4
thumb_func_start sub_8068614
sub_8068614:
push {lr}
ldr r0, _0806862C
ldr r1, _08068630
bl OpenFileAndGetFileDataPtr
ldr r1, _08068634
ldr r1, [r1]
ldr r2, _08068638
adds r1, r2
str r0, [r1]
pop {r0}
bx r0
.align 2, 0
_0806862C: .4byte gUnknown_8106E98
_08068630: .4byte gMonsterFileArchive
_08068634: .4byte gDungeon
_08068638: .4byte 0x000181e4
thumb_func_end sub_8068614
thumb_func_start sub_806863C
sub_806863C:
push {lr}
ldr r0, _08068650
ldr r0, [r0]
ldr r1, _08068654
adds r0, r1
ldr r0, [r0]
bl CloseFile
pop {r0}
bx r0
.align 2, 0
_08068650: .4byte gDungeon
_08068654: .4byte 0x000181e4
thumb_func_end sub_806863C
thumb_func_start LoadDungeonPokemonSprites
LoadDungeonPokemonSprites:
push {r4-r6,lr}
movs r4, 0
ldr r6, _08068740
ldr r5, _08068744
ldr r3, _08068748
movs r2, 0
_08068664:
ldr r0, [r5]
lsls r1, r4, 2
adds r0, r3
adds r0, r1
str r2, [r0]
adds r4, 0x1
cmp r4, r6
ble _08068664
ldr r0, _0806874C
movs r1, 0x1
bl LoadPokemonSprite
movs r4, 0
ldr r1, _08068744
ldr r0, [r1]
ldr r2, _08068750
adds r0, r2
ldr r0, [r0]
cmp r4, r0
bge _080686B2
adds r6, r1, 0
ldr r5, _08068754
_08068690:
ldr r0, [r6]
adds r0, r5
bl ExtractSpeciesIndex
lsls r0, 16
asrs r0, 16
movs r1, 0x1
bl LoadPokemonSprite
adds r5, 0x8
adds r4, 0x1
ldr r0, [r6]
ldr r1, _08068750
adds r0, r1
ldr r0, [r0]
cmp r4, r0
blt _08068690
_080686B2:
ldr r0, _08068744
ldr r0, [r0]
movs r2, 0xD1
lsls r2, 3
adds r1, r0, r2
movs r2, 0
ldrsh r0, [r1, r2]
cmp r0, 0
beq _080686CA
movs r1, 0x1
bl LoadPokemonSprite
_080686CA:
movs r4, 0
ldr r6, _08068758
movs r5, 0x1
_080686D0:
movs r0, 0x64
muls r0, r4
ldr r1, _0806875C
adds r0, r1
ldr r1, [r6]
adds r1, r0
ldrh r2, [r1]
adds r0, r5, 0
ands r0, r2
cmp r0, 0
beq _080686F8
lsrs r0, r2, 1
ands r0, r5
cmp r0, 0
beq _080686F8
movs r2, 0xE
ldrsh r0, [r1, r2]
movs r1, 0
bl LoadPokemonSprite
_080686F8:
adds r4, 0x1
cmp r4, 0x3
ble _080686D0
ldr r0, _08068744
ldr r0, [r0]
ldr r1, _08068760
adds r0, r1
movs r2, 0
ldrsh r0, [r0, r2]
cmp r0, 0x31
bne _08068738
movs r4, 0
ldr r5, _08068758
_08068712:
movs r0, 0x58
muls r0, r4
ldr r1, _08068764
adds r0, r1
ldr r1, [r5]
adds r2, r1, r0
ldrb r1, [r2]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08068732
movs r1, 0x8
ldrsh r0, [r2, r1]
movs r1, 0x1
bl LoadPokemonSprite
_08068732:
adds r4, 0x1
cmp r4, 0x3
ble _08068712
_08068738:
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08068740: .4byte 0x000001a7
_08068744: .4byte gDungeon
_08068748: .4byte 0x00017b44
_0806874C: .4byte 0x000001a5
_08068750: .4byte 0x000037e4
_08068754: .4byte 0x0000343c
_08068758: .4byte gRecruitedPokemonRef
_0806875C: .4byte 0x00008df8
_08068760: .4byte 0x00003a14
_08068764: .4byte 0x00008f88
thumb_func_end LoadDungeonPokemonSprites
.align 2,0

View File

@@ -1,416 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_80732F0
sub_80732F0:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x14
movs r4, 0
_080732FE:
movs r5, 0
ldr r0, _0807335C
ldr r0, [r0]
lsls r1, r4, 2
ldr r2, _08073360
adds r0, r2
adds r0, r1
ldr r0, [r0]
mov r8, r0
bl EntityIsValid
lsls r0, 24
adds r4, 0x1
str r4, [sp, 0x10]
cmp r0, 0
bne _08073320
b _08073472
_08073320:
mov r0, r8
ldr r7, [r0, 0x70]
movs r1, 0xB2
lsls r1, 1
adds r4, r7, r1
ldrb r0, [r4]
cmp r0, 0xFF
bne _08073332
b _08073472
_08073332:
adds r2, r0, 0
mov r9, r2
mov r0, r8
movs r1, 0x1
bl CannotAttack
lsls r0, 24
cmp r0, 0
bne _0807336E
mov r0, r8
bl IsSleeping
lsls r0, 24
cmp r0, 0
bne _08073364
ldrb r0, [r4]
movs r2, 0xFF
orrs r0, r2
strb r0, [r4]
b _08073472
.align 2, 0
_0807335C: .4byte gDungeon
_08073360: .4byte 0x000135cc
_08073364:
adds r0, r7, 0
adds r0, 0xEC
ldrb r0, [r0]
cmp r0, 0x1
bne _08073378
_0807336E:
ldrb r0, [r4]
movs r1, 0xFF
orrs r0, r1
strb r0, [r4]
b _08073472
_08073378:
movs r0, 0x4
bl DungeonRandInt
adds r3, r0, 0
movs r4, 0
_08073382:
lsls r0, r3, 3
movs r2, 0x8C
lsls r2, 1
adds r0, r2
adds r2, r7, r0
ldrb r1, [r2]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08073448
ldr r0, [r2]
ldr r1, [r2, 0x4]
str r0, [sp, 0x8]
str r1, [sp, 0xC]
ldr r1, [sp, 0x8]
lsrs r0, r1, 16
cmp r0, 0x8A
beq _08073448
adds r1, r0, 0
ldr r0, _08073434
cmp r1, r0
beq _08073448
movs r6, 0
movs r0, 0x46
adds r0, r7
mov r10, r0
movs r1, 0x8C
lsls r1, 1
adds r4, r7, r1
_080733BC:
lsls r0, r6, 3
movs r2, 0x8C
lsls r2, 1
adds r0, r2
adds r5, r7, r0
ldrb r1, [r4]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _080733F4
ldrb r0, [r7, 0x7]
cmp r0, 0
bne _080733DE
movs r0, 0x4
ands r0, r1
cmp r0, 0
beq _080733F4
_080733DE:
ldrh r0, [r4, 0x2]
cmp r0, 0xE3
bne _080733F4
mov r0, r8
adds r1, r5, 0
movs r2, 0x1
bl CanMonsterUseMove
lsls r0, 24
cmp r0, 0
bne _08073440
_080733F4:
adds r4, 0x8
adds r6, 0x1
cmp r6, 0x3
ble _080733BC
_080733FC:
ldr r0, _08073438
mov r1, r8
movs r2, 0
bl SubstitutePlaceholderStringTags
ldr r0, _0807343C
ldr r1, [r0]
mov r0, r8
bl LogMessageByIdWithPopupCheckUser
movs r0, 0x7
mov r1, r9
ands r1, r0
movs r0, 0
mov r2, r10
strb r1, [r2]
str r0, [sp]
add r0, sp, 0x8
str r0, [sp, 0x4]
mov r0, r8
movs r1, 0
movs r2, 0
movs r3, 0x1
bl TryUseChosenMove
movs r5, 0x1
b _08073456
.align 2, 0
_08073434: .4byte 0x00000147
_08073438: .4byte gFormatBuffer_Monsters
_0807343C: .4byte gUnknown_80FCF38
_08073440:
adds r0, r5, 0x4
bl sub_80838EC
b _080733FC
_08073448:
adds r3, 0x1
cmp r3, 0x4
bne _08073450
movs r3, 0
_08073450:
adds r4, 0x1
cmp r4, 0x3
ble _08073382
_08073456:
movs r2, 0xB2
lsls r2, 1
adds r1, r7, r2
ldrb r0, [r1]
movs r2, 0xFF
orrs r0, r2
strb r0, [r1]
cmp r5, 0
beq _08073472
mov r0, r8
movs r1, 0xB8
lsls r1, 2
bl sub_80421C0
_08073472:
ldr r4, [sp, 0x10]
cmp r4, 0x13
bgt _0807347A
b _080732FE
_0807347A:
add sp, 0x14
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80732F0
thumb_func_start sub_807348C
sub_807348C:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x18
movs r4, 0
movs r0, 0xFF
mov r9, r0
_0807349E:
ldr r0, _080734E8
ldr r0, [r0]
lsls r1, r4, 2
ldr r2, _080734EC
adds r0, r2
adds r0, r1
ldr r7, [r0]
adds r0, r7, 0
bl EntityIsValid
lsls r0, 24
adds r4, 0x1
str r4, [sp, 0x10]
cmp r0, 0
bne _080734BE
b _080735E6
_080734BE:
ldr r6, [r7, 0x70]
ldr r0, _080734F0
adds r4, r6, r0
ldrb r0, [r4]
cmp r0, 0xFF
bne _080734CC
b _080735E6
_080734CC:
adds r1, r0, 0
mov r8, r1
adds r0, r7, 0
movs r1, 0x1
bl CannotAttack
lsls r0, 24
cmp r0, 0
beq _080734F4
ldrb r0, [r4]
mov r2, r9
orrs r0, r2
strb r0, [r4]
b _080735DA
.align 2, 0
_080734E8: .4byte gDungeon
_080734EC: .4byte 0x000135cc
_080734F0: .4byte 0x00000165
_080734F4:
adds r0, r7, 0
bl IsSleeping
lsls r0, 24
cmp r0, 0
bne _08073514
ldrb r0, [r4]
mov r1, r9
orrs r0, r1
strb r0, [r4]
movs r2, 0xB2
lsls r2, 1
adds r1, r6, r2
ldrb r0, [r1]
mov r2, r9
b _080735E2
_08073514:
adds r0, r6, 0
adds r0, 0xEC
ldrb r0, [r0]
cmp r0, 0x1
bne _0807354A
ldrb r0, [r4]
mov r1, r9
orrs r0, r1
strb r0, [r4]
movs r2, 0xB2
lsls r2, 1
adds r1, r6, r2
ldrb r0, [r1]
mov r2, r9
b _080735E2
_08073532:
ldr r0, [r5]
ldr r1, [r5, 0x4]
str r0, [sp, 0x8]
str r1, [sp, 0xC]
adds r0, r5, 0x4
bl sub_80838EC
adds r0, r7, 0
adds r1, r5, 0
bl MarkLastUsedMonMove
b _0807359C
_0807354A:
movs r3, 0
movs r0, 0x46
adds r0, r6
mov r10, r0
movs r1, 0x8C
lsls r1, 1
adds r4, r6, r1
_08073558:
lsls r0, r3, 3
movs r2, 0x8C
lsls r2, 1
adds r0, r2
adds r5, r6, r0
ldrb r1, [r4]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _08073594
ldrb r0, [r6, 0x7]
cmp r0, 0
bne _0807357A
movs r0, 0x4
ands r0, r1
cmp r0, 0
beq _08073594
_0807357A:
ldrh r0, [r4, 0x2]
cmp r0, 0x19
bne _08073594
adds r0, r7, 0
adds r1, r5, 0
movs r2, 0x1
str r3, [sp, 0x14]
bl CanMonsterUseMove
lsls r0, 24
ldr r3, [sp, 0x14]
cmp r0, 0
bne _08073532
_08073594:
adds r4, 0x8
adds r3, 0x1
cmp r3, 0x3
ble _08073558
_0807359C:
ldr r0, _08073600
adds r1, r7, 0
movs r2, 0
bl SubstitutePlaceholderStringTags
ldr r0, _08073604
ldr r1, [r0]
adds r0, r7, 0
bl LogMessageByIdWithPopupCheckUser
movs r0, 0x7
mov r1, r8
ands r1, r0
movs r0, 0
mov r2, r10
strb r1, [r2]
str r0, [sp]
add r0, sp, 0x8
str r0, [sp, 0x4]
adds r0, r7, 0
movs r1, 0
movs r2, 0
movs r3, 0x1
bl TryUseChosenMove
ldr r2, _08073608
adds r1, r6, r2
ldrb r0, [r1]
mov r2, r9
orrs r0, r2
strb r0, [r1]
_080735DA:
movs r0, 0xB2
lsls r0, 1
adds r1, r6, r0
ldrb r0, [r1]
_080735E2:
orrs r0, r2
strb r0, [r1]
_080735E6:
ldr r4, [sp, 0x10]
cmp r4, 0x13
bgt _080735EE
b _0807349E
_080735EE:
add sp, 0x18
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08073600: .4byte gFormatBuffer_Monsters
_08073604: .4byte gUnknown_80FCF50
_08073608: .4byte 0x00000165
thumb_func_end sub_807348C
.align 2, 0

View File

@@ -1,298 +0,0 @@
#include "asm/constants/gba_constants.inc"
#include "asm/macros.inc"
.syntax unified
.text
thumb_func_start sub_80990EC
sub_80990EC:
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x80
adds r7, r0, 0
lsls r1, 16
asrs r4, r1, 16
adds r0, r4, 0
bl GetDungeonInfo_80A2608
mov r8, r0
ldrb r0, [r0, 0xC]
movs r5, 0
strb r0, [r7]
movs r0, 0x1
strb r0, [r7, 0x1]
strb r5, [r7, 0xC]
adds r0, r4, 0
bl sub_80A2750
lsls r0, 16
asrs r6, r0, 16
cmp r6, 0x2
beq _080991C8
cmp r6, 0x2
bgt _08099126
cmp r6, 0x1
beq _0809912C
b _080991CA
_08099126:
cmp r6, 0x4
beq _080991C4
b _080991CA
_0809912C:
movs r1, 0
strb r5, [r7, 0xB]
adds r0, r4, 0
subs r0, 0x25
lsls r0, 16
lsrs r0, 16
cmp r0, 0x2
bhi _0809913E
movs r1, 0x1
_0809913E:
cmp r1, 0
beq _080991CA
strb r6, [r7, 0xC]
mov r0, sp
movs r1, 0x5B
bl sub_80A8EC0
add r4, sp, 0x18
adds r0, r4, 0
mov r1, sp
movs r2, 0xA
bl BoundedCopyStringtoBuffer
add r5, sp, 0x30
str r4, [sp, 0x58]
add r1, sp, 0x5C
movs r2, 0
movs r0, 0x5E
strh r0, [r1]
mov r0, sp
adds r0, 0x5E
strb r2, [r0]
add r0, sp, 0x60
movs r1, 0x47
strb r1, [r0]
strb r2, [r0, 0x1]
add r1, sp, 0x64
movs r0, 0x82
lsls r0, 1
strh r0, [r1]
movs r0, 0xE0
strh r0, [r1, 0x2]
movs r0, 0xAC
strh r0, [r1, 0x4]
movs r0, 0xBE
strh r0, [r1, 0x6]
add r1, sp, 0x6C
movs r0, 0x50
strh r0, [r1]
mov r0, sp
adds r0, 0x6E
movs r2, 0xF
strh r2, [r0]
add r0, sp, 0x70
strh r6, [r0]
adds r0, 0x2
movs r1, 0x19
strh r1, [r0]
strh r1, [r0, 0x2]
adds r0, 0x4
strh r2, [r0]
strh r2, [r0, 0x2]
ldr r0, _080991C0
str r0, [sp, 0x7C]
add r1, sp, 0x58
adds r0, r5, 0
movs r2, 0x28
bl memcpy
adds r0, r7, 0
adds r0, 0x18
adds r1, r5, 0
bl sub_808D144
b _080991CA
.align 2, 0
_080991C0: .4byte 0x000061a8
_080991C4:
strb r5, [r7, 0xB]
b _080991CA
_080991C8:
strb r6, [r7, 0xB]
_080991CA:
movs r0, 0
strb r0, [r7, 0x4]
strb r0, [r7, 0xD]
mov r1, r8
ldrb r0, [r1, 0x11]
add sp, 0x80
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_80990EC
thumb_func_start sub_80991E0
sub_80991E0:
push {lr}
adds r2, r0, 0
ldr r3, _08099204
ldrh r0, [r3]
strh r0, [r1]
ldr r0, _08099208
ldrb r0, [r0]
cmp r0, 0
bne _0809920C
movs r0, 0
ldrsh r1, [r3, r0]
adds r0, r2, 0
bl sub_80990EC
lsls r0, 24
lsrs r0, 24
b _08099218
.align 2, 0
_08099204: .4byte gUnknown_20398C4
_08099208: .4byte gUnknown_203B49C
_0809920C:
ldr r1, _0809921C
adds r0, r2, 0
movs r2, 0x88
bl memcpy
movs r0, 0x1
_08099218:
pop {r1}
bx r1
.align 2, 0
_0809921C: .4byte gUnknown_20398C8
thumb_func_end sub_80991E0
thumb_func_start sub_8099220
sub_8099220:
push {lr}
adds r2, r0, 0
lsls r1, 16
asrs r3, r1, 16
cmp r2, 0
beq _08099258
ldr r1, _08099248
movs r0, 0x1
strb r0, [r1]
ldr r1, _0809924C
movs r0, 0
strb r0, [r1]
ldr r0, _08099250
strh r3, [r0]
ldr r0, _08099254
adds r1, r2, 0
movs r2, 0x88
bl memcpy
b _0809926A
.align 2, 0
_08099248: .4byte gUnknown_203B49C
_0809924C: .4byte gUnknown_203B49D
_08099250: .4byte gUnknown_20398C4
_08099254: .4byte gUnknown_20398C8
_08099258:
ldr r0, _08099270
strb r2, [r0]
ldr r0, _08099274
strb r2, [r0]
ldr r1, _08099278
movs r2, 0x1
negs r2, r2
adds r0, r2, 0
strh r0, [r1]
_0809926A:
pop {r0}
bx r0
.align 2, 0
_08099270: .4byte gUnknown_203B49C
_08099274: .4byte gUnknown_203B49D
_08099278: .4byte gUnknown_20398C4
thumb_func_end sub_8099220
thumb_func_start sub_809927C
sub_809927C:
push {r4,r5,lr}
adds r5, r0, 0
lsls r5, 24
lsrs r5, 24
ldr r0, _080992CC
movs r1, 0x1
strb r1, [r0]
ldr r0, _080992D0
strb r1, [r0]
ldr r1, _080992D4
movs r0, 0x50
strh r0, [r1]
ldr r4, _080992D8
strb r5, [r4]
movs r0, 0
movs r1, 0x13
movs r2, 0x50
bl SetScriptVarValue
ldrb r2, [r4]
movs r0, 0
movs r1, 0x14
bl SetScriptVarValue
ldr r4, _080992DC
adds r0, r4, 0
adds r1, r5, 0
bl sub_8095494
subs r4, 0x10
movs r1, 0
movs r0, 0x1
strb r0, [r4, 0xB]
strb r1, [r4, 0xC]
strb r1, [r4, 0x4]
strb r1, [r4, 0xD]
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_080992CC: .4byte gUnknown_203B49C
_080992D0: .4byte gUnknown_203B49D
_080992D4: .4byte gUnknown_20398C4
_080992D8: .4byte gUnknown_2039950
_080992DC: .4byte gUnknown_20398C8 + 0x10
thumb_func_end sub_809927C
thumb_func_start sub_80992E0
sub_80992E0:
push {r4,r5,lr}
adds r4, r0, 0
adds r5, r1, 0
movs r0, 0
movs r1, 0x13
bl GetScriptVarValue
lsls r0, 16
asrs r1, r0, 16
movs r0, 0x1
negs r0, r0
cmp r1, r0
beq _08099316
cmp r1, 0x50
beq _08099316
cmp r1, 0x51
beq _08099316
cmp r1, 0x52
beq _08099316
strh r1, [r4]
movs r0, 0
movs r1, 0x14
bl GetScriptVarValue
strh r0, [r5]
movs r0, 0x1
b _08099322
_08099316:
movs r1, 0x1
negs r1, r1
adds r0, r1, 0
strh r0, [r4]
strh r0, [r5]
movs r0, 0
_08099322:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end sub_80992E0

View File

@@ -444,221 +444,4 @@ _080018CE:
bx r1
thumb_func_end GetScriptVarArrayValue
thumb_func_start SetScriptVarValue
SetScriptVarValue:
push {r4,r5,lr}
sub sp, 0x8
adds r3, r0, 0
adds r4, r2, 0
lsls r1, 16
asrs r5, r1, 16
mov r0, sp
adds r1, r3, 0
adds r2, r5, 0
bl GetScriptVarRef
ldr r0, [sp]
ldrh r0, [r0]
subs r0, 0x1
lsls r0, 16
asrs r0, 16
cmp r0, 0x7
bhi _08001990
lsls r0, 2
ldr r1, _08001908
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_08001908: .4byte _0800190C
.align 2, 0
_0800190C:
.4byte _0800192C
.4byte _08001958
.4byte _08001958
.4byte _0800195E
.4byte _0800195E
.4byte _08001964
.4byte _08001958
.4byte _08001968
_0800192C:
ldr r0, [sp]
movs r2, 0x6
ldrsh r1, [r0, r2]
movs r0, 0x80
lsls r0, 17
lsls r0, r1
lsrs r3, r0, 24
cmp r4, 0
beq _0800194A
ldr r2, [sp, 0x4]
ldrb r1, [r2]
adds r0, r3, 0
orrs r0, r1
strb r0, [r2]
b _08001990
_0800194A:
ldr r2, [sp, 0x4]
ldrb r1, [r2]
adds r0, r3, 0
orrs r0, r1
eors r0, r3
strb r0, [r2]
b _08001990
_08001958:
ldr r0, [sp, 0x4]
strb r4, [r0]
b _08001990
_0800195E:
ldr r0, [sp, 0x4]
strh r4, [r0]
b _08001990
_08001964:
ldr r0, [sp, 0x4]
b _0800198E
_08001968:
cmp r5, 0x22
beq _08001972
cmp r5, 0x23
beq _08001984
b _08001990
_08001972:
ldr r0, _08001980
ldr r0, [r0]
movs r1, 0x98
lsls r1, 2
adds r0, r1
b _0800198E
.align 2, 0
_08001980: .4byte gTeamInventoryRef
_08001984:
ldr r0, _08001998
ldr r0, [r0]
movs r2, 0x99
lsls r2, 2
adds r0, r2
_0800198E:
str r4, [r0]
_08001990:
add sp, 0x8
pop {r4,r5}
pop {r0}
bx r0
.align 2, 0
_08001998: .4byte gTeamInventoryRef
thumb_func_end SetScriptVarValue
thumb_func_start SetScriptVarArrayValue
SetScriptVarArrayValue:
push {r4-r7,lr}
sub sp, 0x8
adds r4, r0, 0
adds r6, r3, 0
lsls r1, 16
asrs r7, r1, 16
lsls r2, 16
lsrs r5, r2, 16
mov r0, sp
adds r1, r4, 0
adds r2, r7, 0
bl GetScriptVarRef
ldr r0, [sp]
ldrh r0, [r0]
subs r0, 0x1
lsls r0, 16
asrs r0, 16
cmp r0, 0x7
bhi _08001A68
lsls r0, 2
ldr r1, _080019D0
adds r0, r1
ldr r0, [r0]
mov pc, r0
.align 2, 0
_080019D0: .4byte _080019D4
.align 2, 0
_080019D4:
.4byte _080019F4
.4byte _08001A2C
.4byte _08001A2C
.4byte _08001A34
.4byte _08001A34
.4byte _08001A3E
.4byte _08001A2C
.4byte _08001A44
_080019F4:
ldr r0, [sp]
ldrh r0, [r0, 0x6]
adds r0, r5, r0
lsls r0, 16
lsrs r2, r0, 19
ldr r1, [sp, 0x4]
adds r3, r1, r2
movs r1, 0xE0
lsls r1, 11
ands r1, r0
lsrs r1, 16
movs r0, 0x80
lsls r0, 17
lsls r0, r1
lsrs r2, r0, 24
cmp r6, 0
beq _08001A20
ldrb r1, [r3]
adds r0, r2, 0
orrs r0, r1
strb r0, [r3]
b _08001A68
_08001A20:
ldrb r1, [r3]
adds r0, r2, 0
orrs r0, r1
eors r0, r2
strb r0, [r3]
b _08001A68
_08001A2C:
ldr r0, [sp, 0x4]
adds r0, r5
strb r6, [r0]
b _08001A68
_08001A34:
ldr r1, [sp, 0x4]
lsls r0, r5, 1
adds r0, r1
strh r6, [r0]
b _08001A68
_08001A3E:
ldr r1, [sp, 0x4]
lsls r0, r5, 2
b _08001A64
_08001A44:
cmp r7, 0x22
beq _08001A4E
cmp r7, 0x23
beq _08001A5C
b _08001A68
_08001A4E:
ldr r0, _08001A58
ldr r0, [r0]
movs r1, 0x98
lsls r1, 2
b _08001A64
.align 2, 0
_08001A58: .4byte gTeamInventoryRef
_08001A5C:
ldr r0, _08001A70
ldr r0, [r0]
movs r1, 0x99
lsls r1, 2
_08001A64:
adds r0, r1
str r6, [r0]
_08001A68:
add sp, 0x8
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08001A70: .4byte gTeamInventoryRef
thumb_func_end SetScriptVarArrayValue
.align 2, 0 @ Don't pad with nop.

View File

@@ -1,4 +1,3 @@
#define TILE_SIZE_2BPP 32
.section .rodata
.align 2,0
@@ -5569,633 +5568,4 @@ gUnknown_80CE73C: @ 80CE73C
.string "pksdir0\0"
.string "pksdir0\0"
.string "pksdir0\0"
.align 2,0
.global gUnknown_80CE77C
gUnknown_80CE77C: @ 80CE77C
.string "efob%03d\0"
.align 2,0
.global gUnknown_80CE788
gUnknown_80CE788: @ 80CE788
.string "efbg%03d\0"
.align 2,0
.string "pksdir0\0"
.global gStatusGraphics
gStatusGraphics: @ 80CE79C
@ width, height, vram index, unk, graphic count, offset into graphic
.4byte 0, 0, 0, 0, 0, 0
.4byte 1, 1, 0, 0, 14, TILE_SIZE_2BPP * 0 @ sleepless
.4byte 2, 2, 1, 0, 7, TILE_SIZE_2BPP * 14 @ burned
.4byte 2, 2, 5, 0, 16, TILE_SIZE_2BPP * 42 @ poisoned
.4byte 4, 4, 9, 0, 6, TILE_SIZE_2BPP * 106 @ frozen
.4byte 4, 2, 25, 0, 4, TILE_SIZE_2BPP * 202 @ confused
.4byte 2, 2, 33, 0, 9, TILE_SIZE_2BPP * 234 @ whiffer
.4byte 2, 2, 37, 0, 8, TILE_SIZE_2BPP * 270 @ taunted
.4byte 1, 2, 41, 0, 8, TILE_SIZE_2BPP * 302 @ lowhp
.4byte 2, 2, 43, 0, 13, TILE_SIZE_2BPP * 318 @ shield
.4byte 2, 2, 47, 10, 10, TILE_SIZE_2BPP * 370 @ statdown
.4byte 2, 2, 51, 0, 13, TILE_SIZE_2BPP * 410 @ sword
.4byte 1, 1, 55, 0, 14, TILE_SIZE_2BPP * 462 @ blinker
.4byte 2, 2, 56, 0, 10, TILE_SIZE_2BPP * 476 @ cross-eyed
.4byte 1, 1, 60, 0, 14, TILE_SIZE_2BPP * 516 @ eyedrops
.4byte 2, 2, 61, 0, 8, TILE_SIZE_2BPP * 530 @ muzzled
.4byte 2, 2, 65, 4, 10, TILE_SIZE_2BPP * 562 @ sleep
.global gStatusGraphics4bpp
gStatusGraphics4bpp: @ 80CE934
.incbin "graphics/status/sleepless.4bpp"
.incbin "graphics/status/burned.4bpp"
.incbin "graphics/status/poisoned.4bpp"
.incbin "graphics/status/frozen.4bpp"
.incbin "graphics/status/confused.4bpp"
.incbin "graphics/status/whiffer.4bpp"
.incbin "graphics/status/taunted.4bpp"
.incbin "graphics/status/lowhp.4bpp"
.incbin "graphics/status/shield.4bpp"
.incbin "graphics/status/statdown.4bpp"
.incbin "graphics/status/sword.4bpp"
.incbin "graphics/status/blinker.4bpp"
.incbin "graphics/status/cross_eyed.4bpp"
.incbin "graphics/status/eyedrops.4bpp"
.incbin "graphics/status/muzzled.4bpp"
.incbin "graphics/status/sleep.4bpp"
.global gStatusSprites
gStatusSprites: @ 80D3474
@ Status to status image conversion
@ image, palette
.4byte 0, 0
.4byte 1, 0 @ STATUS_SPRITE_SLEEPLESS
.4byte 2, 0 @ STATUS_SPRITE_BURNED
.4byte 3, 11 @ STATUS_SPRITE_POISONED
.4byte 3, 7 @ STATUS_SPRITE_BADLY_POISONED
.4byte 5, 0 @ STATUS_SPRITE_CONFUSED
.4byte 6, 0 @ STATUS_SPRITE_COWERING
.4byte 7, 0 @ STATUS_SPRITE_TAUNTED
.4byte 8, 0 @ STATUS_SPRITE_ENCORE
.4byte 9, 0 @ STATUS_SPRITE_SHIELD_BLUE
.4byte 9, 4 @ STATUS_SPRITE_SHIELD_RED
.4byte 9, 3 @ STATUS_SPRITE_SHIELD_YELLOW
.4byte 9, 10 @ STATUS_SPRITE_SHIELD_GREEN
.4byte 9, 5 @ STATUS_SPRITE_ENDURE
.4byte 8, 0 @ STATUS_SPRITE_LOWHP
.4byte 3, 6 @ STATUS_SPRITE_CURSED
.4byte 8, 3 @ STATUS_SPRITE_SNATCH
.4byte 11, 0 @ STATUS_SPRITE_SURE_SHOT
.4byte 6, 10 @ STATUS_SPRITE_WHIFFER
.4byte 11, 5 @ STATUS_SPRITE_SET_DAMAGE
.4byte 11, 4 @ STATUS_SPRITE_FOCUS_ENERGY
.4byte 12, 0 @ STATUS_SPRITE_BLINKER
.4byte 13, 0 @ STATUS_SPRITE_CROSS_EYED
.4byte 14, 0 @ STATUS_SPRITE_EYEDROPS
.4byte 15, 0 @ STATUS_SPRITE_MUZZLED
.4byte 9, 7 @ STATUS_SPRITE_GRUDGE
.4byte 14, 4 @ STATUS_SPRITE_EXPOSED
.4byte 16, 4 @ STATUS_SPRITE_SLEEP
.4byte 10, 3 @ STATUS_SPRITE_STAT_DOWN
.4byte 4, 0 @ STATUS_SPRITE_FROZEN
.global gUnknown_80D3564
gUnknown_80D3564: @ 80D3564
.byte 0,0,0,0
.string "pksdir0\0"
.align 2,0
@ Friend Area Data
.global gFriendAreaLocations
gFriendAreaLocations: @ 80D3570
@ replacing .incbin "baserom.gba", 0x000d3570, 0x94c
.4byte gUnknown_80D3EAC
.byte 0xc5, 0x01, 0x71, 0x00, 0x08, 0x09, 0x0a, 0x27, 0x2f, 0x0b, 0x3f, 0x3f, 0x05, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x02, 0x00, 0x07, 0x00 @ Mountain Range
.4byte gUnknown_80D3EA4
.byte 0xcd, 0x01, 0x1c, 0x00, 0x30, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x0c, 0x00
.4byte gUnknown_80D3E9C
.byte 0x61, 0x01, 0x78, 0x00, 0x0d, 0x0e, 0x11, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x1b, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0xff, 0xff, 0x09, 0x00, 0xff, 0xff
.4byte gUnknown_80D3E8C
.byte 0x62, 0x01, 0x2d, 0x01, 0x0f, 0x0c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0x0e, 0x00, 0x12, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3E80
.byte 0x94, 0x01, 0x02, 0x01, 0x34, 0x35, 0x28, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x11, 0x00, 0xff, 0xff, 0x0b, 0x00, 0x08, 0x00, 0xff, 0xff, 0x0e, 0x00, 0x03, 0x00
.4byte gUnknown_80D3E70
.byte 0xc7, 0x01, 0x9d, 0x00, 0x12, 0x13, 0x14, 0x15, 0x3f, 0x3f, 0x3f, 0x3f, 0x0b, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x08, 0x00
.4byte gUnknown_80D3E60
.byte 0x08, 0x01, 0x9d, 0x00, 0x16, 0x17, 0x18, 0x19, 0x3f, 0x3f, 0x3f, 0x3f, 0x10, 0x00, 0xff, 0xff, 0x1b, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1a, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3E58
.byte 0x97, 0x01, 0xa0, 0x00, 0x1a, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x08, 0x00, 0x0b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x02, 0x00, 0x1b, 0x00, 0xff, 0xff
.4byte gUnknown_80D3E48
.byte 0x98, 0x01, 0xcf, 0x00, 0x1b, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x04, 0x00, 0xff, 0xff, 0x0b, 0x00, 0x05, 0x00, 0x07, 0x00, 0x1b, 0x00, 0xff, 0xff, 0x0e, 0x00
.4byte gUnknown_80D3E40
.byte 0x33, 0x01, 0x79, 0x00, 0x1c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x1b, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x0f, 0x00, 0x14, 0x00, 0xff, 0xff, 0x06, 0x00
.4byte gUnknown_80D3E30
.byte 0x82, 0x01, 0x1d, 0x00, 0x1d, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x0c, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x0d, 0x00
.4byte gUnknown_80D3E20
.byte 0xc6, 0x01, 0xd0, 0x00, 0x1e, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x07, 0x00, 0x08, 0x00, 0x04, 0x00
.4byte gUnknown_80D3E18
.byte 0xa2, 0x01, 0x46, 0x00, 0x1f, 0x20, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x0a, 0x00, 0x0d, 0x00, 0x02, 0x00
.4byte gUnknown_80D3E10
.byte 0x60, 0x01, 0x47, 0x00, 0x21, 0x23, 0x24, 0x22, 0x3f, 0x3f, 0x3f, 0x3f, 0x02, 0x00, 0xff, 0xff, 0x0c, 0x00, 0x0a, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x14, 0x00, 0x09, 0x00
.4byte gUnknown_80D3E08
.byte 0x63, 0x01, 0x04, 0x01, 0x25, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x03, 0x00, 0xff, 0xff, 0x04, 0x00, 0x08, 0x00, 0x1b, 0x00, 0xff, 0xff, 0x12, 0x00, 0xff, 0xff
.4byte gUnknown_80D3E00
.byte 0x36, 0x01, 0x1c, 0x00, 0x26, 0x29, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x09, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x00, 0x14, 0x00
.4byte gUnknown_80D3DF8
.byte 0x07, 0x01, 0xcb, 0x00, 0x10, 0x2a, 0x32, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x12, 0x00, 0xff, 0xff, 0x1b, 0x00, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x19, 0x00
.4byte gUnknown_80D3DF0
.byte 0xc4, 0x01, 0x2d, 0x01, 0x2b, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DE8
.byte 0x31, 0x01, 0x05, 0x01, 0x2e, 0x2c, 0x2d, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x03, 0x00, 0x0e, 0x00, 0xff, 0xff, 0xff, 0xff, 0x10, 0x00, 0x19, 0x00, 0xff, 0xff
.4byte gUnknown_80D3DE4
.byte 0x2f, 0x00, 0x15, 0x00, 0x33, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x17, 0x00, 0x1a, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DD4
.byte 0x07, 0x01, 0x47, 0x00, 0x36, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x06, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x0f, 0x00, 0xff, 0xff, 0x18, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DC4
.byte 0x5d, 0x00, 0x0c, 0x01, 0x37, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x19, 0x00, 0xff, 0xff, 0xff, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DB4
.byte 0x2d, 0x00, 0xcb, 0x00, 0x38, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x15, 0x00, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DA4
.byte 0x2d, 0x00, 0x70, 0x00, 0x39, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x16, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x00, 0x13, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D94
.byte 0xd0, 0x00, 0x16, 0x00, 0x01, 0x03, 0x05, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x14, 0x00, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x00
.4byte gUnknown_80D3D84
.byte 0xb2, 0x00, 0x0d, 0x01, 0x02, 0x04, 0x06, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x12, 0x00, 0x10, 0x00, 0xff, 0xff, 0xff, 0xff, 0x15, 0x00, 0xff, 0xff
.4byte gUnknown_80D3D7C
.byte 0x81, 0x00, 0x42, 0x00, 0x07, 0x31, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x06, 0x00, 0xff, 0xff, 0x18, 0x00, 0xff, 0xff, 0x13, 0x00, 0xff, 0xff, 0x17, 0x00 @ Beach
.4byte gUnknown_80D3D78
.byte 0x63, 0x01, 0xa1, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x0e, 0x00, 0x08, 0x00, 0x07, 0x00, 0xff, 0xff, 0x02, 0x00, 0x09, 0x00, 0x06, 0x00, 0x10, 0x00 @ Team Name
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
@ Start of Friend Area String Pool (80D3D70)
@ These are what show on the map when going to Friend Areas
.global gUnknown_80D3D70
gUnknown_80D3D70:
.string "ななし\0"
.align 2,0
.global gUnknown_80D3D78
gUnknown_80D3D78:
.string "$t\0" @ Team Name
.align 2,0
.global gUnknown_80D3D7C
gUnknown_80D3D7C:
.string "Beach\0"
.align 2,0
.global gUnknown_80D3D84
gUnknown_80D3D84:
.string "Southern Sea\0"
.align 2,0
.global gUnknown_80D3D94
gUnknown_80D3D94:
.string "Northern Sea\0"
.align 2,0
.global gUnknown_80D3DA4
gUnknown_80D3DA4:
.string "Western Isles\0"
.align 2,0
.global gUnknown_80D3DB4
gUnknown_80D3DB4:
.string "Southwest Isles\0"
.align 2,0
.global gUnknown_80D3DC4
gUnknown_80D3DC4:
.string "Southern Isles\0"
.align 2,0
.global gUnknown_80D3DD4
gUnknown_80D3DD4:
.string "Northern Isles\0"
.align 2,0
.global gUnknown_80D3DE4
gUnknown_80D3DE4:
.string "Sky\0"
.align 2,0
.global gUnknown_80D3DE8
gUnknown_80D3DE8:
.string "Relics\0"
.align 2,0
.global gUnknown_80D3DF0
gUnknown_80D3DF0:
.string "Desert\0"
.align 2,0
.global gUnknown_80D3DF8
gUnknown_80D3DF8:
.string "Volcano\0"
.align 2,0
.global gUnknown_80D3E00
gUnknown_80D3E00:
.string "Ruins\0"
.align 2,0
.global gUnknown_80D3E08
gUnknown_80D3E08:
.string "Jungle\0"
.align 2,0
.global gUnknown_80D3E10
gUnknown_80D3E10:
.string "Cave\0"
.align 2,0
.global gUnknown_80D3E18
gUnknown_80D3E18:
.string "Marsh\0"
.align 2,0
.global gUnknown_80D3E20
gUnknown_80D3E20:
.string "Eastern Lakes\0"
.align 2,0
.global gUnknown_80D3E30
gUnknown_80D3E30:
.string "Northern Lakes\0"
.align 2,0
.global gUnknown_80D3E40
gUnknown_80D3E40:
.string "Pond\0"
.align 2,0
.global gUnknown_80D3E48
gUnknown_80D3E48:
.string "Eastern Ponds\0"
.align 2,0
.global gUnknown_80D3E58
gUnknown_80D3E58:
.string "River\0"
.align 2,0
.global gUnknown_80D3E60
gUnknown_80D3E60:
.string "Western Forest\0"
.align 2,0
.global gUnknown_80D3E70
gUnknown_80D3E70:
.string "Eastern Forest\0"
.align 2,0
.global gUnknown_80D3E80
gUnknown_80D3E80:
.string "Badlands\0"
.align 2,0
.global gUnknown_80D3E8C
gUnknown_80D3E8C:
.string "South Plains\0"
.align 2,0
.global gUnknown_80D3E9C
gUnknown_80D3E9C:
.string "Plains\0"
.align 2,0
.global gUnknown_80D3EA4
gUnknown_80D3EA4:
.string "Glacier\0"
.align 2,0
.global gUnknown_80D3EAC
gUnknown_80D3EAC:
.string "Mountain Range\0"
.align 2,0
.global gUnknown_80D3EBC
gUnknown_80D3EBC: @ 80D3EBC
@ replacing .incbin "baserom.gba", 0x000d3ebc, 0x20
.byte 0x80, 0x03
.byte 0x80, 0x04
.byte 0x80, 0x00
.byte 0x80, 0x03
.byte 0x80, 0x0f
.byte 0x80, 0x00
.byte 0x80, 0x0c
.byte 0x80, 0x0f
.byte 0x80, 0x0b
.byte 0x80, 0x0c
.byte 0x80, 0x08
.byte 0x80, 0x0b
.byte 0x80, 0x07
.byte 0x80, 0x08
.byte 0x80, 0x04
.byte 0x80, 0x07
.global gUnknown_80D3EDC
gUnknown_80D3EDC: @ 80D3EDC
.byte 0xff, 0x00, 0x02, 0x01
.byte 0x04, 0xff, 0x03, 0xff
.byte 0x06, 0x07, 0xff, 0xff
.byte 0x05, 0xff, 0xff, 0xff
.global gUnknown_80D3EEC
gUnknown_80D3EEC: @ 80D3EEC
.byte 0xff, 0xff, 0xff, 0x01
.byte 0xff, 0xff, 0x03, 0xff
.byte 0xff, 0x07, 0xff, 0xff
.byte 0x05, 0xff, 0xff, 0xff
.global gUnknown_80D3EFC
gUnknown_80D3EFC: @ 80D3EFC
.string "$t Team Base\0"
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gDungeonCoordinates
gDungeonCoordinates: @ 80D3F14
@ replacing .incbin "baserom.gba", 0x000d3f14, 0x100
@ 2 byte X and 2 byte Y
.2byte 172, 174 @ Tiny Woods
.2byte 171, 111
.2byte 242, 126
.2byte 232, 181
.2byte 263, 155
.2byte 298, 159
.2byte 299, 142
.2byte 203, 255
.2byte 385, 166
.2byte 388, 126
.2byte 389, 109
.2byte 417, 112
.2byte 422, 101
.2byte 432, 85
.2byte 436, 69
.2byte 442, 150
.2byte 446, 163
.2byte 365, 27
.2byte 352, 12
.2byte 133, 238
.2byte 129, 143
.2byte 344, 105
.2byte 427, 62
.2byte 27, 211
.2byte 246, 315
.2byte 443, 6
.2byte 32, 279
.2byte 404, 262
.2byte 194, 63
.2byte 159, 46
.2byte 441, 310
.2byte 231, 235
.2byte 169, 287
.2byte 441, 273
.2byte 64, 87
.2byte 80, 54
.2byte 431, 225
.2byte 27, 94
.2byte 354, 298
.2byte 336, 253
.2byte 287, 222
.2byte 63, 163
.2byte 275, 111
.2byte 202, 232
.2byte 268, 302
.2byte 336, 260
.2byte 110, 79
.2byte 225, 314
.2byte 206, 314
.2byte 11, 307
.2byte 472, 25
.2byte 250, 8
.2byte 187, 190
.2byte 205, 111
.2byte 474, 6
.2byte 183, 9
.2byte 367, 214
.2byte 278, 273
.2byte 68, 305
.2byte 270, 33
.2byte 33, 39
.2byte 217, 8
.2byte 69, 280
.2byte 192, 183 @ D63
.global gUnknown_80D4014
gUnknown_80D4014: @ 80D4014
.4byte wmp2font_text
.4byte wmp2mcc_text
.4byte wmp2cani_text
.4byte wmp2pal_text
.4byte wmp2fon1_text
.global wmp2fon1_text
wmp2fon1_text:
.string "wmp2fon1\0"
.align 2,0
.global wmp2pal_text
wmp2pal_text:
.string "wmp2pal\0"
.align 2,0
.global wmp2cani_text
wmp2cani_text:
.string "wmp2cani\0"
.align 2,0
.global wmp2mcc_text
wmp2mcc_text:
.string "wmp2mcc\0"
.align 2,0
.global wmp2font_text
wmp2font_text:
.string "wmp2font\0"
.align 2,0
.global gUnknown_80D405C
gUnknown_80D405C: @ 80D405C
.string "ax%03d\0"
.align 2,0
.global gUnknown_80D4064
gUnknown_80D4064: @ 80D4064
.string "wmapspr\0"
.align 2,0
.global gUnknown_80D406C
gUnknown_80D406C: @ 80D406C
.string "palet\0"
.align 2,0
.global gUnknown_80D4074
gUnknown_80D4074: @ 80D4074
.string "{CENTER_ALIGN}{POKEMON_0}\0"
.align 2,0
.global gUnknown_80D407C
gUnknown_80D407C: @ 80D4074
.string "Yes\0"
.align 2,0
.global gUnknown_80D4080
gUnknown_80D4080: @ 80D4080
.string "No\0"
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gUnknown_80D408C
gUnknown_80D408C: @ 80D408C
.4byte wmapfont_text
.4byte wmapmcc_text
.4byte wmapcani_text
.4byte wmappal_text
.global wmappal_text
wmappal_text:
.string "wmappal\0"
.align 2,0
.global wmapcani_text
wmapcani_text:
.string "wmapcani\0"
.align 2,0
.global wmapmcc_text
wmapmcc_text:
.string "wmapmcc\0"
.align 2,0
.global wmapfont_text
wmapfont_text:
.string "wmapfont\0"
.align 2,0
.global gUnknown_80D40C4
gUnknown_80D40C4: @ 80D40C4
.byte 0x00, 0x00, 0x18, 0x00
.byte 0x18, 0x00, 0x18, 0x00
.byte 0x18, 0x00, 0x00, 0x00
.byte 0x18, 0x00, 0xE8, 0xFF
.byte 0x00, 0x00, 0xE8, 0xFF
.byte 0xE8, 0xFF, 0xE8, 0xFF
.byte 0xE8, 0xFF, 0x00, 0x00
.byte 0xE8, 0xFF, 0x18, 0x00
.global gUnknown_80D40E4
gUnknown_80D40E4: @ 80D40E4
.string "ax%03d\0"
.align 2,0
.global gUnknown_80D40EC
gUnknown_80D40EC: @ 80D40EC
.string "wmapspr\0"
.align 2,0
.global gUnknown_80D40F4
gUnknown_80D40F4: @ 80D40F4
.string "palet\0"
.align 2,0
.global gUnknown_80D40FC
gUnknown_80D40FC: @ 80D40FC
.string "{CENTER_ALIGN}%s\0"
.align 2,0
.global gUnknown_80D4104
gUnknown_80D4104: @ 80D4104
.string "Where would you like to go?\0"
.align 2,0
.global gUnknown_80D4120
gUnknown_80D4120: @ 80D4120
.string "{MOVE_ITEM_0}\0"
.align 2,0
.global gUnknown_80D4124
gUnknown_80D4124: @ 80D4124
.string "{MOVE_ITEM_0}($v02"
.byte 0x81, 0x5E
.asciz "$v12)"
.align 2,0
.asciz "pksdir0"
.asciz "pksdir0"
.global gUnknown_80D4144
gUnknown_80D4144: @ 80D4144
.2byte 302
.2byte 303
.2byte 303
.2byte 301
.2byte 304
.2byte 306
.2byte 307
.2byte 0
.string "pksdir0\0"
.string "pksdir0\0"
.4byte noneText
.byte 0xff, 0xff, 0xff, 0xff
.4byte noneText
.global noneText
noneText:
.string "none\0"
.align 2,0
.4byte defaultText
.byte 0xff, 0xff, 0xff, 0xff
.4byte noneText
.global defaultText
defaultText:
.string "default\0"

603
data/data_80CE77C.s Normal file
View File

@@ -0,0 +1,603 @@
.section .rodata
.align 2,0
@ code_800F958
.global gStatusGraphics4bpp
gStatusGraphics4bpp: @ 80CE934
.incbin "graphics/status/sleepless.4bpp"
.incbin "graphics/status/burned.4bpp"
.incbin "graphics/status/poisoned.4bpp"
.incbin "graphics/status/frozen.4bpp"
.incbin "graphics/status/confused.4bpp"
.incbin "graphics/status/whiffer.4bpp"
.incbin "graphics/status/taunted.4bpp"
.incbin "graphics/status/lowhp.4bpp"
.incbin "graphics/status/shield.4bpp"
.incbin "graphics/status/statdown.4bpp"
.incbin "graphics/status/sword.4bpp"
.incbin "graphics/status/blinker.4bpp"
.incbin "graphics/status/cross_eyed.4bpp"
.incbin "graphics/status/eyedrops.4bpp"
.incbin "graphics/status/muzzled.4bpp"
.incbin "graphics/status/sleep.4bpp"
.global gStatusSprites
gStatusSprites: @ 80D3474
@ Status to status image conversion
@ image, palette
.4byte 0, 0
.4byte 1, 0 @ STATUS_SPRITE_SLEEPLESS
.4byte 2, 0 @ STATUS_SPRITE_BURNED
.4byte 3, 11 @ STATUS_SPRITE_POISONED
.4byte 3, 7 @ STATUS_SPRITE_BADLY_POISONED
.4byte 5, 0 @ STATUS_SPRITE_CONFUSED
.4byte 6, 0 @ STATUS_SPRITE_COWERING
.4byte 7, 0 @ STATUS_SPRITE_TAUNTED
.4byte 8, 0 @ STATUS_SPRITE_ENCORE
.4byte 9, 0 @ STATUS_SPRITE_SHIELD_BLUE
.4byte 9, 4 @ STATUS_SPRITE_SHIELD_RED
.4byte 9, 3 @ STATUS_SPRITE_SHIELD_YELLOW
.4byte 9, 10 @ STATUS_SPRITE_SHIELD_GREEN
.4byte 9, 5 @ STATUS_SPRITE_ENDURE
.4byte 8, 0 @ STATUS_SPRITE_LOWHP
.4byte 3, 6 @ STATUS_SPRITE_CURSED
.4byte 8, 3 @ STATUS_SPRITE_SNATCH
.4byte 11, 0 @ STATUS_SPRITE_SURE_SHOT
.4byte 6, 10 @ STATUS_SPRITE_WHIFFER
.4byte 11, 5 @ STATUS_SPRITE_SET_DAMAGE
.4byte 11, 4 @ STATUS_SPRITE_FOCUS_ENERGY
.4byte 12, 0 @ STATUS_SPRITE_BLINKER
.4byte 13, 0 @ STATUS_SPRITE_CROSS_EYED
.4byte 14, 0 @ STATUS_SPRITE_EYEDROPS
.4byte 15, 0 @ STATUS_SPRITE_MUZZLED
.4byte 9, 7 @ STATUS_SPRITE_GRUDGE
.4byte 14, 4 @ STATUS_SPRITE_EXPOSED
.4byte 16, 4 @ STATUS_SPRITE_SLEEP
.4byte 10, 3 @ STATUS_SPRITE_STAT_DOWN
.4byte 4, 0 @ STATUS_SPRITE_FROZEN
.global gUnknown_80D3564
gUnknown_80D3564: @ 80D3564
.byte 0,0,0,0
@
.string "pksdir0\0"
.align 2,0
@ Friend Area Data
.global gFriendAreaLocations
gFriendAreaLocations: @ 80D3570
@ replacing .incbin "baserom.gba", 0x000d3570, 0x94c
.4byte gUnknown_80D3EAC
.byte 0xc5, 0x01, 0x71, 0x00, 0x08, 0x09, 0x0a, 0x27, 0x2f, 0x0b, 0x3f, 0x3f, 0x05, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x02, 0x00, 0x07, 0x00 @ Mountain Range
.4byte gUnknown_80D3EA4
.byte 0xcd, 0x01, 0x1c, 0x00, 0x30, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x0c, 0x00
.4byte gUnknown_80D3E9C
.byte 0x61, 0x01, 0x78, 0x00, 0x0d, 0x0e, 0x11, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x1b, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0d, 0x00, 0xff, 0xff, 0x09, 0x00, 0xff, 0xff
.4byte gUnknown_80D3E8C
.byte 0x62, 0x01, 0x2d, 0x01, 0x0f, 0x0c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0x0e, 0x00, 0x12, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3E80
.byte 0x94, 0x01, 0x02, 0x01, 0x34, 0x35, 0x28, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x11, 0x00, 0xff, 0xff, 0x0b, 0x00, 0x08, 0x00, 0xff, 0xff, 0x0e, 0x00, 0x03, 0x00
.4byte gUnknown_80D3E70
.byte 0xc7, 0x01, 0x9d, 0x00, 0x12, 0x13, 0x14, 0x15, 0x3f, 0x3f, 0x3f, 0x3f, 0x0b, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x07, 0x00, 0x08, 0x00
.4byte gUnknown_80D3E60
.byte 0x08, 0x01, 0x9d, 0x00, 0x16, 0x17, 0x18, 0x19, 0x3f, 0x3f, 0x3f, 0x3f, 0x10, 0x00, 0xff, 0xff, 0x1b, 0x00, 0x09, 0x00, 0x14, 0x00, 0x1a, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3E58
.byte 0x97, 0x01, 0xa0, 0x00, 0x1a, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x08, 0x00, 0x0b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x02, 0x00, 0x1b, 0x00, 0xff, 0xff
.4byte gUnknown_80D3E48
.byte 0x98, 0x01, 0xcf, 0x00, 0x1b, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x04, 0x00, 0xff, 0xff, 0x0b, 0x00, 0x05, 0x00, 0x07, 0x00, 0x1b, 0x00, 0xff, 0xff, 0x0e, 0x00
.4byte gUnknown_80D3E40
.byte 0x33, 0x01, 0x79, 0x00, 0x1c, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x1b, 0x00, 0x02, 0x00, 0x0d, 0x00, 0x0f, 0x00, 0x14, 0x00, 0xff, 0xff, 0x06, 0x00
.4byte gUnknown_80D3E30
.byte 0x82, 0x01, 0x1d, 0x00, 0x1d, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x0c, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x0d, 0x00
.4byte gUnknown_80D3E20
.byte 0xc6, 0x01, 0xd0, 0x00, 0x1e, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x07, 0x00, 0x08, 0x00, 0x04, 0x00
.4byte gUnknown_80D3E18
.byte 0xa2, 0x01, 0x46, 0x00, 0x1f, 0x20, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x0a, 0x00, 0x0d, 0x00, 0x02, 0x00
.4byte gUnknown_80D3E10
.byte 0x60, 0x01, 0x47, 0x00, 0x21, 0x23, 0x24, 0x22, 0x3f, 0x3f, 0x3f, 0x3f, 0x02, 0x00, 0xff, 0xff, 0x0c, 0x00, 0x0a, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x14, 0x00, 0x09, 0x00
.4byte gUnknown_80D3E08
.byte 0x63, 0x01, 0x04, 0x01, 0x25, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x03, 0x00, 0xff, 0xff, 0x04, 0x00, 0x08, 0x00, 0x1b, 0x00, 0xff, 0xff, 0x12, 0x00, 0xff, 0xff
.4byte gUnknown_80D3E00
.byte 0x36, 0x01, 0x1c, 0x00, 0x26, 0x29, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x09, 0x00, 0x0d, 0x00, 0x0a, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x18, 0x00, 0x14, 0x00
.4byte gUnknown_80D3DF8
.byte 0x07, 0x01, 0xcb, 0x00, 0x10, 0x2a, 0x32, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x12, 0x00, 0xff, 0xff, 0x1b, 0x00, 0x06, 0x00, 0xff, 0xff, 0xff, 0xff, 0x19, 0x00
.4byte gUnknown_80D3DF0
.byte 0xc4, 0x01, 0x2d, 0x01, 0x2b, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DE8
.byte 0x31, 0x01, 0x05, 0x01, 0x2e, 0x2c, 0x2d, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x03, 0x00, 0x0e, 0x00, 0xff, 0xff, 0xff, 0xff, 0x10, 0x00, 0x19, 0x00, 0xff, 0xff
.4byte gUnknown_80D3DE4
.byte 0x2f, 0x00, 0x15, 0x00, 0x33, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x17, 0x00, 0x1a, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DD4
.byte 0x07, 0x01, 0x47, 0x00, 0x36, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x06, 0x00, 0x09, 0x00, 0x0d, 0x00, 0x0f, 0x00, 0xff, 0xff, 0x18, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DC4
.byte 0x5d, 0x00, 0x0c, 0x01, 0x37, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x19, 0x00, 0xff, 0xff, 0xff, 0xff, 0x16, 0x00, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DB4
.byte 0x2d, 0x00, 0xcb, 0x00, 0x38, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x15, 0x00, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3DA4
.byte 0x2d, 0x00, 0x70, 0x00, 0x39, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x16, 0x00, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x00, 0x13, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D94
.byte 0xd0, 0x00, 0x16, 0x00, 0x01, 0x03, 0x05, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x14, 0x00, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1a, 0x00
.4byte gUnknown_80D3D84
.byte 0xb2, 0x00, 0x0d, 0x01, 0x02, 0x04, 0x06, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x12, 0x00, 0x10, 0x00, 0xff, 0xff, 0xff, 0xff, 0x15, 0x00, 0xff, 0xff
.4byte gUnknown_80D3D7C
.byte 0x81, 0x00, 0x42, 0x00, 0x07, 0x31, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0x06, 0x00, 0xff, 0xff, 0x18, 0x00, 0xff, 0xff, 0x13, 0x00, 0xff, 0xff, 0x17, 0x00 @ Beach
.4byte gUnknown_80D3D78
.byte 0x63, 0x01, 0xa1, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x0e, 0x00, 0x08, 0x00, 0x07, 0x00, 0xff, 0xff, 0x02, 0x00, 0x09, 0x00, 0x06, 0x00, 0x10, 0x00 @ Team Name
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
.4byte gUnknown_80D3D70
.byte 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
@ Start of Friend Area String Pool (80D3D70)
@ These are what show on the map when going to Friend Areas
.global gUnknown_80D3D70
gUnknown_80D3D70:
.string "ななし\0"
.align 2,0
.global gUnknown_80D3D78
gUnknown_80D3D78:
.string "$t\0" @ Team Name
.align 2,0
.global gUnknown_80D3D7C
gUnknown_80D3D7C:
.string "Beach\0"
.align 2,0
.global gUnknown_80D3D84
gUnknown_80D3D84:
.string "Southern Sea\0"
.align 2,0
.global gUnknown_80D3D94
gUnknown_80D3D94:
.string "Northern Sea\0"
.align 2,0
.global gUnknown_80D3DA4
gUnknown_80D3DA4:
.string "Western Isles\0"
.align 2,0
.global gUnknown_80D3DB4
gUnknown_80D3DB4:
.string "Southwest Isles\0"
.align 2,0
.global gUnknown_80D3DC4
gUnknown_80D3DC4:
.string "Southern Isles\0"
.align 2,0
.global gUnknown_80D3DD4
gUnknown_80D3DD4:
.string "Northern Isles\0"
.align 2,0
.global gUnknown_80D3DE4
gUnknown_80D3DE4:
.string "Sky\0"
.align 2,0
.global gUnknown_80D3DE8
gUnknown_80D3DE8:
.string "Relics\0"
.align 2,0
.global gUnknown_80D3DF0
gUnknown_80D3DF0:
.string "Desert\0"
.align 2,0
.global gUnknown_80D3DF8
gUnknown_80D3DF8:
.string "Volcano\0"
.align 2,0
.global gUnknown_80D3E00
gUnknown_80D3E00:
.string "Ruins\0"
.align 2,0
.global gUnknown_80D3E08
gUnknown_80D3E08:
.string "Jungle\0"
.align 2,0
.global gUnknown_80D3E10
gUnknown_80D3E10:
.string "Cave\0"
.align 2,0
.global gUnknown_80D3E18
gUnknown_80D3E18:
.string "Marsh\0"
.align 2,0
.global gUnknown_80D3E20
gUnknown_80D3E20:
.string "Eastern Lakes\0"
.align 2,0
.global gUnknown_80D3E30
gUnknown_80D3E30:
.string "Northern Lakes\0"
.align 2,0
.global gUnknown_80D3E40
gUnknown_80D3E40:
.string "Pond\0"
.align 2,0
.global gUnknown_80D3E48
gUnknown_80D3E48:
.string "Eastern Ponds\0"
.align 2,0
.global gUnknown_80D3E58
gUnknown_80D3E58:
.string "River\0"
.align 2,0
.global gUnknown_80D3E60
gUnknown_80D3E60:
.string "Western Forest\0"
.align 2,0
.global gUnknown_80D3E70
gUnknown_80D3E70:
.string "Eastern Forest\0"
.align 2,0
.global gUnknown_80D3E80
gUnknown_80D3E80:
.string "Badlands\0"
.align 2,0
.global gUnknown_80D3E8C
gUnknown_80D3E8C:
.string "South Plains\0"
.align 2,0
.global gUnknown_80D3E9C
gUnknown_80D3E9C:
.string "Plains\0"
.align 2,0
.global gUnknown_80D3EA4
gUnknown_80D3EA4:
.string "Glacier\0"
.align 2,0
.global gUnknown_80D3EAC
gUnknown_80D3EAC:
.string "Mountain Range\0"
.align 2,0
.global gUnknown_80D3EBC
gUnknown_80D3EBC: @ 80D3EBC
@ replacing .incbin "baserom.gba", 0x000d3ebc, 0x20
.byte 0x80, 0x03
.byte 0x80, 0x04
.byte 0x80, 0x00
.byte 0x80, 0x03
.byte 0x80, 0x0f
.byte 0x80, 0x00
.byte 0x80, 0x0c
.byte 0x80, 0x0f
.byte 0x80, 0x0b
.byte 0x80, 0x0c
.byte 0x80, 0x08
.byte 0x80, 0x0b
.byte 0x80, 0x07
.byte 0x80, 0x08
.byte 0x80, 0x04
.byte 0x80, 0x07
.global gUnknown_80D3EDC
gUnknown_80D3EDC: @ 80D3EDC
.byte 0xff, 0x00, 0x02, 0x01
.byte 0x04, 0xff, 0x03, 0xff
.byte 0x06, 0x07, 0xff, 0xff
.byte 0x05, 0xff, 0xff, 0xff
.global gUnknown_80D3EEC
gUnknown_80D3EEC: @ 80D3EEC
.byte 0xff, 0xff, 0xff, 0x01
.byte 0xff, 0xff, 0x03, 0xff
.byte 0xff, 0x07, 0xff, 0xff
.byte 0x05, 0xff, 0xff, 0xff
.global gUnknown_80D3EFC
gUnknown_80D3EFC: @ 80D3EFC
.string "$t Team Base\0"
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gDungeonCoordinates
gDungeonCoordinates: @ 80D3F14
@ replacing .incbin "baserom.gba", 0x000d3f14, 0x100
@ 2 byte X and 2 byte Y
.2byte 172, 174 @ Tiny Woods
.2byte 171, 111
.2byte 242, 126
.2byte 232, 181
.2byte 263, 155
.2byte 298, 159
.2byte 299, 142
.2byte 203, 255
.2byte 385, 166
.2byte 388, 126
.2byte 389, 109
.2byte 417, 112
.2byte 422, 101
.2byte 432, 85
.2byte 436, 69
.2byte 442, 150
.2byte 446, 163
.2byte 365, 27
.2byte 352, 12
.2byte 133, 238
.2byte 129, 143
.2byte 344, 105
.2byte 427, 62
.2byte 27, 211
.2byte 246, 315
.2byte 443, 6
.2byte 32, 279
.2byte 404, 262
.2byte 194, 63
.2byte 159, 46
.2byte 441, 310
.2byte 231, 235
.2byte 169, 287
.2byte 441, 273
.2byte 64, 87
.2byte 80, 54
.2byte 431, 225
.2byte 27, 94
.2byte 354, 298
.2byte 336, 253
.2byte 287, 222
.2byte 63, 163
.2byte 275, 111
.2byte 202, 232
.2byte 268, 302
.2byte 336, 260
.2byte 110, 79
.2byte 225, 314
.2byte 206, 314
.2byte 11, 307
.2byte 472, 25
.2byte 250, 8
.2byte 187, 190
.2byte 205, 111
.2byte 474, 6
.2byte 183, 9
.2byte 367, 214
.2byte 278, 273
.2byte 68, 305
.2byte 270, 33
.2byte 33, 39
.2byte 217, 8
.2byte 69, 280
.2byte 192, 183 @ D63
.global gUnknown_80D4014
gUnknown_80D4014: @ 80D4014
.4byte wmp2font_text
.4byte wmp2mcc_text
.4byte wmp2cani_text
.4byte wmp2pal_text
.4byte wmp2fon1_text
.global wmp2fon1_text
wmp2fon1_text:
.string "wmp2fon1\0"
.align 2,0
.global wmp2pal_text
wmp2pal_text:
.string "wmp2pal\0"
.align 2,0
.global wmp2cani_text
wmp2cani_text:
.string "wmp2cani\0"
.align 2,0
.global wmp2mcc_text
wmp2mcc_text:
.string "wmp2mcc\0"
.align 2,0
.global wmp2font_text
wmp2font_text:
.string "wmp2font\0"
.align 2,0
.global gUnknown_80D405C
gUnknown_80D405C: @ 80D405C
.string "ax%03d\0"
.align 2,0
.global gUnknown_80D4064
gUnknown_80D4064: @ 80D4064
.string "wmapspr\0"
.align 2,0
.global gUnknown_80D406C
gUnknown_80D406C: @ 80D406C
.string "palet\0"
.align 2,0
.global gUnknown_80D4074
gUnknown_80D4074: @ 80D4074
.string "{CENTER_ALIGN}{POKEMON_0}\0"
.align 2,0
.global gUnknown_80D407C
gUnknown_80D407C: @ 80D4074
.string "Yes\0"
.align 2,0
.global gUnknown_80D4080
gUnknown_80D4080: @ 80D4080
.string "No\0"
.align 2,0
.string "pksdir0\0"
.align 2,0
.global gUnknown_80D408C
gUnknown_80D408C: @ 80D408C
.4byte wmapfont_text
.4byte wmapmcc_text
.4byte wmapcani_text
.4byte wmappal_text
.global wmappal_text
wmappal_text:
.string "wmappal\0"
.align 2,0
.global wmapcani_text
wmapcani_text:
.string "wmapcani\0"
.align 2,0
.global wmapmcc_text
wmapmcc_text:
.string "wmapmcc\0"
.align 2,0
.global wmapfont_text
wmapfont_text:
.string "wmapfont\0"
.align 2,0
.global gUnknown_80D40C4
gUnknown_80D40C4: @ 80D40C4
.byte 0x00, 0x00, 0x18, 0x00
.byte 0x18, 0x00, 0x18, 0x00
.byte 0x18, 0x00, 0x00, 0x00
.byte 0x18, 0x00, 0xE8, 0xFF
.byte 0x00, 0x00, 0xE8, 0xFF
.byte 0xE8, 0xFF, 0xE8, 0xFF
.byte 0xE8, 0xFF, 0x00, 0x00
.byte 0xE8, 0xFF, 0x18, 0x00
.global gUnknown_80D40E4
gUnknown_80D40E4: @ 80D40E4
.string "ax%03d\0"
.align 2,0
.global gUnknown_80D40EC
gUnknown_80D40EC: @ 80D40EC
.string "wmapspr\0"
.align 2,0
.global gUnknown_80D40F4
gUnknown_80D40F4: @ 80D40F4
.string "palet\0"
.align 2,0
.global gUnknown_80D40FC
gUnknown_80D40FC: @ 80D40FC
.string "{CENTER_ALIGN}%s\0"
.align 2,0
.global gUnknown_80D4104
gUnknown_80D4104: @ 80D4104
.string "Where would you like to go?\0"
.align 2,0
.global gUnknown_80D4120
gUnknown_80D4120: @ 80D4120
.string "{MOVE_ITEM_0}\0"
.align 2,0
.global gUnknown_80D4124
gUnknown_80D4124: @ 80D4124
.string "{MOVE_ITEM_0}($v02"
.byte 0x81, 0x5E
.asciz "$v12)"
.align 2,0
.asciz "pksdir0"
.asciz "pksdir0"
.global gUnknown_80D4144
gUnknown_80D4144: @ 80D4144
.2byte 302
.2byte 303
.2byte 303
.2byte 301
.2byte 304
.2byte 306
.2byte 307
.2byte 0
.string "pksdir0\0"
.string "pksdir0\0"
.4byte noneText
.byte 0xff, 0xff, 0xff, 0xff
.4byte noneText
.global noneText
noneText:
.string "none\0"
.align 2,0
.4byte defaultText
.byte 0xff, 0xff, 0xff, 0xff
.4byte noneText
.global defaultText
defaultText:
.string "default\0"

View File

@@ -1,7 +1,15 @@
#ifndef GUARD_CODE_8002774_H
#define GUARD_CODE_8002774_H
#include "structs/str_position.h"
s32 sub_8002A70(s32 a0, s32 a1, s32 a2);
s32 sub_8002B04(s32, s32);
s32 VecDirection8Sign(PixelPos *param_1);
s32 VecDirection4SignYX(PixelPos *param_1);
s8 VecDirection8Radial(PixelPos *param_1);
s8 VecDirection4Radial(PixelPos *param_1);
s8 SizedDeltaDirection4(PixelPos *r0, PixelPos *r1, PixelPos *r2, PixelPos *r3);
s8 SizedDeltaDirection8(PixelPos *r0, PixelPos *r1, PixelPos *r2, PixelPos *r3);
#endif

View File

@@ -3,19 +3,19 @@
#include "structs/sprite_oam.h"
#include "structs/str_position.h"
#include "code_800E9A8.h"
typedef struct unkStruct_80416E0
{
s32 unk0;
s32 unk4;
s32 unk8;
s32 dir;
u16 x;
u16 y;
u16 unk10;
u16 unk12;
s32 unk14;
u32 unk18;
unkStruct_2039DB0 unk1C;
} unkStruct_80416E0;
u32 sub_800E890(unkStruct_80416E0 *);
@@ -25,7 +25,8 @@ bool8 sub_800E9A8(s32);
void sub_800DAC0(u32);
void sub_800DB7C(void);
void sub_800DBBC(void);
void sub_800E90C(DungeonPos *);
void sub_800E8AC(s32 a0, void *a1, void *a2, s32 a3, void *a4); // a2 could be DungeonPos
bool8 sub_800E90C(DungeonPos *);
void sub_800E8AC(s32 a0, DungeonPos *a1, DungeonPos *a2, s32 a3, unkStruct_2039DB0 *a4);
#endif // GUARD_CODE_800DAC0_H

View File

@@ -1,11 +1,9 @@
#ifndef GUARD_CODE_800E9A8_H
#define GUARD_CODE_800E9A8_H
typedef struct unkStruct_800EAE4
{
s16 unk0;
s16 unk2;
} unkStruct_800EAE4;
#include "structs/axdata.h"
#include "structs/sprite_oam.h"
#include "structs/str_position.h"
struct unkStruct_203B0CC_sub
{
@@ -13,22 +11,27 @@ struct unkStruct_203B0CC_sub
u32 unk0;
s32 unk4;
s32 unk8;
u8 fillc[0x18 - 0x0c];
s32 unk18;
unkStruct_800EAE4 unk1c;
s32 unkC;
s32 unk10;
s32 unk14;
DungeonPos unk18;
DungeonPos unk1c;
s32 unk20;
s32 unk24;
u8 fill28[0x32 - 0x28];
unkStruct_2039DB0 spriteMasks;
u32 unk34;
u32 unk38;
u8 fill3C[0x4C - 0x3C];
u32 effectID;
s32 paletteNum;
u8 fill40[0x4C - 0x40];
u32 unk4C;
s32 unk50;
u8 unk54;
u8 fill55[0xB8 - 0x55];
u8 fill55[0x58 - 0x55];
struct axObject unk58;
u8 fillA4[0xB8 - 0xA4];
u32 unkB8;
u8 fillBC[0xCC - 0xBC];
u32 unkCC;
s16 unkCC[2]; // NOTE: might be DungeonPos
};
struct unkStruct_203B0CC

View File

@@ -3,6 +3,6 @@
#include "structs/str_position.h"
void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32);
void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32 priority);
#endif // GUARD_CODE_800F958_H
#endif // GUARD_CODE_800F958_H

View File

@@ -5,7 +5,10 @@
void CloseAllSpriteFiles(void);
void sub_8068768(void);
void OpenDungeonPaletteFile(void);
void CloseDungeonPaletteFile(void);
void LoadDungeonPokemonSprites(void);
void LoadDungeonActivePokemonSprites(void);
void sub_80687AC(void);
OpenedFile *GetSpriteData(s32 _species);
void LoadPokemonSprite(s16 id, bool32);

View File

@@ -17,7 +17,7 @@ const u8 *GetCurrentMissionText(s16 index);
bool8 IsMazeCompleted(s16 mazeIndex);
bool8 sub_8096F50(WonderMail *mail);
void sub_8097418(s16 index, bool32);
void sub_8097418(s32 index, bool32);
bool8 sub_8097504(s16 mazeIndex);
const u8 *sub_80975DC(s16);

View File

@@ -7,7 +7,7 @@
typedef struct DungeonPokemonStatusSprite
{
/* 0x0 */ u32 status;
/* 0x4 */ u32 frame;
/* 0x4 */ s32 frame;
} DungeonPokemonStatusSprite;
// size: 0x40
@@ -19,13 +19,14 @@ typedef struct DungeonPokemonSprite
/* 0xA */ u16 unkA;
/* 0xC */ u32 status;
/* 0x10 */ u8 visible;
/* 0x11 */ u8 unk11;
/* 0x11 */ u8 priority;
/* 0x14 */ DungeonPos pos;
/* 0x18 */ DungeonPos statusOffsets[2];
/* 0x20 */ u32 unk20;
/* 0x24 */ u32 unk24;
/* 0x28 */ DungeonPokemonStatusSprite statusSprites[2];
/* 0x38 */ u8 unk38;
u16 fill3A;
/* 0x3C */ u16 unk3C;
/* 0x3E */ u16 unk3E;
} DungeonPokemonSprite;
@@ -33,10 +34,10 @@ typedef struct DungeonPokemonSprite
// size: 0x584
typedef struct DungeonPokemonSprites
{
/* 0x0 */ u32 frame;
/* 0x0 */ s32 frame;
/* 0x4 */ DungeonPokemonSprite sprites[22];
} DungeonPokemonSprites;
extern DungeonPokemonSprites *gDungeonPokemonSprites;
#endif // GUARD_DUNGEON_POKEMON_SPRITES_H
#endif // GUARD_DUNGEON_POKEMON_SPRITES_H

View File

@@ -146,7 +146,7 @@ void GetScriptVarRef(struct ScriptVarPtr *out, u8 *localVarBuf, s32 varId);
s32 GetScriptVarValue(u8 *localVarBuf, s32 varId);
s32 GetScriptVarArrayValue(u8 *localVarBuf, s32 varId, u16 idx);
void SetScriptVarValue(u8 *localVarBuf, s32 varId, s32 val);
void SetScriptVarArrayValue(u8 *localVarBuf, s32 varId, u16 idx, s32 val);
void SetScriptVarArrayValue(u8 *localVarBuf, s32 varId, s32 idx, s32 val);
s32 GetScriptVarArraySum(u8 *localVarBuf, s16 varId);
void GetScriptVarScenario(s32 varId,u32 *outMain,u32 *outSub);
void ScenarioCalc(s16 varId, s32 main, s32 sub);

View File

@@ -12,12 +12,14 @@
#if defined(__APPLE__) || defined(__CYGWIN__)
#define _(x) x
#define __(x) x
#define INCBIN_U8 {0}
#define INCBIN_U16 {0}
#define INCBIN_U32 {0}
#define INCBIN_S8 {0}
#define INCBIN_S16 {0}
#define INCBIN_S32 {0}
#define INCBIN(...) {0}
#define INCBIN_U8 INCBIN
#define INCBIN_U16 INCBIN
#define INCBIN_U32 INCBIN
#define INCBIN_S8 INCBIN
#define INCBIN_S16 INCBIN
#define INCBIN_S32 INCBIN
#define INCBIN_COMP INCBIN
#endif
// Prevent cross-jump optimization.

View File

@@ -47,5 +47,9 @@ void sub_8013AA0(unkStructFor8013AA0 *);
u32 sub_8013BBC(unkStructFor8013AA0 *);
void sub_8013C68(unkStructFor8013AA0 *);
void sub_8013D10(unkStructFor8013AA0 *);
void sub_8013E54(void);
void sub_8013F84(void);
void sub_80140B4(UnkTextStruct2 *);
#endif // GUARD_MENU_INPUT_H

View File

@@ -105,6 +105,7 @@ void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon);
void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level);
const u8* DecompressMoveID(const u8* a1, u16* moveID);
bool8 sub_808DA44(s32, u32);
void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1);
static inline bool8 PokemonFlag1(PokemonStruct1 *mon)
{

View File

@@ -8,9 +8,6 @@
// TODO: once the files close to string_format.c are decompiled, check if these should be included here. Most likely, they should be declared elsewhere.
// code_80130A8.s
void sub_8013E54(void);
void sub_8013F84(void);
void sub_80140B4(UnkTextStruct2 *);
void sub_80140DC(void);
void sub_8014114(void);
s32 sub_80144A4(s32 *);

View File

@@ -0,0 +1,37 @@
#ifndef GUARD_STRUCTS_CODE_800E9E4_H
#define GUARD_STRUCTS_CODE_800E9E4_H
typedef struct unkStruct_80B9C60
{
s32 unk0;
s32 unk1;
s32 unk2;
} unkStruct_80B9C60;
typedef struct unkStruct_80CE37C
{
s16 unk0;
s16 unk2;
} unkStruct_80CE37C;
typedef struct unkStruct_80C183C
{
// size: 0xc
s16 unk0;
s16 unk2;
u8 fill4[0xc - 0x4];
} unkStruct_80C183C;
typedef struct unkStruct_800EA44
{
s16 unk0;
s16 unk2;
} unkStruct_800EA44;
typedef struct unkStruct_800E208
{
s32 unk00[7];
unkStruct_80B9C60 unk1c;
} unkStruct_800E208;
#endif

View File

@@ -79,7 +79,7 @@ typedef struct UnkDungeonGlobal_unk181E8_sub
u32 unk181FC; // x14
u32 unk18200; // x18
u32 unk18204; // x1C
u8 unk18208; // x20
u8 priority; // x20
/* 0x18209 */ u8 visibilityRange; // x21 Dungeon light level.
/* 0x1820A */ bool8 blinded; // x22 Blacks out the screen when the player has the Blinker status.
bool8 unk1820B; // x23

View File

@@ -161,4 +161,19 @@ struct FaceData
u8 *unk0[5];
};
struct unkStruct_808D144
{
/* 0x0 */ u8 *name;
/* 0x4 */ s16 speciesNum;
/* 0x6 */ u8 itemID;
/* 0x8 */ struct DungeonLocation dungeonLocation;
/* 0xC */ u16 moveID[MAX_MON_MOVES];
/* 0x14 */ s16 pokeHP;
/* 0x16 */ u16 level;
/* 0x18 */ u16 IQ;
s16 offenseAtk[2]; // atk, spatt, def, spdef (not sure why s16/u16 and not u8)
s16 offenseDef[2];
/* 0x24 */ u32 currExp;
};
#endif // GUARD_STR_POKEMON_H

View File

@@ -56,7 +56,6 @@ SECTIONS {
src/event_flag.o(.text);
asm/code_8002774.o(.text);
src/code_8002774.o(.text);
asm/code_8002774_2.o(.text);
src/memory.o(.text);
asm/code_80035F0.o(.text);
src/other_random.o(.text);
@@ -89,6 +88,7 @@ SECTIONS {
src/code_800E9E4.o(.text);
src/code_800ED38.o(.text);
asm/code_800ED38.o(.text);
src/code_800F034.o(.text);
src/code_800F958.o(.text);
asm/code_800F990.o(.text);
src/code_8010EF0.o(.text);
@@ -102,7 +102,6 @@ SECTIONS {
src/quick_save_write.o(.text);
src/code_8012A18.o(.text);
src/menu_input.o(.text);
asm/code_80130A8.o(.text);
src/string_format.o(.text);
src/code_8015080.o(.text);
asm/code_8015080.o(.text);
@@ -252,7 +251,6 @@ SECTIONS {
asm/code_80718D8.o(.text);
src/code_8072B78.o(.text);
src/dungeon_ai_leader.o(.text);
asm/code_8072CF4.o(.text);
src/dungeon_ai_items.o(.text);
src/code_8073CF0.o(.text);
src/code_8075708.o(.text);
@@ -317,7 +315,6 @@ SECTIONS {
src/position_util.o(.text);
asm/code_8098468.o(.text);
src/ground_main.o(.text);
asm/code_8098BDC.o(.text);
src/code_8099328.o(.text);
src/code_8099360.o(.text);
asm/code_8099360.o(.text);
@@ -429,6 +426,9 @@ SECTIONS {
src/main.o(.rodata);
src/reg_control.o(.rodata);
data/data_80B9BB8_2.o(.rodata);
src/code_800F034.o(.rodata);
src/code_800F958.o(.rodata);
data/data_80CE77C.o(.rodata);
src/debug.o(.rodata);
src/save.o(.rodata);
src/save_read.o(.rodata);

View File

@@ -1,6 +1,95 @@
#include "global.h"
#include "code_8002774.h"
#include "constants/direction.h"
#include "structs/str_position.h"
#include "other_random.h"
extern PixelPos gVectorDirections[8];
void sub_800290C(PixelPos *param_1, s32 param_2)
{
if (param_1->x > param_2)
param_1->x = param_2;
else if (param_1->x < -param_2)
param_1->x = -param_2;
if (param_1->y > param_2)
param_1->y = param_2;
else if(param_1->y < -param_2)
param_1->y = -param_2;
}
void sub_8002934(PixelPos *param_1, PixelPos *param_2, PixelPos *param_3, s32 param_4, s32 param_5)
{
s32 r9 = (param_4 + param_5);
param_1->x = (param_4 * param_2->x + param_5 * param_3->x) / r9;
param_1->y = (param_4 * param_2->y + param_5 * param_3->y) / r9;
}
static inline s8 sub_8002984_sub(s32 direction1, s32 rand, s32 add, s32 multi)
{
return (s8)(((direction1 + add) + OtherRandInt(rand) * multi) % NUM_DIRECTIONS);
}
s32 sub_8002984(s32 _direction1, u32 caseID)
{
s32 direction1;
direction1 = (s8)_direction1;
switch((u8)caseID) {
case 1:
if (direction1 >= 0) {
direction1 += 7;
direction1 &= DIRECTION_MASK;
}
break;
case 2:
if (direction1 >= 0) {
direction1 += 1;
direction1 &= DIRECTION_MASK;
}
break;
case 3:
if (direction1 >= 0) {
direction1 += 6;
direction1 &= DIRECTION_MASK;
}
break;
case 4:
if (direction1 >= 0) {
direction1 += 2;
direction1 &= DIRECTION_MASK;
}
break;
case 5:
if (direction1 >= 0) {
direction1 += 4;
direction1 &= DIRECTION_MASK;
}
break;
case 6:
if ((direction1 & 1) != 0) {
direction1 = sub_8002984_sub(direction1, 2, 7, 2);
}
else
{
direction1 = sub_8002984_sub(direction1, 3, 6, 2);
}
break;
case 7:
direction1 = sub_8002984_sub(direction1, 3, 7, 1);
break;
case 8:
direction1 = (s8)(OtherRandInt(NUM_DIRECTIONS) & 0xfe);
break;
case 9:
direction1 = (s8)OtherRandInt(NUM_DIRECTIONS);
break;
default:
break;
}
return direction1;
}
s32 sub_8002A70(s32 _direction1, s32 _direction2, s32 _caseId)
{
@@ -66,3 +155,326 @@ s32 sub_8002B04(s32 _direction1, s32 _direction2)
}
return direction1;
}
UNUSED s32 sub_8002B5C(s32 _direction1, s32 _direction2)
{
int newDirection;
int direction1;
int direction2;
direction1 = (s8)_direction1;
direction2 = (s8)_direction2;
if (direction2 != -1) {
newDirection = ((direction2 + NUM_DIRECTIONS) - direction1) % NUM_DIRECTIONS;
if (newDirection != 0) {
if (newDirection < 4) {
newDirection = (direction1 + 2) % NUM_DIRECTIONS;
}
else {
newDirection = (direction1 + 6) % NUM_DIRECTIONS;
}
direction1 = (s8)(newDirection);
}
}
return direction1 & DIRECTION_MASK_CARDINAL;
}
PixelPos SetVecFromDirectionSpeed(s8 r1, u32 r2)
{
PixelPos *vec = &gVectorDirections[r1];
return (PixelPos){ .x = vec->x * r2, .y = vec->y * r2 };
}
s32 VecDirection8Sign(PixelPos *param_1)
{
if (param_1->x < 0) {
if (param_1->y < 0) {
return DIRECTION_NORTHWEST;
}
else if (param_1->y > 0) {
return DIRECTION_SOUTHWEST;
}
else {
return DIRECTION_WEST;
}
}
else if (param_1->x > 0) {
if (param_1->y < 0) {
return DIRECTION_NORTHEAST;
}
else if (param_1->y > 0) {
return DIRECTION_SOUTHEAST;
}
else {
return DIRECTION_EAST;
}
}
else if (param_1->y < 0) {
return DIRECTION_NORTH;
}
else if (param_1->y > 0) {
return DIRECTION_SOUTH;
}
else {
return -1;
}
}
s32 VecDirection4SignYX(PixelPos *param_1)
{
if (param_1->y < 0) {
return DIRECTION_NORTH;
}
else if (param_1->y > 0) {
return DIRECTION_SOUTH;
}
else if (param_1->x < 0) {
return DIRECTION_WEST;
}
else if (param_1->x > 0) {
return DIRECTION_EAST;
}
else {
return -1;
}
}
// https://decomp.me/scratch/bD5wO
s8 VecDirection8Radial(PixelPos *param_1)
{
#ifdef NONMATCHING
s32 r0;
s32 r1;
s32 r2;
s32 r3;
s32 r4;
s32 r5;
#else
register s32 r0;
register s32 r1 asm("r1");
register s32 r2 asm("r2");
register s32 r3 asm("r3");
register s32 r4 asm("r4");
register s32 r5;
#endif
r0 = param_1->x;
if (r0 < 0) {
r0 = -r0;
}
r1 = r0;
r3 = param_1->y;
r5 = r3;
if (r3 < 0) {
r5 = -r3;
}
r2 = r5;
r4 = param_1->x;
if (r4 < 0) {
if (r3 < 0) {
if (r2 > r0 * 2) {
return DIRECTION_NORTH;
}
if (r1 <= r5 * 2) {
return DIRECTION_NORTHWEST;
}
return DIRECTION_WEST;
}
if (r2 <= r0 * 2) {
if (r1 > r5 * 2) {
return DIRECTION_WEST;
}
return DIRECTION_SOUTHWEST;
}
}
else {
if (0 < r4) {
if (r3 < 0) {
if (r2 > r0 * 2) {
return DIRECTION_NORTH;
}
if (r1 <= r5 * 2) {
return DIRECTION_NORTHEAST;
}
return DIRECTION_EAST;
}
else {
if (r2 > r0 * 2) {
return DIRECTION_SOUTH;
}
if (r1 > r5 * 2) {
return DIRECTION_EAST;
}
return DIRECTION_SOUTHEAST;
}
}
if (r3 < 0) {
return DIRECTION_NORTH;
}
if (r3 < 1) {
return -1;
}
}
return DIRECTION_SOUTH;
}
// https://decomp.me/scratch/Bgbxc
s8 VecDirection4Radial(PixelPos *param_1)
{
#ifdef NONMATCHING
s32 r0;
s32 r1;
s32 r2;
s32 r3;
s32 r4;
s32 r5;
#else
register s32 r0 asm("r3");
register s32 r1 asm("r1");
register s32 r2 asm("r2");
register s32 r3;
register s32 r4;
register s32 r5 asm("r0");
#endif
r0 = param_1->x;
if (r0 < 0) {
r0 = -r0;
}
r1 = r0;
r3 = param_1->y;
r5 = r3;
if (r3 < 0) {
r5 = -r3;
}
r2 = r5;
r4 = param_1->x;
if (r4 < 0) {
if (r3 < 0) {
if (r2 > r1) {
return DIRECTION_NORTH;
}
else
return DIRECTION_WEST;
}
if (r2 <= r1) {
return DIRECTION_WEST;
}
}
else {
if (0 < r4) {
if (r3 < 0) {
if (r2 > r1) {
return DIRECTION_NORTH;
}
else
return DIRECTION_EAST;
}
else {
if (r2 > r1) {
return DIRECTION_SOUTH;
}
return DIRECTION_EAST;
}
}
if (r3 < 0) {
return DIRECTION_NORTH;
}
if (r3 < 1) {
return -1;
}
}
return DIRECTION_SOUTH;
}
s8 SizedDeltaDirection4(PixelPos *r0, PixelPos *r1, PixelPos *r2, PixelPos *r3) {
PixelPos stack;
s32 iVar1;
s32 iVar2;
s32 iVar3;
stack.x = r2->x - r0->x;
stack.y = r2->y - r0->y;
if(stack.x >= 0)
{
iVar3 = (stack.x + 1);
iVar3 -= ((r1->x + r3->x) / 2);
stack.x = iVar3;
if(stack.x < 0) stack.x = 0;
}
else
{
iVar1 = (stack.x - 1);
iVar1 += ((r1->x + r3->x) / 2);
stack.x = iVar1;
if(stack.x > 0) stack.x = 0;
}
if(stack.y >= 0)
{
iVar2 = (stack.y + 1);
iVar2 -= ((r1->y + r3->y) / 2);
stack.y = iVar2;
if(stack.y < 0) stack.y = 0;
}
else
{
iVar1 = (stack.y - 1);
iVar1 += ((r1->y + r3->y) / 2);
stack.y = iVar1;
if(stack.y > 0) stack.y = 0;
}
return VecDirection4Radial(&stack);
}
s8 SizedDeltaDirection8(PixelPos *r0, PixelPos *r1, PixelPos *r2, PixelPos *r3) {
PixelPos stack;
s32 iVar1;
s32 iVar2;
s32 iVar3;
stack.x = r2->x - r0->x;
stack.y = r2->y - r0->y;
if(stack.x >= 0)
{
iVar3 = (stack.x + 1);
iVar3 -= ((r1->x + r3->x) / 2);
stack.x = iVar3;
if(stack.x < 0) stack.x = 0;
}
else
{
iVar1 = (stack.x - 1);
iVar1 += ((r1->x + r3->x) / 2);
stack.x = iVar1;
if(stack.x > 0) stack.x = 0;
}
if(stack.y >= 0)
{
iVar2 = (stack.y + 1);
iVar2 -= ((r1->y + r3->y) / 2);
stack.y = iVar2;
if(stack.y < 0) stack.y = 0;
}
else
{
iVar1 = (stack.y - 1);
iVar1 += ((r1->y + r3->y) / 2);
stack.y = iVar1;
if(stack.y > 0) stack.y = 0;
}
return VecDirection8Radial(&stack);
}

View File

@@ -11,8 +11,8 @@ EWRAM_INIT struct unkStruct_203B0CC *gUnknown_203B0CC = NULL;
struct unkStruct_800F18C
{
u32 unk0;
u32 unk4;
s32 effectID;
u32 counter;
};
extern s32 sub_800E2C0(u32);
@@ -144,16 +144,16 @@ void sub_800DC14(s32 param_1)
if (preload->unk34 == 3) {
for (index2 = 0; index2 < 2; index2 = index2 + 1) {
piVar3 = sub_800F18C(index2);
if (piVar3->unk0 == preload->unk38) {
piVar3->unk4--;
if (piVar3->effectID == preload->effectID) {
piVar3->counter--;
break;
}
}
}
else {
puVar4 = sub_800F18C(1);
puVar4->unk4 = 0;
puVar4->unk0 = 0xffffffff;
puVar4->counter = 0;
puVar4->effectID = -1;
}
sub_800DCA8(preload);
}

View File

@@ -1,11 +1,131 @@
#include "global.h"
#include "structs/code_800E9E4.h"
#include "code_800DAC0.h"
#include "code_800E9A8.h"
#include "code_800E9E4.h"
#include "structs/str_position.h"
s32 sub_800E2C0(u32);
struct unkStruct_203B0CC *gUnknown_203B0CC;
void sub_800DE38(struct unkStruct_203B0CC_sub *);
void sub_800DE8C(struct unkStruct_203B0CC_sub *, DungeonPos *);
void sub_800DD0C(struct unkStruct_203B0CC_sub *, DungeonPos *);
void sub_800DCD0(struct unkStruct_203B0CC_sub *);
s32 sub_800E900(s32 r0);
s32 sub_800E208(s32, unkStruct_800E208*);
bool8 sub_800E7D0(u16 *param_1)
{
int local_1c [4];
bool8 flag;
s32 index;
flag = FALSE;
local_1c[0] = sub_800ECB8(*param_1)->unk0;
local_1c[1] = sub_800ECB8(*param_1)->unk2;
local_1c[2] = sub_800ECB8(*param_1)->unk4;
local_1c[3] = sub_800ECB8(*param_1)->unk6;
for(index = 0; index < 4; index++)
{
flag = (sub_800ECA4(local_1c[index])->animType == 4);
if(flag) break;
}
return flag;
}
bool8 sub_800E838(u16 *param_1, s32 param_2)
{
s32 local_1c [4];
local_1c[0] = sub_800ECB8(*param_1)->unk0;
local_1c[1] = sub_800ECB8(*param_1)->unk2;
local_1c[2] = sub_800ECB8(*param_1)->unk4;
local_1c[3] = sub_800ECB8(*param_1)->unk6;
return sub_800ECA4(local_1c[param_2])->animType == 4;
}
// TODO: look at this later
// https://decomp.me/scratch/luz2f
u32 sub_800E890(unkStruct_80416E0 *param_1)
{
param_1->unk14 = sub_800E900(param_1->unk0);
return sub_800E208(7, (void*)&param_1->unk0);
}
void sub_800E8AC(s32 a0, DungeonPos *a1, DungeonPos *a2, s32 a3, unkStruct_2039DB0 *a4)
{
s32 index;
struct unkStruct_203B0CC_sub *ptr;
index = sub_800E2C0(a0);
if(index != -1)
{
ptr = &gUnknown_203B0CC->unk0[index];
if(a1 != NULL) ptr->unk18 = *a1;
if(a2 != NULL) ptr->unk1c = *a2;
if(a3 != 0xFFFF) ptr->unk24 = a3;
if(a4 != NULL) ptr->spriteMasks = *a4;
}
}
s32 sub_800E900(s32 r0)
{
return sub_800ECA4(r0)->unk1c;
}
bool8 sub_800E90C(DungeonPos *param_1)
{
bool8 flag;
s32 iVar1;
struct unkStruct_203B0CC_sub *ptr;
flag = FALSE;
for(iVar1 = 0, ptr = &gUnknown_203B0CC->unk0[iVar1]; iVar1 < 0x20; iVar1++, ptr++)
{
if(ptr->unk4 != -1)
{
if(ptr->unk10 <= 0)
{
if(ptr->unk34 == 4)
{
sub_800DE8C(ptr, param_1);
}
else
{
sub_800DD0C(ptr, param_1);
}
}
if(ptr->unk10 > 0)
ptr->unk10--;
sub_800DCD0(ptr);
if(ptr->unk54 == 0)
flag = TRUE;
}
}
return flag;
}
void sub_800E970(void)
{
s32 iVar1;
struct unkStruct_203B0CC_sub *ptr;
for(iVar1 = 0, ptr = &gUnknown_203B0CC->unk0[iVar1]; iVar1 < 0x20; iVar1++, ptr++)
{
if(ptr->unk4 != -1)
if(ptr->unk10 <= 0)
if(ptr->unk34 != 4)
sub_800DE38(ptr);
}
}
bool8 sub_800E9A8(s32 a0)
{
s32 i;

View File

@@ -1,4 +1,5 @@
#include "global.h"
#include "structs/code_800E9E4.h"
#include "code_800E9E4.h"
#include "code_800E9A8.h"
@@ -9,44 +10,20 @@ s32 sub_800EC68(s32);
struct unkStruct_203B0CC *gUnknown_203B0CC;
typedef struct unkStruct_80B9C60
{
s32 unk0;
s32 unk1;
s32 unk2;
} unkStruct_80B9C60;
extern unkStruct_80B9C60 gUnknown_80B9C60;
extern s32 gUnknown_80B9C9C[8];
extern s16 gUnknown_80CE73C[20];
typedef struct unkStruct_80CE37C
{
s16 unk0;
s16 unk2;
} unkStruct_80CE37C;
unkStruct_80CE37C gUnknown_80CE37C[1];
extern unkStruct_80BDBC4 gUnknown_80BDBC4[430];
extern unkStruct_80B9CC4 gUnknown_80B9CC4[448];
typedef struct unkStruct_80C183C
{
// size: 0xc
s16 unk0;
s16 unk2;
u8 fill4[0xc - 0x4];
} unkStruct_80C183C;
extern unkStruct_80C183C gUnknown_80C183C[4336];
unkStruct_80C183C *sub_800ECD0(s32 param_1);
typedef struct unkStruct_800EA44
{
s16 unk0;
s16 unk2;
} unkStruct_800EA44;
u8 sub_800EA44(unkStruct_800EA44 param_1, s32 param_2)
{
@@ -70,11 +47,6 @@ u8 sub_800EA44(unkStruct_800EA44 param_1, s32 param_2)
return ret->unk10;
}
typedef struct unkStruct_800E208
{
s32 unk00[7];
unkStruct_80B9C60 unk1c;
} unkStruct_800E208;
s32 sub_800E208(s32, unkStruct_800E208*);
@@ -101,34 +73,34 @@ s32 sub_800EA84(s32 *param_1)
return sub_800E208(5, &stack[0]);
}
void sub_800EAE4(s32 param_1, s32 *param_2, unkStruct_800EAE4 *param_3)
void sub_800EAE4(s32 param_1, DungeonPos *param_2, DungeonPos *param_3)
{
s32 idx = sub_800E2C0(param_1);
if (idx != -1)
{
struct unkStruct_203B0CC_sub *a;
a = &gUnknown_203B0CC->unk0[idx];
a->unk18 = param_2[0];
a->unk18 = *param_2;
if (a->unk20 != -1)
{
a->unk1c = *param_3;
}
else
{
a->unk1c.unk0 = 0;
a->unk1c.unk2 = 0;
a->unk1c.x = 0;
a->unk1c.y = 0;
}
}
}
void sub_800EB24(s32 param_1, s32 *param_2, unkStruct_800EAE4 *param_3, s32 r5, s32 r4)
void sub_800EB24(s32 param_1, DungeonPos *param_2, DungeonPos *param_3, s32 r5, s32 r4)
{
s32 idx = sub_800E2C0(param_1);
if (idx != -1) {
struct unkStruct_203B0CC_sub *curStruct;
curStruct = &gUnknown_203B0CC->unk0[idx];
if (curStruct->unkCC == 0) {
curStruct->unk18 = param_2[0];
if (curStruct->unkCC[0] == 0 && curStruct->unkCC[1] == 0) {
curStruct->unk18 = *param_2;
}
if (curStruct->unk0 == 6) {
@@ -147,8 +119,8 @@ void sub_800EB24(s32 param_1, s32 *param_2, unkStruct_800EAE4 *param_3, s32 r5,
curStruct->unk1c = *param_3;
}
else {
curStruct->unk1c.unk0 = 0;
curStruct->unk1c.unk2 = 0;
curStruct->unk1c.x = 0;
curStruct->unk1c.y = 0;
}
}
}
@@ -182,7 +154,7 @@ s32 sub_800EBC8(s32 *param_1)
return sub_800E208(6, &stack[0]);
}
void sub_800EC28(u32 param_1, s32 *param_2, unkStruct_800EAE4 *param_3)
void sub_800EC28(u32 param_1, DungeonPos *param_2, DungeonPos *param_3)
{
s32 idx;
idx = sub_800E2C0(param_1);
@@ -190,15 +162,15 @@ void sub_800EC28(u32 param_1, s32 *param_2, unkStruct_800EAE4 *param_3)
{
struct unkStruct_203B0CC_sub *struct203B0CC;
struct203B0CC = &gUnknown_203B0CC->unk0[idx];
struct203B0CC->unk18 = param_2[0];
struct203B0CC->unk18 = *param_2;
if (struct203B0CC->unk20 != -1)
{
struct203B0CC->unk1c = *param_3;
}
else
{
struct203B0CC->unk1c.unk0 = 0;
struct203B0CC->unk1c.unk2 = 0;
struct203B0CC->unk1c.x = 0;
struct203B0CC->unk1c.y = 0;
}
}
}

140
src/code_800F034.c Normal file
View File

@@ -0,0 +1,140 @@
#include "global.h"
#include "globaldata.h"
#include <stdio.h>
#include "code_800E9E4.h"
#include "file_system.h"
#include "memory.h"
struct unkStruct_800F18C
{
s32 effectID;
u32 counter;
};
struct unkStruct_203B0D4
{
struct unkStruct_800F18C unk0[2];
};
struct unkStruct_203B0D4 *gUnknown_203B0D4;
ALIGNED(4) static const u8 gUnknown_80CE77C[] = "efob%03d";
ALIGNED(4) static const u8 gUnknown_80CE788[] = "efbg%03d";
extern struct FileArchive gEffectFileArchive;
void sub_800F034(void) {
s32 index;
if(gUnknown_203B0D4 == NULL)
{
gUnknown_203B0D4 = MemoryAlloc(sizeof(struct unkStruct_203B0D4), 0xB);
MemoryClear8(gUnknown_203B0D4, sizeof(struct unkStruct_203B0D4));
}
for(index = 0; index < 2; index++)
{
gUnknown_203B0D4->unk0[index].effectID = -1;
gUnknown_203B0D4->unk0[index].counter = 0;
}
}
void sub_800F078(void)
{
if(gUnknown_203B0D4)
{
MemoryFree(gUnknown_203B0D4);
gUnknown_203B0D4 = NULL;
}
}
void sub_800F094(void)
{
s32 index;
for(index = 0; index < 2; index++)
{
gUnknown_203B0D4->unk0[index].effectID = -1;
gUnknown_203B0D4->unk0[index].counter = 0;
}
}
s32 sub_800F0C0(s32 animType, s32 effectID)
{
if (animType == 3) {
if (gUnknown_203B0D4->unk0[0].effectID == effectID) return 0;
}
else {
if (gUnknown_203B0D4->unk0[1].effectID == effectID) return 1;
}
return -3;
}
s32 sub_800F0F4(s32 animType, s32 effectID)
{
if (animType == 3) {
if (gUnknown_203B0D4->unk0[0].effectID == effectID) return -2;
if (gUnknown_203B0D4->unk0[0].counter == 0) return 0;
}
else {
if (gUnknown_203B0D4->unk0[1].effectID == effectID) return -2;
if (gUnknown_203B0D4->unk0[1].counter == 0) return 1;
}
return -1;
}
void sub_800F13C(s32 index, OpenedFile *file, unkStruct_80B9CC4 * r2)
{
if(gUnknown_203B0D4->unk0[index].counter == 0)
gUnknown_203B0D4->unk0[index].effectID = r2->effectId;
}
void sub_800F15C(s32 effectID)
{
s32 index;
for(index = 0; index < 2; index++)
{
if(gUnknown_203B0D4->unk0[index].effectID == effectID)
{
gUnknown_203B0D4->unk0[index].counter++;
break;
}
}
}
struct unkStruct_800F18C *sub_800F18C(s32 index)
{
return &gUnknown_203B0D4->unk0[index];
}
s32 sub_800F19C(s32 index)
{
if(gUnknown_203B0D4->unk0[index].counter == 0)
return 0;
else
return 1;
}
OpenedFile * sub_800F1C0(u32 animType, s32 effectID)
{
u8 fileName [8];
switch(animType)
{
case 1:
case 2:
case 3:
sprintf(fileName,gUnknown_80CE77C,effectID); // efob
break;
case 4:
sprintf(fileName,gUnknown_80CE788,effectID); // efbg
break;
}
return Call_OpenFileAndGetFileDataPtr(fileName,&gEffectFileArchive);
}
void sub_800F204(OpenedFile *file)
{
CloseFile(file);
}

View File

@@ -1,14 +1,421 @@
#include "global.h"
#include "globaldata.h"
#include "code_800F958.h"
#include "code_8009804.h"
#include "cpu.h"
#include "dungeon_pokemon_sprites.h"
#include "memory.h"
#include "sprite.h"
#include "structs/sprite_oam.h"
#include <stdio.h>
extern DungeonPokemonSprite *NewDungeonPokemonSprite(void);
extern DungeonPokemonSprite* GetDungeonPokemonSprite(s32 id);
struct StatusGraphicsInfo
{
/* 0x0 */ s32 width;
/* 0x4 */ s32 height;
/* 0x8 */ s32 vramIndex;
/* 0xC */ s32 unk;
/* 0x10 */ s32 graphicsCount;
/* 0x14 */ s32 offsetIntoGraphic;
};
#define TILE_SIZE_2BPP 32
const struct StatusGraphicsInfo gStatusGraphics[] = {
{0, 0, 0, 0, 0, 0},
{1, 1, 0, 0, 14, TILE_SIZE_2BPP * 0 }, // sleepless
{2, 2, 1, 0, 7, TILE_SIZE_2BPP * 14 }, // burned
{2, 2, 5, 0, 16, TILE_SIZE_2BPP * 42 }, // poisoned
{4, 4, 9, 0, 6, TILE_SIZE_2BPP * 106}, // frozen
{4, 2, 25, 0, 4, TILE_SIZE_2BPP * 202}, // confused
{2, 2, 33, 0, 9, TILE_SIZE_2BPP * 234}, // whiffer
{2, 2, 37, 0, 8, TILE_SIZE_2BPP * 270}, // taunted
{1, 2, 41, 0, 8, TILE_SIZE_2BPP * 302}, // lowhp
{2, 2, 43, 0, 13, TILE_SIZE_2BPP * 318}, // shield
{2, 2, 47, 10, 10, TILE_SIZE_2BPP * 370}, // statdown
{2, 2, 51, 0, 13, TILE_SIZE_2BPP * 410}, // sword
{1, 1, 55, 0, 14, TILE_SIZE_2BPP * 462}, // blinker
{2, 2, 56, 0, 10, TILE_SIZE_2BPP * 476}, // cross-eyed
{1, 1, 60, 0, 14, TILE_SIZE_2BPP * 516}, // eyedrops
{2, 2, 61, 0, 8, TILE_SIZE_2BPP * 530}, // muzzled
{2, 2, 65, 4, 10, TILE_SIZE_2BPP * 562}, // sleep
};
extern const u8 gStatusGraphics4bpp[16][3072];
// static const u8 *gStatusGraphics4bpp[16][3072] = {
// INCBIN_U8("graphics/status/sleepless.4bpp"),
// INCBIN_U8("graphics/status/burned.4bpp"),
// INCBIN_U8("graphics/status/poisoned.4bpp"),
// INCBIN_U8("graphics/status/frozen.4bpp"),
// INCBIN_U8("graphics/status/confused.4bpp"),
// INCBIN_U8("graphics/status/whiffer.4bpp"),
// INCBIN_U8("graphics/status/taunted.4bpp"),
// INCBIN_U8("graphics/status/lowhp.4bpp"),
// INCBIN_U8("graphics/status/shield.4bpp"),
// INCBIN_U8("graphics/status/statdown.4bpp"),
// INCBIN_U8("graphics/status/sword.4bpp"),
// INCBIN_U8("graphics/status/blinker.4bpp"),
// INCBIN_U8("graphics/status/cross_eyed.4bpp"),
// INCBIN_U8("graphics/status/eyedrops.4bpp"),
// INCBIN_U8("graphics/status/muzzled.4bpp"),
// INCBIN_U8("graphics/status/sleep.4bpp")
// };
struct StatusSprite
{
u32 image;
u32 palette;
};
extern struct StatusSprite gStatusSprites[8];
extern SpriteOAM gUnknown_203B0DC;
extern DungeonPos gUnknown_80D3564;
void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32 r3) {
void DrawStatusSprite(s16 param_1,s32 status,DungeonPos *pos,DungeonPos *posOffset,
DungeonPos *posScreen,u32 priority, u32 unused);
DungeonPokemonSprite *GetDungeonPokemonSprite(s32 id)
{
s32 index;
for(index = 0; index < 22; index++)
{
if(gDungeonPokemonSprites->sprites[index].exists && gDungeonPokemonSprites->sprites[index].id == id)
{
return &gDungeonPokemonSprites->sprites[index];
}
}
return NULL;
}
DungeonPokemonSprite *NewDungeonPokemonSprite(void){
s32 index;
DungeonPokemonSprite *sprite;
for(index = 0; index < 22; index++)
{
sprite = &gDungeonPokemonSprites->sprites[index];
if(!sprite->exists)
{
return sprite;
}
}
return NULL;
}
u32 GetNextStatusSymbol(DungeonPokemonSprite *sprite, s32 statusIndex)
{
u32 uVar1;
u32 status;
s32 counter;
s32 max;
u32 uVar5;
u32 uVar6;
DungeonPokemonStatusSprite *statusSprite;
statusSprite = &sprite->statusSprites[statusIndex];
uVar5 = 0x10000000;
if (statusIndex == 0) {
uVar5 = 1;
}
uVar6 = 0x10000000;
if (statusIndex == 0) {
uVar6 = 0x8000000;
}
max = 1;
if (statusIndex == 0) {
max = 0x1c;
}
if (sprite->status == 0) {
return 0;
}
status = statusSprite->status;
uVar1 = uVar5;
if (status != 0) {
uVar1 = status;
}
for(counter = 0; counter < max; counter++)
{
uVar1 *= 2;
if (uVar1 > uVar6) {
uVar1 = uVar5;
}
if ((sprite->status & uVar1) != 0) {
return uVar1;
}
}
return 0;
}
u32 StatusSymbolBitToIndex(u32 statusBit)
{
u32 index;
index = 0;
while (statusBit != 0) {
statusBit >>= 1;
index++;
}
return index;
}
void sub_800F2EC(DungeonPokemonSprite *sprite, s32 index, DungeonPos *screenPos)
{
u32 newFrame;
DungeonPokemonStatusSprite *statusSprite;
u32 statusSymbol;
statusSprite = sprite->statusSprites + index;
if (sprite->status == 0) {
statusSprite->status = 0;
}
else {
if (statusSprite->status == 0) {
statusSprite->frame = 0;
}
if (statusSprite->frame < 1) {
statusSymbol = GetNextStatusSymbol(sprite,index);
if (statusSprite->status != statusSymbol) {
statusSprite->status = statusSymbol;
}
newFrame = 0x3c;
}
else {
newFrame = statusSprite->frame - 1;
}
statusSprite->frame = newFrame;
if ((sprite->visible != 0) && (statusSprite->status != 0)) {
DrawStatusSprite(sprite->species,StatusSymbolBitToIndex(statusSprite->status),&(sprite->pos),
&sprite->statusOffsets[index],screenPos,sprite->priority, sprite->id);
}
}
}
void DrawStatusSprite(s16 param_1, s32 status, DungeonPos *pos, DungeonPos *posOffset,
DungeonPos *posScreen, u32 priority, u32 unused)
{
struct StatusSprite sprite;
s32 posY;
s32 posX;
u32 uVar7;
s32 vramIndex;
const struct StatusGraphicsInfo *ptr;
sprite = gStatusSprites[status];
ptr = &gStatusGraphics[sprite.image];
vramIndex = (ptr->vramIndex + 0x32b);
SpriteSetPriority(&gUnknown_203B0DC, priority);
posX = (pos->x - ptr->width * 4 - posScreen->x) + posOffset->x;
posY = (pos->y - ptr->height * 4 - posScreen->y) + posOffset->y;
uVar7 = posY - 0x10;
if ((((-0x20 <= posX) && (-0x20 <= posY)) && (posX < 0xf0)) && (posY < 0xa0)) {
switch(sprite.image) {
case 1:
case 0xc:
case 0xe:
SpriteSetShape(&gUnknown_203B0DC, 0);
SpriteSetSize(&gUnknown_203B0DC, 0);
SpriteSetX(&gUnknown_203B0DC, posX);
SpriteSetY(&gUnknown_203B0DC, uVar7);
break;
case 8:
SpriteSetShape(&gUnknown_203B0DC, 2);
SpriteSetSize(&gUnknown_203B0DC, 0);
SpriteSetX(&gUnknown_203B0DC, posX);
SpriteSetY(&gUnknown_203B0DC, uVar7);
break;
case 2:
case 3:
case 6:
case 7:
case 9:
case 10:
case 11:
case 13:
case 15:
SpriteSetShape(&gUnknown_203B0DC, 0);
SpriteSetSize(&gUnknown_203B0DC, 1);
SpriteSetX(&gUnknown_203B0DC, posX);
SpriteSetY(&gUnknown_203B0DC, uVar7);
break;
case 0x10:
SpriteSetShape(&gUnknown_203B0DC, 0);
SpriteSetSize(&gUnknown_203B0DC, 1);
SpriteSetX(&gUnknown_203B0DC, posX + 8);
SpriteSetY(&gUnknown_203B0DC, uVar7);
break;
case 5:
SpriteSetShape(&gUnknown_203B0DC, 1);
SpriteSetSize(&gUnknown_203B0DC, 2);
SpriteSetX(&gUnknown_203B0DC, posX);
SpriteSetY(&gUnknown_203B0DC, uVar7);
break;
case 4:
SpriteSetShape(&gUnknown_203B0DC, 0);
SpriteSetSize(&gUnknown_203B0DC, 2);
SpriteSetX(&gUnknown_203B0DC, posX);
SpriteSetY(&gUnknown_203B0DC, posY);
break;
}
SpriteSetTileNum(&gUnknown_203B0DC, vramIndex);
SpriteSetPalNum(&gUnknown_203B0DC, sprite.palette);
AddSprite(&gUnknown_203B0DC,(pos->y - posScreen->y) / 2 + 1,NULL,NULL);
}
}
void LoadStatusGraphics(s32 graphicIndex, bool8 param_2)
{
s32 frame;
s32 size;
s32 vramIndex;
s32 offset;
u8 *ptr;
s32 graphicsCount;
const struct StatusGraphicsInfo *graphic = &gStatusGraphics[graphicIndex];
offset = graphic->offsetIntoGraphic;
graphicsCount = graphic->graphicsCount;
size = graphic->width * graphic->height * 0x20;
vramIndex = (graphic->vramIndex + 0x32b) * 0x20;
frame = (gDungeonPokemonSprites->frame / 4) % graphicsCount;
frame *= size;
ptr = (u8 *)gStatusGraphics4bpp + (offset) + (frame);
if (param_2) {
sub_80098BC((void *)(VRAM + 0x10000 + vramIndex), (void *)ptr, size);
}
else {
CpuCopy((void *)(VRAM + 0x10000 + vramIndex), ptr, size);
}
return;
}
void InitDungeonPokemonSprites(void)
{
if (gDungeonPokemonSprites == NULL) {
gDungeonPokemonSprites = MemoryAlloc(sizeof(DungeonPokemonSprites),0xc);
MemoryClear8(gDungeonPokemonSprites,sizeof(DungeonPokemonSprites));
}
gDungeonPokemonSprites->frame = 0;
LoadStatusGraphics(1,0);
LoadStatusGraphics(2,0);
LoadStatusGraphics(3,0);
LoadStatusGraphics(4,0);
LoadStatusGraphics(5,0);
LoadStatusGraphics(6,0);
LoadStatusGraphics(7,0);
LoadStatusGraphics(8,0);
LoadStatusGraphics(9,0);
LoadStatusGraphics(10,0);
LoadStatusGraphics(0xb,0);
LoadStatusGraphics(0xc,0);
LoadStatusGraphics(0xd,0);
LoadStatusGraphics(0xe,0);
LoadStatusGraphics(0xf,0);
LoadStatusGraphics(0x10,0);
return;
}
void FreeDungeonPokemonSprites(void)
{
if (gDungeonPokemonSprites != 0) {
MemoryFree(gDungeonPokemonSprites);
gDungeonPokemonSprites = NULL;
}
}
void UpdateDungeonPokemonSprite(s32 id, s32 species, s32 status, u32 visible)
{
DungeonPokemonSprite *sprite;
s32 species_s32 = (s16)species;
u32 visible_u8 = (u8)visible;
if (gDungeonPokemonSprites != 0) {
sprite = GetDungeonPokemonSprite(id);
if (sprite != 0) {
sprite->species = species_s32;
sprite->status = status;
sprite->visible = visible_u8;
sprite->unk38 = 0;
}
}
}
void sub_800F794(s32 id, s32 r1, s32 r2, s32 r3, s32 *r4)
{
if(gDungeonPokemonSprites)
{
DungeonPokemonSprite *sprite = GetDungeonPokemonSprite(id);
if(sprite)
{
sprite->unk38 = 1;
sprite->unk3C = r2;
sprite->unk3E = r3;
sprite->unk20 = r4[0];
sprite->unk24 = r4[3];
}
}
}
void sub_800F7D0(DungeonPos *r0)
{
s32 index;
if (gDungeonPokemonSprites == NULL)
return;
switch(gDungeonPokemonSprites->frame % 4) {
case 0:
LoadStatusGraphics(1, 1);
LoadStatusGraphics(2, 1);
LoadStatusGraphics(3, 1);
LoadStatusGraphics(4, 1);
break;
case 1:
LoadStatusGraphics(5, 1);
LoadStatusGraphics(6, 1);
LoadStatusGraphics(7, 1);
LoadStatusGraphics(8, 1);
break;
case 2:
LoadStatusGraphics(9, 1);
LoadStatusGraphics(0xA, 1);
LoadStatusGraphics(0xB, 1);
LoadStatusGraphics(0xC, 1);
break;
case 3:
LoadStatusGraphics(0xD, 1);
LoadStatusGraphics(0xE, 1);
LoadStatusGraphics(0xF, 1);
LoadStatusGraphics(0x10, 1);
break;
}
for (index = 0; index < 22; index++) {
if (gDungeonPokemonSprites->sprites[index].exists) {
DungeonPokemonSprite *spritePtr = &gDungeonPokemonSprites->sprites[index];
sub_800F2EC(spritePtr, 0, r0);
sub_800F2EC(spritePtr, 1, r0);
}
}
gDungeonPokemonSprites->frame++;
}
void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32 priority) {
DungeonPokemonSprite *dSprite;
DungeonPokemonSprite *newSprite;
DungeonPos newPos;
@@ -32,7 +439,7 @@ void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32 r3) {
newSprite->species = species_s32;
newSprite->status = 0;
newSprite->pos = *pos;
newSprite->unk11 = r3;
newSprite->priority = priority;
newPos = gUnknown_80D3564;
newSprite->statusOffsets[1] = newPos;
newSprite->statusOffsets[0] = newPos;
@@ -57,7 +464,7 @@ void DeletePokemonDungeonSprite(s32 id)
}
void sub_800F958(s32 dungeonSpriteID, DungeonPos *pos,
DungeonPos *statusOffsets, u32 a3)
DungeonPos *statusOffsets, u32 priority)
{
DungeonPokemonSprite *dSprite;
@@ -69,7 +476,7 @@ void sub_800F958(s32 dungeonSpriteID, DungeonPos *pos,
return;
dSprite->pos = *pos;
dSprite->unk11 = a3;
dSprite->priority = priority;
dSprite->statusOffsets[0] = statusOffsets[0];
dSprite->statusOffsets[1] = statusOffsets[3];
}

View File

@@ -60,12 +60,12 @@ void sub_803E490(u32 unused)
if(gDungeon->unk181e8.unk1821A)
{
gDungeon->unk181e8.unk18208 = 2;
gDungeon->unk181e8.priority = 2;
SetBG2RegOffsets(gDungeon->unk181e8.cameraPixelPos.x, gDungeon->unk181e8.cameraPixelPos.y);
}
else
{
gDungeon->unk181e8.unk18208 = 3;
gDungeon->unk181e8.priority = 3;
SetBG2RegOffsets(0, 0);
}
SetBG3RegOffsets(gDungeon->unk181e8.cameraPixelPos.x, gDungeon->unk181e8.cameraPixelPos.y - gDungeon->unk181e8.unk181FC);

View File

@@ -378,7 +378,7 @@ void sub_803EDF0(void)
SpriteSetMatrixNum(&gUnknown_202EDDC, 0);
SpriteSetSize(&gUnknown_202EDDC, 1);
SpriteSetTileNum(&gUnknown_202EDDC, 0x216);
SpriteSetPriority(&gUnknown_202EDDC, gDungeon->unk181e8.unk18208);
SpriteSetPriority(&gUnknown_202EDDC, gDungeon->unk181e8.priority);
SpriteSetPalNum(&gUnknown_202EDDC, gUnknown_202EDE8.unk2);
SpriteSetUnk6_0(&gUnknown_202EDDC, 0);
@@ -827,7 +827,7 @@ void sub_803F27C(bool8 a0)
}
strPtr->cameraTarget = NULL;
strPtr->unk18208 = 3;
strPtr->priority = 3;
strPtr->unk1821A = 0;
strPtr->unk18212 = 0;
strPtr->unk1821B = 0;

View File

@@ -15,6 +15,7 @@
#include "dungeon_util.h"
#include "items.h"
#include "structs/dungeon_entity.h"
#include "structs/sprite_oam.h"
#include "structs/str_dungeon.h"
extern u32 gStatusSpriteMasks_SleepClassStatus[];
@@ -67,10 +68,11 @@ s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3)
int counter;
s32 ret;
unkStruct_80416E0 auStack_10;
unkStruct_2039DB0 stack1C;
auStack_10.unk0 = param_2;
auStack_10.unk4 = 0;
auStack_10.unk8 = -1;
auStack_10.dir = -1;
auStack_10.x = pos->x / 256;
auStack_10.y = pos->y / 256;
@@ -79,7 +81,7 @@ s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3)
auStack_10.unk10 = 0;
auStack_10.unk12 = 0;
auStack_10.unk18 = 0xffff;
sub_8004E8C(&auStack_10.unk1C);
sub_8004E8C(&stack1C);
ret = sub_8041764(&auStack_10, FALSE);
if (param_3) {
counter = 0;

View File

@@ -1,4 +1,5 @@
#include "global.h"
#include "code_800DAC0.h"
#include "code_8041AD0.h"
#include "code_804267C.h"
#include "code_803E46C.h"
@@ -11,6 +12,7 @@
#include "dungeon_message.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "items.h"
#include "structs/str_dungeon.h"
extern const u16 gUnknown_80F67DC[4];
@@ -30,6 +32,119 @@ extern bool8 sub_8042CC0(void);
extern void sub_8042D7C(void);
extern u8 GetFloorType(void);
extern bool8 sub_8045888(Entity *);
extern s32 sub_80416E0(PixelPos*, u32, bool8);
extern u32 sub_8041764(unkStruct_80416E0 *, bool8);
extern void sub_8005700(DungeonPos *a0, struct axObject *a1);
extern u32 sub_800E49C();
extern void sub_800EF40(u8 r0, u8 r1);
extern void sub_800EF64(void);
void sub_8042390(Entity *entity, Item *item)
{
s32 sVar1;
s32 counter;
u8 id;
u32 uVar6;
DungeonPos asStack_24[4];
DungeonPos local_14;
if (sub_8042768(entity)) {
id = !ItemSticky(item) ? item->id : ITEM_NOTHING;
sub_800EF40(id, 0);
sub_800EF64();
sub_803E708(4,0x42);
local_14.x = (entity->pixelPos).x / 256;
local_14.y = (entity->pixelPos).y / 256;
sVar1 = (local_14.y - gDungeon->unk181e8.cameraPixelPos.y) / 2 + 1;
sub_8005700(asStack_24,&entity->axObj);
uVar6 = sub_800E49C(id,&local_14,asStack_24,0,sVar1);
for (counter = 0; counter < 1000; counter++) {
sub_803E46C(0x42);
if (!sub_800E9A8(uVar6)) {
break;
}
}
}
}
void sub_804245C(Entity *entity, Item *item)
{
s32 sVar1;
s32 counter;
u8 id;
u32 uVar6;
DungeonPos asStack_24[4];
DungeonPos local_14;
if (sub_8042768(entity)) {
id = !ItemSticky(item) ? item->id : ITEM_NOTHING;
sub_800EF64();
sub_803E708(4,0x42);
local_14.x = (entity->pixelPos).x / 256;
local_14.y = (entity->pixelPos).y / 256;
sVar1 = (local_14.y - gDungeon->unk181e8.cameraPixelPos.y) / 2 + 1;
sub_8005700(asStack_24,&entity->axObj);
uVar6 = sub_800E49C(id,&local_14,asStack_24,1,sVar1);
for (counter = 0; counter < 1000; counter++) {
sub_803E46C(0x42);
if (!sub_800E9A8(uVar6)) {
break;
}
}
}
}
s32 sub_8042520(Entity *a0)
{
s32 i;
s32 uVar4;
DungeonPos pos;
u32 dir;
s32 iVar8;
unkStruct_80416E0 local_58;
unkStruct_2039DB0 u203; // Unused
PixelPos local_2c;
if (sub_8045888(a0)) {
dir = GetEntInfo(a0)->action.direction;
pos.x = a0->pixelPos.x / 0x100;
pos.y = a0->pixelPos.y / 0x100;
iVar8 = (pos.y - gDungeon->unk181e8.cameraPixelPos.y) / 2;
local_58.unk0 = 357;
local_58.unk4 = 0;
local_58.dir = dir;
local_58.x = pos.x;
local_58.y = pos.y;
local_58.unk10 = 0;
local_58.unk12 = 0;
local_58.unk14 = -1;
local_58.unk18 = iVar8;
sub_8004E8C(&u203);
uVar4 = sub_8041764(&local_58, 0);
for (i = 0; i < 6; i++) {
sub_800E8AC(uVar4, &pos, 0, iVar8, 0);
sub_803E46C(66);
pos.x += gAdjacentTileOffsets[dir].x * 4;
pos.y += gAdjacentTileOffsets[dir].y * 4;
iVar8 = (pos.y - gDungeon->unk181e8.cameraPixelPos.y) / 2;
}
sub_800DBBC();
local_2c.x = pos.x * 0x100;
local_2c.y = pos.y * 0x100;
uVar4 = sub_80416E0(&local_2c, 416, TRUE);
}
else
{
uVar4 = -1;
}
return uVar4;
}
// This func plays the appropriate ascend/descend SFX for stairs depending on the direction
void PlayStairsSound(void)

View File

@@ -2,6 +2,7 @@
#include "dungeon_util_1.h"
#include "memory.h"
#include "structs/rgb.h"
#include "structs/sprite_oam.h"
#include "structs/str_dungeon_8042F6C.h"
#include "code_803E46C.h"
#include "code_800E9E4.h"
@@ -44,12 +45,6 @@ extern void sub_800EE5C(s32);
extern void sub_800EF64(void);
extern void sub_800F15C(s32);
struct Sub_UnkStruct_203B414 // Maybe DungeonPos?
{
s16 a0;
s16 a2;
};
struct UnkStruct_203B414
{
s32 unk0;
@@ -57,7 +52,7 @@ struct UnkStruct_203B414
s32 unk8;
s32 unkC[16];
s32 unk4C[16];
struct Sub_UnkStruct_203B414 unk8C[16];
struct DungeonPos unk8C[16];
};
EWRAM_INIT DungeonPos gUnknown_203B410 = {100, 100};
@@ -80,6 +75,7 @@ extern const unkStruct_2039DB0 gUnknown_80F683C;
void sub_8042B34(s32 a0, s32 a1, s32 a2)
{
unkStruct_80416E0 spStruct;
unkStruct_2039DB0 stack1C;
s32 i;
s32 r8 = 0;
Entity *leader = xxx_call_GetLeader();
@@ -96,20 +92,20 @@ void sub_8042B34(s32 a0, s32 a1, s32 a2)
spStruct.unk0 = gUnknown_80F6624[sUnknown_203B414->unk0][r8].unk0;
spStruct.unk4 = i;
spStruct.unk8 = 0;
spStruct.dir = 0;
spStruct.x = leader->pixelPos.x / 256;
spStruct.y = leader->pixelPos.y / 256;
rnd = RandInt(2);
sUnknown_203B414->unk4C[i] = (gUnknown_80F6624[sUnknown_203B414->unk0][r8].unk4 * 2) + rnd;
sUnknown_203B414->unk8C[i].a0 = RandInt(240) + 152;
sUnknown_203B414->unk8C[i].a2 = RandInt(8 + (i * 2)) - (((i - (i / 4 * 4)) * 40) - 24);
sUnknown_203B414->unk8C[i].x = RandInt(240) + 152;
sUnknown_203B414->unk8C[i].y = RandInt(8 + (i * 2)) - (((i - (i / 4 * 4)) * 40) - 24);
spStruct.unk10 = sUnknown_203B414->unk8C[i].a0;
spStruct.unk12 = sUnknown_203B414->unk8C[i].a2;
spStruct.unk10 = sUnknown_203B414->unk8C[i].x;
spStruct.unk12 = sUnknown_203B414->unk8C[i].y;
spStruct.unk14 = 4;
spStruct.unk18 = 0xFFFF;
spStruct.unk1C = gUnknown_80F683C;
stack1C = gUnknown_80F683C;
sUnknown_203B414->unkC[i] = sub_800E890(&spStruct);
r8++;
@@ -132,13 +128,13 @@ bool8 sub_8042CC0(void)
}
for (i = 0; i < sUnknown_203B414->unk8; i++) {
sUnknown_203B414->unk8C[i].a0 -= sUnknown_203B414->unk4C[i];
if (sUnknown_203B414->unk8C[i].a0 <= -152) {
sUnknown_203B414->unk8C[i].x -= sUnknown_203B414->unk4C[i];
if (sUnknown_203B414->unk8C[i].x <= -152) {
if (sUnknown_203B414->unk4 > 0) {
sUnknown_203B414->unk8C[i].a0 = 152;
sUnknown_203B414->unk8C[i].x = 152;
}
else {
sUnknown_203B414->unk8C[i].a0 = -152;
sUnknown_203B414->unk8C[i].x = -152;
}
}
else {
@@ -269,7 +265,6 @@ extern void sub_8040124(void);
extern void sub_803E830(void);
extern void sub_803E214(void);
extern void nullsub_56(void);
extern void sub_806863C(void);
extern void sub_8040218(void);
extern void sub_8047104(void);
extern void sub_8068F28(void);
@@ -286,7 +281,6 @@ extern void sub_803E02C(void);
extern void sub_80847D4(void);
extern void sub_8043D60(void);
extern void sub_806890C(void);
extern void sub_8068614(void);
extern void sub_80840A4(void);
extern void sub_803E178(void);
extern void sub_80848F0(void);
@@ -331,7 +325,6 @@ extern bool8 sub_8044B28(void);
extern bool8 sub_8083C24(void);
extern bool8 sub_8083C88(u8 param_1);
extern bool8 sub_8043ED0(bool8);
extern void LoadDungeonPokemonSprites(void);
extern void ShowDungeonNameBanner(void);
extern void sub_803EAF0(u32, u32);
extern void sub_806A914(bool8 a0, bool8 a1, bool8 showRunAwayEffect);
@@ -491,7 +484,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
}
}
sub_8068614();
OpenDungeonPaletteFile();
if (!r6 && gDungeon->unk644.unk34 == 1) {
if (sub_8099394(&sp)) {
unkStruct_203B480 *mailStr = GetMailatIndex(sp);
@@ -582,7 +575,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
sub_80687AC();
}
else {
sub_8068768();
LoadDungeonActivePokemonSprites();
sub_8082B40();
}
sub_806C42C();
@@ -918,7 +911,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
}
}
sub_806863C();
CloseDungeonPaletteFile();
sub_803E214();
nullsub_56();
sub_8040218();

View File

@@ -2,20 +2,132 @@
#include "code_805D8C8.h"
#include "structs/str_dungeon.h"
#include "dungeon_util.h"
#include "dungeon_util_1.h"
#include "file_system.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "text.h"
// monster_sbin.s
extern const struct FileArchive gMonsterFileArchive;
// data_8106A4C.s
extern const u8 gUnknown_8106EA0[]; // ax%03d
extern const u8 gUnknown_8106E98[]; // palet
// ???
extern s32 sprintf(char *, const char *, ...);
extern u32 gUnknown_202EDCC;
static void EnsureCastformLoaded(void);
static void EnsureDeoxysLoaded(void);
void sub_8068768(void)
extern s32 gUnknown_202F310;
void sub_8068310(s32 size, u16 **param_2)
{
s32 counter;
s32 index;
counter = 0;
for(index = 0; index < size; index++) {
if ((*param_2[index] & 0x8000) != 0) {
counter++;
}
}
gUnknown_202F310 = counter;
}
void sub_8068344(void)
{
if ((gUnknown_202EDCC & 8) != 0) {
UnkTextStruct1 *ptr = &gUnknown_2027370[0];
SpriteOAM sprite = {0};
SpriteSetAffine1(&sprite, 0);
SpriteSetAffine2(&sprite, 0);
SpriteSetObjMode(&sprite, 0);
SpriteSetMosaic(&sprite, 0);
SpriteSetBpp(&sprite, 0);
SpriteSetShape(&sprite, 1);
SpriteSetMatrixNum(&sprite, 16);
SpriteSetSize(&sprite, 0);
SpriteSetTileNum(&sprite, 0x3F0);
SpriteSetPriority(&sprite, 0);
SpriteSetPalNum(&sprite, 15);
SpriteSetY(&sprite, (ptr->unk2 * 8) + 0x8);
SpriteSetX(&sprite, (ptr->unk0 * 8) + 0x40);
AddSprite(&sprite,0x100,NULL,NULL);
}
}
void sub_80684C4(void)
{
if ((gUnknown_202EDCC & 8) != 0) {
UnkTextStruct1 *ptr = &gUnknown_2027370[0];
SpriteOAM sprite = {0};
SpriteSetAffine1(&sprite, 0);
SpriteSetAffine2(&sprite, 0);
SpriteSetObjMode(&sprite, 0);
SpriteSetMosaic(&sprite, 0);
SpriteSetBpp(&sprite, 0);
SpriteSetShape(&sprite, 1);
SpriteSetSize(&sprite, 0);
SpriteSetTileNum(&sprite, 0x3F0);
SpriteSetPriority(&sprite, 0);
SpriteSetPalNum(&sprite, 15);
SpriteSetY(&sprite, (ptr->unk2 * 8) + 0x70);
SpriteSetX_MatrixNumSize0(&sprite, (ptr->unk0 * 8) + 0x40);
AddSprite(&sprite,0x100,NULL,NULL);
}
}
void OpenDungeonPaletteFile(void)
{
gDungeon->paletFile = OpenFileAndGetFileDataPtr(gUnknown_8106E98, &gMonsterFileArchive);
}
void CloseDungeonPaletteFile(void)
{
CloseFile(gDungeon->paletFile);
}
void LoadDungeonPokemonSprites(void)
{
s32 index;
for(index = 0; index < 0x1A8; index++)
{
gDungeon->sprites[index] = NULL;
}
LoadPokemonSprite(MONSTER_DECOY, TRUE);
for(index = 0; index < gDungeon->unk37E4; index++)
{
LoadPokemonSprite(ExtractSpeciesIndex(&gDungeon->unk343C[index]), TRUE);
}
if(gDungeon->unk644.unk44)
{
LoadPokemonSprite(gDungeon->unk644.unk44, TRUE);
}
for(index = 0; index < 4; index++)
{
PokemonStruct2 *ptr = &gRecruitedPokemonRef->pokemon2[index];
if(PokemonFlag1Struct2(ptr))
if(PokemonFlag2Struct2(ptr))
LoadPokemonSprite(ptr->speciesNum, FALSE);
}
if(gDungeon->fixedRoomNumber == 0x31)
{
for(index = 0; index < MAX_TEAM_MEMBERS; index++)
{
PokemonStruct1 *ptr = &gRecruitedPokemonRef->team[index];
if(PokemonFlag1(ptr))
LoadPokemonSprite(ptr->speciesNum, TRUE);
}
}
}
void LoadDungeonActivePokemonSprites(void)
{
Entity *entity;
s32 i;

View File

@@ -1,8 +1,394 @@
#include "global.h"
#include "constants/status.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "dungeon_ai_targeting.h"
#include "dungeon_map_access.h"
#include "dungeon_movement.h"
#include "move_effects_target.h"
#include "pokemon.h"
#include "pokemon_3.h"
#include "dungeon_util.h"
#include "status_checks_1.h"
#include "code_8069D4C.h"
extern u8 gUnknown_810AC60; // 0xC
extern u8 gUnknown_810AC62; // 0xC
extern u8 gUnknown_810AC68; // 0x8
extern u8 gUnknown_810AC64; // 0x8
extern u8 gUnknown_810AC66; // 0x8
extern DungeonPos gUnknown_203B410;
extern DungeonPos gUnknown_202EE0C;
s32 sub_806A4DC(EntityInfo *info);
bool8 sub_8070F80(Entity * pokemon, s32 direction);
void sub_80402AC(s32, s32);
void sub_80694C0(Entity *target,s32 x,int y,char param_4)
{
Tile *tile;
Tile *tile2;
EntityInfo *info;
tile = GetTileMut(x,y);
info = GetEntInfo(target);
if (info->frozenClassStatus.status == STATUS_WRAP || info->frozenClassStatus.status == STATUS_WRAPPED) {
sub_8076CB4(info->unk9C);
}
if (info->frozenClassStatus.status == STATUS_CONSTRICTION || info->frozenClassStatus.status == STATUS_INGRAIN || info->frozenClassStatus.status == STATUS_SHADOW_HOLD) {
EndFrozenClassStatus(target,target);
}
if ((x != (target->pos).x) || (y != (target->pos).y)) {
if ((0 <= (target->pos).x) && (0 <= (target->pos).y)) {
tile2 = GetTileMut((target->pos).x,(target->pos).y);
if (tile2->monster == target) {
tile2->monster = NULL;
}
sub_80402AC((target->pos).x,(target->pos).y);
}
(target->prevPos).x = (target->pos).x;
(target->prevPos).y = (target->pos).y;
(target->pos).x = x;
(target->pos).y = y;
if (info->isTeamLeader) {
gUnknown_203B410.x = x;
gUnknown_203B410.y = y;
}
tile->monster = target;
if (info->isTeamLeader) {
gUnknown_202EE0C.x = x;
gUnknown_202EE0C.y = y;
gDungeon->unk1 = 0;
}
sub_80402AC(x,y);
switch(param_4)
{
case 0:
info->prevPos[3] = info->prevPos[2];
info->prevPos[2] = info->prevPos[1];
info->prevPos[1] = info->prevPos[0];
if (info->invisibleClassStatus.status != 1) {
info->prevPos[0] = target->prevPos;
}
break;
case 1:
info->prevPos[0] = target->pos;
info->prevPos[1] = info->prevPos[0];
info->prevPos[2] = info->prevPos[0];
info->prevPos[3] = info->prevPos[0];
break;
}
target->room = tile->room;
sub_806CF98(target);
}
return;
}
void sub_80695EC(Entity *param_1,int x,int y)
{
EntityInfo *info;
info = GetEntInfo(param_1);
if (info->frozenClassStatus.status == STATUS_WRAP || info->frozenClassStatus.status == STATUS_WRAPPED) {
sub_8076CB4(info->unk9C);
}
if ((x != (param_1->pos).x) || (y != (param_1->pos).y)) {
param_1->prevPos.x = param_1->pos.x;
param_1->prevPos.y = param_1->pos.y;
param_1->pos.x = x;
param_1->pos.y = y;
info->prevPos[3] = info->prevPos[2];
info->prevPos[2] = info->prevPos[1];
info->prevPos[1] = info->prevPos[0];
if (info->invisibleClassStatus.status != 1) {
info->prevPos[0] = param_1->prevPos;
}
param_1->room = GetTile(x,y)->room;
}
}
Entity * sub_8069660(Entity *target)
{
const Tile *tile;
EntityInfo *info;
info = GetEntInfo(target);
if(sub_8070F80(target, info->action.direction))
{
tile = GetTile((target->pos).x + (gAdjacentTileOffsets)[info->action.direction].x,(target->pos).y + (gAdjacentTileOffsets)[info->action.direction].y);
return tile->monster;
}
return NULL;
}
Entity * sub_80696A8(Entity *target)
{
const Tile *tile;
Entity *entity;
EntityInfo *info;
info = GetEntInfo(target);
if(CanAttackInDirection(target, info->action.direction))
{
tile = GetTile((target->pos).x + (gAdjacentTileOffsets)[info->action.direction].x,(target->pos).y + (gAdjacentTileOffsets)[info->action.direction].y);
if (((entity = tile->monster, entity != NULL)) && (entity->type == ENTITY_MONSTER)) {
return entity;
}
}
return NULL;
}
Entity * sub_80696FC(Entity *target)
{
const Tile *tile;
Entity *entity;
DungeonPos pos;
EntityInfo *info;
info = GetEntInfo(target);
pos.x = (target->pos).x + (gAdjacentTileOffsets)[info->action.direction].x;
pos.y = (target->pos).y + (gAdjacentTileOffsets)[info->action.direction].y;
tile = GetTile(pos.x,pos.y);
if (((!sub_80705F0(target,&pos)) && (entity = tile->monster, entity != NULL)) && (entity->type == ENTITY_MONSTER)) {
return entity;
}
return NULL;
}
Entity * sub_806977C(Entity *target)
{
const Tile *tile;
Entity *entity;
DungeonPos pos;
EntityInfo *info;
info = GetEntInfo(target);
pos.x = (target->pos).x + (gAdjacentTileOffsets)[info->action.direction].x;
pos.y = (target->pos).y + ((gAdjacentTileOffsets)[info->action.direction].y);
GetTile(pos.x,(int)pos.y);
if (!sub_80705F0(target,&pos)) {
pos.x = (gAdjacentTileOffsets)[info->action.direction].x * 2 + (target->pos).x;
pos.y = (gAdjacentTileOffsets)[info->action.direction].y * 2 + (target->pos).y;
tile = GetTile(pos.x,pos.y);
if (((!sub_80705F0(target,&pos)) && (entity = tile->monster, entity != NULL)) && (entity->type == ENTITY_MONSTER)) {
return entity;
}
}
return NULL;
}
void sub_8069844(struct unkStruct_808FF20 *param_1, Entity *target) {
int index;
u8 *atkPtr;
u8 *spAtkPtr;
u8 *defPtr;
s32 uVar15;
u8 *spDefBoost;
EntityInfo *info = GetEntInfo(target);
SetMessageArgument_2(param_1->nameBuffer, info, 0);
param_1->species = info->id;
param_1->HP1 = info->HP;
param_1->HP2 = info->maxHPStat;
param_1->level = info->level;
param_1->exp = info->exp;
for(index = 0; index < 2; index++)
{
(param_1->offense).att[index] = info->atk[index];
(param_1->offense).def[index] = info->def[index];
param_1->types[index] = info->types[index];
param_1->abilities[index] = info->abilities[index];
}
param_1->isTeamLeader = info->isTeamLeader;
atkPtr = &param_1->atkBoost;
*atkPtr = 0;
spAtkPtr = &param_1->spAtkBoost;
*spAtkPtr = 0;
defPtr = &param_1->defBoost;
*defPtr = 0;
spDefBoost = &param_1->spDefBoost;
*spDefBoost = 0;
if ((info->heldItem.flags & ITEM_FLAG_EXISTS) && ((info->heldItem.flags & ITEM_FLAG_STICKY) == 0)) {
if (info->heldItem.id == ITEM_POWER_BAND) {
*atkPtr += gUnknown_810AC60;
}
if (info->heldItem.id == ITEM_MUNCH_BELT) {
*atkPtr += gUnknown_810AC68;
}
if (info->heldItem.id == ITEM_SPECIAL_BAND) {
*spAtkPtr += gUnknown_810AC62;
}
if (info->heldItem.id == ITEM_MUNCH_BELT) {
*spAtkPtr += gUnknown_810AC68;
}
if (info->heldItem.id == ITEM_DEF_SCARF) {
*defPtr += gUnknown_810AC64;
}
if (info->heldItem.id == ITEM_ZINC_BAND) {
*spDefBoost += gUnknown_810AC66;
}
}
param_1->tactic = info->tactic;
param_1->item = info->heldItem;
param_1->IQ = info->IQ;
(param_1->dungeonLocation) = info->joinedAt;
param_1->unk44[0].level = 0;
param_1->unk44[1].level = 0;
param_1->IQSkills = info->IQSkillMenuFlags;
if (gDungeon->unk644.unk16 != 0) {
param_1->unk4C = sub_806A4DC(info);
}
else {
param_1->unk4C = 3;
}
uVar15 = 0;
if (info->HP <= info->maxHPStat / 4) {
param_1->unk58[0] = 6;
uVar15 = 1;
}
if (gDungeon->unk644.itemHoldersIdentified) {
param_1->unk58[uVar15] = 11;
uVar15++;
}
if (FixedPointToInt(info->belly) == 0) {
if (info->isTeamLeader) {
param_1->unk58[uVar15] = 19;
}
else {
param_1->unk58[uVar15] = 59;
}
uVar15++;
}
if (GetEntInfo(target)->speedStage > 1) {
param_1->unk58[uVar15] = 27;
uVar15++;
}
if (GetEntInfo(target)->speedStage < 1) {
param_1->unk58[uVar15] = 40;
uVar15++;
}
if ((((((info->offensiveMultipliers[0].raw < 0x100) || (info->offensiveMultipliers[1].raw < 0x100)
) || (info->defensiveMultipliers[0].raw < 0x100)) ||
((info->defensiveMultipliers[1].raw < 0x100 || (info->offensiveStages[0] < 10)))) ||
((info->offensiveStages[1] < 10 ||
((info->defensiveStages[0] < 10 || (info->defensiveStages[1] < 10)))))) ||
((info->hitChanceStages[0] < 10 || (info->hitChanceStages[1] < 10)))) {
param_1->unk58[uVar15] = 55;
uVar15++;
}
if (((info->sleepClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = (info->sleepClassStatus).status;
uVar15++;
}
if (((info->burnClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = (info->burnClassStatus).status + 6;
uVar15++;
}
if (((info->frozenClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = (info->frozenClassStatus).status + 11;
uVar15++;
}
if (((info->cringeClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = (info->cringeClassStatus).status + 19;
uVar15++;
}
if (((info->bideClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = (info->bideClassStatus).status + 27;
uVar15++;
}
if (((info->reflectClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = (info->reflectClassStatus).status + 40;
uVar15++;
}
if (((info->curseClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = (info->curseClassStatus).status + 55;
uVar15++;
}
if (((info->leechSeedClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = (info->leechSeedClassStatus).status + 59;
uVar15++;
}
if (((info->sureShotClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = info->sureShotClassStatus.status + 62;
uVar15++;
}
if (((info->longTossClassStatus).status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = info->longTossClassStatus.status + 67;
uVar15++;
}
if ((info->invisibleClassStatus.status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = info->invisibleClassStatus.status + 70;
uVar15++;
}
if ((info->blinkerClassStatus.status != STATUS_NONE) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = info->blinkerClassStatus.status + 74;
uVar15++;
}
if ((info->muzzled.muzzled) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = info->muzzled.muzzled + 78;
uVar15++;
}
if ((info->stockpileStage != 0) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = 80;
uVar15++;
}
if ((info->powerEars) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = 81;
uVar15++;
}
if ((info->scanning) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = 82;
uVar15++;
}
if ((info->grudge) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = 83;
uVar15++;
}
if ((info->exposed) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = 84;
uVar15++;
}
if ((ShouldMonsterRunAway(target)) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = 85;
uVar15++;
}
if ((info->perishSongTurns != 0) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = 86;
uVar15++;
}
if ((1 < sub_8070828(target,FALSE)) && (uVar15 < 0xc)) {
param_1->unk58[uVar15] = 87;
uVar15++;
}
if (info->stairSpotter) {
if (0xb < uVar15) {
return;
}
param_1->unk58[uVar15] = 88;
uVar15++;
}
for(; uVar15 < 0xC; uVar15++)
{
param_1->unk58[uVar15] = 0;
}
return;
}
u32 sub_8069D18(DungeonPos *pos,Entity *entity)
{
EntityInfo *info;

View File

@@ -1,4 +1,5 @@
#include "global.h"
#include "code_800F958.h"
#include "code_803E46C.h"
#include "code_803E668.h"
#include "code_8045A00.h"
@@ -70,7 +71,6 @@ extern void DeletePokemonDungeonSprite(s32 id);
extern void sub_80429E8(Entity *r0);
extern s32 sub_803DA20(s32 param_1);
extern void sub_80694C0(Entity *, s32, s32, u32);
extern void AddPokemonDungeonSprite(s32 id, s16 species, DungeonPos *pos, u32);
extern s32 gUnknown_202EDCC;
extern void sub_800F958(s32 dungeonSpriteID, DungeonPos *pos, DungeonPos *statusOffsets, u32 a3);
extern void sub_8005700(DungeonPos *a0, struct axObject *a1);
@@ -1780,7 +1780,7 @@ void sub_806BC68(bool8 a0, Entity *entity, struct unkStruct_806B7F8 *structPtr,
entityPos.x = entity->pos.x;
entityPos.y = entity->pos.y;
AddPokemonDungeonSprite(entInfo->unk98, entInfo->apparentID, &entityPos, gDungeon->unk181e8.unk18208);
AddPokemonDungeonSprite(entInfo->unk98, entInfo->apparentID, &entityPos, gDungeon->unk181e8.priority);
LoadIQSkills(entity);
sub_806A898(entity, FALSE, FALSE);
}
@@ -2206,7 +2206,7 @@ void sub_806C51C(Entity *entity)
pos1.y = ((entity->pixelPos.y - entity->unk1C.raw) - entInfo->unk174.raw) / 256;
sub_8005700(posArray, &entity->axObj);
sub_800F958(entInfo->unk98, &pos1, posArray, gDungeon->unk181e8.unk18208);
sub_800F958(entInfo->unk98, &pos1, posArray, gDungeon->unk181e8.priority);
statusSprites = EntityGetStatusSprites(entity);
UpdateDungeonPokemonSprite(entInfo->unk98, entInfo->apparentID, statusSprites, (var_3C && entInfo->unk14C));
@@ -2240,7 +2240,7 @@ void sub_806C51C(Entity *entity)
spriteMasks.unk4 = 0xF3FF;
spriteMasks.unk6 = 0;
spriteMasks.unk8 = 0;
spriteMasks.unkA = gDungeon->unk181e8.unk18208 << 10;
spriteMasks.unkA = gDungeon->unk181e8.priority << 10;
if (entInfo->isNotTeamMember && (entInfo->apparentID == MONSTER_DEOXYS_ATTACK || entInfo->apparentID == MONSTER_DEOXYS_DEFENSE || entInfo->apparentID == MONSTER_DEOXYS_SPEED)) {
r4 = TRUE;

View File

@@ -6,6 +6,7 @@
#include "items.h"
#include "code_800DAC0.h"
#include "structs/sprite_oam.h"
#include "structs/str_dungeon.h"
extern const unkStruct_2039DB0 gUnknown_8107374;
@@ -14,7 +15,7 @@ extern const unkStruct_2039DB0 gUnknown_8107374;
void sub_800EF64(void);
void sub_800EE5C(s32);
void sub_8085F44(s32);
void sub_800E90C(DungeonPos *);
bool8 sub_800E90C(DungeonPos *);
void sub_8088EE8(void);
void sub_8088848(void);
void sub_808A718(void);
@@ -35,6 +36,7 @@ u32 sub_8085EC8(s16 param_1,u32 param_2,u32 param_3,DungeonPos *param_4,
{
u32 uVar1;
unkStruct_80416E0 local_40;
unkStruct_2039DB0 stack1C;
bool8 param_5_bool8;
s32 param_1_s32 = param_1;
@@ -47,13 +49,13 @@ u32 sub_8085EC8(s16 param_1,u32 param_2,u32 param_3,DungeonPos *param_4,
sub_803E46C(0x46);
local_40.unk0 = param_1;
local_40.unk4 = param_2;
local_40.unk8 = param_3;
local_40.dir = param_3;
local_40.x = param_4->x;
local_40.y = param_4->y;
local_40.unk10 = 0;
local_40.unk12 = 0;
local_40.unk18 = 0xffff;
local_40.unk1C = gUnknown_8107374;
stack1C = gUnknown_8107374;
uVar1 = sub_800E890(&local_40);
if (param_5_bool8) {

View File

@@ -6,6 +6,7 @@
#include "code_806CD90.h"
#include "dungeon_music.h"
#include "dungeon_util.h"
#include "structs/sprite_oam.h"
extern const unkStruct_2039DB0 gUnknown_8107380;
@@ -80,6 +81,7 @@ s32 sub_80861F8(s16 param_1,Entity *param_2,bool32 param_3)
s32 uStack_38;
DungeonPos pos;
unkStruct_80416E0 stack;
unkStruct_2039DB0 stack1C;
#ifdef NONMATCHING
s32 param_1_s32 = param_1;
@@ -102,7 +104,7 @@ s32 sub_80861F8(s16 param_1,Entity *param_2,bool32 param_3)
}
stack.unk0 = param_1_s32;
stack.unk4 = 0;
stack.unk8 = (u32)(info->action).direction;
stack.dir = (u32)(info->action).direction;
stack.x = (param_2->pixelPos).x / 256;
stack.y = (param_2->pixelPos).y / 256;
@@ -110,7 +112,7 @@ s32 sub_80861F8(s16 param_1,Entity *param_2,bool32 param_3)
stack.unk12 = pos.y;
stack.unk14 = uStack_38;
stack.unk18 = 0xffff;
stack.unk1C = gUnknown_8107380;
stack1C = gUnknown_8107380;
uVar2 = sub_800E890(&stack);
if (param_3_bool32 != '\0') {

View File

@@ -1,8 +1,8 @@
#include "global.h"
#include "globaldata.h"
#include "dungeon.h"
#include "exclusive_pokemon.h"
#include "event_flag.h"
#include "exclusive_pokemon.h"
#include "code_80A26CC.h"
#include "code_80972F4.h"
@@ -85,21 +85,21 @@ bool32 sub_8097384(s16 param_1)
return val;
}
void sub_80973A8(s16 param_1,u32 param_2)
void sub_80973A8(s32 param_1,u32 param_2)
{
s32 sVar1;
s32 param_1_s32 = param_1;
s32 param_1_s32 = (s16)param_1;
u8 param_2_u32 = param_2;
if (param_1_s32 != 0xd) {
if (param_2_u32 != 0) {
sVar1 = sub_80A26B8(param_1);
SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_ORDER_LIST,param_1_s32,0);
SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_ORDER_LIST,(u16)param_1_s32,0);
if (sVar1 != -1) {
SetScriptVarValue(NULL,DUNGEON_SELECT,sVar1);
}
}
SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_JOB_LIST,param_1_s32,param_2_u32);
SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_JOB_LIST,(u16)param_1_s32,param_2_u32);
}
}
@@ -120,12 +120,12 @@ bool32 RescueScenarioConquered(s16 param_1)
return val;
}
void sub_8097418(s16 index,bool32 param_2)
void sub_8097418(s32 index,bool32 param_2)
{
int index_s32 = index;
int index_s32 = (s16)index;
bool8 param_2_u8 = param_2;
if (index_s32 != 0xd) {
if ((param_2_u8) && (SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_JOB_LIST,index_s32,0), index_s32 < 0x1f)) {
if ((param_2_u8) && (SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_JOB_LIST,(u16)index_s32,0), index_s32 < 0x1f)) {
const MissionText *mt = &sStoryMissionText[index_s32];
if (mt->unk4 != 0xFF) {
sub_8097FA8(mt->unk4);
@@ -138,7 +138,7 @@ void sub_8097418(s16 index,bool32 param_2)
}
sub_8097FF8();
}
SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_CONQUEST_LIST,index_s32,param_2_u8);
SetScriptVarArrayValue(NULL,RESCUE_SCENARIO_CONQUEST_LIST,(u16)index_s32,param_2_u8);
}
}

View File

@@ -2,6 +2,23 @@
#include "code_80A26CC.h"
#include "event_flag.h"
u8 sub_80992E0(s16 *param_1, s16 *param_2)
{
s32 sVar2;
sVar2 = (s16)GetScriptVarValue(NULL,DUNGEON_ENTER);
if ((((sVar2 != -1) && (sVar2 != 0x50)) && (sVar2 != 0x51)) && (sVar2 != 0x52)) {
*param_1 = sVar2;
*param_2 = GetScriptVarValue(NULL,DUNGEON_ENTER_INDEX);
return TRUE;
}
else {
*param_1 = -1;
*param_2 = -1;
return FALSE;
}
}
bool8 sub_8099328(u8 *dungeonId) {
s16 script_disc;
DungeonInfo* dungeonInfo;

View File

@@ -1,14 +1,9 @@
#include "global.h"
#include "structs/str_position.h"
#include "other_random.h"
#include "math.h"
#include "memory.h"
struct unkStruct_809D158
{
s32 a0;
s32 a4;
};
struct unkStruct_20399E8
{
u32 unk0;
@@ -16,15 +11,15 @@ struct unkStruct_20399E8
u32 unk8;
s32 unkC;
s32 unk10;
struct unkStruct_809D158 unk14;
struct unkStruct_809D158 unk1C;
PixelPos unk14;
PixelPos unk1C;
s32 unk24;
s32 unk28;
s32 unk2C;
s32 unk30;
s32 unk34;
s32 unk38;
struct unkStruct_809D158 unk3C;
PixelPos unk3C;
u8 unk44;
};
@@ -32,7 +27,7 @@ extern struct unkStruct_20399E8 gUnknown_20399E8;
void sub_809D0BC(void);
void sub_809D4B0(void);
void sub_809D158(s32 r0, const struct unkStruct_809D158 *r1);
void sub_809D158(s32 r0, const PixelPos *r1);
s32 sub_809CFE8(u16 param_1)
{
@@ -105,7 +100,7 @@ void nullsub_119(void)
{
}
extern const struct unkStruct_809D158 gZeroPos_8116478;
extern const PixelPos gZeroPos_8116478;
void sub_809D0BC(void)
{
@@ -162,7 +157,7 @@ struct Test1
u64 ukn0;
};
void sub_809D158(s32 r0, const struct unkStruct_809D158 *r1)
void sub_809D158(s32 r0, const PixelPos *r1)
{
gUnknown_20399E8.unk0 = r0;
gUnknown_20399E8.unk8 = 0;
@@ -183,7 +178,7 @@ void sub_809D180(s32 r0, s32 r1)
gUnknown_20399E8.unkC = r1;
}
void sub_809D190(s32 r0, struct unkStruct_809D158 *r1, s32 r2)
void sub_809D190(s32 r0, PixelPos *r1, s32 r2)
{
gUnknown_20399E8.unk0 = r0;
gUnknown_20399E8.unk8 = 1;
@@ -206,7 +201,7 @@ void sub_809D1BC(s32 r0, s32 r1)
gUnknown_20399E8.unk10 = r1;
}
void sub_809D1CC(s32 r0, struct unkStruct_809D158 *r1, s32 r2)
void sub_809D1CC(s32 r0, PixelPos *r1, s32 r2)
{
gUnknown_20399E8.unk0 = r0;
gUnknown_20399E8.unk8 = 2;
@@ -229,7 +224,7 @@ void sub_809D1F8(s32 r0, s32 r1)
gUnknown_20399E8.unkC = r1;
}
void sub_809D208(s32 r0, struct unkStruct_809D158 *r1, s32 r2)
void sub_809D208(s32 r0, PixelPos *r1, s32 r2)
{
gUnknown_20399E8.unk0 = r0;
gUnknown_20399E8.unk8 = 3;
@@ -250,27 +245,27 @@ bool8 sub_809D234(void)
return gUnknown_20399E8.unk8 != 0;
}
u8 sub_809D248(struct unkStruct_809D158 *r0)
u8 sub_809D248(PixelPos *r0)
{
*r0 = gUnknown_20399E8.unk3C;
return gUnknown_20399E8.unk44;
}
// Todo: move these to appropriate header files
extern s32 sub_80A8FD8(s16 a0, struct unkStruct_809D158 *a1);
extern s32 sub_80AC448(s16 a0, struct unkStruct_809D158 *a1);
extern s32 sub_80AD360(s16 a0, struct unkStruct_809D158 *a1);
extern void sub_800290C(struct unkStruct_809D158 *a0, s32 a1);
extern void sub_8002934(struct unkStruct_809D158 *a0, struct unkStruct_809D158 *a1, struct unkStruct_809D158 *a2, u32 a3, u32 a4);
extern bool8 sub_80A579C(struct unkStruct_809D158 *a0, struct unkStruct_809D158 *a1);
extern s32 sub_80A8FD8(s16 a0, PixelPos *a1);
extern s32 sub_80AC448(s16 a0, PixelPos *a1);
extern s32 sub_80AD360(s16 a0, PixelPos *a1);
extern void sub_800290C(PixelPos *a0, s32 a1);
extern void sub_8002934(PixelPos *a0, PixelPos *a1, PixelPos *a2, u32 a3, u32 a4);
extern bool8 sub_80A579C(PixelPos *a0, PixelPos *a1);
void sub_809D25C(void)
{
s32 r2, r1, r3;
struct unkStruct_809D158 sp4;
struct unkStruct_809D158 spC;
struct unkStruct_809D158 sp14;
struct unkStruct_809D158 sp1C;
PixelPos sp4;
PixelPos spC;
PixelPos sp14;
PixelPos sp1C;
u16 val;
// For some reason I have to compare with 0xFFFF instead of -1. Maybe it has to do with return value of the functions?
switch (gUnknown_20399E8.unk0)
@@ -295,22 +290,22 @@ void sub_809D25C(void)
switch (gUnknown_20399E8.unk8)
{
case 1:
sp4.a0 = gUnknown_20399E8.unk1C.a0 - gUnknown_20399E8.unk14.a0;
sp4.a4 = gUnknown_20399E8.unk1C.a4 - gUnknown_20399E8.unk14.a4;
sp4.x = gUnknown_20399E8.unk1C.x - gUnknown_20399E8.unk14.x;
sp4.y = gUnknown_20399E8.unk1C.y - gUnknown_20399E8.unk14.y;
sub_800290C(&sp4, gUnknown_20399E8.unkC);
if (sp4.a0 == 0 && sp4.a4 == 0)
if (sp4.x == 0 && sp4.y == 0)
{
gUnknown_20399E8.unk8 = 0;
}
else
{
gUnknown_20399E8.unk14.a0 += sp4.a0;
gUnknown_20399E8.unk14.a4 += sp4.a4;
gUnknown_20399E8.unk14.x += sp4.x;
gUnknown_20399E8.unk14.y += sp4.y;
}
break;
case 3:
r2 = (gUnknown_20399E8.unk1C.a0 - gUnknown_20399E8.unk14.a0) / 256;
r1 = (gUnknown_20399E8.unk1C.a4 - gUnknown_20399E8.unk14.a4) / 256;
r2 = (gUnknown_20399E8.unk1C.x - gUnknown_20399E8.unk14.x) / 256;
r1 = (gUnknown_20399E8.unk1C.y - gUnknown_20399E8.unk14.y) / 256;
gUnknown_20399E8.unk10 = (F248ToInt(FP24_8_Hypot(IntToF248(r2), IntToF248(r1))) << 8) / gUnknown_20399E8.unkC;
if (gUnknown_20399E8.unk10 <= 0)
gUnknown_20399E8.unk10 = 1;
@@ -353,21 +348,21 @@ void sub_809D25C(void)
if (sub_80A579C(&sp14, &sp1C))
{
r2 = gUnknown_20399E8.unk14.a0 + gUnknown_20399E8.unk34 - 0x80;
r3 = gUnknown_20399E8.unk14.a4 + gUnknown_20399E8.unk38 - 2944;
r2 = gUnknown_20399E8.unk14.x + gUnknown_20399E8.unk34 - 0x80;
r3 = gUnknown_20399E8.unk14.y + gUnknown_20399E8.unk38 - 2944;
if (r2 < sp14.a0)
r2 = sp14.a0;
if (r2 >= sp1C.a0)
r2 = sp1C.a0 - 1;
if (r2 < sp14.x)
r2 = sp14.x;
if (r2 >= sp1C.x)
r2 = sp1C.x - 1;
if (r3 < sp14.a4)
r3 = sp14.a4;
if (r3 >= sp1C.a4)
r3 = sp1C.a4 - 1;
if (r3 < sp14.y)
r3 = sp14.y;
if (r3 >= sp1C.y)
r3 = sp1C.y - 1;
gUnknown_20399E8.unk3C.a0 = (r2 - 30976) / 256;
gUnknown_20399E8.unk3C.a4 = (r3 - 20480) / 256;
gUnknown_20399E8.unk3C.x = (r2 - 30976) / 256;
gUnknown_20399E8.unk3C.y = (r3 - 20480) / 256;
gUnknown_20399E8.unk44 = 1;
}
}

View File

@@ -21,8 +21,6 @@
#include "items.h"
#include "structs/str_position.h"
#include "position_util.h"
#include "status.h"
#define NUM_POTENTIAL_ROCK_TARGETS 20
#define GROUND_ITEM_TOOLBOX_INDEX 0x80
@@ -42,25 +40,6 @@ EWRAM_DATA u32 gAIThrownItemProbabilities[NUM_DIRECTIONS] = {0};
extern TeamInventory *gTeamInventoryRef;
void sub_807360C(void)
{
s32 index;
Entity *entity;
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->activePokemon[index];
if(EntityIsValid(entity))
{
if(GetEntInfo(entity)->unk152 != 0)
{
GetEntInfo(entity)->unk152 = 0;
UpdateFlashFireBoost(entity, entity);
}
}
}
}
void AIDecideUseItem(Entity *pokemon)
{
EntityInfo *pokemonInfo = GetEntInfo(pokemon);

View File

@@ -2,6 +2,7 @@
#include "dungeon_ai_leader.h"
#include "charge_move.h"
#include "code_803E46C.h"
#include "code_8041AD0.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "dungeon_message.h"
@@ -20,10 +21,15 @@
#include "dungeon_leader.h"
#include "dungeon_movement.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_random.h"
#include "dungeon_util.h"
#include "dungeon_visibility.h"
#include "move_util.h"
#include "moves.h"
#include "pokemon_3.h"
#include "pokemon.h"
#include "status.h"
#include "status_checks_1.h"
#include "trap.h"
#include "dungeon_config.h"
@@ -34,8 +40,10 @@ extern u8 gUnknown_202F32D;
extern u8 gUnknown_203B434;
extern u8 *gUnknown_80FA5B4[];
extern u8 *gUnknown_80FE478[];
extern u8 *gUnknown_80FCF50[];
extern u8 *gUnknown_80FCF38[];
extern u8 *gUnknown_80FD2CC[];
extern u8 *gUnknown_80FE478[];
extern u8 *gUnknown_80FE6D4[];
void sub_8075BA4(Entity *param_1, u8 param_2);
@@ -79,6 +87,10 @@ bool8 sub_8044B84(void);
extern void sub_8074094(Entity *);
extern void sub_8071DA4(Entity *);
u32 sub_8075818(Entity *entity);
extern void MarkLastUsedMonMove(Entity *entity, Move *move);
bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, bool32 isLinkedMove, struct Move *move);
extern void sub_80838EC(u8 *a);
bool8 TargetLeader(Entity *pokemon)
{
@@ -369,3 +381,157 @@ bool8 sub_8072CF4(Entity *entity)
}
return FALSE;
}
void sub_80732F0(void)
{
s32 index;
Entity *entity;
EntityInfo *info;
s32 moveIndex;
s32 counter;
s32 otherIndex;
u8 flag;
Move *move;
Move *move2;
Move moveStack;
u8 sl;
for(index = 0; index < DUNGEON_MAX_POKEMON; index++){
flag = FALSE;
entity = gDungeon->activePokemon[index];
if(EntityIsValid(entity)){
info = GetEntInfo(entity);
if(info->unk164 != 0xFF){
sl = info->unk164;
if(CannotAttack(entity, TRUE)){
info->unk164 |= 0xFF;
}
else if(!IsSleeping(entity)){
info->unk164 |= 0xFF;
}
else if(info->muzzled.muzzled == TRUE){
info->unk164 |= 0xFF;
}
else{
moveIndex = DungeonRandInt(MAX_MON_MOVES);
for(counter = 0; counter < MAX_MON_MOVES; counter++){
move = &info->moves.moves[moveIndex];
if(MoveFlagExists(move)){
moveStack = *move;
if(moveStack.id == MOVE_SKETCH)
goto _increase;
if(moveStack.id == MOVE_MIMIC)
goto _increase;
for(otherIndex = 0; otherIndex < MAX_MON_MOVES; otherIndex++){
move2 = &info->moves.moves[otherIndex];
if(MoveFlagExists(move2)){
if(!info->isTeamLeader){
if(!(move2->moveFlags & MOVE_FLAG_ENABLED_FOR_AI)) continue;
}
if(move2->id == MOVE_SLEEP_TALK){
if(CanMonsterUseMove(entity, move2, TRUE))
{
sub_80838EC(&move2->PP);
break;
}
}
}
}
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
LogMessageByIdWithPopupCheckUser(entity, *gUnknown_80FCF38); // {ARG_POKEMON_0} uttered its sleep talk!
info->action.direction = sl & DIRECTION_MASK;
TryUseChosenMove(entity, 0, ITEM_NOTHING, 1, FALSE, &moveStack);
flag = TRUE;
break;
}
else
{
_increase:
moveIndex++;
if(moveIndex == MAX_MON_MOVES)
moveIndex = 0;
}
}
info->unk164 |= 0xFF;
if(flag)
sub_80421C0(entity, 0x2E0);
}
}
}
}
}
void sub_807348C(void)
{
int index;
s32 moveIndex;
Move *move;
EntityInfo *info;
Entity *pokemon;
Move chosenMove;
u8 r8;
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) {
pokemon = gDungeon->activePokemon[index];
if (EntityIsValid(pokemon)) {
info = GetEntInfo(pokemon);
if (info->unk165 != 0xff) {
r8 = info->unk165;
if (CannotAttack(pokemon,TRUE)) {
info->unk165 |= 0xff;
info->unk164 |= 0xff;
}
else if (!IsSleeping(pokemon)) {
info->unk165 |= 0xff;
info->unk164 |= 0xff;
}
else if (info->muzzled.muzzled == TRUE) {
info->unk165 |= 0xff;
info->unk164 |= 0xff;
}
else {
for(moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
{
move = &info->moves.moves[moveIndex];
if (((MoveFlagExists(move)) &&
((info->isTeamLeader || (move->moveFlags & MOVE_FLAG_ENABLED_FOR_AI)) && move->id == MOVE_SNORE)) &&
(CanMonsterUseMove(pokemon,move,TRUE))) {
chosenMove = *move;
sub_80838EC(&move->PP);
MarkLastUsedMonMove(pokemon,move);
break;
}
}
SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0);
LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FCF50);
info->action.direction = r8 & DIRECTION_MASK;
TryUseChosenMove(pokemon,0,ITEM_NOTHING,1,FALSE,&chosenMove);
info->unk165 |= 0xff;
info->unk164 |= 0xff;
}
}
}
}
}
void sub_807360C(void)
{
s32 index;
Entity *entity;
for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{
entity = gDungeon->activePokemon[index];
if(EntityIsValid(entity))
{
if(GetEntInfo(entity)->unk152 != 0)
{
GetEntInfo(entity)->unk152 = 0;
UpdateFlashFireBoost(entity, entity);
}
}
}
}

View File

@@ -306,3 +306,16 @@ void sub_8047104(void)
}
FillInventoryGaps();
}
void sub_8047158(void)
{
s32 index;
index = 0;
for(index = 0; index < INVENTORY_SIZE; index++) {
Item *item = &gTeamInventoryRef->teamItems[index];
if (ItemExists(item) && item->flags & ITEM_FLAG_UNPAID) {
item->flags &= ~(ITEM_FLAG_UNPAID);
}
}
}

View File

@@ -447,7 +447,7 @@ static void WriteDungeonVisibility(DataSerializer *seri)
{
WriteBlame(seri, sMisakiSan);
WriteU8(seri, gDungeon->unk181e8.unk18208);
WriteU8(seri, gDungeon->unk181e8.priority);
WriteU8(seri, gDungeon->unk181e8.visibilityRange);
WriteBool8(seri, gDungeon->unk181e8.blinded);
WriteBool8(seri, gDungeon->unk181e8.unk1820B);
@@ -844,7 +844,7 @@ static void ReadDungeonVisibility(DataSerializer *seri)
ReadBlame(seri, sMisakiSan);
gDungeon->unk181e8.cameraTarget = NULL;
gDungeon->unk181e8.unk18208 = ReadU8(seri);
gDungeon->unk181e8.priority = ReadU8(seri);
gDungeon->unk181e8.visibilityRange = ReadU8(seri);
gDungeon->unk181e8.blinded = ReadBool8(seri);
gDungeon->unk181e8.unk1820B = ReadBool8(seri);

View File

@@ -52,6 +52,124 @@ extern void sub_80973A8(u32, u32);
// code_80972F4.h (read comment)
extern bool8 RescueScenarioConquered(s16);
void SetScriptVarValue(u8 *localVarBuf, s32 varId_, s32 val)
{
s32 varID;
struct ScriptVarPtr sp;
varID = (s16)varId_;
GetScriptVarRef(&sp, localVarBuf, varID);
switch (sp.info->type) {
case 1: {
u8 bVar1 = 1 << sp.info->bitOffset;
if (val != 0)
*sp.ptr |= bVar1;
else
*sp.ptr = (bVar1 | *sp.ptr) ^ bVar1;
break;
}
case 2: {
*((s8 *)sp.ptr) = val;
break;
}
case 3: {
*((u8 *)sp.ptr) = val;
break;
}
case 7: {
*((bool8 *)sp.ptr) = val;
break;
}
case 4: {
*((s16 *)sp.ptr) = val;
break;
}
case 5: {
*((u16 *)sp.ptr) = val;
break;
}
case 6: {
*((s32 *)sp.ptr) = val;
break;
}
case 8: {
switch (varID) {
case 0x22: {
gTeamInventoryRef->teamMoney = val;
break;
}
case 0x23: {
gTeamInventoryRef->teamSavings = val;
break;
}
}
}
}
}
void SetScriptVarArrayValue(u8 *localVarBuf, s32 varId_, s32 idx_, s32 val)
{
s32 varID;
struct ScriptVarPtr sp;
s32 idx;
varID = (s16)varId_;
idx = (u16)idx_;
GetScriptVarRef(&sp, localVarBuf, varID);
switch (sp.info->type) {
case 1: {
s32 bitOffset = (u16)sp.info->bitOffset;
u16 flagNum = idx + bitOffset;
u8 *a = &sp.ptr[flagNum / 8];
u8 bVar1 = 1 << (flagNum % 8);
if (val != 0)
*a |= bVar1;
else
*a = (bVar1 | *a) ^ bVar1;
break;
}
case 2: {
((s8 *)sp.ptr)[idx] = val;
break;
}
case 3: {
((u8 *)sp.ptr)[idx] = val;
break;
}
case 7: {
((bool8 *)sp.ptr)[idx] = val;
break;
}
case 4: {
((s16 *)sp.ptr)[idx] = val;
break;
}
case 5: {
((u16 *)sp.ptr)[idx] = val;
break;
}
case 6: {
((s32 *)sp.ptr)[idx] = val;
break;
}
case 8: {
switch (varID) {
case 0x22: {
gTeamInventoryRef->teamMoney = val;
break;
}
case 0x23: {
gTeamInventoryRef->teamSavings = val;
break;
}
}
}
}
}
UNUSED u8 *GetScriptVarPointer(s16 varId)
{
struct ScriptVarPtr local_1c;

View File

@@ -1,4 +1,7 @@
#include "global.h"
#include "constants/dungeon.h"
#include "constants/move_id.h"
#include "structs/str_wonder_mail.h"
#include "code_8009804.h"
#include "code_800C9CC.h"
#include "code_80118A4.h"
@@ -8,6 +11,26 @@
#include "ground_main.h"
#include "ground_map_2.h"
#include "play_time.h"
#include "pokemon.h"
#include "text_util.h"
// size: 0x88
struct unkStruct_20398C8
{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
u8 unk4;
u8 fill5[0xB - 0x5];
u8 unkB;
u8 unkC;
u8 unkD;
WonderMailSub unk10;
PokemonStruct1 unk18;
u8 fill70[0x88 - 0x70];
};
EWRAM_DATA u32 gUnknown_20398A8 = {0};
EWRAM_DATA u32 gUnknown_20398AC = {0};
@@ -21,8 +44,10 @@ EWRAM_DATA u16 gUnknown_20398BC = {0};
EWRAM_DATA u16 gUnknown_20398BE = {0};
EWRAM_DATA u32 gUnknown_20398C0 = {0};
EWRAM_DATA s16 gUnknown_20398C4 = {0};
struct unkStruct_20398C8 gUnknown_20398C8;
extern u8 gUnknown_2039950;
EWRAM_INIT u8 gUnknown_203B49C = {0};
EWRAM_INIT bool8 gUnknown_203B49C = {0};
EWRAM_INIT u8 gUnknown_203B49D = {0};
#include "data/ground_main.h"
@@ -53,8 +78,8 @@ extern void sub_8098CC8();
extern void GeneratePelipperJobs();
extern void sub_80961B4();
extern void ClearAllItems_8091FB4();
extern void ChooseKecleonShopInventory(u32);
extern u8 sub_809C730();
extern void sub_8095494(WonderMailSub *param_1, u8 index);
void sub_8098BDC(void)
{
@@ -203,7 +228,7 @@ bool8 GroundMainRescueRequest(s32 r0, s32 r1)
}
else
{
if(gUnknown_203B49C == 0)
if(!gUnknown_203B49C)
{
gUnknown_20398C4 = r5;
}
@@ -332,3 +357,115 @@ const char *sub_80990B8(void)
return sub_8098FB4();
}
}
static inline bool8 sub_80990EC_sub(struct unkStruct_20398C8 *iVar1, u32 iVar2)
{
bool8 flag = FALSE;
iVar1->unkB = 0;
if ((u16)(iVar2 - 0x25) < 3)
flag = TRUE;
else
flag = FALSE;
return flag;
}
extern void sub_80A8EC0(u8 *, u32);
u8 sub_80990EC(struct unkStruct_20398C8 *param_1, s16 param_2)
{
const DungeonInfo *iVar1;
u8 auStack_98 [24];
u8 nameBuffer [24];
u8 r5;
u8 dungeonIndex;
iVar1 = GetDungeonInfo_80A2608(param_2);
dungeonIndex = iVar1->dungeonIndex;
r5 = 0;
param_1->unk0 = dungeonIndex;
param_1->unk1 = 1;
param_1->unkC = r5;
switch(sub_80A2750(param_2))
{
case 1:
if (sub_80990EC_sub(param_1, param_2)) {
param_1->unkC = 1;
sub_80A8EC0(auStack_98, 0x5b);
BoundedCopyStringtoBuffer(nameBuffer, auStack_98, POKEMON_NAME_LENGTH);
{
struct unkStruct_808D144 stack =
{
.name = nameBuffer,
.speciesNum = MONSTER_GENGAR,
.itemID = ITEM_NOTHING,
.dungeonLocation= {DUNGEON_RESCUE_TEAM_BASE, 0}, // DUNGEON_RESCUE_TEAM_BASE
.moveID = {MOVE_SCRATCH, MOVE_LEER, MOVE_TAUNT, MOVE_QUICK_ATTACK},
.pokeHP = 80,
.level = 15,
.IQ = 1,
.offenseAtk = {25, 25},
.offenseDef = {15, 15},
.currExp = 25000,
};
sub_808D144(&param_1->unk18, &stack);
}
}
break;
case 4:
param_1->unkB = 0;
break;
case 2:
param_1->unkB = 2;
break;
}
param_1->unk4 = 0;
param_1->unkD = 0;
return iVar1->unk11;
}
u8 sub_80991E0(struct unkStruct_20398C8 *param_1,short *param_2)
{
*param_2 = gUnknown_20398C4;
if (gUnknown_203B49C) {
memcpy(param_1, &gUnknown_20398C8, sizeof(struct unkStruct_20398C8));
return TRUE;
}
else {
return sub_80990EC(param_1,gUnknown_20398C4);
}
}
void sub_8099220(struct unkStruct_20398C8 *param_1, s16 param_2)
{
s32 param_2_s32 = (s16)param_2;
if (param_1 != NULL)
{
gUnknown_203B49C = TRUE;
gUnknown_203B49D = 0;
gUnknown_20398C4 = param_2_s32;
memcpy(&gUnknown_20398C8, param_1, sizeof(struct unkStruct_20398C8));
}
else {
gUnknown_203B49C = FALSE;
gUnknown_203B49D = 0;
gUnknown_20398C4 = -1;
}
}
void sub_809927C(u8 param_1)
{
gUnknown_203B49C = 1;
gUnknown_203B49D = 1;
gUnknown_20398C4 = 0x50;
gUnknown_2039950 = param_1;
SetScriptVarValue(0x0,DUNGEON_ENTER,0x50);
SetScriptVarValue(0x0,DUNGEON_ENTER_INDEX,gUnknown_2039950);
sub_8095494(&gUnknown_20398C8.unk10,param_1);
gUnknown_20398C8.unkB = 1;
gUnknown_20398C8.unkC = 0;
gUnknown_20398C8.unk4 = 0;
gUnknown_20398C8.unkD = 0;
}

View File

@@ -1,4 +1,5 @@
#include "global.h"
#include "code_8002774.h"
#include "debug.h"
#include "event_flag.h"
#include "ground_link.h"
@@ -15,6 +16,7 @@
#include "math.h"
#include "ground_main.h"
#include "code_80A26CC.h"
#include "wigglytuff_shop1.h"
// Size: unknown
typedef struct UnkAction3D
@@ -51,11 +53,6 @@ s16 GroundEffect_Add(s16 id, GroundEffectData*, s16 group, s8 sector);
// Beware of the declarations without specified arguments, returning u32 or s32, these were quickly hacked in to get the code to compile and link
// The return values are almost certainly NOT correct and will need to be rechecked when moving to header files
char sub_8002984(s32, u8);
s8 VecDirection8Radial(PixelPos*);
s8 SizedDeltaDirection4(PixelPos*, PixelPos*, PixelPos*, PixelPos*);
s8 SizedDeltaDirection8(PixelPos*, PixelPos*, PixelPos*, PixelPos*);
bool8 sub_8021700(s32);
bool8 sub_802FCF0(void);
@@ -204,7 +201,7 @@ s32 ExecuteScriptCommand(Action *action) {
break;
}
case 0x03: {
if ((s8)sub_8021700(curCmd.arg1)) {
if (sub_8021700(curCmd.arg1)) {
action->scriptData.script.ptr = ResolveJump(action, -1);
} else {
sub_8098D80(curCmd.argShort);
@@ -628,7 +625,7 @@ s32 ExecuteScriptCommand(Action *action) {
case 0x2c: {
if (!(s8)sub_809A768()) break;
sub_80A87AC(0, 10);
if ((s8)GroundScriptCheckLockCondition(action, 0)) return 2;
if (GroundScriptCheckLockCondition(action, 0)) return 2;
break;
}
case 0x30: {
@@ -737,20 +734,20 @@ s32 ExecuteScriptCommand(Action *action) {
}
if (ret) {
sub_80A87AC(0, 10);
if ((s8)GroundScriptCheckLockCondition(action, 0)) return 2;
if (GroundScriptCheckLockCondition(action, 0)) return 2;
}
break;
}
case 0x39: {
if ((s8)sub_809AF6C(curCmd.argShort, curCmd.argPtr) && curCmd.argShort >= 0) {
sub_80A87AC(0, 10);
if ((s8)GroundScriptCheckLockCondition(action, 0)) return 2;
if (GroundScriptCheckLockCondition(action, 0)) return 2;
}
break;
}
case 0x3a: {
sub_809AFC8((u8)curCmd.argByte > 0, curCmd.arg1, (s16)curCmd.arg2, curCmd.argPtr);
if ((s8)GroundScriptCheckLockCondition(action, 1)) {
if (GroundScriptCheckLockCondition(action, 1)) {
sub_80A87AC(0, 11);
return 2;
}
@@ -1481,19 +1478,19 @@ s32 ExecuteScriptCommand(Action *action) {
break;
}
case 0xb3: {
if ((u8)JudgeVarWithImmediate(NULL, curCmd.argShort, curCmd.arg1, JUDGE_EQ)) {
if (JudgeVarWithImmediate(NULL, curCmd.argShort, curCmd.arg1, JUDGE_EQ)) {
scriptData->script.ptr = FindLabel(action, (u8)curCmd.argByte);
}
break;
}
case 0xb4: {
if ((s8)JudgeVarWithImmediate(scriptData->localVars.buf, (s16)curCmd.arg1, curCmd.arg2, (u8)curCmd.argByte)) {
if (JudgeVarWithImmediate(scriptData->localVars.buf, (s16)curCmd.arg1, curCmd.arg2, (u8)curCmd.argByte)) {
scriptData->script.ptr = FindLabel(action, curCmd.argShort);
}
break;
}
case 0xb5: {
if ((s8)JudgeVarWithVar(scriptData->localVars.buf, (s16)curCmd.arg1, (s16)curCmd.arg2, (u8)curCmd.argByte)) {
if (JudgeVarWithVar(scriptData->localVars.buf, (s16)curCmd.arg1, (s16)curCmd.arg2, (u8)curCmd.argByte)) {
scriptData->script.ptr = FindLabel(action, curCmd.argShort);
}
break;
@@ -1505,43 +1502,43 @@ s32 ExecuteScriptCommand(Action *action) {
break;
}
case 0xb7: {
if ((s8)FlagJudge(GetScriptVarArraySum(scriptData->localVars.buf, (s16)curCmd.arg1), curCmd.arg2, (u8)curCmd.argByte)) {
if (FlagJudge(GetScriptVarArraySum(scriptData->localVars.buf, (s16)curCmd.arg1), curCmd.arg2, (u8)curCmd.argByte)) {
scriptData->script.ptr = FindLabel(action, curCmd.argShort);
}
break;
}
case 0xb8: {
if ((s8)ScriptVarScenarioBefore(curCmd.argShort, curCmd.arg1, curCmd.arg2)) {
if (ScriptVarScenarioBefore(curCmd.argShort, curCmd.arg1, curCmd.arg2)) {
scriptData->script.ptr = FindLabel(action, (u8)curCmd.argByte);
}
break;
}
case 0xb9: {
if ((s8)ScriptVarScenarioEqual(curCmd.argShort, curCmd.arg1, curCmd.arg2)) {
if (ScriptVarScenarioEqual(curCmd.argShort, curCmd.arg1, curCmd.arg2)) {
scriptData->script.ptr = FindLabel(action, (u8)curCmd.argByte);
}
break;
}
case 0xba: {
if ((s8)ScriptVarScenarioAfter(curCmd.argShort, curCmd.arg1, curCmd.arg2)) {
if (ScriptVarScenarioAfter(curCmd.argShort, curCmd.arg1, curCmd.arg2)) {
scriptData->script.ptr = FindLabel(action, (u8)curCmd.argByte);
}
break;
}
case 0xbb: {
if ((s8)sub_80023E4(curCmd.argShort)) {
if (sub_80023E4(curCmd.argShort)) {
scriptData->script.ptr = FindLabel(action, (u8)curCmd.argByte);
}
break;
}
case 0xbc: {
if ((s8)sub_8098100((u8)curCmd.argShort)) {
if (sub_8098100(curCmd.argShort)) {
scriptData->script.ptr = FindLabel(action, (u8)curCmd.argByte);
}
break;
}
case 0xbd: {
if ((s8)sub_80026CC((s16)curCmd.arg1)) {
if (sub_80026CC(curCmd.arg1)) {
scriptData->script.ptr = FindLabel(action, (u8)curCmd.argByte);
}
break;
@@ -1718,7 +1715,7 @@ s32 ExecuteScriptCommand(Action *action) {
break;
}
}
if ((s8)GroundScriptCheckLockCondition(action, 1)) {
if (GroundScriptCheckLockCondition(action, 1)) {
sub_80A87AC(0, 11);
return 2;
}
@@ -1754,7 +1751,7 @@ s32 ExecuteScriptCommand(Action *action) {
}
case 0xe5: {
scriptData->branchDiscriminant = curCmd.argShort;
if ((s8)GroundScriptLockCond(action, curCmd.argShort, curCmd.argByte)) {
if (GroundScriptLockCond(action, curCmd.argShort, curCmd.argByte)) {
return 2;
}
break;

View File

@@ -1148,3 +1148,58 @@ static bool8 sub_8013DD0(unkStructFor8013AA0 *a0)
return FALSE;
}
}
void sub_8013E54(void)
{
UnkTextStruct1 *ptr = &gUnknown_2027370[0];
SpriteOAM SStack_18 = {0};
SpriteSetAffine1(&SStack_18, 0);
SpriteSetAffine2(&SStack_18, 0);
SpriteSetObjMode(&SStack_18, 0);
SpriteSetMosaic(&SStack_18, 0);
SpriteSetBpp(&SStack_18, 0);
SpriteSetShape(&SStack_18, 1);
SpriteSetMatrixNum(&SStack_18, 0);
SpriteSetSize(&SStack_18, 0);
SpriteSetTileNum(&SStack_18, 0x3F0);
SpriteSetPriority(&SStack_18, 0);
SpriteSetPalNum(&SStack_18, 15);
SpriteSetY(&SStack_18, (ptr->unk2 * 8) + 0x80);
SpriteSetX(&SStack_18, 112);
AddSprite(&SStack_18,0x100,0,0x0);
}
void sub_8013F84(void)
{
UnkTextStruct1 *ptr = &gUnknown_2027370[0];
SpriteOAM SStack_18 = {0};
SpriteSetAffine1(&SStack_18, 0);
SpriteSetAffine2(&SStack_18, 0);
SpriteSetObjMode(&SStack_18, 0);
SpriteSetMosaic(&SStack_18, 0);
SpriteSetBpp(&SStack_18, 0);
SpriteSetShape(&SStack_18, 1);
SpriteSetMatrixNum(&SStack_18, 0);
SpriteSetSize(&SStack_18, 0);
SpriteSetTileNum(&SStack_18, 0x3F0);
SpriteSetPriority(&SStack_18, 0);
SpriteSetPalNum(&SStack_18, 15);
SpriteSetY(&SStack_18, (ptr->unk2 * 8) + 0x60);
SpriteSetX(&SStack_18, 112);
AddSprite(&SStack_18,0x100,0,0x0);
}
void sub_80140B4(UnkTextStruct2 *a0)
{
s32 i;
for(i = 0; i < 4; i++)
{
a0[i] = gUnknown_80D47C8[i];
}
}

View File

@@ -5,6 +5,7 @@
#include "code_8097DD0.h"
#include "constants/colors.h"
#include "constants/monster.h"
#include "constants/tactic.h"
#include "decompress.h"
#include "file_system.h"
#include "pokemon_3.h"
@@ -19,7 +20,7 @@ extern struct FileArchive gMonsterFileArchive;
static EWRAM_DATA MonsterDataEntry *gMonsterParameters = {0};
static EWRAM_DATA OpenedFile *gMonsterParametersFile = {0};
EWRAM_DATA SpriteOAM gShadowSprites[3] = {0}; // TODO: make static once pokemon_2.s is ded
static EWRAM_DATA SpriteOAM gShadowSprites[3] = {0};
static EWRAM_DATA unkStruct_203B45C gRecruitedPokemon = {0};
static EWRAM_DATA u16 gLevelCurrentPokeId = {0};
UNUSED static EWRAM_DATA u16 unused_data[3] = {0};
@@ -117,7 +118,7 @@ void sub_808CE74(s16 _species, bool32 _isLeader, u8* name)
pokemon.heldItem.id = ITEM_NOTHING;
pokemon.heldItem.quantity = 0;
pokemon.currExp = 0;
pokemon.tacticIndex = 0; // TACTIC_LETS_GO_TOGETHER
pokemon.tacticIndex = TACTIC_LETS_GO_TOGETHER;
pokemon.dungeonLocation.floor = 0;
sub_808E490(pokemon.moves, species);
@@ -164,7 +165,7 @@ void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, D
pokemon->speciesNum = species;
xxx_init_helditem_8090B08(&pokemon->heldItem, itemID);
pokemon->currExp = 0;
pokemon->tacticIndex = 0;
pokemon->tacticIndex = TACTIC_LETS_GO_TOGETHER;
pokemon->IQ = 1;
pokemon->dungeonLocation = *location;
pokemon->unkC[0].level = 0;
@@ -211,26 +212,12 @@ void sub_808D0D8(PokemonStruct1 *pokemon)
pokemon->offense.def[0] = GetBaseDefensiveStat(pokemon->speciesNum, 0);
pokemon->offense.def[1] = GetBaseDefensiveStat(pokemon->speciesNum, 1);
pokemon->currExp = 0;
pokemon->tacticIndex = 0;
pokemon->tacticIndex = TACTIC_LETS_GO_TOGETHER;
pokemon->IQ = 1;
SetDefaultIQSkills(&pokemon->IQSkills, FALSE);
sub_808E490(pokemon->moves, pokemon->speciesNum);
}
struct unkStruct_808D144
{
/* 0x0 */ u8 *name;
/* 0x4 */ s16 speciesNum;
/* 0x6 */ u8 itemID;
/* 0x8 */ struct DungeonLocation dungeonLocation;
/* 0xC */ u16 moveID[MAX_MON_MOVES];
/* 0x14 */ s16 pokeHP;
/* 0x16 */ u16 level;
/* 0x18 */ u16 IQ;
s16 offense[4]; // atk, spatt, def, spdef (not sure why s16/u16 and not u8)
/* 0x24 */ u32 currExp;
};
void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1)
{
s32 i;
@@ -239,14 +226,14 @@ void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1)
pokemon->isTeamLeader = FALSE;
pokemon->level = r1->level;
pokemon->pokeHP = r1->pokeHP;
pokemon->offense.att[0] = r1->offense[0];
pokemon->offense.att[1] = r1->offense[1];
pokemon->offense.def[0] = r1->offense[2];
pokemon->offense.def[1] = r1->offense[3];
pokemon->offense.att[0] = r1->offenseAtk[0];
pokemon->offense.att[1] = r1->offenseAtk[1];
pokemon->offense.def[0] = r1->offenseDef[0];
pokemon->offense.def[1] = r1->offenseDef[1];
pokemon->speciesNum = r1->speciesNum;
xxx_init_helditem_8090B08(&pokemon->heldItem, r1->itemID);
pokemon->currExp = r1->currExp;
pokemon->tacticIndex = 0;
pokemon->tacticIndex = TACTIC_LETS_GO_TOGETHER;
pokemon->IQ = r1->IQ;
pokemon->dungeonLocation = r1->dungeonLocation;
pokemon->unkC[0].level = 0;

View File

@@ -16,21 +16,6 @@
#include "data/code_80140DC.h"
// TODO: move to menu_input
extern UnkTextStruct2 gUnknown_80D47C8[4];
void sub_80140B4(UnkTextStruct2 *a0)
{
s32 i;
for(i = 0; i < 4; i++)
{
a0[i] = gUnknown_80D47C8[i];
}
}
// End of menu_input.c
void sub_80140DC(void)
{
DungeonPos pos;