split more code

This commit is contained in:
YamaArashi 2017-01-15 17:14:00 -08:00
parent 3c6e4dba69
commit 0f27bfba8d
29 changed files with 32924 additions and 32825 deletions

130
asm/bard_music.s Normal file
View File

@ -0,0 +1,130 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_817C7DC
sub_817C7DC: @ 817C7DC
ldr r2, =gUnknown_0860A320
lsls r0, 2
adds r0, r2
ldr r0, [r0]
lsls r1, 1
adds r1, r0
movs r2, 0
ldrsh r0, [r1, r2]
bx lr
.pool
thumb_func_end sub_817C7DC
thumb_func_start sub_817C7F4
sub_817C7F4: @ 817C7F4
push {r4,r5,lr}
lsls r4, r0, 16
lsrs r5, r4, 16
adds r0, r5, 0
bl sub_811EB10
lsls r0, 24
cmp r0, 0
beq _0817C810
ldr r0, =gUnknown_0860A3AC
b _0817C84E
.pool
_0817C810:
lsrs r0, r4, 25
ldr r2, =0x000001ff
ands r2, r5
cmp r0, 0x13
bhi _0817C828
cmp r0, 0x12
bcs _0817C834
cmp r0, 0
beq _0817C82C
b _0817C83C
.pool
_0817C828:
cmp r0, 0x15
bne _0817C83C
_0817C82C:
ldr r1, =gUnknown_085F5494
b _0817C844
.pool
_0817C834:
ldr r1, =gUnknown_085FA1D8
b _0817C844
.pool
_0817C83C:
ldr r1, =gUnknown_0860A168
lsls r0, 2
adds r0, r1
ldr r1, [r0]
_0817C844:
lsls r0, r2, 1
adds r0, r2
lsls r0, 4
adds r1, r0
adds r0, r1, 0
_0817C84E:
pop {r4,r5}
pop {r1}
bx r1
.pool
thumb_func_end sub_817C7F4
thumb_func_start sub_817C858
sub_817C858: @ 817C858
push {r4-r7,lr}
mov r7, r8
push {r7}
adds r5, r0, 0
lsls r1, 16
lsrs r7, r1, 16
movs r0, 0
strh r0, [r5, 0x4]
movs r6, 0
ldr r0, =gUnknown_0860A3DC
mov r8, r0
adds r4, r5, 0
adds r4, 0x18
_0817C872:
lsls r0, r6, 3
ldr r1, [r5, 0x30]
adds r2, r1, r0
ldrb r0, [r2]
cmp r0, 0xFF
beq _0817C8A0
movs r1, 0x1
ldrsb r1, [r2, r1]
lsls r0, 2
add r0, r8
ldr r0, [r0]
adds r1, r0
strh r1, [r4]
adds r0, r7, 0
adds r0, 0x1E
adds r1, r6, 0
bl sub_817C7DC
strh r0, [r4, 0x2]
ldrh r0, [r4]
ldrh r1, [r5, 0x4]
adds r0, r1
strh r0, [r5, 0x4]
_0817C8A0:
adds r4, 0x4
adds r6, 0x1
cmp r6, 0x5
ble _0817C872
movs r0, 0
strb r0, [r5, 0x1]
strh r0, [r5, 0xA]
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_817C858
.align 2, 0 @ Don't pad with nop.

4205
asm/battle_anim.s Normal file

File diff suppressed because it is too large Load Diff

5832
asm/battle_anim_8170478.s Normal file

File diff suppressed because it is too large Load Diff

627
asm/braille_puzzles.s Normal file
View File

@ -0,0 +1,627 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_81795E8
sub_81795E8: @ 81795E8
push {lr}
ldr r0, =0x000008af
bl FlagGet
lsls r0, 24
cmp r0, 0
bne _08179634
ldr r0, =gSaveBlock1Ptr
ldr r2, [r0]
ldrh r1, [r2, 0x4]
ldr r0, =0x00004718
cmp r1, r0
bne _08179634
ldr r1, [r2]
ldr r0, =0x0003000a
cmp r1, r0
beq _08179616
ldr r0, =0x00030009
cmp r1, r0
beq _08179616
ldr r0, =0x0003000b
cmp r1, r0
bne _08179634
_08179616:
movs r0, 0x1
b _08179636
.pool
_08179634:
movs r0, 0
_08179636:
pop {r1}
bx r1
thumb_func_end sub_81795E8
thumb_func_start sub_817963C
sub_817963C: @ 817963C
push {lr}
ldr r2, =0x0000022a
movs r0, 0x10
movs r1, 0x8
bl MapGridSetMetatileIdAt
ldr r2, =0x0000022b
movs r0, 0x11
movs r1, 0x8
bl MapGridSetMetatileIdAt
movs r2, 0x8B
lsls r2, 2
movs r0, 0x12
movs r1, 0x8
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e32
movs r0, 0x10
movs r1, 0x9
bl MapGridSetMetatileIdAt
ldr r2, =0x00000233
movs r0, 0x11
movs r1, 0x9
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e34
movs r0, 0x12
movs r1, 0x9
bl MapGridSetMetatileIdAt
bl DrawWholeMapView
movs r0, 0x14
bl audio_play
ldr r0, =0x000008af
bl FlagSet
bl script_env_2_disable
pop {r0}
bx r0
.pool
thumb_func_end sub_817963C
thumb_func_start sub_81796AC
sub_81796AC: @ 81796AC
push {r4,lr}
ldr r4, =gUnknown_020244EC
adds r0, r4, 0
movs r1, 0x41
movs r2, 0
bl pokemon_getattr
movs r1, 0x9D
lsls r1, 1
cmp r0, r1
bne _081796F4
bl calc_player_party_count
ldr r0, =gUnknown_020244E9
ldrb r1, [r0]
movs r0, 0x64
muls r0, r1
adds r1, r4, 0
subs r1, 0x64
adds r0, r1
movs r1, 0x41
movs r2, 0
bl pokemon_getattr
ldr r1, =0x0000017d
cmp r0, r1
bne _081796F4
movs r0, 0x1
b _081796F6
.pool
_081796F4:
movs r0, 0
_081796F6:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81796AC
thumb_func_start nullsub_84
nullsub_84: @ 81796FC
bx lr
thumb_func_end nullsub_84
thumb_func_start sub_8179700
sub_8179700: @ 8179700
push {lr}
ldr r0, =sub_8179778
movs r1, 0x9
bl CreateTask
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
movs r0, 0
strh r0, [r1, 0xA]
strh r0, [r1, 0xC]
movs r0, 0x2
strh r0, [r1, 0x10]
movs r0, 0x5
strh r0, [r1, 0x12]
movs r0, 0x32
strh r0, [r1, 0x14]
movs r0, 0
bl SetCameraPanningCallback
pop {r0}
bx r0
.pool
thumb_func_end sub_8179700
thumb_func_start sub_817973C
sub_817973C: @ 817973C
push {lr}
ldr r0, =sub_8179778
movs r1, 0x9
bl CreateTask
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
movs r0, 0
strh r0, [r1, 0xA]
strh r0, [r1, 0xC]
movs r0, 0x3
strh r0, [r1, 0x10]
movs r0, 0x5
strh r0, [r1, 0x12]
movs r0, 0x2
strh r0, [r1, 0x14]
movs r0, 0
bl SetCameraPanningCallback
pop {r0}
bx r0
.pool
thumb_func_end sub_817973C
thumb_func_start sub_8179778
sub_8179778: @ 8179778
push {r4,r5,lr}
lsls r0, 24
lsrs r5, r0, 24
lsls r0, r5, 2
adds r0, r5
lsls r0, 3
ldr r1, =gTasks
adds r4, r0, r1
ldrh r0, [r4, 0xA]
adds r0, 0x1
strh r0, [r4, 0xA]
movs r1, 0xA
ldrsh r0, [r4, r1]
movs r2, 0x12
ldrsh r1, [r4, r2]
bl __modsi3
cmp r0, 0
bne _081797D0
strh r0, [r4, 0xA]
ldrh r0, [r4, 0xC]
adds r0, 0x1
strh r0, [r4, 0xC]
ldrh r0, [r4, 0x10]
negs r0, r0
strh r0, [r4, 0x10]
movs r0, 0x10
ldrsh r1, [r4, r0]
movs r0, 0
bl SetCameraPanning
movs r2, 0xC
ldrsh r1, [r4, r2]
movs r2, 0x14
ldrsh r0, [r4, r2]
cmp r1, r0
bne _081797D0
adds r0, r5, 0
bl DestroyTask
bl script_env_2_enable_and_set_ctx_running
bl InstallCameraPanAheadCallback
_081797D0:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8179778
thumb_func_start sub_81797DC
sub_81797DC: @ 81797DC
push {lr}
movs r0, 0x8B
lsls r0, 4
bl FlagGet
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0
bne _0817982C
ldr r0, =gSaveBlock1Ptr
ldr r3, [r0]
ldrh r1, [r3, 0x4]
movs r0, 0xC3
lsls r0, 3
cmp r1, r0
bne _0817982C
ldr r1, [r3]
ldr r0, =0x00170006
cmp r1, r0
beq _08179810
ldr r0, =0x00170005
cmp r1, r0
beq _08179810
ldr r0, =0x00170007
cmp r1, r0
bne _0817982C
_08179810:
ldr r0, =gUnknown_0203BD14
strb r2, [r0]
movs r0, 0x1
b _0817982E
.pool
_0817982C:
movs r0, 0
_0817982E:
pop {r1}
bx r1
thumb_func_end sub_81797DC
thumb_func_start sub_8179834
sub_8179834: @ 8179834
push {lr}
bl brm_get_pokemon_selection
ldr r1, =gUnknown_02038C08
lsls r0, 24
lsrs r0, 24
str r0, [r1]
movs r0, 0x3C
bl FieldEffectStart
pop {r0}
bx r0
.pool
thumb_func_end sub_8179834
thumb_func_start sub_8179850
sub_8179850: @ 8179850
push {lr}
movs r0, 0x3C
bl FieldEffectActiveListRemove
bl sub_8179860
pop {r0}
bx r0
thumb_func_end sub_8179850
thumb_func_start sub_8179860
sub_8179860: @ 8179860
push {lr}
ldr r2, =0x0000022a
movs r0, 0xE
movs r1, 0x1A
bl MapGridSetMetatileIdAt
ldr r2, =0x0000022b
movs r0, 0xF
movs r1, 0x1A
bl MapGridSetMetatileIdAt
movs r2, 0x8B
lsls r2, 2
movs r0, 0x10
movs r1, 0x1A
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e32
movs r0, 0xE
movs r1, 0x1B
bl MapGridSetMetatileIdAt
ldr r2, =0x00000233
movs r0, 0xF
movs r1, 0x1B
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e34
movs r0, 0x10
movs r1, 0x1B
bl MapGridSetMetatileIdAt
bl DrawWholeMapView
movs r0, 0x14
bl audio_play
movs r0, 0x8B
lsls r0, 4
bl FlagSet
bl script_env_2_disable
pop {r0}
bx r0
.pool
thumb_func_end sub_8179860
thumb_func_start sub_81798D0
sub_81798D0: @ 81798D0
push {lr}
ldr r0, =0x000008b2
bl FlagGet
lsls r0, 24
cmp r0, 0
bne _08179910
ldr r0, =gSaveBlock1Ptr
ldr r2, [r0]
ldrh r1, [r2, 0x4]
ldr r0, =0x00004418
cmp r1, r0
bne _08179910
ldr r1, [r2]
ldr r0, =0x00190008
cmp r1, r0
bne _08179910
ldr r1, =gUnknown_0203BD14
movs r0, 0x1
strb r0, [r1]
movs r0, 0x1
b _08179912
.pool
_08179910:
movs r0, 0
_08179912:
pop {r1}
bx r1
thumb_func_end sub_81798D0
thumb_func_start sub_8179918
sub_8179918: @ 8179918
push {lr}
bl brm_get_pokemon_selection
ldr r1, =gUnknown_02038C08
lsls r0, 24
lsrs r0, 24
str r0, [r1]
movs r0, 0x3C
bl FieldEffectStart
pop {r0}
bx r0
.pool
thumb_func_end sub_8179918
thumb_func_start sub_8179934
sub_8179934: @ 8179934
push {lr}
movs r0, 0x3C
bl FieldEffectActiveListRemove
bl sub_8179944
pop {r0}
bx r0
thumb_func_end sub_8179934
thumb_func_start sub_8179944
sub_8179944: @ 8179944
push {lr}
ldr r2, =0x0000022a
movs r0, 0xE
movs r1, 0x1A
bl MapGridSetMetatileIdAt
ldr r2, =0x0000022b
movs r0, 0xF
movs r1, 0x1A
bl MapGridSetMetatileIdAt
movs r2, 0x8B
lsls r2, 2
movs r0, 0x10
movs r1, 0x1A
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e32
movs r0, 0xE
movs r1, 0x1B
bl MapGridSetMetatileIdAt
ldr r2, =0x00000233
movs r0, 0xF
movs r1, 0x1B
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e34
movs r0, 0x10
movs r1, 0x1B
bl MapGridSetMetatileIdAt
bl DrawWholeMapView
movs r0, 0x14
bl audio_play
ldr r0, =0x000008b2
bl FlagSet
bl script_env_2_disable
pop {r0}
bx r0
.pool
thumb_func_end sub_8179944
thumb_func_start nullsub_64
nullsub_64: @ 81799B4
bx lr
thumb_func_end nullsub_64
thumb_func_start sub_81799B8
sub_81799B8: @ 81799B8
push {lr}
bl oei_task_add
lsls r0, 24
lsrs r2, r0, 24
ldr r0, =gUnknown_0203BD14
ldrb r0, [r0]
cmp r0, 0x1
bne _081799E4
ldr r1, =gTasks
lsls r0, r2, 2
adds r0, r2
lsls r0, 3
adds r0, r1
ldr r2, =sub_8179934
b _081799F0
.pool
_081799E4:
ldr r1, =gTasks
lsls r0, r2, 2
adds r0, r2
lsls r0, 3
adds r0, r1
ldr r2, =sub_8179850
_081799F0:
lsrs r1, r2, 16
strh r1, [r0, 0x18]
strh r2, [r0, 0x1A]
movs r0, 0
pop {r1}
bx r1
.pool
thumb_func_end sub_81799B8
thumb_func_start sub_8179A04
sub_8179A04: @ 8179A04
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
ldr r4, =gSaveBlock1Ptr
ldr r0, [r4]
ldrh r1, [r0, 0x4]
ldr r0, =0x00004318
cmp r1, r0
beq _08179A1A
b _08179B5A
_08179A1A:
ldr r0, =0x000008b1
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _08179A28
b _08179B5A
_08179A28:
movs r0, 0x2
bl FlagGet
lsls r0, 24
cmp r0, 0
bne _08179A36
b _08179B5A
_08179A36:
movs r0, 0x3
bl FlagGet
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _08179A58
b _08179B5A
.pool
_08179A54:
movs r0, 0x1
b _08179B5C
_08179A58:
movs r5, 0
mov r8, r4
ldr r4, =gUnknown_085EFE74
adds r0, r4, 0x1
mov r12, r0
ldr r6, =0x0000403b
ldr r1, =0x0000403c
mov r9, r1
_08179A68:
lsls r0, r5, 1
adds r1, r0, r4
add r0, r12
ldrb r3, [r0]
mov r7, r8
ldr r2, [r7]
movs r7, 0
ldrsh r0, [r2, r7]
ldrb r1, [r1]
cmp r0, r1
bne _08179B44
movs r1, 0x2
ldrsh r0, [r2, r1]
cmp r0, r3
bne _08179B44
cmp r5, 0xF
bhi _08179AB0
adds r0, r6, 0
bl VarGet
lsls r0, 16
movs r1, 0x80
lsls r1, 9
lsls r1, r5
orrs r1, r0
lsrs r1, 16
adds r0, r6, 0
bl VarSet
b _08179AF0
.pool
_08179AB0:
cmp r5, 0x1F
bhi _08179AD2
mov r0, r9
bl VarGet
lsls r0, 16
adds r2, r5, 0
subs r2, 0x10
movs r1, 0x80
lsls r1, 9
lsls r1, r2
orrs r1, r0
lsrs r1, 16
mov r0, r9
bl VarSet
b _08179AF0
_08179AD2:
ldr r4, =0x0000403d
adds r0, r4, 0
bl VarGet
lsls r0, 16
adds r2, r5, 0
subs r2, 0x20
movs r1, 0x80
lsls r1, 9
lsls r1, r2
orrs r1, r0
lsrs r1, 16
adds r0, r4, 0
bl VarSet
_08179AF0:
ldr r0, =0x0000403b
bl VarGet
lsls r0, 16
lsrs r4, r0, 16
ldr r0, =0x0000ffff
cmp r4, r0
bne _08179B5A
ldr r0, =0x0000403c
bl VarGet
lsls r0, 16
lsrs r0, 16
cmp r0, r4
bne _08179B5A
ldr r0, =0x0000403d
bl VarGet
lsls r0, 16
lsrs r0, 16
cmp r0, 0xF
bne _08179B5A
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, [r0]
ldr r0, =0x00150008
cmp r1, r0
beq _08179A54
b _08179B5A
.pool
_08179B44:
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x23
bls _08179A68
movs r0, 0x3
bl FlagSet
movs r0, 0x2
bl FlagReset
_08179B5A:
movs r0, 0
_08179B5C:
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8179A04
.align 2, 0 @ Don't pad with nop.

175
asm/clock.s Normal file
View File

@ -0,0 +1,175 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_809E778
sub_809E778: @ 809E778
push {lr}
ldr r0, =0x00000895
bl FlagSet
bl GameFreakRTC_CalcLocalDateTime
ldr r0, =gSaveBlock2Ptr
ldr r2, [r0]
adds r2, 0xA0
ldr r3, =gUnknown_03005CF8
ldr r0, [r3]
ldr r1, [r3, 0x4]
str r0, [r2]
str r1, [r2, 0x4]
ldr r0, =0x00004040
ldrh r1, [r3]
bl VarSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809E778
thumb_func_start sub_809E7B0
sub_809E7B0: @ 809E7B0
push {r4,lr}
ldr r0, =0x00000895
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _0809E7DA
bl sub_813B9C0
lsls r0, 24
cmp r0, 0
bne _0809E7DA
bl GameFreakRTC_CalcLocalDateTime
ldr r4, =gUnknown_03005CF8
adds r0, r4, 0
bl sub_809E7E8
adds r0, r4, 0
bl sub_809E858
_0809E7DA:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_809E7B0
thumb_func_start sub_809E7E8
sub_809E7E8: @ 809E7E8
push {r4-r6,lr}
adds r5, r0, 0
ldr r0, =0x00004040
bl GetVarPointer
adds r6, r0, 0
ldrh r0, [r6]
movs r2, 0
ldrsh r1, [r5, r2]
cmp r0, r1
beq _0809E84E
cmp r0, r1
bgt _0809E84E
ldrh r4, [r5]
subs r4, r0
lsls r4, 16
lsrs r4, 16
bl sub_809D3A0
adds r0, r4, 0
bl sub_8122580
adds r0, r4, 0
bl sub_80ED888
adds r0, r4, 0
bl sub_80AEFBC
adds r0, r4, 0
bl sub_806DE44
adds r0, r4, 0
bl sub_8137904
adds r0, r4, 0
bl sub_8137A20
adds r0, r4, 0
bl sub_8139EF4
adds r0, r4, 0
bl sub_813A7F4
adds r0, r4, 0
bl sub_813945C
adds r0, r4, 0
bl sub_8177584
ldrh r0, [r5]
strh r0, [r6]
_0809E84E:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_809E7E8
thumb_func_start sub_809E858
sub_809E858: @ 809E858
push {r4-r6,lr}
sub sp, 0x8
adds r5, r0, 0
mov r4, sp
ldr r6, =gSaveBlock2Ptr
ldr r1, [r6]
adds r1, 0xA0
mov r0, sp
adds r2, r5, 0
bl GameFreakRTC_GetDelta
mov r0, sp
movs r2, 0
ldrsh r1, [r0, r2]
lsls r0, r1, 1
adds r0, r1
lsls r1, r0, 4
subs r1, r0
lsls r1, 5
movs r2, 0x2
ldrsb r2, [r4, r2]
lsls r0, r2, 4
subs r0, r2
lsls r0, 2
adds r1, r0
movs r0, 0x3
ldrsb r0, [r4, r0]
adds r0, r1, r0
cmp r0, 0
beq _0809E8A8
cmp r0, 0
blt _0809E8A8
bl BerryTreeTimeUpdate
ldr r2, [r6]
adds r2, 0xA0
ldr r0, [r5]
ldr r1, [r5, 0x4]
str r0, [r2]
str r1, [r2, 0x4]
_0809E8A8:
add sp, 0x8
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_809E858
thumb_func_start sub_809E8B4
sub_809E8B4: @ 809E8B4
push {lr}
bl sub_809E778
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
bl SetMainCallback2
pop {r0}
bx r0
.pool
thumb_func_end sub_809E8B4
thumb_func_start Special_StartWallClock
Special_StartWallClock: @ 809E8C8
push {lr}
ldr r0, =Cb2_StartWallClock
bl SetMainCallback2
ldr r1, =gUnknown_030022C0
ldr r0, =sub_809E8B4
str r0, [r1, 0x8]
pop {r0}
bx r0
.pool
thumb_func_end Special_StartWallClock
.align 2, 0 @ Don't pad with nop.

156
asm/coord_event_weather.s Normal file
View File

@ -0,0 +1,156 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_809D7BC
sub_809D7BC: @ 809D7BC
push {lr}
movs r0, 0x1
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7BC
thumb_func_start sub_809D7C8
sub_809D7C8: @ 809D7C8
push {lr}
movs r0, 0x2
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7C8
thumb_func_start sub_809D7D4
sub_809D7D4: @ 809D7D4
push {lr}
movs r0, 0x3
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7D4
thumb_func_start sub_809D7E0
sub_809D7E0: @ 809D7E0
push {lr}
movs r0, 0x4
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7E0
thumb_func_start sub_809D7EC
sub_809D7EC: @ 809D7EC
push {lr}
movs r0, 0x5
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7EC
thumb_func_start sub_809D7F8
sub_809D7F8: @ 809D7F8
push {lr}
movs r0, 0x6
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7F8
thumb_func_start sub_809D804
sub_809D804: @ 809D804
push {lr}
movs r0, 0x9
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D804
thumb_func_start sub_809D810
sub_809D810: @ 809D810
push {lr}
movs r0, 0x7
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D810
thumb_func_start sub_809D81C
sub_809D81C: @ 809D81C
push {lr}
movs r0, 0x8
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D81C
thumb_func_start sub_809D828
sub_809D828: @ 809D828
push {lr}
movs r0, 0xB
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D828
thumb_func_start sub_809D834
sub_809D834: @ 809D834
push {lr}
movs r0, 0xC
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D834
thumb_func_start sub_809D840
sub_809D840: @ 809D840
push {lr}
movs r0, 0x14
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D840
thumb_func_start sub_809D84C
sub_809D84C: @ 809D84C
push {lr}
movs r0, 0x15
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D84C
thumb_func_start trigger_activate_weather
trigger_activate_weather: @ 809D858
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
movs r2, 0
ldr r3, =gUnknown_085102E0
_0809D862:
lsls r1, r2, 3
adds r0, r1, r3
ldrb r0, [r0]
cmp r0, r4
bne _0809D87C
adds r0, r3, 0x4
adds r0, r1, r0
ldr r0, [r0]
bl _call_via_r0
b _0809D886
.pool
_0809D87C:
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0xC
bls _0809D862
_0809D886:
pop {r4}
pop {r0}
bx r0
thumb_func_end trigger_activate_weather
.align 2, 0 @ Don't pad with nop.

3903
asm/credits.s Normal file

File diff suppressed because it is too large Load Diff

565
asm/event_data.s Normal file
View File

@ -0,0 +1,565 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_809D300
sub_809D300: @ 809D300
push {r4,lr}
ldr r4, =gSaveBlock1Ptr
ldr r0, [r4]
ldr r1, =0x00001270
adds r0, r1
movs r2, 0x96
lsls r2, 1
movs r1, 0
bl memset
ldr r0, [r4]
ldr r1, =0x0000139c
adds r0, r1
movs r2, 0x80
lsls r2, 2
movs r1, 0
bl memset
ldr r0, =gUnknown_020375FC
movs r1, 0
movs r2, 0x10
bl memset
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_809D300
thumb_func_start sub_809D344
sub_809D344: @ 809D344
push {lr}
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, =0x00001270
adds r2, r0, r1
movs r1, 0
str r1, [r2]
ldr r1, =0x0000139c
adds r0, r1
movs r1, 0
movs r2, 0x20
bl memset
ldr r0, =0x000008ad
bl FlagReset
ldr r0, =0x000008ae
bl FlagReset
ldr r0, =0x00000889
bl FlagReset
ldr r0, =0x000008c1
bl FlagReset
movs r0, 0x88
lsls r0, 4
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D344
thumb_func_start sub_809D3A0
sub_809D3A0: @ 809D3A0
push {lr}
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, =0x00001394
adds r0, r1
movs r1, 0
movs r2, 0x8
bl memset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D3A0
thumb_func_start sub_809D3C0
sub_809D3C0: @ 809D3C0
push {lr}
ldr r0, =0x00004046
bl GetVarPointer
ldr r1, =gSaveBlock2Ptr
ldr r2, [r1]
movs r1, 0
strb r1, [r2, 0x1A]
strh r1, [r0]
ldr r0, =0x00000896
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D3C0
thumb_func_start sub_809D3E8
sub_809D3E8: @ 809D3E8
push {r4,r5,lr}
ldr r0, =0x00004046
bl GetVarPointer
ldr r4, =gSaveBlock2Ptr
ldr r2, [r4]
movs r5, 0
movs r1, 0xDA
strb r1, [r2, 0x1A]
ldr r2, =0x00000302
adds r1, r2, 0
strh r1, [r0]
ldr r0, =0x00000896
bl FlagSet
ldr r1, [r4]
movs r0, 0x1
strb r0, [r1, 0x19]
ldr r0, [r4]
strb r5, [r0, 0x18]
bl sub_80BB358
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_809D3E8
thumb_func_start sub_809D42C
sub_809D42C: @ 809D42C
push {lr}
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r0, [r0, 0x1A]
cmp r0, 0xDA
bne _0809D468
ldr r0, =0x00004046
bl VarGet
lsls r0, 16
ldr r1, =0x03020000
cmp r0, r1
bne _0809D468
ldr r0, =0x00000896
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _0809D468
movs r0, 0x1
b _0809D46A
.pool
_0809D468:
movs r0, 0
_0809D46A:
pop {r1}
bx r1
thumb_func_end sub_809D42C
thumb_func_start sub_809D470
sub_809D470: @ 809D470
push {lr}
ldr r0, =0x000008ac
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D470
thumb_func_start sub_809D480
sub_809D480: @ 809D480
push {lr}
ldr r0, =0x000008ac
bl FlagSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809D480
thumb_func_start sub_809D490
sub_809D490: @ 809D490
push {lr}
ldr r0, =0x000008ac
bl FlagGet
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.pool
thumb_func_end sub_809D490
thumb_func_start sub_809D4A4
sub_809D4A4: @ 809D4A4
push {lr}
ldr r0, =0x000008db
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D4A4
thumb_func_start sub_809D4B4
sub_809D4B4: @ 809D4B4
push {lr}
ldr r0, =0x000008db
bl FlagSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809D4B4
thumb_func_start sub_809D4C4
sub_809D4C4: @ 809D4C4
push {lr}
ldr r0, =0x000008db
bl FlagGet
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.pool
thumb_func_end sub_809D4C4
thumb_func_start sub_809D4D8
sub_809D4D8: @ 809D4D8
push {lr}
movs r0, 0xF2
lsls r0, 1
bl FlagReset
ldr r0, =0x000001e5
bl FlagReset
movs r0, 0xF3
lsls r0, 1
bl FlagReset
ldr r0, =0x000001e7
bl FlagReset
movs r0, 0xF4
lsls r0, 1
bl FlagReset
ldr r0, =0x000001e9
bl FlagReset
movs r0, 0xF5
lsls r0, 1
bl FlagReset
ldr r0, =0x000001eb
bl FlagReset
movs r0, 0xF6
lsls r0, 1
bl FlagReset
ldr r0, =0x000001ed
bl FlagReset
movs r0, 0xF7
lsls r0, 1
bl FlagReset
ldr r0, =0x000001ef
bl FlagReset
movs r0, 0xF8
lsls r0, 1
bl FlagReset
ldr r0, =0x000001f1
bl FlagReset
movs r0, 0xF9
lsls r0, 1
bl FlagReset
ldr r0, =0x000001f3
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D4D8
thumb_func_start sub_809D570
sub_809D570: @ 809D570
push {lr}
ldr r0, =0x000040dd
movs r1, 0
bl VarSet
ldr r0, =0x000040de
movs r1, 0
bl VarSet
ldr r0, =0x000040df
movs r1, 0
bl VarSet
ldr r0, =0x000040e0
movs r1, 0
bl VarSet
ldr r0, =0x000040e1
movs r1, 0
bl VarSet
ldr r0, =0x000040e2
movs r1, 0
bl VarSet
ldr r0, =0x000040e3
movs r1, 0
bl VarSet
ldr r0, =0x000040e4
movs r1, 0
bl VarSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809D570
thumb_func_start sub_809D5D8
sub_809D5D8: @ 809D5D8
push {lr}
ldr r0, =0x0000402c
movs r1, 0
bl VarSet
ldr r0, =0x000008c2
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D5D8
thumb_func_start sub_809D5F4
sub_809D5F4: @ 809D5F4
push {lr}
ldr r0, =0x0000402c
movs r1, 0x92
lsls r1, 4
bl VarSet
ldr r0, =0x000008c2
bl FlagSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809D5F4
thumb_func_start sub_809D614
sub_809D614: @ 809D614
push {lr}
ldr r0, =0x000008c2
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _0809D640
ldr r0, =0x0000402c
bl VarGet
lsls r0, 16
movs r1, 0x92
lsls r1, 20
cmp r0, r1
bne _0809D640
movs r0, 0x1
b _0809D642
.pool
_0809D640:
movs r0, 0
_0809D642:
pop {r1}
bx r1
thumb_func_end sub_809D614
thumb_func_start GetVarPointer
@ u16 *GetVarPointer(u16 varId)
GetVarPointer: @ 809D648
push {lr}
lsls r0, 16
lsrs r1, r0, 16
adds r2, r1, 0
ldr r0, =0x00003fff
cmp r1, r0
bhi _0809D660
movs r0, 0
b _0809D688
.pool
_0809D660:
lsls r0, r1, 16
cmp r0, 0
bge _0809D67C
ldr r0, =gUnknown_081DBA0C
ldr r2, =0xffff8000
adds r1, r2
lsls r1, 2
adds r1, r0
ldr r0, [r1]
b _0809D688
.pool
_0809D67C:
ldr r0, =gSaveBlock1Ptr
lsls r1, r2, 1
ldr r2, =0xffff939c
adds r1, r2
ldr r0, [r0]
adds r0, r1
_0809D688:
pop {r1}
bx r1
.pool
thumb_func_end GetVarPointer
thumb_func_start VarGet
@ u16 VarGet(u16 varId)
VarGet: @ 809D694
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
adds r0, r4, 0
bl GetVarPointer
cmp r0, 0
beq _0809D6A8
ldrh r0, [r0]
b _0809D6AA
_0809D6A8:
adds r0, r4, 0
_0809D6AA:
pop {r4}
pop {r1}
bx r1
thumb_func_end VarGet
thumb_func_start VarSet
@ bool8 VarSet(u16 varId, u16 value)
VarSet: @ 809D6B0
push {r4,lr}
lsls r0, 16
lsrs r0, 16
lsls r1, 16
lsrs r4, r1, 16
bl GetVarPointer
cmp r0, 0
beq _0809D6C8
strh r4, [r0]
movs r0, 0x1
b _0809D6CA
_0809D6C8:
movs r0, 0
_0809D6CA:
pop {r4}
pop {r1}
bx r1
thumb_func_end VarSet
thumb_func_start VarGetFieldObjectGraphicsId
@ u8 VarGetFieldObjectGraphicsId(u8 index)
VarGetFieldObjectGraphicsId: @ 809D6D0
push {lr}
lsls r0, 24
lsrs r0, 8
ldr r1, =0x40100000
adds r0, r1
lsrs r0, 16
bl VarGet
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.pool
thumb_func_end VarGetFieldObjectGraphicsId
thumb_func_start GetFlagPointer
@ u8 *GetFlagPointer(u16 flagId)
GetFlagPointer: @ 809D6EC
push {lr}
lsls r1, r0, 16
lsrs r2, r1, 16
adds r3, r2, 0
cmp r2, 0
bne _0809D6FC
movs r0, 0
b _0809D72E
_0809D6FC:
ldr r0, =0x00003fff
cmp r2, r0
bhi _0809D71C
ldr r0, =gSaveBlock1Ptr
lsrs r1, 19
ldr r2, =0x00001270
adds r1, r2
ldr r0, [r0]
b _0809D72C
.pool
_0809D71C:
ldr r1, =0xffffc000
adds r0, r3, r1
cmp r0, 0
bge _0809D728
ldr r2, =0xffffc007
adds r0, r3, r2
_0809D728:
asrs r0, 3
ldr r1, =gUnknown_020375FC
_0809D72C:
adds r0, r1
_0809D72E:
pop {r1}
bx r1
.pool
thumb_func_end GetFlagPointer
thumb_func_start FlagSet
@ bool8 FlagSet(u16 flagId)
FlagSet: @ 809D740
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
adds r0, r4, 0
bl GetFlagPointer
adds r2, r0, 0
cmp r2, 0
beq _0809D760
movs r0, 0x7
ands r0, r4
movs r1, 0x1
lsls r1, r0
ldrb r0, [r2]
orrs r1, r0
strb r1, [r2]
_0809D760:
movs r0, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end FlagSet
thumb_func_start FlagReset
@ bool8 FlagReset(u16 flagId)
FlagReset: @ 809D768
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
adds r0, r4, 0
bl GetFlagPointer
adds r2, r0, 0
cmp r2, 0
beq _0809D788
movs r0, 0x7
ands r0, r4
movs r1, 0x1
lsls r1, r0
ldrb r0, [r2]
bics r0, r1
strb r0, [r2]
_0809D788:
movs r0, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end FlagReset
thumb_func_start FlagGet
@ bool8 FlagGet(u16 flagId)
FlagGet: @ 809D790
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
adds r0, r4, 0
bl GetFlagPointer
cmp r0, 0
beq _0809D7B4
ldrb r0, [r0]
movs r1, 0x7
ands r1, r4
asrs r0, r1
movs r1, 0x1
ands r0, r1
cmp r0, 0
beq _0809D7B4
movs r0, 0x1
b _0809D7B6
_0809D7B4:
movs r0, 0
_0809D7B6:
pop {r4}
pop {r1}
bx r1
thumb_func_end FlagGet
.align 2, 0 @ Don't pad with nop.

1751
asm/evolution_graphics.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2509,346 +2509,4 @@ sub_809D2BC: @ 809D2BC
.pool .pool
thumb_func_end sub_809D2BC thumb_func_end sub_809D2BC
thumb_func_start sub_809D300
sub_809D300: @ 809D300
push {r4,lr}
ldr r4, =gSaveBlock1Ptr
ldr r0, [r4]
ldr r1, =0x00001270
adds r0, r1
movs r2, 0x96
lsls r2, 1
movs r1, 0
bl memset
ldr r0, [r4]
ldr r1, =0x0000139c
adds r0, r1
movs r2, 0x80
lsls r2, 2
movs r1, 0
bl memset
ldr r0, =gUnknown_020375FC
movs r1, 0
movs r2, 0x10
bl memset
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_809D300
thumb_func_start sub_809D344
sub_809D344: @ 809D344
push {lr}
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, =0x00001270
adds r2, r0, r1
movs r1, 0
str r1, [r2]
ldr r1, =0x0000139c
adds r0, r1
movs r1, 0
movs r2, 0x20
bl memset
ldr r0, =0x000008ad
bl FlagReset
ldr r0, =0x000008ae
bl FlagReset
ldr r0, =0x00000889
bl FlagReset
ldr r0, =0x000008c1
bl FlagReset
movs r0, 0x88
lsls r0, 4
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D344
thumb_func_start sub_809D3A0
sub_809D3A0: @ 809D3A0
push {lr}
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, =0x00001394
adds r0, r1
movs r1, 0
movs r2, 0x8
bl memset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D3A0
thumb_func_start sub_809D3C0
sub_809D3C0: @ 809D3C0
push {lr}
ldr r0, =0x00004046
bl GetVarPointer
ldr r1, =gSaveBlock2Ptr
ldr r2, [r1]
movs r1, 0
strb r1, [r2, 0x1A]
strh r1, [r0]
ldr r0, =0x00000896
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D3C0
thumb_func_start sub_809D3E8
sub_809D3E8: @ 809D3E8
push {r4,r5,lr}
ldr r0, =0x00004046
bl GetVarPointer
ldr r4, =gSaveBlock2Ptr
ldr r2, [r4]
movs r5, 0
movs r1, 0xDA
strb r1, [r2, 0x1A]
ldr r2, =0x00000302
adds r1, r2, 0
strh r1, [r0]
ldr r0, =0x00000896
bl FlagSet
ldr r1, [r4]
movs r0, 0x1
strb r0, [r1, 0x19]
ldr r0, [r4]
strb r5, [r0, 0x18]
bl sub_80BB358
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_809D3E8
thumb_func_start sub_809D42C
sub_809D42C: @ 809D42C
push {lr}
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r0, [r0, 0x1A]
cmp r0, 0xDA
bne _0809D468
ldr r0, =0x00004046
bl VarGet
lsls r0, 16
ldr r1, =0x03020000
cmp r0, r1
bne _0809D468
ldr r0, =0x00000896
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _0809D468
movs r0, 0x1
b _0809D46A
.pool
_0809D468:
movs r0, 0
_0809D46A:
pop {r1}
bx r1
thumb_func_end sub_809D42C
thumb_func_start sub_809D470
sub_809D470: @ 809D470
push {lr}
ldr r0, =0x000008ac
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D470
thumb_func_start sub_809D480
sub_809D480: @ 809D480
push {lr}
ldr r0, =0x000008ac
bl FlagSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809D480
thumb_func_start sub_809D490
sub_809D490: @ 809D490
push {lr}
ldr r0, =0x000008ac
bl FlagGet
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.pool
thumb_func_end sub_809D490
thumb_func_start sub_809D4A4
sub_809D4A4: @ 809D4A4
push {lr}
ldr r0, =0x000008db
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D4A4
thumb_func_start sub_809D4B4
sub_809D4B4: @ 809D4B4
push {lr}
ldr r0, =0x000008db
bl FlagSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809D4B4
thumb_func_start sub_809D4C4
sub_809D4C4: @ 809D4C4
push {lr}
ldr r0, =0x000008db
bl FlagGet
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.pool
thumb_func_end sub_809D4C4
thumb_func_start sub_809D4D8
sub_809D4D8: @ 809D4D8
push {lr}
movs r0, 0xF2
lsls r0, 1
bl FlagReset
ldr r0, =0x000001e5
bl FlagReset
movs r0, 0xF3
lsls r0, 1
bl FlagReset
ldr r0, =0x000001e7
bl FlagReset
movs r0, 0xF4
lsls r0, 1
bl FlagReset
ldr r0, =0x000001e9
bl FlagReset
movs r0, 0xF5
lsls r0, 1
bl FlagReset
ldr r0, =0x000001eb
bl FlagReset
movs r0, 0xF6
lsls r0, 1
bl FlagReset
ldr r0, =0x000001ed
bl FlagReset
movs r0, 0xF7
lsls r0, 1
bl FlagReset
ldr r0, =0x000001ef
bl FlagReset
movs r0, 0xF8
lsls r0, 1
bl FlagReset
ldr r0, =0x000001f1
bl FlagReset
movs r0, 0xF9
lsls r0, 1
bl FlagReset
ldr r0, =0x000001f3
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D4D8
thumb_func_start sub_809D570
sub_809D570: @ 809D570
push {lr}
ldr r0, =0x000040dd
movs r1, 0
bl VarSet
ldr r0, =0x000040de
movs r1, 0
bl VarSet
ldr r0, =0x000040df
movs r1, 0
bl VarSet
ldr r0, =0x000040e0
movs r1, 0
bl VarSet
ldr r0, =0x000040e1
movs r1, 0
bl VarSet
ldr r0, =0x000040e2
movs r1, 0
bl VarSet
ldr r0, =0x000040e3
movs r1, 0
bl VarSet
ldr r0, =0x000040e4
movs r1, 0
bl VarSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809D570
thumb_func_start sub_809D5D8
sub_809D5D8: @ 809D5D8
push {lr}
ldr r0, =0x0000402c
movs r1, 0
bl VarSet
ldr r0, =0x000008c2
bl FlagReset
pop {r0}
bx r0
.pool
thumb_func_end sub_809D5D8
thumb_func_start sub_809D5F4
sub_809D5F4: @ 809D5F4
push {lr}
ldr r0, =0x0000402c
movs r1, 0x92
lsls r1, 4
bl VarSet
ldr r0, =0x000008c2
bl FlagSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809D5F4
thumb_func_start sub_809D614
sub_809D614: @ 809D614
push {lr}
ldr r0, =0x000008c2
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _0809D640
ldr r0, =0x0000402c
bl VarGet
lsls r0, 16
movs r1, 0x92
lsls r1, 20
cmp r0, r1
bne _0809D640
movs r0, 0x1
b _0809D642
.pool
_0809D640:
movs r0, 0
_0809D642:
pop {r1}
bx r1
thumb_func_end sub_809D614
.align 2, 0 @ Don't pad with nop. .align 2, 0 @ Don't pad with nop.

File diff suppressed because it is too large Load Diff

325
asm/field_region_map.s Normal file
View File

@ -0,0 +1,325 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_817018C
sub_817018C: @ 817018C
push {r4,r5,lr}
adds r5, r0, 0
movs r0, 0
bl SetVBlankCallback
ldr r4, =gUnknown_0203BCD0
movs r0, 0x89
lsls r0, 4
bl Alloc
str r0, [r4]
ldr r1, =0x0000088c
adds r2, r0, r1
movs r1, 0
strh r1, [r2]
str r5, [r0]
ldr r0, =sub_81701C4
bl SetMainCallback2
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_817018C
thumb_func_start sub_81701C4
sub_81701C4: @ 81701C4
push {lr}
movs r0, 0
movs r1, 0
bl SetGpuReg
movs r0, 0x10
movs r1, 0
bl SetGpuReg
movs r0, 0x12
movs r1, 0
bl SetGpuReg
movs r0, 0x14
movs r1, 0
bl SetGpuReg
movs r0, 0x16
movs r1, 0
bl SetGpuReg
movs r0, 0x18
movs r1, 0
bl SetGpuReg
movs r0, 0x1A
movs r1, 0
bl SetGpuReg
movs r0, 0x1C
movs r1, 0
bl SetGpuReg
movs r0, 0x1E
movs r1, 0
bl SetGpuReg
bl ResetAllObjectData
bl ResetObjectPaletteAllocator
movs r0, 0
bl ResetBgsAndClearDma3BusyFlags
ldr r1, =gUnknown_085E5068
movs r0, 0x1
movs r2, 0x2
bl InitBgsFromTemplates
ldr r0, =gUnknown_085E5070
bl InitWindows
bl DeactivateAllTextPrinters
movs r0, 0
movs r1, 0x27
movs r2, 0xD0
bl sub_809882C
bl clear_scheduled_bg_copies_to_vram
ldr r0, =sub_8170274
bl SetMainCallback2
ldr r0, =sub_8170260
bl SetVBlankCallback
pop {r0}
bx r0
.pool
thumb_func_end sub_81701C4
thumb_func_start sub_8170260
sub_8170260: @ 8170260
push {lr}
bl LoadOamFromSprites
bl ProcessObjectCopyRequests
bl copy_pal_bg_faded_to_pal_ram
pop {r0}
bx r0
thumb_func_end sub_8170260
thumb_func_start sub_8170274
sub_8170274: @ 8170274
push {lr}
bl sub_8170290
bl CallObjectCallbacks
bl PrepareSpritesForOamLoad
bl fade_and_return_progress_probably
bl do_scheduled_bg_tilemap_copies_to_vram
pop {r0}
bx r0
thumb_func_end sub_8170274
thumb_func_start sub_8170290
sub_8170290: @ 8170290
push {r4,r5,lr}
sub sp, 0xC
ldr r1, =gUnknown_0203BCD0
ldr r0, [r1]
ldr r2, =0x0000088c
adds r0, r2
ldrh r0, [r0]
adds r4, r1, 0
cmp r0, 0x6
bls _081702A6
b _08170416
_081702A6:
lsls r0, 2
ldr r1, =_081702BC
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_081702BC:
.4byte _081702D8
.4byte _08170300
.4byte _08170358
.4byte _08170380
.4byte _08170394
.4byte _081703C0
.4byte _081703E8
_081702D8:
ldr r0, [r4]
adds r0, 0x8
movs r1, 0
bl sub_8122CDC
movs r0, 0
movs r1, 0
bl sub_8124288
movs r0, 0x1
movs r1, 0x1
bl sub_81240D4
ldr r1, [r4]
ldr r0, =0x0000088c
adds r1, r0
b _081703D8
.pool
_08170300:
movs r0, 0x1
movs r1, 0
movs r2, 0x27
movs r3, 0xD
bl SetWindowBorderStyle
ldr r5, =gUnknown_085EE8F1
movs r0, 0x1
adds r1, r5, 0
movs r2, 0x38
bl GetStringCenterAlignXOffset
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
movs r0, 0x1
str r0, [sp]
movs r4, 0
str r4, [sp, 0x4]
str r4, [sp, 0x8]
movs r1, 0x1
adds r2, r5, 0
bl Print
movs r0, 0
bl schedule_bg_copy_tilemap_to_vram
movs r0, 0
movs r1, 0
movs r2, 0x27
movs r3, 0xD
bl SetWindowBorderStyle
bl sub_8170428
movs r0, 0x1
negs r0, r0
str r4, [sp]
movs r1, 0
movs r2, 0x10
movs r3, 0
b _081703CC
.pool
_08170358:
movs r1, 0x82
lsls r1, 5
movs r0, 0
bl SetGpuRegBits
movs r0, 0
bl ShowBg
movs r0, 0x2
bl ShowBg
ldr r0, =gUnknown_0203BCD0
ldr r1, [r0]
ldr r0, =0x0000088c
adds r1, r0
b _081703D8
.pool
_08170380:
ldr r0, =gUnknown_02037FD4
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _08170416
ldr r1, [r4]
b _081703D4
.pool
_08170394:
bl sub_81230AC
lsls r0, 24
lsrs r0, 24
cmp r0, 0x3
bne _081703A6
bl sub_8170428
b _08170416
_081703A6:
cmp r0, 0x3
blt _08170416
cmp r0, 0x5
bgt _08170416
ldr r0, =gUnknown_0203BCD0
ldr r1, [r0]
ldr r0, =0x0000088c
adds r1, r0
b _081703D8
.pool
_081703C0:
movs r0, 0x1
negs r0, r0
movs r1, 0
str r1, [sp]
movs r2, 0
movs r3, 0x10
_081703CC:
bl pal_fade_maybe
ldr r0, =gUnknown_0203BCD0
ldr r1, [r0]
_081703D4:
ldr r2, =0x0000088c
adds r1, r2
_081703D8:
ldrh r0, [r1]
adds r0, 0x1
strh r0, [r1]
b _08170416
.pool
_081703E8:
ldr r0, =gUnknown_02037FD4
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0
bne _08170416
bl sub_812305C
ldr r4, =gUnknown_0203BCD0
ldr r0, [r4]
ldr r0, [r0]
bl SetMainCallback2
ldr r0, [r4]
cmp r0, 0
beq _08170412
bl Free
str r5, [r4]
_08170412:
bl FreeAllWindowBuffers
_08170416:
add sp, 0xC
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8170290
thumb_func_start sub_8170428
sub_8170428: @ 8170428
push {r4,lr}
sub sp, 0xC
ldr r4, =gUnknown_0203BCD0
ldr r0, [r4]
ldrb r0, [r0, 0xA]
cmp r0, 0
beq _08170460
movs r0, 0
movs r1, 0x11
bl FillWindowPixelBuffer
ldr r2, [r4]
adds r2, 0xC
movs r0, 0x1
str r0, [sp]
movs r0, 0
str r0, [sp, 0x4]
str r0, [sp, 0x8]
movs r1, 0x1
movs r3, 0
bl Print
movs r0, 0
bl schedule_bg_copy_tilemap_to_vram
b _08170470
.pool
_08170460:
movs r0, 0
movs r1, 0x11
bl FillWindowPixelBuffer
movs r0, 0
movs r1, 0x3
bl CopyWindowToVram
_08170470:
add sp, 0xC
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_8170428
.align 2, 0 @ Don't pad with nop.

View File

@ -5,154 +5,6 @@
.text .text
thumb_func_start sub_809D7BC
sub_809D7BC: @ 809D7BC
push {lr}
movs r0, 0x1
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7BC
thumb_func_start sub_809D7C8
sub_809D7C8: @ 809D7C8
push {lr}
movs r0, 0x2
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7C8
thumb_func_start sub_809D7D4
sub_809D7D4: @ 809D7D4
push {lr}
movs r0, 0x3
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7D4
thumb_func_start sub_809D7E0
sub_809D7E0: @ 809D7E0
push {lr}
movs r0, 0x4
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7E0
thumb_func_start sub_809D7EC
sub_809D7EC: @ 809D7EC
push {lr}
movs r0, 0x5
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7EC
thumb_func_start sub_809D7F8
sub_809D7F8: @ 809D7F8
push {lr}
movs r0, 0x6
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D7F8
thumb_func_start sub_809D804
sub_809D804: @ 809D804
push {lr}
movs r0, 0x9
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D804
thumb_func_start sub_809D810
sub_809D810: @ 809D810
push {lr}
movs r0, 0x7
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D810
thumb_func_start sub_809D81C
sub_809D81C: @ 809D81C
push {lr}
movs r0, 0x8
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D81C
thumb_func_start sub_809D828
sub_809D828: @ 809D828
push {lr}
movs r0, 0xB
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D828
thumb_func_start sub_809D834
sub_809D834: @ 809D834
push {lr}
movs r0, 0xC
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D834
thumb_func_start sub_809D840
sub_809D840: @ 809D840
push {lr}
movs r0, 0x14
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D840
thumb_func_start sub_809D84C
sub_809D84C: @ 809D84C
push {lr}
movs r0, 0x15
bl sub_80AEDF0
pop {r0}
bx r0
thumb_func_end sub_809D84C
thumb_func_start trigger_activate_weather
trigger_activate_weather: @ 809D858
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
movs r2, 0
ldr r3, =gUnknown_085102E0
_0809D862:
lsls r1, r2, 3
adds r0, r1, r3
ldrb r0, [r0]
cmp r0, r4
bne _0809D87C
adds r0, r3, 0x4
adds r0, r1, r0
ldr r0, [r0]
bl _call_via_r0
b _0809D886
.pool
_0809D87C:
adds r0, r2, 0x1
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0xC
bls _0809D862
_0809D886:
pop {r4}
pop {r0}
bx r0
thumb_func_end trigger_activate_weather
thumb_func_start task_per_step_callback_manager thumb_func_start task_per_step_callback_manager
task_per_step_callback_manager: @ 809D88C task_per_step_callback_manager: @ 809D88C
push {lr} push {lr}
@ -2066,171 +1918,4 @@ _0809E762:
bx r0 bx r0
thumb_func_end sub_809E638 thumb_func_end sub_809E638
thumb_func_start sub_809E778
sub_809E778: @ 809E778
push {lr}
ldr r0, =0x00000895
bl FlagSet
bl GameFreakRTC_CalcLocalDateTime
ldr r0, =gSaveBlock2Ptr
ldr r2, [r0]
adds r2, 0xA0
ldr r3, =gUnknown_03005CF8
ldr r0, [r3]
ldr r1, [r3, 0x4]
str r0, [r2]
str r1, [r2, 0x4]
ldr r0, =0x00004040
ldrh r1, [r3]
bl VarSet
pop {r0}
bx r0
.pool
thumb_func_end sub_809E778
thumb_func_start sub_809E7B0
sub_809E7B0: @ 809E7B0
push {r4,lr}
ldr r0, =0x00000895
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _0809E7DA
bl sub_813B9C0
lsls r0, 24
cmp r0, 0
bne _0809E7DA
bl GameFreakRTC_CalcLocalDateTime
ldr r4, =gUnknown_03005CF8
adds r0, r4, 0
bl sub_809E7E8
adds r0, r4, 0
bl sub_809E858
_0809E7DA:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_809E7B0
thumb_func_start sub_809E7E8
sub_809E7E8: @ 809E7E8
push {r4-r6,lr}
adds r5, r0, 0
ldr r0, =0x00004040
bl GetVarPointer
adds r6, r0, 0
ldrh r0, [r6]
movs r2, 0
ldrsh r1, [r5, r2]
cmp r0, r1
beq _0809E84E
cmp r0, r1
bgt _0809E84E
ldrh r4, [r5]
subs r4, r0
lsls r4, 16
lsrs r4, 16
bl sub_809D3A0
adds r0, r4, 0
bl sub_8122580
adds r0, r4, 0
bl sub_80ED888
adds r0, r4, 0
bl sub_80AEFBC
adds r0, r4, 0
bl sub_806DE44
adds r0, r4, 0
bl sub_8137904
adds r0, r4, 0
bl sub_8137A20
adds r0, r4, 0
bl sub_8139EF4
adds r0, r4, 0
bl sub_813A7F4
adds r0, r4, 0
bl sub_813945C
adds r0, r4, 0
bl sub_8177584
ldrh r0, [r5]
strh r0, [r6]
_0809E84E:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_809E7E8
thumb_func_start sub_809E858
sub_809E858: @ 809E858
push {r4-r6,lr}
sub sp, 0x8
adds r5, r0, 0
mov r4, sp
ldr r6, =gSaveBlock2Ptr
ldr r1, [r6]
adds r1, 0xA0
mov r0, sp
adds r2, r5, 0
bl GameFreakRTC_GetDelta
mov r0, sp
movs r2, 0
ldrsh r1, [r0, r2]
lsls r0, r1, 1
adds r0, r1
lsls r1, r0, 4
subs r1, r0
lsls r1, 5
movs r2, 0x2
ldrsb r2, [r4, r2]
lsls r0, r2, 4
subs r0, r2
lsls r0, 2
adds r1, r0
movs r0, 0x3
ldrsb r0, [r4, r0]
adds r0, r1, r0
cmp r0, 0
beq _0809E8A8
cmp r0, 0
blt _0809E8A8
bl BerryTreeTimeUpdate
ldr r2, [r6]
adds r2, 0xA0
ldr r0, [r5]
ldr r1, [r5, 0x4]
str r0, [r2]
str r1, [r2, 0x4]
_0809E8A8:
add sp, 0x8
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_809E858
thumb_func_start sub_809E8B4
sub_809E8B4: @ 809E8B4
push {lr}
bl sub_809E778
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
bl SetMainCallback2
pop {r0}
bx r0
.pool
thumb_func_end sub_809E8B4
thumb_func_start Special_StartWallClock
Special_StartWallClock: @ 809E8C8
push {lr}
ldr r0, =Cb2_StartWallClock
bl SetMainCallback2
ldr r1, =gUnknown_030022C0
ldr r0, =sub_809E8B4
str r0, [r1, 0x8]
pop {r0}
bx r0
.pool
thumb_func_end Special_StartWallClock
.align 2, 0 @ Don't pad with nop. .align 2, 0 @ Don't pad with nop.

View File

@ -1,126 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start GetFlagPointer
@ u8 *GetFlagPointer(u16 flagId)
GetFlagPointer: @ 809D6EC
push {lr}
lsls r1, r0, 16
lsrs r2, r1, 16
adds r3, r2, 0
cmp r2, 0
bne _0809D6FC
movs r0, 0
b _0809D72E
_0809D6FC:
ldr r0, =0x00003fff
cmp r2, r0
bhi _0809D71C
ldr r0, =gSaveBlock1Ptr
lsrs r1, 19
ldr r2, =0x00001270
adds r1, r2
ldr r0, [r0]
b _0809D72C
.pool
_0809D71C:
ldr r1, =0xffffc000
adds r0, r3, r1
cmp r0, 0
bge _0809D728
ldr r2, =0xffffc007
adds r0, r3, r2
_0809D728:
asrs r0, 3
ldr r1, =gUnknown_020375FC
_0809D72C:
adds r0, r1
_0809D72E:
pop {r1}
bx r1
.pool
thumb_func_end GetFlagPointer
thumb_func_start FlagSet
@ bool8 FlagSet(u16 flagId)
FlagSet: @ 809D740
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
adds r0, r4, 0
bl GetFlagPointer
adds r2, r0, 0
cmp r2, 0
beq _0809D760
movs r0, 0x7
ands r0, r4
movs r1, 0x1
lsls r1, r0
ldrb r0, [r2]
orrs r1, r0
strb r1, [r2]
_0809D760:
movs r0, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end FlagSet
thumb_func_start FlagReset
@ bool8 FlagReset(u16 flagId)
FlagReset: @ 809D768
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
adds r0, r4, 0
bl GetFlagPointer
adds r2, r0, 0
cmp r2, 0
beq _0809D788
movs r0, 0x7
ands r0, r4
movs r1, 0x1
lsls r1, r0
ldrb r0, [r2]
bics r0, r1
strb r0, [r2]
_0809D788:
movs r0, 0
pop {r4}
pop {r1}
bx r1
thumb_func_end FlagReset
thumb_func_start FlagGet
@ bool8 FlagGet(u16 flagId)
FlagGet: @ 809D790
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
adds r0, r4, 0
bl GetFlagPointer
cmp r0, 0
beq _0809D7B4
ldrb r0, [r0]
movs r1, 0x7
ands r1, r4
asrs r0, r1
movs r1, 0x1
ands r0, r1
cmp r0, 0
beq _0809D7B4
movs r0, 0x1
b _0809D7B6
_0809D7B4:
movs r0, 0
_0809D7B6:
pop {r4}
pop {r1}
bx r1
thumb_func_end FlagGet
.align 2, 0 @ Don't pad with nop.

84
asm/fldeff_teleport.s Normal file
View File

@ -0,0 +1,84 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_817C8BC
sub_817C8BC: @ 817C8BC
push {lr}
ldr r0, =gUnknown_02037318
ldrb r0, [r0, 0x17]
bl is_light_level_1_2_3_or_6
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
beq _0817C8D8
movs r0, 0
b _0817C8E6
.pool
_0817C8D8:
ldr r1, =gUnknown_03005DB0
ldr r0, =hm_add_c3_launch_phase_2
str r0, [r1]
ldr r1, =gUnknown_0203CEEC
ldr r0, =hm_teleport_run_dp02scr
str r0, [r1]
movs r0, 0x1
_0817C8E6:
pop {r1}
bx r1
.pool
thumb_func_end sub_817C8BC
thumb_func_start hm_teleport_run_dp02scr
hm_teleport_run_dp02scr: @ 817C8FC
push {lr}
bl sub_808469C
movs r0, 0x3F
bl FieldEffectStart
bl brm_get_pokemon_selection
ldr r1, =gUnknown_02038C08
lsls r0, 24
lsrs r0, 24
str r0, [r1]
pop {r0}
bx r0
.pool
thumb_func_end hm_teleport_run_dp02scr
thumb_func_start sub_817C91C
sub_817C91C: @ 817C91C
push {lr}
bl oei_task_add
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
ldr r2, =sub_817C94C
lsrs r0, r2, 16
strh r0, [r1, 0x18]
strh r2, [r1, 0x1A]
movs r0, 0x1
bl SetPlayerAvatarTransitionFlags
movs r0, 0
pop {r1}
bx r1
.pool
thumb_func_end sub_817C91C
thumb_func_start sub_817C94C
sub_817C94C: @ 817C94C
push {lr}
movs r0, 0x3F
bl FieldEffectActiveListRemove
bl sub_80B7FC8
pop {r0}
bx r0
thumb_func_end sub_817C94C
.align 2, 0 @ Don't pad with nop.

3603
asm/hall_of_fame.s Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1077
asm/intro_credits_graphics.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,625 +5,6 @@
.text .text
thumb_func_start sub_81795E8
sub_81795E8: @ 81795E8
push {lr}
ldr r0, =0x000008af
bl FlagGet
lsls r0, 24
cmp r0, 0
bne _08179634
ldr r0, =gSaveBlock1Ptr
ldr r2, [r0]
ldrh r1, [r2, 0x4]
ldr r0, =0x00004718
cmp r1, r0
bne _08179634
ldr r1, [r2]
ldr r0, =0x0003000a
cmp r1, r0
beq _08179616
ldr r0, =0x00030009
cmp r1, r0
beq _08179616
ldr r0, =0x0003000b
cmp r1, r0
bne _08179634
_08179616:
movs r0, 0x1
b _08179636
.pool
_08179634:
movs r0, 0
_08179636:
pop {r1}
bx r1
thumb_func_end sub_81795E8
thumb_func_start sub_817963C
sub_817963C: @ 817963C
push {lr}
ldr r2, =0x0000022a
movs r0, 0x10
movs r1, 0x8
bl MapGridSetMetatileIdAt
ldr r2, =0x0000022b
movs r0, 0x11
movs r1, 0x8
bl MapGridSetMetatileIdAt
movs r2, 0x8B
lsls r2, 2
movs r0, 0x12
movs r1, 0x8
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e32
movs r0, 0x10
movs r1, 0x9
bl MapGridSetMetatileIdAt
ldr r2, =0x00000233
movs r0, 0x11
movs r1, 0x9
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e34
movs r0, 0x12
movs r1, 0x9
bl MapGridSetMetatileIdAt
bl DrawWholeMapView
movs r0, 0x14
bl audio_play
ldr r0, =0x000008af
bl FlagSet
bl script_env_2_disable
pop {r0}
bx r0
.pool
thumb_func_end sub_817963C
thumb_func_start sub_81796AC
sub_81796AC: @ 81796AC
push {r4,lr}
ldr r4, =gUnknown_020244EC
adds r0, r4, 0
movs r1, 0x41
movs r2, 0
bl pokemon_getattr
movs r1, 0x9D
lsls r1, 1
cmp r0, r1
bne _081796F4
bl calc_player_party_count
ldr r0, =gUnknown_020244E9
ldrb r1, [r0]
movs r0, 0x64
muls r0, r1
adds r1, r4, 0
subs r1, 0x64
adds r0, r1
movs r1, 0x41
movs r2, 0
bl pokemon_getattr
ldr r1, =0x0000017d
cmp r0, r1
bne _081796F4
movs r0, 0x1
b _081796F6
.pool
_081796F4:
movs r0, 0
_081796F6:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81796AC
thumb_func_start nullsub_84
nullsub_84: @ 81796FC
bx lr
thumb_func_end nullsub_84
thumb_func_start sub_8179700
sub_8179700: @ 8179700
push {lr}
ldr r0, =sub_8179778
movs r1, 0x9
bl CreateTask
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
movs r0, 0
strh r0, [r1, 0xA]
strh r0, [r1, 0xC]
movs r0, 0x2
strh r0, [r1, 0x10]
movs r0, 0x5
strh r0, [r1, 0x12]
movs r0, 0x32
strh r0, [r1, 0x14]
movs r0, 0
bl SetCameraPanningCallback
pop {r0}
bx r0
.pool
thumb_func_end sub_8179700
thumb_func_start sub_817973C
sub_817973C: @ 817973C
push {lr}
ldr r0, =sub_8179778
movs r1, 0x9
bl CreateTask
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
movs r0, 0
strh r0, [r1, 0xA]
strh r0, [r1, 0xC]
movs r0, 0x3
strh r0, [r1, 0x10]
movs r0, 0x5
strh r0, [r1, 0x12]
movs r0, 0x2
strh r0, [r1, 0x14]
movs r0, 0
bl SetCameraPanningCallback
pop {r0}
bx r0
.pool
thumb_func_end sub_817973C
thumb_func_start sub_8179778
sub_8179778: @ 8179778
push {r4,r5,lr}
lsls r0, 24
lsrs r5, r0, 24
lsls r0, r5, 2
adds r0, r5
lsls r0, 3
ldr r1, =gTasks
adds r4, r0, r1
ldrh r0, [r4, 0xA]
adds r0, 0x1
strh r0, [r4, 0xA]
movs r1, 0xA
ldrsh r0, [r4, r1]
movs r2, 0x12
ldrsh r1, [r4, r2]
bl __modsi3
cmp r0, 0
bne _081797D0
strh r0, [r4, 0xA]
ldrh r0, [r4, 0xC]
adds r0, 0x1
strh r0, [r4, 0xC]
ldrh r0, [r4, 0x10]
negs r0, r0
strh r0, [r4, 0x10]
movs r0, 0x10
ldrsh r1, [r4, r0]
movs r0, 0
bl SetCameraPanning
movs r2, 0xC
ldrsh r1, [r4, r2]
movs r2, 0x14
ldrsh r0, [r4, r2]
cmp r1, r0
bne _081797D0
adds r0, r5, 0
bl DestroyTask
bl script_env_2_enable_and_set_ctx_running
bl InstallCameraPanAheadCallback
_081797D0:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_8179778
thumb_func_start sub_81797DC
sub_81797DC: @ 81797DC
push {lr}
movs r0, 0x8B
lsls r0, 4
bl FlagGet
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0
bne _0817982C
ldr r0, =gSaveBlock1Ptr
ldr r3, [r0]
ldrh r1, [r3, 0x4]
movs r0, 0xC3
lsls r0, 3
cmp r1, r0
bne _0817982C
ldr r1, [r3]
ldr r0, =0x00170006
cmp r1, r0
beq _08179810
ldr r0, =0x00170005
cmp r1, r0
beq _08179810
ldr r0, =0x00170007
cmp r1, r0
bne _0817982C
_08179810:
ldr r0, =gUnknown_0203BD14
strb r2, [r0]
movs r0, 0x1
b _0817982E
.pool
_0817982C:
movs r0, 0
_0817982E:
pop {r1}
bx r1
thumb_func_end sub_81797DC
thumb_func_start sub_8179834
sub_8179834: @ 8179834
push {lr}
bl brm_get_pokemon_selection
ldr r1, =gUnknown_02038C08
lsls r0, 24
lsrs r0, 24
str r0, [r1]
movs r0, 0x3C
bl FieldEffectStart
pop {r0}
bx r0
.pool
thumb_func_end sub_8179834
thumb_func_start sub_8179850
sub_8179850: @ 8179850
push {lr}
movs r0, 0x3C
bl FieldEffectActiveListRemove
bl sub_8179860
pop {r0}
bx r0
thumb_func_end sub_8179850
thumb_func_start sub_8179860
sub_8179860: @ 8179860
push {lr}
ldr r2, =0x0000022a
movs r0, 0xE
movs r1, 0x1A
bl MapGridSetMetatileIdAt
ldr r2, =0x0000022b
movs r0, 0xF
movs r1, 0x1A
bl MapGridSetMetatileIdAt
movs r2, 0x8B
lsls r2, 2
movs r0, 0x10
movs r1, 0x1A
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e32
movs r0, 0xE
movs r1, 0x1B
bl MapGridSetMetatileIdAt
ldr r2, =0x00000233
movs r0, 0xF
movs r1, 0x1B
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e34
movs r0, 0x10
movs r1, 0x1B
bl MapGridSetMetatileIdAt
bl DrawWholeMapView
movs r0, 0x14
bl audio_play
movs r0, 0x8B
lsls r0, 4
bl FlagSet
bl script_env_2_disable
pop {r0}
bx r0
.pool
thumb_func_end sub_8179860
thumb_func_start sub_81798D0
sub_81798D0: @ 81798D0
push {lr}
ldr r0, =0x000008b2
bl FlagGet
lsls r0, 24
cmp r0, 0
bne _08179910
ldr r0, =gSaveBlock1Ptr
ldr r2, [r0]
ldrh r1, [r2, 0x4]
ldr r0, =0x00004418
cmp r1, r0
bne _08179910
ldr r1, [r2]
ldr r0, =0x00190008
cmp r1, r0
bne _08179910
ldr r1, =gUnknown_0203BD14
movs r0, 0x1
strb r0, [r1]
movs r0, 0x1
b _08179912
.pool
_08179910:
movs r0, 0
_08179912:
pop {r1}
bx r1
thumb_func_end sub_81798D0
thumb_func_start sub_8179918
sub_8179918: @ 8179918
push {lr}
bl brm_get_pokemon_selection
ldr r1, =gUnknown_02038C08
lsls r0, 24
lsrs r0, 24
str r0, [r1]
movs r0, 0x3C
bl FieldEffectStart
pop {r0}
bx r0
.pool
thumb_func_end sub_8179918
thumb_func_start sub_8179934
sub_8179934: @ 8179934
push {lr}
movs r0, 0x3C
bl FieldEffectActiveListRemove
bl sub_8179944
pop {r0}
bx r0
thumb_func_end sub_8179934
thumb_func_start sub_8179944
sub_8179944: @ 8179944
push {lr}
ldr r2, =0x0000022a
movs r0, 0xE
movs r1, 0x1A
bl MapGridSetMetatileIdAt
ldr r2, =0x0000022b
movs r0, 0xF
movs r1, 0x1A
bl MapGridSetMetatileIdAt
movs r2, 0x8B
lsls r2, 2
movs r0, 0x10
movs r1, 0x1A
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e32
movs r0, 0xE
movs r1, 0x1B
bl MapGridSetMetatileIdAt
ldr r2, =0x00000233
movs r0, 0xF
movs r1, 0x1B
bl MapGridSetMetatileIdAt
ldr r2, =0x00000e34
movs r0, 0x10
movs r1, 0x1B
bl MapGridSetMetatileIdAt
bl DrawWholeMapView
movs r0, 0x14
bl audio_play
ldr r0, =0x000008b2
bl FlagSet
bl script_env_2_disable
pop {r0}
bx r0
.pool
thumb_func_end sub_8179944
thumb_func_start nullsub_64
nullsub_64: @ 81799B4
bx lr
thumb_func_end nullsub_64
thumb_func_start sub_81799B8
sub_81799B8: @ 81799B8
push {lr}
bl oei_task_add
lsls r0, 24
lsrs r2, r0, 24
ldr r0, =gUnknown_0203BD14
ldrb r0, [r0]
cmp r0, 0x1
bne _081799E4
ldr r1, =gTasks
lsls r0, r2, 2
adds r0, r2
lsls r0, 3
adds r0, r1
ldr r2, =sub_8179934
b _081799F0
.pool
_081799E4:
ldr r1, =gTasks
lsls r0, r2, 2
adds r0, r2
lsls r0, 3
adds r0, r1
ldr r2, =sub_8179850
_081799F0:
lsrs r1, r2, 16
strh r1, [r0, 0x18]
strh r2, [r0, 0x1A]
movs r0, 0
pop {r1}
bx r1
.pool
thumb_func_end sub_81799B8
thumb_func_start sub_8179A04
sub_8179A04: @ 8179A04
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
ldr r4, =gSaveBlock1Ptr
ldr r0, [r4]
ldrh r1, [r0, 0x4]
ldr r0, =0x00004318
cmp r1, r0
beq _08179A1A
b _08179B5A
_08179A1A:
ldr r0, =0x000008b1
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _08179A28
b _08179B5A
_08179A28:
movs r0, 0x2
bl FlagGet
lsls r0, 24
cmp r0, 0
bne _08179A36
b _08179B5A
_08179A36:
movs r0, 0x3
bl FlagGet
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _08179A58
b _08179B5A
.pool
_08179A54:
movs r0, 0x1
b _08179B5C
_08179A58:
movs r5, 0
mov r8, r4
ldr r4, =gUnknown_085EFE74
adds r0, r4, 0x1
mov r12, r0
ldr r6, =0x0000403b
ldr r1, =0x0000403c
mov r9, r1
_08179A68:
lsls r0, r5, 1
adds r1, r0, r4
add r0, r12
ldrb r3, [r0]
mov r7, r8
ldr r2, [r7]
movs r7, 0
ldrsh r0, [r2, r7]
ldrb r1, [r1]
cmp r0, r1
bne _08179B44
movs r1, 0x2
ldrsh r0, [r2, r1]
cmp r0, r3
bne _08179B44
cmp r5, 0xF
bhi _08179AB0
adds r0, r6, 0
bl VarGet
lsls r0, 16
movs r1, 0x80
lsls r1, 9
lsls r1, r5
orrs r1, r0
lsrs r1, 16
adds r0, r6, 0
bl VarSet
b _08179AF0
.pool
_08179AB0:
cmp r5, 0x1F
bhi _08179AD2
mov r0, r9
bl VarGet
lsls r0, 16
adds r2, r5, 0
subs r2, 0x10
movs r1, 0x80
lsls r1, 9
lsls r1, r2
orrs r1, r0
lsrs r1, 16
mov r0, r9
bl VarSet
b _08179AF0
_08179AD2:
ldr r4, =0x0000403d
adds r0, r4, 0
bl VarGet
lsls r0, 16
adds r2, r5, 0
subs r2, 0x20
movs r1, 0x80
lsls r1, 9
lsls r1, r2
orrs r1, r0
lsrs r1, 16
adds r0, r4, 0
bl VarSet
_08179AF0:
ldr r0, =0x0000403b
bl VarGet
lsls r0, 16
lsrs r4, r0, 16
ldr r0, =0x0000ffff
cmp r4, r0
bne _08179B5A
ldr r0, =0x0000403c
bl VarGet
lsls r0, 16
lsrs r0, 16
cmp r0, r4
bne _08179B5A
ldr r0, =0x0000403d
bl VarGet
lsls r0, 16
lsrs r0, 16
cmp r0, 0xF
bne _08179B5A
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldr r1, [r0]
ldr r0, =0x00150008
cmp r1, r0
beq _08179A54
b _08179B5A
.pool
_08179B44:
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x23
bls _08179A68
movs r0, 0x3
bl FlagSet
movs r0, 0x2
bl FlagReset
_08179B5A:
movs r0, 0
_08179B5C:
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8179A04
thumb_func_start sub_8179B68 thumb_func_start sub_8179B68
sub_8179B68: @ 8179B68 sub_8179B68: @ 8179B68
push {lr} push {lr}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

64
asm/rom_81700F8.s Normal file
View File

@ -0,0 +1,64 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_81700F8
sub_81700F8: @ 81700F8
push {r4,r5,lr}
ldr r5, =0x04000208
ldrh r4, [r5]
movs r0, 0
strh r0, [r5]
movs r0, 0x1
bl RegisterRamReset
movs r0, 0
movs r1, 0x80
bl ClearGpuRegBits
strh r4, [r5]
ldr r1, =gUnknown_030022C0
ldr r0, =0x00000439
adds r1, r0
ldrb r2, [r1]
movs r0, 0x3
negs r0, r0
ands r0, r2
strb r0, [r1]
bl sub_815355C
lsls r0, 16
lsrs r0, 16
bl InitSaveBlockPointersWithRandomOffset
bl sub_808447C
bl sub_8152680
movs r0, 0
bl sub_81534D0
ldr r0, =gUnknown_03006210
ldrh r0, [r0]
cmp r0, 0
beq _08170148
cmp r0, 0x2
bne _0817014C
_08170148:
bl init_sav2
_0817014C:
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r0, [r0, 0x15]
lsls r0, 31
lsrs r0, 31
bl SetPokemonCryStereo
ldr r0, =0x02000000
movs r1, 0xE0
lsls r1, 9
bl InitHeap
ldr r0, =sub_8086230
bl SetMainCallback2
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81700F8
.align 2, 0 @ Don't pad with nop.

File diff suppressed because it is too large Load Diff

593
asm/unknown_task.s Normal file
View File

@ -0,0 +1,593 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start remove_some_task
remove_some_task: @ 80B9FB8
push {r4,lr}
ldr r4, =gUnknown_02039B28
movs r0, 0
strb r0, [r4, 0x15]
ldr r1, =0x040000b0
ldrh r2, [r1, 0xA]
ldr r0, =0x0000c5ff
ands r0, r2
strh r0, [r1, 0xA]
ldrh r2, [r1, 0xA]
ldr r0, =0x00007fff
ands r0, r2
strh r0, [r1, 0xA]
ldrh r0, [r1, 0xA]
ldrb r0, [r4, 0x18]
cmp r0, 0xFF
beq _080B9FE2
bl DestroyTask
movs r0, 0xFF
strb r0, [r4, 0x18]
_080B9FE2:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end remove_some_task
thumb_func_start dp12_8087EA4
dp12_8087EA4: @ 80B9FF8
push {r4,lr}
sub sp, 0x4
mov r0, sp
movs r4, 0
strh r4, [r0]
ldr r1, =gUnknown_02038C28
ldr r2, =0x01000780
bl CpuSet
ldr r0, =gUnknown_02039B28
movs r1, 0
str r1, [r0]
str r1, [r0, 0x4]
str r1, [r0, 0x8]
str r1, [r0, 0xC]
strb r4, [r0, 0x14]
strb r4, [r0, 0x15]
strb r4, [r0, 0x16]
strb r4, [r0, 0x17]
movs r1, 0xFF
strb r1, [r0, 0x18]
add sp, 0x4
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end dp12_8087EA4
thumb_func_start sub_80BA038
sub_80BA038: @ 80BA038
push {lr}
sub sp, 0xC
str r0, [sp]
str r1, [sp, 0x4]
str r2, [sp, 0x8]
ldr r0, =0xa2600001
cmp r1, r0
bne _080BA06C
ldr r0, =gUnknown_02039B28
ldr r1, =gUnknown_02038C2A
str r1, [r0]
movs r2, 0xF0
lsls r2, 3
adds r1, r2
str r1, [r0, 0x4]
ldr r1, =sub_80BA134
b _080BA07C
.pool
_080BA06C:
ldr r0, =gUnknown_02039B28
ldr r1, =gUnknown_02038C2C
str r1, [r0]
movs r2, 0xF0
lsls r2, 3
adds r1, r2
str r1, [r0, 0x4]
ldr r1, =sub_80BA154
_080BA07C:
str r1, [r0, 0x10]
adds r1, r0, 0
ldr r0, [sp, 0x4]
str r0, [r1, 0xC]
ldr r0, [sp]
str r0, [r1, 0x8]
mov r0, sp
ldrb r0, [r0, 0x8]
strb r0, [r1, 0x15]
mov r0, sp
ldrb r0, [r0, 0x9]
strb r0, [r1, 0x16]
strb r0, [r1, 0x17]
add sp, 0xC
pop {r0}
bx r0
.pool
thumb_func_end sub_80BA038
thumb_func_start sub_80BA0A8
sub_80BA0A8: @ 80BA0A8
push {r4,lr}
ldr r4, =gUnknown_02039B28
ldrb r0, [r4, 0x15]
cmp r0, 0
beq _080BA122
cmp r0, 0x3
bne _080BA0EC
movs r0, 0
strb r0, [r4, 0x15]
ldr r1, =0x040000b0
ldrh r2, [r1, 0xA]
ldr r0, =0x0000c5ff
ands r0, r2
strh r0, [r1, 0xA]
ldrh r2, [r1, 0xA]
ldr r0, =0x00007fff
ands r0, r2
strh r0, [r1, 0xA]
ldrh r0, [r1, 0xA]
ldr r1, =gUnknown_02039B44
movs r0, 0x1
strb r0, [r1]
b _080BA122
.pool
_080BA0EC:
ldr r1, =0x040000b0
ldrh r2, [r1, 0xA]
ldr r0, =0x0000c5ff
ands r0, r2
strh r0, [r1, 0xA]
ldrh r2, [r1, 0xA]
ldr r0, =0x00007fff
ands r0, r2
strh r0, [r1, 0xA]
ldrh r0, [r1, 0xA]
ldrb r0, [r4, 0x14]
lsls r0, 2
adds r0, r4
ldr r0, [r0]
str r0, [r1]
ldr r0, [r4, 0x8]
str r0, [r1, 0x4]
ldr r0, [r4, 0xC]
str r0, [r1, 0x8]
ldr r0, [r1, 0x8]
ldr r0, [r4, 0x10]
bl _call_via_r0
ldrb r0, [r4, 0x14]
movs r1, 0x1
eors r0, r1
strb r0, [r4, 0x14]
_080BA122:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_80BA0A8
thumb_func_start sub_80BA134
sub_80BA134: @ 80BA134
ldr r0, =gUnknown_02039B28
ldr r2, [r0, 0x8]
ldrb r1, [r0, 0x14]
lsls r0, r1, 4
subs r0, r1
lsls r0, 7
ldr r1, =gUnknown_02038C28
adds r0, r1
ldrh r0, [r0]
strh r0, [r2]
bx lr
.pool
thumb_func_end sub_80BA134
thumb_func_start sub_80BA154
sub_80BA154: @ 80BA154
ldr r0, =gUnknown_02039B28
ldr r2, [r0, 0x8]
ldrb r1, [r0, 0x14]
lsls r0, r1, 4
subs r0, r1
lsls r0, 7
ldr r1, =gUnknown_02038C28
adds r0, r1
ldr r0, [r0]
str r0, [r2]
bx lr
.pool
thumb_func_end sub_80BA154
thumb_func_start task00_for_dp12
task00_for_dp12: @ 80BA174
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
lsls r0, 24
lsrs r0, 24
mov r12, r0
movs r6, 0
ldr r0, =gUnknown_02039B44
ldrb r0, [r0]
cmp r0, 0
beq _080BA1A4
mov r0, r12
bl DestroyTask
ldr r1, =gUnknown_02039B28
movs r0, 0xFF
strb r0, [r1, 0x18]
b _080BA324
.pool
_080BA1A4:
ldr r1, =gTasks
mov r0, r12
lsls r2, r0, 2
adds r0, r2, r0
lsls r0, 3
adds r3, r0, r1
movs r4, 0x16
ldrsh r0, [r3, r4]
mov r10, r1
mov r9, r2
cmp r0, 0
beq _080BA250
movs r1, 0x14
ldrsh r0, [r3, r1]
cmp r0, 0xE
bhi _080BA250
lsls r0, 2
ldr r1, =_080BA1D8
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_080BA1D8:
.4byte _080BA214
.4byte _080BA250
.4byte _080BA21C
.4byte _080BA250
.4byte _080BA224
.4byte _080BA250
.4byte _080BA22C
.4byte _080BA250
.4byte _080BA234
.4byte _080BA250
.4byte _080BA23C
.4byte _080BA250
.4byte _080BA244
.4byte _080BA250
.4byte _080BA24C
_080BA214:
ldr r0, =gUnknown_02022E14
b _080BA24E
.pool
_080BA21C:
ldr r0, =gUnknown_02022E16
b _080BA24E
.pool
_080BA224:
ldr r0, =gUnknown_02022E18
b _080BA24E
.pool
_080BA22C:
ldr r0, =gUnknown_02022E1A
b _080BA24E
.pool
_080BA234:
ldr r0, =gUnknown_02022E1C
b _080BA24E
.pool
_080BA23C:
ldr r0, =gUnknown_02022E1E
b _080BA24E
.pool
_080BA244:
ldr r0, =gUnknown_02022E20
b _080BA24E
.pool
_080BA24C:
ldr r0, =gUnknown_02022E22
_080BA24E:
ldrh r6, [r0]
_080BA250:
mov r0, r9
add r0, r12
lsls r0, 3
mov r2, r10
adds r1, r0, r2
ldrh r2, [r1, 0x10]
movs r3, 0x10
ldrsh r0, [r1, r3]
cmp r0, 0
beq _080BA2BC
subs r0, r2, 0x1
strh r0, [r1, 0x10]
movs r4, 0xE
ldrsh r0, [r1, r4]
movs r3, 0xA0
lsls r3, 1
adds r2, r0, r3
movs r4, 0x8
ldrsh r3, [r1, r4]
movs r4, 0xA
ldrsh r0, [r1, r4]
cmp r3, r0
bge _080BA324
ldr r5, =gUnknown_02038C28
ldr r0, =gUnknown_02039B28
mov r8, r0
adds r7, r1, 0
lsls r0, r2, 1
adds r4, r0, r5
_080BA28A:
lsls r2, r3, 1
mov r0, r8
ldrb r1, [r0, 0x14]
lsls r0, r1, 4
subs r0, r1
lsls r0, 7
adds r2, r0
adds r2, r5
ldrh r0, [r4]
adds r0, r6
strh r0, [r2]
adds r4, 0x2
adds r3, 0x1
movs r1, 0xA
ldrsh r0, [r7, r1]
cmp r3, r0
blt _080BA28A
b _080BA324
.pool
_080BA2BC:
ldrh r0, [r1, 0x12]
strh r0, [r1, 0x10]
movs r2, 0xE
ldrsh r0, [r1, r2]
movs r3, 0xA0
lsls r3, 1
adds r2, r0, r3
movs r4, 0x8
ldrsh r3, [r1, r4]
movs r4, 0xA
ldrsh r0, [r1, r4]
cmp r3, r0
bge _080BA304
ldr r5, =gUnknown_02038C28
adds r7, r1, 0
lsls r0, r2, 1
adds r4, r0, r5
ldr r0, =gUnknown_02039B28
mov r8, r0
_080BA2E2:
lsls r2, r3, 1
mov r0, r8
ldrb r1, [r0, 0x14]
lsls r0, r1, 4
subs r0, r1
lsls r0, 7
adds r2, r0
adds r2, r5
ldrh r0, [r4]
adds r0, r6
strh r0, [r2]
adds r4, 0x2
adds r3, 0x1
movs r1, 0xA
ldrsh r0, [r7, r1]
cmp r3, r0
blt _080BA2E2
_080BA304:
mov r0, r9
add r0, r12
lsls r0, 3
mov r3, r10
adds r2, r0, r3
ldrh r0, [r2, 0xE]
adds r0, 0x1
strh r0, [r2, 0xE]
lsls r0, 16
asrs r0, 16
movs r4, 0xC
ldrsh r1, [r2, r4]
cmp r0, r1
bne _080BA324
movs r0, 0
strh r0, [r2, 0xE]
_080BA324:
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end task00_for_dp12
thumb_func_start sub_80BA33C
sub_80BA33C: @ 80BA33C
push {r4-r7,lr}
adds r6, r0, 0
lsls r1, 24
lsrs r5, r1, 24
lsls r2, 24
lsrs r4, r2, 24
movs r1, 0
movs r2, 0
ldr r0, =gUnknown_08329F40
mov r12, r0
_080BA350:
lsls r0, r1, 1
adds r3, r0, r6
lsls r0, r2, 1
add r0, r12
movs r7, 0
ldrsh r0, [r0, r7]
muls r0, r4
cmp r0, 0
bge _080BA364
adds r0, 0xFF
_080BA364:
asrs r0, 8
strh r0, [r3]
adds r0, r2, r5
lsls r0, 24
lsrs r2, r0, 24
adds r0, r1, 0x1
lsls r0, 16
lsrs r1, r0, 16
cmp r1, 0xFF
bls _080BA350
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_80BA33C
thumb_func_start sub_80BA384
sub_80BA384: @ 80BA384
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x20
adds r5, r0, 0
str r1, [sp, 0x10]
ldr r0, [sp, 0x40]
mov r8, r0
ldr r1, [sp, 0x44]
mov r9, r1
ldr r0, [sp, 0x48]
mov r10, r0
lsls r5, 24
lsrs r5, 24
ldr r1, [sp, 0x10]
lsls r1, 24
str r1, [sp, 0x14]
lsrs r0, r1, 24
str r0, [sp, 0xC]
lsls r1, r2, 24
lsrs r1, 24
str r1, [sp, 0x18]
lsls r2, r3, 24
lsrs r2, 24
str r2, [sp, 0x1C]
mov r1, r8
lsls r1, 24
lsrs r1, 24
mov r8, r1
mov r3, r9
lsls r3, 24
lsrs r3, 24
mov r9, r3
mov r0, r10
lsls r0, 24
lsrs r0, 24
mov r10, r0
bl dp12_8087EA4
ldr r0, =0x04000010
add r0, r9
str r0, [sp]
ldr r0, =0xa2600001
str r0, [sp, 0x4]
mov r1, sp
movs r0, 0x1
strb r0, [r1, 0x8]
mov r0, sp
movs r1, 0
strb r1, [r0, 0x9]
ldr r0, [sp]
ldr r1, [sp, 0x4]
ldr r2, [sp, 0x8]
bl sub_80BA038
ldr r0, =task00_for_dp12
movs r1, 0
bl CreateTask
lsls r0, 24
lsrs r7, r0, 24
ldr r0, =gTasks
lsls r4, r7, 2
adds r4, r7
lsls r4, 3
adds r4, r0
strh r5, [r4, 0x8]
mov r3, sp
ldrh r3, [r3, 0xC]
strh r3, [r4, 0xA]
movs r0, 0x80
lsls r0, 1
ldr r1, [sp, 0x18]
bl __divsi3
strh r0, [r4, 0xC]
movs r0, 0
strh r0, [r4, 0xE]
mov r1, r8
strh r1, [r4, 0x10]
strh r1, [r4, 0x12]
mov r3, r9
strh r3, [r4, 0x14]
mov r0, r10
strh r0, [r4, 0x16]
ldr r0, =gUnknown_02039B28
strb r7, [r0, 0x18]
ldr r0, =gUnknown_02039B44
movs r1, 0
strb r1, [r0]
ldr r4, =gUnknown_02038EA8
ldr r3, [sp, 0xC]
subs r6, r3, r5
lsls r3, r6, 24
lsrs r3, 24
adds r0, r4, 0
ldr r1, [sp, 0x18]
ldr r2, [sp, 0x1C]
bl sub_80BA33C
ldr r0, [sp, 0xC]
cmp r5, r0
bge _080BA47E
ldr r1, =0xfffffd80
adds r2, r4, r1
lsls r1, r5, 1
movs r3, 0xF0
lsls r3, 3
adds r0, r1, r3
adds r3, r0, r2
adds r1, r2
adds r2, r4, 0
adds r5, r6, 0
_080BA46A:
ldrh r0, [r2]
strh r0, [r1]
ldrh r0, [r2]
strh r0, [r3]
adds r2, 0x2
adds r3, 0x2
adds r1, 0x2
subs r5, 0x1
cmp r5, 0
bne _080BA46A
_080BA47E:
adds r0, r7, 0
add sp, 0x20
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
.pool
thumb_func_end sub_80BA384
.align 2, 0 @ Don't pad with nop.

105
asm/var.s
View File

@ -1,105 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start GetVarPointer
@ u16 *GetVarPointer(u16 varId)
GetVarPointer: @ 809D648
push {lr}
lsls r0, 16
lsrs r1, r0, 16
adds r2, r1, 0
ldr r0, =0x00003fff
cmp r1, r0
bhi _0809D660
movs r0, 0
b _0809D688
.pool
_0809D660:
lsls r0, r1, 16
cmp r0, 0
bge _0809D67C
ldr r0, =gUnknown_081DBA0C
ldr r2, =0xffff8000
adds r1, r2
lsls r1, 2
adds r1, r0
ldr r0, [r1]
b _0809D688
.pool
_0809D67C:
ldr r0, =gSaveBlock1Ptr
lsls r1, r2, 1
ldr r2, =0xffff939c
adds r1, r2
ldr r0, [r0]
adds r0, r1
_0809D688:
pop {r1}
bx r1
.pool
thumb_func_end GetVarPointer
thumb_func_start VarGet
@ u16 VarGet(u16 varId)
VarGet: @ 809D694
push {r4,lr}
lsls r0, 16
lsrs r4, r0, 16
adds r0, r4, 0
bl GetVarPointer
cmp r0, 0
beq _0809D6A8
ldrh r0, [r0]
b _0809D6AA
_0809D6A8:
adds r0, r4, 0
_0809D6AA:
pop {r4}
pop {r1}
bx r1
thumb_func_end VarGet
thumb_func_start VarSet
@ bool8 VarSet(u16 varId, u16 value)
VarSet: @ 809D6B0
push {r4,lr}
lsls r0, 16
lsrs r0, 16
lsls r1, 16
lsrs r4, r1, 16
bl GetVarPointer
cmp r0, 0
beq _0809D6C8
strh r4, [r0]
movs r0, 0x1
b _0809D6CA
_0809D6C8:
movs r0, 0
_0809D6CA:
pop {r4}
pop {r1}
bx r1
thumb_func_end VarSet
thumb_func_start VarGetFieldObjectGraphicsId
@ u8 VarGetFieldObjectGraphicsId(u8 index)
VarGetFieldObjectGraphicsId: @ 809D6D0
push {lr}
lsls r0, 24
lsrs r0, 8
ldr r1, =0x40100000
adds r0, r1
lsrs r0, 16
bl VarGet
lsls r0, 24
lsrs r0, 24
pop {r1}
bx r1
.pool
thumb_func_end VarGetFieldObjectGraphicsId
.align 2, 0 @ Don't pad with nop.

View File

@ -58,10 +58,10 @@ SECTIONS {
asm/pokemon_1.o(.text); asm/pokemon_1.o(.text);
asm/calculate_base_damage.o(.text); asm/calculate_base_damage.o(.text);
asm/pokemon_2.o(.text); asm/pokemon_2.o(.text);
asm/rom_806BD04.o(.text); asm/pokemon_3.o(.text);
asm/trig.o(.text); asm/trig.o(.text);
asm/rng.o(.text); asm/rng.o(.text);
asm/rom_806F640.o(.text); asm/util.o(.text);
asm/blend_palette.o(.text); asm/blend_palette.o(.text);
asm/daycare.o(.text); asm/daycare.o(.text);
asm/egg_hatch.o(.text); asm/egg_hatch.o(.text);
@ -85,16 +85,18 @@ SECTIONS {
asm/text_window.o(.text); asm/text_window.o(.text);
asm/script.o(.text); asm/script.o(.text);
asm/scrcmd.o(.text); asm/scrcmd.o(.text);
asm/rom_809BEDC.o(.text); asm/field_control_avatar.o(.text);
asm/var.o(.text); asm/event_data.o(.text);
asm/flag.o(.text); asm/coord_event_weather.o(.text);
asm/rom_809D7BC.o(.text); asm/field_tasks.o(.text);
asm/clock.o(.text);
asm/reset_rtc_screen.o(.text); asm/reset_rtc_screen.o(.text);
asm/start_menu.o(.text); asm/start_menu.o(.text);
asm/tileset.o(.text); asm/tileset.o(.text);
asm/palette.o(.text); asm/palette.o(.text);
asm/sound.o(.text); asm/sound.o(.text);
asm/rom_80A3934.o(.text); asm/battle_anim.o(.text);
asm/rom_80A5C6C.o(.text);
src/task.o(.text); src/task.o(.text);
asm/rom5.o(.text); asm/rom5.o(.text);
asm/title_screen.o(.text); asm/title_screen.o(.text);
@ -106,7 +108,7 @@ SECTIONS {
asm/fldeff_emotion.o(.text); asm/fldeff_emotion.o(.text);
asm/wild_encounter.o(.text); asm/wild_encounter.o(.text);
asm/field_effect.o(.text); asm/field_effect.o(.text);
asm/rom_80B5E6C.o(.text); asm/unknown_task.o(.text);
asm/option_menu.o(.text); asm/option_menu.o(.text);
asm/pokedex.o(.text); asm/pokedex.o(.text);
asm/trainer_card.o(.text); asm/trainer_card.o(.text);
@ -176,15 +178,24 @@ SECTIONS {
asm/rom_8158B30.o(.text); asm/rom_8158B30.o(.text);
asm/player_pc.o(.text); asm/player_pc.o(.text);
asm/intro.o(.text); asm/intro.o(.text);
asm/rom_816F318.o(.text); asm/rom_81700F8.o(.text);
asm/field_region_map.o(.text);
asm/battle_anim_8170478.o(.text);
asm/hall_of_fame.o(.text);
asm/credits.o(.text);
asm/lottery_corner.o(.text); asm/lottery_corner.o(.text);
asm/diploma.o(.text); asm/diploma.o(.text);
asm/berry_tag_screen.o(.text); asm/berry_tag_screen.o(.text);
asm/mystery_event_menu.o(.text); asm/mystery_event_menu.o(.text);
asm/save_failed_screen.o(.text); asm/save_failed_screen.o(.text);
asm/rom_81795E8.o(.text); asm/braille_puzzles.o(.text);
asm/pokeblock_feed.o(.text);
asm/clear_save_data_screen.o(.text); asm/clear_save_data_screen.o(.text);
asm/rom_817B064.o(.text); asm/intro_credits_graphics.o(.text);
asm/evolution_graphics.o(.text);
asm/bard_music.o(.text);
asm/fldeff_teleport.o(.text);
asm/rom_817C95C.o(.text);
asm/front_pic_anim.o(.text); asm/front_pic_anim.o(.text);
asm/rom_8184DA4.o(.text); asm/rom_8184DA4.o(.text);
src/multiboot.o(.text); src/multiboot.o(.text);