mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Merge pull request #33 from ProjectRevoTPP/master
split/rename remaining rom files.
This commit is contained in:
commit
74bda5b680
2446
asm/battle_anim_80D51AC.s
Executable file
2446
asm/battle_anim_80D51AC.s
Executable file
File diff suppressed because it is too large
Load Diff
1970
asm/rom_815A0D4.s → asm/battle_anim_815A0D4.s
Normal file → Executable file
1970
asm/rom_815A0D4.s → asm/battle_anim_815A0D4.s
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
16014
asm/battle_frontier_1.s
Executable file
16014
asm/battle_frontier_1.s
Executable file
File diff suppressed because it is too large
Load Diff
31336
asm/battle_frontier_2.s
Executable file
31336
asm/battle_frontier_2.s
Executable file
File diff suppressed because it is too large
Load Diff
3059
asm/rom_8072304.s → asm/battle_interface.s
Normal file → Executable file
3059
asm/rom_8072304.s → asm/battle_interface.s
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
@ -760,4 +760,526 @@ sub_813C5A0: @ 813C5A0
|
||||
.pool
|
||||
thumb_func_end sub_813C5A0
|
||||
|
||||
thumb_func_start sub_813C5BC
|
||||
sub_813C5BC: @ 813C5BC
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0813C5DC
|
||||
ldr r0, =gTasks
|
||||
lsls r1, r2, 2
|
||||
adds r1, r2
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldr r0, =sub_813C5EC
|
||||
str r0, [r1]
|
||||
_0813C5DC:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C5BC
|
||||
|
||||
thumb_func_start sub_813C5EC
|
||||
sub_813C5EC: @ 813C5EC
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
ldr r0, =gTasks
|
||||
adds r4, r1, r0
|
||||
ldr r0, =gMain
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0813C610
|
||||
movs r0, 0x2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _0813C61A
|
||||
_0813C610:
|
||||
movs r0, 0x5
|
||||
bl PlaySE
|
||||
ldr r0, =sub_813C62C
|
||||
str r0, [r4]
|
||||
_0813C61A:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C5EC
|
||||
|
||||
thumb_func_start sub_813C62C
|
||||
sub_813C62C: @ 813C62C
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0
|
||||
movs r3, 0x10
|
||||
bl BeginNormalPaletteFade
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_813C664
|
||||
str r1, [r0]
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C62C
|
||||
|
||||
thumb_func_start sub_813C664
|
||||
sub_813C664: @ 813C664
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0813C694
|
||||
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
|
||||
bl SetMainCallback2
|
||||
ldr r0, =gUnknown_0203AB78
|
||||
ldr r0, [r0]
|
||||
bl Free
|
||||
movs r0, 0
|
||||
bl sub_813C6A8
|
||||
bl FreeAllWindowBuffers
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
_0813C694:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C664
|
||||
|
||||
thumb_func_start sub_813C6A8
|
||||
sub_813C6A8: @ 813C6A8
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
adds r0, r4, 0
|
||||
bl ClearWindowTilemap
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
adds r0, r4, 0
|
||||
bl RemoveWindow
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C6A8
|
||||
|
||||
thumb_func_start sub_813C6D4
|
||||
sub_813C6D4: @ 813C6D4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x8
|
||||
movs r3, 0xC0
|
||||
lsls r3, 19
|
||||
movs r4, 0xC0
|
||||
lsls r4, 9
|
||||
add r0, sp, 0x4
|
||||
mov r8, r0
|
||||
mov r2, sp
|
||||
movs r6, 0
|
||||
ldr r1, =0x040000d4
|
||||
movs r5, 0x80
|
||||
lsls r5, 5
|
||||
ldr r7, =0x81000800
|
||||
movs r0, 0x81
|
||||
lsls r0, 24
|
||||
mov r12, r0
|
||||
_0813C6FA:
|
||||
strh r6, [r2]
|
||||
mov r0, sp
|
||||
str r0, [r1]
|
||||
str r3, [r1, 0x4]
|
||||
str r7, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
adds r3, r5
|
||||
subs r4, r5
|
||||
cmp r4, r5
|
||||
bhi _0813C6FA
|
||||
strh r6, [r2]
|
||||
mov r2, sp
|
||||
str r2, [r1]
|
||||
str r3, [r1, 0x4]
|
||||
lsrs r0, r4, 1
|
||||
mov r2, r12
|
||||
orrs r0, r2
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
movs r0, 0xE0
|
||||
lsls r0, 19
|
||||
movs r3, 0x80
|
||||
lsls r3, 3
|
||||
movs r4, 0
|
||||
str r4, [sp, 0x4]
|
||||
ldr r2, =0x040000d4
|
||||
mov r1, r8
|
||||
str r1, [r2]
|
||||
str r0, [r2, 0x4]
|
||||
lsrs r0, r3, 2
|
||||
movs r1, 0x85
|
||||
lsls r1, 24
|
||||
orrs r0, r1
|
||||
str r0, [r2, 0x8]
|
||||
ldr r0, [r2, 0x8]
|
||||
movs r1, 0xA0
|
||||
lsls r1, 19
|
||||
mov r0, sp
|
||||
strh r4, [r0]
|
||||
str r0, [r2]
|
||||
str r1, [r2, 0x4]
|
||||
lsrs r3, 1
|
||||
movs r0, 0x81
|
||||
lsls r0, 24
|
||||
orrs r3, r0
|
||||
str r3, [r2, 0x8]
|
||||
ldr r0, [r2, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x8
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x10
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x12
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xA
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x14
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x16
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xC
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x18
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1A
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xE
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1C
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1E
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
add sp, 0x8
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C6D4
|
||||
|
||||
thumb_func_start sub_813C80C
|
||||
sub_813C80C: @ 813C80C
|
||||
push {lr}
|
||||
bl remove_some_task
|
||||
bl ResetTasks
|
||||
bl ResetSpriteData
|
||||
bl ResetPaletteFade
|
||||
bl FreeAllSpritePalettes
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C80C
|
||||
|
||||
thumb_func_start sub_813C828
|
||||
sub_813C828: @ 813C828
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C828
|
||||
|
||||
thumb_func_start sub_813C880
|
||||
sub_813C880: @ 813C880
|
||||
push {lr}
|
||||
movs r1, 0x94
|
||||
lsls r1, 4
|
||||
movs r0, 0
|
||||
bl SetGpuReg
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C880
|
||||
|
||||
thumb_func_start sub_813C890
|
||||
sub_813C890: @ 813C890
|
||||
push {r4,lr}
|
||||
sub sp, 0x8
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
ldr r1, =gUnknown_085B3484
|
||||
adds r0, r4, 0
|
||||
movs r2, 0xC0
|
||||
movs r3, 0
|
||||
bl LoadBgTiles
|
||||
ldr r1, =gUnknown_085B3564
|
||||
movs r0, 0x20
|
||||
str r0, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
adds r0, r4, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl CopyToBgTilemapBufferRect
|
||||
ldr r0, =gUnknown_085B3544
|
||||
movs r1, 0
|
||||
movs r2, 0x20
|
||||
bl LoadPalette
|
||||
add sp, 0x8
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C890
|
||||
|
||||
thumb_func_start sub_813C8D8
|
||||
sub_813C8D8: @ 813C8D8
|
||||
push {lr}
|
||||
bl LoadOam
|
||||
bl ProcessSpriteCopyRequests
|
||||
bl TransferPlttBuffer
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C8D8
|
||||
|
||||
thumb_func_start sub_813C8EC
|
||||
sub_813C8EC: @ 813C8EC
|
||||
push {lr}
|
||||
bl RunTasks
|
||||
bl AnimateSprites
|
||||
bl BuildOamBuffer
|
||||
bl UpdatePaletteFade
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C8EC
|
||||
|
||||
thumb_func_start sub_813C904
|
||||
sub_813C904: @ 813C904
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
ldr r0, =sub_813C91C
|
||||
bl SetMainCallback2
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C904
|
||||
|
||||
thumb_func_start sub_813C91C
|
||||
sub_813C91C: @ 813C91C
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
ldr r0, =gMain
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x7
|
||||
bls _0813C930
|
||||
b _0813CA3C
|
||||
_0813C930:
|
||||
lsls r0, 2
|
||||
ldr r1, =_0813C944
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_0813C944:
|
||||
.4byte _0813C964
|
||||
.4byte _0813C970
|
||||
.4byte _0813C976
|
||||
.4byte _0813C9A8
|
||||
.4byte _0813C9BE
|
||||
.4byte _0813C9DE
|
||||
.4byte _0813C9F0
|
||||
.4byte _0813CA14
|
||||
_0813C964:
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
bl sub_813C6D4
|
||||
b _0813CA00
|
||||
_0813C970:
|
||||
bl sub_813C80C
|
||||
b _0813CA00
|
||||
_0813C976:
|
||||
ldr r4, =gUnknown_0203AB78
|
||||
movs r0, 0x80
|
||||
lsls r0, 4
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
movs r0, 0
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
ldr r1, =gUnknown_085B3D64
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl InitBgsFromTemplates
|
||||
ldr r1, [r4]
|
||||
movs r0, 0x3
|
||||
bl SetBgTilemapBuffer
|
||||
bl sub_813C828
|
||||
b _0813CA00
|
||||
.pool
|
||||
_0813C9A8:
|
||||
movs r0, 0x3
|
||||
bl sub_813C890
|
||||
movs r0, 0
|
||||
bl stdpal_get
|
||||
movs r1, 0xF0
|
||||
movs r2, 0x20
|
||||
bl LoadPalette
|
||||
b _0813CA00
|
||||
_0813C9BE:
|
||||
bl IsDma3ManagerBusyWithBgCopy
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _0813CA3C
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
movs r0, 0x3
|
||||
bl ShowBg
|
||||
movs r0, 0x3
|
||||
bl CopyBgTilemapBufferToVram
|
||||
b _0813CA00
|
||||
_0813C9DE:
|
||||
ldr r0, =gUnknown_085B3D6C
|
||||
bl InitWindows
|
||||
bl DeactivateAllTextPrinters
|
||||
b _0813CA00
|
||||
.pool
|
||||
_0813C9F0:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0x10
|
||||
movs r3, 0
|
||||
bl BeginNormalPaletteFade
|
||||
_0813CA00:
|
||||
ldr r1, =gMain
|
||||
movs r0, 0x87
|
||||
lsls r0, 3
|
||||
adds r1, r0
|
||||
ldrb r0, [r1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1]
|
||||
b _0813CA3C
|
||||
.pool
|
||||
_0813CA14:
|
||||
bl sub_813C880
|
||||
ldr r0, =sub_813C8D8
|
||||
bl SetVBlankCallback
|
||||
bl sub_81D5C8C
|
||||
ldr r0, =sub_813C5BC
|
||||
movs r1, 0x8
|
||||
bl CreateTask
|
||||
ldr r0, =sub_813C8EC
|
||||
bl SetMainCallback2
|
||||
ldr r0, =gMain
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
strb r1, [r0]
|
||||
_0813CA3C:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C91C
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
||||
|
1028
asm/battle_tent.s
Executable file
1028
asm/battle_tent.s
Executable file
File diff suppressed because it is too large
Load Diff
3765
asm/rom_8161F74.s → asm/battle_tower.s
Normal file → Executable file
3765
asm/rom_8161F74.s → asm/battle_tower.s
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
592
asm/berry_fix_program.s
Executable file
592
asm/berry_fix_program.s
Executable file
@ -0,0 +1,592 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81BF384
|
||||
sub_81BF384: @ 81BF384
|
||||
push {r4,lr}
|
||||
ldr r0, =0x0000ffff
|
||||
bl DisableInterrupts
|
||||
movs r0, 0x1
|
||||
bl EnableInterrupts
|
||||
bl m4aSoundVSyncOff
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
bl ResetSpriteData
|
||||
bl ResetTasks
|
||||
bl remove_some_task
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
ldr r4, =gUnknown_030012B8
|
||||
movs r0, 0x50
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
movs r1, 0
|
||||
strb r1, [r0]
|
||||
ldr r1, [r4]
|
||||
movs r0, 0x6
|
||||
strb r0, [r1, 0x1]
|
||||
ldr r0, =sub_81BF3DC
|
||||
bl SetMainCallback2
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BF384
|
||||
|
||||
thumb_func_start sub_81BF3DC
|
||||
sub_81BF3DC: @ 81BF3DC
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
ldr r1, =gUnknown_030012B8
|
||||
ldr r0, [r1]
|
||||
ldrb r0, [r0]
|
||||
adds r5, r1, 0
|
||||
cmp r0, 0x7
|
||||
bls _081BF3EE
|
||||
b _081BF592
|
||||
_081BF3EE:
|
||||
lsls r0, 2
|
||||
ldr r1, =_081BF400
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081BF400:
|
||||
.4byte _081BF420
|
||||
.4byte _081BF430
|
||||
.4byte _081BF45C
|
||||
.4byte _081BF488
|
||||
.4byte _081BF4BC
|
||||
.4byte _081BF514
|
||||
.4byte _081BF552
|
||||
.4byte _081BF574
|
||||
_081BF420:
|
||||
bl sub_81BF5A4
|
||||
ldr r0, =gUnknown_030012B8
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x1
|
||||
b _081BF590
|
||||
.pool
|
||||
_081BF430:
|
||||
movs r0, 0x5
|
||||
bl sub_81BF7A4
|
||||
cmp r0, 0x5
|
||||
beq _081BF43C
|
||||
b _081BF592
|
||||
_081BF43C:
|
||||
ldr r0, =gMain
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081BF44A
|
||||
b _081BF592
|
||||
_081BF44A:
|
||||
ldr r0, =gUnknown_030012B8
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x2
|
||||
b _081BF590
|
||||
.pool
|
||||
_081BF45C:
|
||||
movs r0, 0
|
||||
bl sub_81BF7A4
|
||||
cmp r0, 0
|
||||
beq _081BF468
|
||||
b _081BF592
|
||||
_081BF468:
|
||||
ldr r0, =gMain
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081BF476
|
||||
b _081BF592
|
||||
_081BF476:
|
||||
ldr r0, =gUnknown_030012B8
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x3
|
||||
b _081BF590
|
||||
.pool
|
||||
_081BF488:
|
||||
movs r0, 0x1
|
||||
bl sub_81BF7A4
|
||||
cmp r0, 0x1
|
||||
beq _081BF494
|
||||
b _081BF592
|
||||
_081BF494:
|
||||
ldr r4, =gUnknown_030012B8
|
||||
ldr r0, [r4]
|
||||
ldr r1, =gUnknown_089A6550
|
||||
str r1, [r0, 0x2C]
|
||||
adds r0, 0x4F
|
||||
movs r5, 0
|
||||
strb r5, [r0]
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
bl MultiBootInit
|
||||
ldr r1, [r4]
|
||||
strh r5, [r1, 0x2]
|
||||
movs r0, 0x4
|
||||
b _081BF590
|
||||
.pool
|
||||
_081BF4BC:
|
||||
adds r4, r5, 0
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
bl MultiBootMain
|
||||
ldr r4, [r4]
|
||||
ldrb r0, [r4, 0x1C]
|
||||
cmp r0, 0
|
||||
bne _081BF4D8
|
||||
ldr r0, [r4, 0x20]
|
||||
ldr r1, =0x00020200
|
||||
ands r0, r1
|
||||
cmp r0, r1
|
||||
beq _081BF4E4
|
||||
_081BF4D8:
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0x2]
|
||||
b _081BF592
|
||||
.pool
|
||||
_081BF4E4:
|
||||
ldrh r0, [r4, 0x2]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x2]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0xB4
|
||||
bls _081BF592
|
||||
adds r0, r4, 0x4
|
||||
ldr r1, =gMultiBootProgram_BerryGlitchFix_Start
|
||||
ldr r2, =gMultiBootProgram_BerryGlitchFix_End
|
||||
subs r2, r1
|
||||
movs r3, 0x1
|
||||
str r3, [sp]
|
||||
movs r3, 0x4
|
||||
bl MultiBootStartMaster
|
||||
ldr r1, [r5]
|
||||
movs r0, 0x5
|
||||
b _081BF590
|
||||
.pool
|
||||
_081BF514:
|
||||
movs r0, 0x2
|
||||
bl sub_81BF7A4
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0x2
|
||||
bne _081BF592
|
||||
ldr r5, =gUnknown_030012B8
|
||||
ldr r0, [r5]
|
||||
adds r0, 0x4
|
||||
bl MultiBootMain
|
||||
ldr r0, [r5]
|
||||
adds r0, 0x4
|
||||
bl MultiBootCheckComplete
|
||||
cmp r0, 0
|
||||
beq _081BF540
|
||||
ldr r1, [r5]
|
||||
movs r0, 0x6
|
||||
b _081BF590
|
||||
.pool
|
||||
_081BF540:
|
||||
ldr r1, [r5]
|
||||
adds r0, r1, 0
|
||||
adds r0, 0x22
|
||||
ldrb r0, [r0]
|
||||
ands r4, r0
|
||||
cmp r4, 0
|
||||
bne _081BF592
|
||||
movs r0, 0x7
|
||||
b _081BF590
|
||||
_081BF552:
|
||||
movs r0, 0x3
|
||||
bl sub_81BF7A4
|
||||
cmp r0, 0x3
|
||||
bne _081BF592
|
||||
ldr r0, =gMain
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081BF592
|
||||
bl DoSoftReset
|
||||
b _081BF592
|
||||
.pool
|
||||
_081BF574:
|
||||
movs r0, 0x4
|
||||
bl sub_81BF7A4
|
||||
cmp r0, 0x4
|
||||
bne _081BF592
|
||||
ldr r0, =gMain
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081BF592
|
||||
ldr r0, =gUnknown_030012B8
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x1
|
||||
_081BF590:
|
||||
strb r0, [r1]
|
||||
_081BF592:
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BF3DC
|
||||
|
||||
thumb_func_start sub_81BF5A4
|
||||
sub_81BF5A4: @ 81BF5A4
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0x10
|
||||
movs r0, 0x8
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xA
|
||||
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, 0x50
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r1, 0
|
||||
str r1, [sp, 0xC]
|
||||
ldr r4, =0x040000d4
|
||||
add r0, sp, 0xC
|
||||
str r0, [r4]
|
||||
movs r0, 0xC0
|
||||
lsls r0, 19
|
||||
str r0, [r4, 0x4]
|
||||
ldr r0, =0x85006000
|
||||
str r0, [r4, 0x8]
|
||||
ldr r0, [r4, 0x8]
|
||||
str r1, [sp, 0xC]
|
||||
add r0, sp, 0xC
|
||||
str r0, [r4]
|
||||
movs r0, 0xE0
|
||||
lsls r0, 19
|
||||
str r0, [r4, 0x4]
|
||||
ldr r2, =0x85000100
|
||||
str r2, [r4, 0x8]
|
||||
ldr r0, [r4, 0x8]
|
||||
str r1, [sp, 0xC]
|
||||
add r0, sp, 0xC
|
||||
str r0, [r4]
|
||||
movs r0, 0xA0
|
||||
lsls r0, 19
|
||||
str r0, [r4, 0x4]
|
||||
str r2, [r4, 0x8]
|
||||
ldr r0, [r4, 0x8]
|
||||
movs r0, 0
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
ldr r1, =gUnknown_08618108
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl InitBgsFromTemplates
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
ldr r0, =gUnknown_08618110
|
||||
bl InitWindows
|
||||
bl DeactivateAllTextPrinters
|
||||
ldr r0, =gUnknown_08618138
|
||||
str r0, [r4]
|
||||
ldr r0, =0x050001e0
|
||||
str r0, [r4, 0x4]
|
||||
ldr r0, =0x84000008
|
||||
str r0, [r4, 0x8]
|
||||
ldr r0, [r4, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0x40
|
||||
bl SetGpuReg
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
movs r0, 0
|
||||
movs r1, 0xAA
|
||||
bl FillWindowPixelBuffer
|
||||
ldr r5, =gUnknown_08617E9B
|
||||
movs r0, 0
|
||||
adds r1, r5, 0
|
||||
movs r2, 0
|
||||
bl GetStringWidth
|
||||
adds r1, r0, 0
|
||||
movs r4, 0x78
|
||||
subs r0, r4, r1
|
||||
lsrs r1, r0, 31
|
||||
adds r0, r1
|
||||
asrs r0, 1
|
||||
lsls r2, r0, 24
|
||||
lsrs r2, 24
|
||||
ldr r6, =gUnknown_0861815B
|
||||
str r6, [sp]
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
mov r8, r0
|
||||
str r0, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r3, 0x3
|
||||
bl box_print
|
||||
ldr r5, =gUnknown_08617E8D
|
||||
movs r0, 0
|
||||
adds r1, r5, 0
|
||||
movs r2, 0
|
||||
bl GetStringWidth
|
||||
adds r1, r0, 0
|
||||
subs r4, r1
|
||||
lsrs r0, r4, 31
|
||||
adds r4, r0
|
||||
asrs r4, 1
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x78
|
||||
lsls r2, r0, 24
|
||||
lsrs r2, 24
|
||||
str r6, [sp]
|
||||
mov r0, r8
|
||||
str r0, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r3, 0x3
|
||||
bl box_print
|
||||
movs r0, 0
|
||||
adds r1, r5, 0
|
||||
movs r2, 0
|
||||
bl GetStringWidth
|
||||
adds r1, r0, 0
|
||||
movs r0, 0x70
|
||||
subs r0, r1
|
||||
lsrs r1, r0, 31
|
||||
adds r0, r1
|
||||
asrs r0, 1
|
||||
lsls r2, r0, 24
|
||||
lsrs r2, 24
|
||||
str r6, [sp]
|
||||
mov r0, r8
|
||||
str r0, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r3, 0
|
||||
bl box_print
|
||||
ldr r4, =gUnknown_08617E78
|
||||
movs r0, 0x1
|
||||
adds r1, r4, 0
|
||||
movs r2, 0
|
||||
bl GetStringWidth
|
||||
adds r1, r0, 0
|
||||
movs r0, 0xD0
|
||||
subs r0, r1
|
||||
lsrs r1, r0, 31
|
||||
adds r0, r1
|
||||
asrs r0, 1
|
||||
lsls r2, r0, 24
|
||||
lsrs r2, 24
|
||||
ldr r0, =gUnknown_08618158
|
||||
str r0, [sp]
|
||||
mov r0, r8
|
||||
str r0, [sp, 0x4]
|
||||
str r4, [sp, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0x1
|
||||
movs r3, 0x2
|
||||
bl box_print
|
||||
movs r0, 0x2
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
movs r0, 0x3
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
movs r0, 0
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
add sp, 0x10
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BF5A4
|
||||
|
||||
thumb_func_start sub_81BF7A4
|
||||
sub_81BF7A4: @ 81BF7A4
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r5, =gUnknown_030012B8
|
||||
ldr r0, [r5]
|
||||
ldrb r0, [r0, 0x1]
|
||||
cmp r0, r4
|
||||
bne _081BF7BC
|
||||
adds r0, r4, 0
|
||||
b _081BF7DC
|
||||
.pool
|
||||
_081BF7BC:
|
||||
cmp r0, 0x6
|
||||
bne _081BF7CC
|
||||
adds r0, r4, 0
|
||||
bl sub_81BF7E8
|
||||
ldr r0, [r5]
|
||||
strb r4, [r0, 0x1]
|
||||
b _081BF7D6
|
||||
_081BF7CC:
|
||||
bl sub_81BF8D8
|
||||
ldr r1, [r5]
|
||||
movs r0, 0x6
|
||||
strb r0, [r1, 0x1]
|
||||
_081BF7D6:
|
||||
ldr r0, =gUnknown_030012B8
|
||||
ldr r0, [r0]
|
||||
ldrb r0, [r0, 0x1]
|
||||
_081BF7DC:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81BF7A4
|
||||
|
||||
thumb_func_start sub_81BF7E8
|
||||
sub_81BF7E8: @ 81BF7E8
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0xC
|
||||
adds r6, r0, 0
|
||||
movs r0, 0x20
|
||||
str r0, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl FillBgTilemapBufferRect_Palette0
|
||||
movs r0, 0x1
|
||||
movs r1, 0xAA
|
||||
bl FillWindowPixelBuffer
|
||||
ldr r0, =gUnknown_08618158
|
||||
str r0, [sp]
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
str r0, [sp, 0x4]
|
||||
ldr r0, =gUnknown_08618160
|
||||
lsls r4, r6, 2
|
||||
adds r0, r4, r0
|
||||
ldr r0, [r0]
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x1
|
||||
movs r1, 0x1
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl box_print
|
||||
movs r0, 0x1
|
||||
bl PutWindowTilemap
|
||||
movs r0, 0x1
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
cmp r6, 0x5
|
||||
bhi _081BF87E
|
||||
ldr r0, =_081BF850
|
||||
adds r0, r4, r0
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081BF850:
|
||||
.4byte _081BF868
|
||||
.4byte _081BF870
|
||||
.4byte _081BF868
|
||||
.4byte _081BF868
|
||||
.4byte _081BF868
|
||||
.4byte _081BF878
|
||||
_081BF868:
|
||||
movs r0, 0x2
|
||||
bl PutWindowTilemap
|
||||
b _081BF87E
|
||||
_081BF870:
|
||||
movs r0, 0x3
|
||||
bl PutWindowTilemap
|
||||
b _081BF87E
|
||||
_081BF878:
|
||||
movs r0, 0
|
||||
bl PutWindowTilemap
|
||||
_081BF87E:
|
||||
movs r0, 0
|
||||
bl CopyBgTilemapBufferToVram
|
||||
ldr r5, =gUnknown_08618178
|
||||
lsls r4, r6, 1
|
||||
adds r4, r6
|
||||
lsls r4, 2
|
||||
adds r0, r4, r5
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x06004000
|
||||
bl LZ77UnCompVram
|
||||
adds r0, r5, 0x4
|
||||
adds r0, r4, r0
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x0600f800
|
||||
bl LZ77UnCompVram
|
||||
adds r5, 0x8
|
||||
adds r4, r5
|
||||
ldr r0, [r4]
|
||||
movs r1, 0xA0
|
||||
lsls r1, 19
|
||||
ldr r2, =0x04000040
|
||||
bl CpuSet
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
movs r0, 0x1
|
||||
bl ShowBg
|
||||
add sp, 0xC
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BF7E8
|
||||
|
||||
thumb_func_start sub_81BF8D8
|
||||
sub_81BF8D8: @ 81BF8D8
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
bl HideBg
|
||||
movs r0, 0x1
|
||||
bl HideBg
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81BF8D8
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
890
asm/contest_link_81D9DE4.s
Executable file
890
asm/contest_link_81D9DE4.s
Executable file
@ -0,0 +1,890 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81D9DE4
|
||||
sub_81D9DE4: @ 81D9DE4
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r6, 2
|
||||
adds r0, r6
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
movs r1, 0x1A
|
||||
ldrsh r0, [r0, r1]
|
||||
cmp r0, 0x4
|
||||
bhi _081D9EA4
|
||||
lsls r0, 2
|
||||
ldr r1, =_081D9E10
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081D9E10:
|
||||
.4byte _081D9E24
|
||||
.4byte _081D9E44
|
||||
.4byte _081D9E64
|
||||
.4byte _081D9E84
|
||||
.4byte _081D9EA4
|
||||
_081D9E24:
|
||||
ldr r4, =gUnknown_02039F31
|
||||
ldr r0, =gUnknown_02039F24
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x32
|
||||
b _081D9EB4
|
||||
.pool
|
||||
_081D9E44:
|
||||
ldr r4, =gUnknown_02039F31
|
||||
ldr r0, =gUnknown_02039F24
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x33
|
||||
b _081D9EB4
|
||||
.pool
|
||||
_081D9E64:
|
||||
ldr r4, =gUnknown_02039F31
|
||||
ldr r0, =gUnknown_02039F24
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x34
|
||||
b _081D9EB4
|
||||
.pool
|
||||
_081D9E84:
|
||||
ldr r4, =gUnknown_02039F31
|
||||
ldr r0, =gUnknown_02039F24
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x35
|
||||
b _081D9EB4
|
||||
.pool
|
||||
_081D9EA4:
|
||||
ldr r4, =gUnknown_02039F31
|
||||
ldr r0, =gUnknown_02039F24
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x36
|
||||
_081D9EB4:
|
||||
bl GetMonData
|
||||
strb r0, [r4]
|
||||
ldr r5, =gUnknown_02039E00
|
||||
ldr r4, =gUnknown_02039F25
|
||||
ldrb r0, [r4]
|
||||
lsls r0, 6
|
||||
adds r0, r5
|
||||
ldr r1, =gUnknown_02039F31
|
||||
ldrb r1, [r1]
|
||||
adds r0, 0x2C
|
||||
strb r1, [r0]
|
||||
ldr r0, =0x00000864
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
negs r0, r0
|
||||
lsrs r0, 31
|
||||
ldrb r1, [r4]
|
||||
lsls r1, 6
|
||||
adds r1, r5
|
||||
adds r1, 0x2D
|
||||
strb r0, [r1]
|
||||
ldr r1, =sub_81DA160
|
||||
ldr r2, =sub_81D9F14
|
||||
adds r0, r6, 0
|
||||
bl SetTaskFuncWithFollowupFunc
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D9DE4
|
||||
|
||||
thumb_func_start sub_81D9F14
|
||||
sub_81D9F14: @ 81D9F14
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =sub_81DA244
|
||||
ldr r2, =sub_81D9F30
|
||||
bl SetTaskFuncWithFollowupFunc
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D9F14
|
||||
|
||||
thumb_func_start sub_81D9F30
|
||||
sub_81D9F30: @ 81D9F30
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =sub_81DA2E8
|
||||
ldr r2, =sub_81D9F4C
|
||||
bl SetTaskFuncWithFollowupFunc
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D9F30
|
||||
|
||||
thumb_func_start sub_81D9F4C
|
||||
sub_81D9F4C: @ 81D9F4C
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =sub_81DA3B8
|
||||
ldr r2, =sub_81D9F68
|
||||
bl SetTaskFuncWithFollowupFunc
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D9F4C
|
||||
|
||||
thumb_func_start sub_81D9F68
|
||||
sub_81D9F68: @ 81D9F68
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
sub sp, 0x8
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
movs r3, 0
|
||||
ldr r5, =gUnknown_02039F30
|
||||
mov r8, r5
|
||||
ldr r0, =gSpecialVar_0x8004
|
||||
mov r12, r0
|
||||
add r1, sp, 0x4
|
||||
mov r9, r1
|
||||
ldrb r4, [r5]
|
||||
cmp r3, r4
|
||||
bcs _081D9FB2
|
||||
lsls r0, r6, 2
|
||||
adds r0, r6
|
||||
lsls r4, r0, 3
|
||||
ldr r7, =gTasks + 0x8
|
||||
_081D9F98:
|
||||
mov r0, sp
|
||||
adds r2, r0, r3
|
||||
adds r1, r3, 0x1
|
||||
lsls r0, r1, 1
|
||||
adds r0, r4
|
||||
adds r0, r7
|
||||
ldrh r0, [r0]
|
||||
strb r0, [r2]
|
||||
lsls r1, 24
|
||||
lsrs r3, r1, 24
|
||||
ldrb r1, [r5]
|
||||
cmp r3, r1
|
||||
bcc _081D9F98
|
||||
_081D9FB2:
|
||||
movs r3, 0
|
||||
mov r4, r8
|
||||
ldrb r0, [r4]
|
||||
cmp r3, r0
|
||||
bcs _081D9FD6
|
||||
adds r4, r0, 0
|
||||
mov r2, sp
|
||||
_081D9FC0:
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, r4
|
||||
bcs _081D9FD6
|
||||
mov r7, sp
|
||||
adds r1, r7, r3
|
||||
ldrb r0, [r2]
|
||||
ldrb r1, [r1]
|
||||
cmp r0, r1
|
||||
beq _081D9FC0
|
||||
_081D9FD6:
|
||||
mov r0, r8
|
||||
ldrb r0, [r0]
|
||||
cmp r3, r0
|
||||
bne _081D9FF4
|
||||
movs r0, 0
|
||||
mov r1, r12
|
||||
strh r0, [r1]
|
||||
b _081D9FFA
|
||||
.pool
|
||||
_081D9FF4:
|
||||
movs r0, 0x1
|
||||
mov r4, r12
|
||||
strh r0, [r4]
|
||||
_081D9FFA:
|
||||
movs r3, 0
|
||||
mov r7, r8
|
||||
mov r0, r8
|
||||
ldrb r0, [r0]
|
||||
cmp r3, r0
|
||||
bcs _081DA02A
|
||||
mov r4, r9
|
||||
lsls r0, r6, 2
|
||||
adds r0, r6
|
||||
lsls r2, r0, 3
|
||||
ldr r5, =gTasks + 0x8
|
||||
_081DA010:
|
||||
adds r1, r4, r3
|
||||
adds r0, r3, 0x5
|
||||
lsls r0, 1
|
||||
adds r0, r2
|
||||
adds r0, r5
|
||||
ldrh r0, [r0]
|
||||
strb r0, [r1]
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
ldrb r1, [r7]
|
||||
cmp r3, r1
|
||||
bcc _081DA010
|
||||
_081DA02A:
|
||||
mov r4, r8
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0x4
|
||||
beq _081DA0B8
|
||||
bl GetMultiplayerId
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DA0B8
|
||||
ldr r0, =gUnknown_02039E00
|
||||
adds r1, r0, 0
|
||||
adds r1, 0x2C
|
||||
ldrb r2, [r1]
|
||||
movs r3, 0x1
|
||||
ldrb r1, [r4]
|
||||
adds r5, r0, 0
|
||||
cmp r3, r1
|
||||
bcs _081DA06C
|
||||
adds r4, r5, 0
|
||||
mov r7, r8
|
||||
ldrb r1, [r7]
|
||||
_081DA054:
|
||||
lsls r0, r3, 6
|
||||
adds r0, r4
|
||||
adds r0, 0x2C
|
||||
ldrb r7, [r0]
|
||||
cmp r2, r7
|
||||
bcs _081DA062
|
||||
ldrb r2, [r0]
|
||||
_081DA062:
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
cmp r3, r1
|
||||
bcc _081DA054
|
||||
_081DA06C:
|
||||
cmp r2, 0
|
||||
beq _081DA076
|
||||
subs r0, r2, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
_081DA076:
|
||||
movs r4, 0x1
|
||||
movs r3, 0
|
||||
mov r0, r8
|
||||
ldrb r0, [r0]
|
||||
cmp r3, r0
|
||||
bcs _081DA0AC
|
||||
adds r0, r5, 0
|
||||
b _081DA0A2
|
||||
.pool
|
||||
_081DA090:
|
||||
adds r0, r3, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
mov r1, r8
|
||||
ldrb r1, [r1]
|
||||
cmp r3, r1
|
||||
bcs _081DA0AC
|
||||
lsls r0, r3, 6
|
||||
adds r0, r5
|
||||
_081DA0A2:
|
||||
adds r0, 0x2D
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _081DA090
|
||||
movs r4, 0
|
||||
_081DA0AC:
|
||||
mov r0, sp
|
||||
ldrb r0, [r0]
|
||||
adds r1, r2, 0
|
||||
adds r2, r4, 0
|
||||
bl sub_80DACBC
|
||||
_081DA0B8:
|
||||
mov r0, r9
|
||||
bl sub_80F86E0
|
||||
ldr r1, =gUnknown_02039F2B
|
||||
strb r0, [r1]
|
||||
ldr r0, =gUnknown_02039F30
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x3
|
||||
bhi _081DA0E8
|
||||
ldr r1, =sub_81DA488
|
||||
ldr r2, =sub_81DA10C
|
||||
adds r0, r6, 0
|
||||
bl SetTaskFuncWithFollowupFunc
|
||||
b _081DA0F6
|
||||
.pool
|
||||
_081DA0E8:
|
||||
ldr r0, =gTasks
|
||||
lsls r1, r6, 2
|
||||
adds r1, r6
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldr r0, =sub_81DA10C
|
||||
str r0, [r1]
|
||||
_081DA0F6:
|
||||
add sp, 0x8
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D9F68
|
||||
|
||||
thumb_func_start sub_81DA10C
|
||||
sub_81DA10C: @ 81DA10C
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
ldr r0, =gUnknown_02039F2C
|
||||
ldrb r0, [r0]
|
||||
bl sub_80DB09C
|
||||
ldr r1, =sub_80FCF40
|
||||
ldr r2, =sub_81DA138
|
||||
adds r0, r4, 0
|
||||
bl SetTaskFuncWithFollowupFunc
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA10C
|
||||
|
||||
thumb_func_start sub_81DA138
|
||||
sub_81DA138: @ 81DA138
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0
|
||||
bl sub_80DCE58
|
||||
ldr r1, =sub_80FCFD0
|
||||
ldr r2, =sub_80F8714
|
||||
adds r0, r4, 0
|
||||
bl SetTaskFuncWithFollowupFunc
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA138
|
||||
|
||||
thumb_func_start sub_81DA160
|
||||
sub_81DA160: @ 81DA160
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
lsls r6, r7, 2
|
||||
adds r0, r6, r7
|
||||
lsls r4, r0, 3
|
||||
ldr r5, =gTasks + 0x8
|
||||
adds r0, r4, r5
|
||||
adds r0, 0x18
|
||||
bl sub_80FC670
|
||||
cmp r0, 0
|
||||
beq _081DA224
|
||||
adds r0, r5, 0
|
||||
subs r0, 0x8
|
||||
adds r4, r0
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
beq _081DA1A4
|
||||
cmp r0, 0x1
|
||||
beq _081DA1D4
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0x8]
|
||||
strh r0, [r4, 0x20]
|
||||
adds r0, r7, 0
|
||||
bl SwitchTaskToFollowupFunc
|
||||
b _081DA224
|
||||
.pool
|
||||
_081DA1A4:
|
||||
bl sub_800A520
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA224
|
||||
ldr r0, =gUnknown_02039F25
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 6
|
||||
ldr r1, =gUnknown_02039E00
|
||||
adds r0, r1
|
||||
movs r1, 0x40
|
||||
bl sub_80FC4F4
|
||||
cmp r0, 0x1
|
||||
bne _081DA224
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
b _081DA224
|
||||
.pool
|
||||
_081DA1D4:
|
||||
bl sub_80FC55C
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA224
|
||||
movs r5, 0
|
||||
ldr r0, =gUnknown_02039F30
|
||||
mov r8, r6
|
||||
ldrb r0, [r0]
|
||||
cmp r5, r0
|
||||
bge _081DA214
|
||||
ldr r6, =gLinkPlayers
|
||||
_081DA1EC:
|
||||
lsls r4, r5, 6
|
||||
ldr r0, =gUnknown_02039E00
|
||||
adds r4, r0
|
||||
lsls r1, r5, 8
|
||||
ldr r0, =gUnknown_020223C4
|
||||
adds r1, r0
|
||||
adds r0, r4, 0
|
||||
movs r2, 0x40
|
||||
bl memcpy
|
||||
ldrh r1, [r6, 0x1A]
|
||||
adds r0, r4, 0
|
||||
bl sub_80DFA08
|
||||
adds r6, 0x1C
|
||||
adds r5, 0x1
|
||||
ldr r0, =gUnknown_02039F30
|
||||
ldrb r0, [r0]
|
||||
cmp r5, r0
|
||||
blt _081DA1EC
|
||||
_081DA214:
|
||||
ldr r0, =gTasks
|
||||
mov r2, r8
|
||||
adds r1, r2, r7
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
_081DA224:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA160
|
||||
|
||||
thumb_func_start sub_81DA244
|
||||
sub_81DA244: @ 81DA244
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r5, r0, 3
|
||||
ldr r6, =gTasks + 0x8
|
||||
adds r0, r5, r6
|
||||
adds r0, 0x18
|
||||
bl sub_80FC670
|
||||
cmp r0, 0
|
||||
beq _081DA2D4
|
||||
adds r0, r6, 0
|
||||
subs r0, 0x8
|
||||
adds r5, r0
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
beq _081DA284
|
||||
cmp r0, 0x1
|
||||
beq _081DA2AC
|
||||
movs r0, 0
|
||||
strh r0, [r5, 0x8]
|
||||
strh r0, [r5, 0x20]
|
||||
adds r0, r4, 0
|
||||
bl SwitchTaskToFollowupFunc
|
||||
b _081DA2D4
|
||||
.pool
|
||||
_081DA284:
|
||||
bl GetMultiplayerId
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DA2CE
|
||||
bl sub_800A520
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA2D4
|
||||
ldr r0, =gRngValue
|
||||
movs r1, 0x4
|
||||
bl sub_80FC4F4
|
||||
cmp r0, 0x1
|
||||
bne _081DA2D4
|
||||
b _081DA2CE
|
||||
.pool
|
||||
_081DA2AC:
|
||||
movs r0, 0
|
||||
bl sub_80FC530
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA2D4
|
||||
ldr r0, =gRngValue
|
||||
ldr r4, =gUnknown_020223C4
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x4
|
||||
bl memcpy
|
||||
ldr r0, =gUnknown_030060B8
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x4
|
||||
bl memcpy
|
||||
_081DA2CE:
|
||||
ldrh r0, [r5, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5, 0x8]
|
||||
_081DA2D4:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA244
|
||||
|
||||
thumb_func_start sub_81DA2E8
|
||||
sub_81DA2E8: @ 81DA2E8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0xC
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
lsls r0, r6, 2
|
||||
mov r9, r0
|
||||
adds r0, r6
|
||||
lsls r5, r0, 3
|
||||
ldr r1, =gTasks + 0x8
|
||||
mov r8, r1
|
||||
adds r0, r5, r1
|
||||
adds r0, 0x18
|
||||
bl sub_80FC670
|
||||
cmp r0, 0
|
||||
beq _081DA39E
|
||||
movs r0, 0x8
|
||||
negs r0, r0
|
||||
add r0, r8
|
||||
mov r10, r0
|
||||
adds r4, r5, r0
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
beq _081DA338
|
||||
cmp r0, 0x1
|
||||
beq _081DA35A
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0x8]
|
||||
strh r0, [r4, 0x20]
|
||||
adds r0, r6, 0
|
||||
bl SwitchTaskToFollowupFunc
|
||||
b _081DA39E
|
||||
.pool
|
||||
_081DA338:
|
||||
bl sub_800A520
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA39E
|
||||
add r0, sp, 0x8
|
||||
movs r1, 0x6E
|
||||
strh r1, [r0]
|
||||
movs r1, 0x2
|
||||
bl sub_80FC4F4
|
||||
cmp r0, 0x1
|
||||
bne _081DA39E
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
b _081DA39E
|
||||
_081DA35A:
|
||||
bl sub_80FC55C
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA39E
|
||||
movs r1, 0
|
||||
ldr r7, =gUnknown_02039F30
|
||||
ldrb r0, [r7]
|
||||
cmp r1, r0
|
||||
bge _081DA390
|
||||
mov r0, r8
|
||||
adds r0, 0xA
|
||||
adds r3, r5, r0
|
||||
ldr r4, =gUnknown_020223C4
|
||||
mov r2, sp
|
||||
movs r5, 0x80
|
||||
lsls r5, 1
|
||||
_081DA37C:
|
||||
ldrh r0, [r4]
|
||||
strh r0, [r2]
|
||||
strh r0, [r3]
|
||||
adds r3, 0x2
|
||||
adds r4, r5
|
||||
adds r2, 0x2
|
||||
adds r1, 0x1
|
||||
ldrb r0, [r7]
|
||||
cmp r1, r0
|
||||
blt _081DA37C
|
||||
_081DA390:
|
||||
mov r0, r9
|
||||
adds r1, r0, r6
|
||||
lsls r1, 3
|
||||
add r1, r10
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
_081DA39E:
|
||||
add sp, 0xC
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA2E8
|
||||
|
||||
thumb_func_start sub_81DA3B8
|
||||
sub_81DA3B8: @ 81DA3B8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0xC
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
lsls r0, r6, 2
|
||||
mov r9, r0
|
||||
adds r0, r6
|
||||
lsls r5, r0, 3
|
||||
ldr r1, =gTasks + 0x8
|
||||
mov r8, r1
|
||||
adds r0, r5, r1
|
||||
adds r0, 0x18
|
||||
bl sub_80FC670
|
||||
cmp r0, 0
|
||||
beq _081DA46E
|
||||
movs r0, 0x8
|
||||
negs r0, r0
|
||||
add r0, r8
|
||||
mov r10, r0
|
||||
adds r4, r5, r0
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
beq _081DA408
|
||||
cmp r0, 0x1
|
||||
beq _081DA42A
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0x8]
|
||||
strh r0, [r4, 0x20]
|
||||
adds r0, r6, 0
|
||||
bl SwitchTaskToFollowupFunc
|
||||
b _081DA46E
|
||||
.pool
|
||||
_081DA408:
|
||||
bl sub_800A520
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA46E
|
||||
ldrh r1, [r4, 0x1A]
|
||||
add r0, sp, 0x8
|
||||
strh r1, [r0]
|
||||
movs r1, 0x2
|
||||
bl sub_80FC4F4
|
||||
cmp r0, 0x1
|
||||
bne _081DA46E
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
b _081DA46E
|
||||
_081DA42A:
|
||||
bl sub_80FC55C
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA46E
|
||||
movs r1, 0
|
||||
ldr r7, =gUnknown_02039F30
|
||||
ldrb r0, [r7]
|
||||
cmp r1, r0
|
||||
bge _081DA460
|
||||
mov r0, r8
|
||||
adds r0, 0x2
|
||||
adds r3, r5, r0
|
||||
ldr r4, =gUnknown_020223C4
|
||||
mov r2, sp
|
||||
movs r5, 0x80
|
||||
lsls r5, 1
|
||||
_081DA44C:
|
||||
ldrh r0, [r4]
|
||||
strh r0, [r2]
|
||||
strh r0, [r3]
|
||||
adds r3, 0x2
|
||||
adds r4, r5
|
||||
adds r2, 0x2
|
||||
adds r1, 0x1
|
||||
ldrb r0, [r7]
|
||||
cmp r1, r0
|
||||
blt _081DA44C
|
||||
_081DA460:
|
||||
mov r0, r9
|
||||
adds r1, r0, r6
|
||||
lsls r1, 3
|
||||
add r1, r10
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
_081DA46E:
|
||||
add sp, 0xC
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA3B8
|
||||
|
||||
thumb_func_start sub_81DA488
|
||||
sub_81DA488: @ 81DA488
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
lsls r7, r6, 2
|
||||
adds r0, r7, r6
|
||||
lsls r4, r0, 3
|
||||
ldr r5, =gTasks + 0x8
|
||||
adds r0, r4, r5
|
||||
adds r0, 0x18
|
||||
bl sub_80FC670
|
||||
cmp r0, 0
|
||||
beq _081DA55C
|
||||
adds r0, r5, 0
|
||||
subs r0, 0x8
|
||||
adds r4, r0
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
beq _081DA4CC
|
||||
cmp r0, 0x1
|
||||
beq _081DA50C
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0x8]
|
||||
strh r0, [r4, 0x20]
|
||||
adds r0, r6, 0
|
||||
bl SwitchTaskToFollowupFunc
|
||||
b _081DA55C
|
||||
.pool
|
||||
_081DA4CC:
|
||||
bl GetMultiplayerId
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DA4FA
|
||||
bl sub_800A520
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA55C
|
||||
ldr r0, =gUnknown_02039F30
|
||||
ldrb r2, [r0]
|
||||
lsls r0, r2, 6
|
||||
ldr r1, =gUnknown_02039E00
|
||||
adds r0, r1
|
||||
movs r1, 0x4
|
||||
subs r1, r2
|
||||
lsls r1, 22
|
||||
lsrs r1, 16
|
||||
bl sub_80FC4F4
|
||||
cmp r0, 0x1
|
||||
bne _081DA55C
|
||||
_081DA4FA:
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
b _081DA55C
|
||||
.pool
|
||||
_081DA50C:
|
||||
movs r0, 0
|
||||
bl sub_80FC530
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA55C
|
||||
ldr r4, =gUnknown_02039F30
|
||||
ldrb r3, [r4]
|
||||
lsls r0, r3, 6
|
||||
ldr r5, =gUnknown_02039E00
|
||||
adds r0, r5
|
||||
ldr r1, =gUnknown_020223C4
|
||||
movs r2, 0x4
|
||||
subs r2, r3
|
||||
lsls r2, 6
|
||||
bl memcpy
|
||||
ldrb r4, [r4]
|
||||
mov r8, r7
|
||||
cmp r4, 0x3
|
||||
bgt _081DA54C
|
||||
lsls r0, r4, 6
|
||||
adds r5, r0, r5
|
||||
ldr r7, =gLinkPlayers
|
||||
_081DA53C:
|
||||
ldrh r1, [r7, 0x1A]
|
||||
adds r0, r5, 0
|
||||
bl sub_80DFA08
|
||||
adds r5, 0x40
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x3
|
||||
ble _081DA53C
|
||||
_081DA54C:
|
||||
ldr r0, =gTasks
|
||||
mov r2, r8
|
||||
adds r1, r2, r6
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
_081DA55C:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA488
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
File diff suppressed because it is too large
Load Diff
1486
asm/fldeff_cut.s
Executable file
1486
asm/fldeff_cut.s
Executable file
File diff suppressed because it is too large
Load Diff
596
asm/fldeff_groundshake.s
Executable file
596
asm/fldeff_groundshake.s
Executable file
@ -0,0 +1,596 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81BE66C
|
||||
sub_81BE66C: @ 81BE66C
|
||||
push {lr}
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r0, 0x4]
|
||||
movs r0, 0xD0
|
||||
lsls r0, 5
|
||||
cmp r1, r0
|
||||
bne _081BE690
|
||||
movs r0, 0xA7
|
||||
lsls r0, 1
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
b _081BE692
|
||||
.pool
|
||||
_081BE690:
|
||||
movs r0, 0
|
||||
_081BE692:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81BE66C
|
||||
|
||||
thumb_func_start sub_81BE698
|
||||
sub_81BE698: @ 81BE698
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_0203CF18
|
||||
ldr r0, [r0]
|
||||
adds r0, 0x4
|
||||
bl sub_8151E50
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE698
|
||||
|
||||
thumb_func_start sub_81BE6AC
|
||||
sub_81BE6AC: @ 81BE6AC
|
||||
ldr r1, =gUnknown_0203CF18
|
||||
movs r0, 0
|
||||
str r0, [r1]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_81BE6AC
|
||||
|
||||
thumb_func_start sub_81BE6B8
|
||||
sub_81BE6B8: @ 81BE6B8
|
||||
push {r4,lr}
|
||||
ldr r4, =gUnknown_0203CF18
|
||||
ldr r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _081BE6CC
|
||||
movs r0, 0
|
||||
str r0, [r4]
|
||||
b _081BE718
|
||||
.pool
|
||||
_081BE6CC:
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r0, 0x4]
|
||||
movs r0, 0xD0
|
||||
lsls r0, 5
|
||||
cmp r1, r0
|
||||
bne _081BE718
|
||||
movs r0, 0xA7
|
||||
lsls r0, 1
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081BE718
|
||||
movs r0, 0xC8
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
adds r0, 0x4
|
||||
bl sub_8151B3C
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
ldr r1, =gUnknown_08617E18
|
||||
bl sub_8151B68
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
movs r1, 0x1
|
||||
movs r2, 0x1
|
||||
bl sub_8151CA8
|
||||
ldr r0, =sub_81BE698
|
||||
movs r1, 0xFF
|
||||
bl CreateTask
|
||||
ldr r1, [r4]
|
||||
strb r0, [r1]
|
||||
_081BE718:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE6B8
|
||||
|
||||
thumb_func_start sub_81BE72C
|
||||
sub_81BE72C: @ 81BE72C
|
||||
push {r4,lr}
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r0, 0x4]
|
||||
movs r0, 0xD0
|
||||
lsls r0, 5
|
||||
cmp r1, r0
|
||||
bne _081BE788
|
||||
movs r0, 0xA7
|
||||
lsls r0, 1
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081BE788
|
||||
ldr r4, =gUnknown_0203CF18
|
||||
ldr r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _081BE788
|
||||
ldr r0, =sub_81BE698
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081BE766
|
||||
ldr r0, [r4]
|
||||
ldrb r0, [r0]
|
||||
bl DestroyTask
|
||||
_081BE766:
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
movs r1, 0x1
|
||||
movs r2, 0x1
|
||||
bl sub_8151D28
|
||||
ldr r0, [r4]
|
||||
adds r0, 0x4
|
||||
movs r1, 0x1
|
||||
movs r2, 0x1
|
||||
bl sub_8151C50
|
||||
ldr r0, [r4]
|
||||
bl Free
|
||||
movs r0, 0
|
||||
str r0, [r4]
|
||||
_081BE788:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE72C
|
||||
|
||||
thumb_func_start sub_81BE79C
|
||||
sub_81BE79C: @ 81BE79C
|
||||
push {r4,lr}
|
||||
ldr r0, =0x000040cb
|
||||
bl VarGet
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _081BE7B8
|
||||
movs r0, 0xA7
|
||||
lsls r0, 1
|
||||
bl FlagReset
|
||||
b _081BE7EE
|
||||
.pool
|
||||
_081BE7B8:
|
||||
bl Random
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
movs r0, 0x1
|
||||
ands r4, r0
|
||||
movs r0, 0x9D
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _081BE7D4
|
||||
movs r4, 0x1
|
||||
_081BE7D4:
|
||||
cmp r4, 0
|
||||
beq _081BE7E6
|
||||
movs r0, 0xA7
|
||||
lsls r0, 1
|
||||
bl FlagSet
|
||||
bl sub_81BE6B8
|
||||
b _081BE7EE
|
||||
_081BE7E6:
|
||||
movs r0, 0xA7
|
||||
lsls r0, 1
|
||||
bl FlagReset
|
||||
_081BE7EE:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81BE79C
|
||||
|
||||
thumb_func_start sub_81BE7F4
|
||||
sub_81BE7F4: @ 81BE7F4
|
||||
push {lr}
|
||||
ldr r0, =sub_81BE808
|
||||
movs r1, 0x8
|
||||
bl CreateTask
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE7F4
|
||||
|
||||
thumb_func_start sub_81BE808
|
||||
sub_81BE808: @ 81BE808
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
ldrb r1, [r0, 0x5]
|
||||
ldrb r2, [r0, 0x4]
|
||||
movs r0, 0x2D
|
||||
mov r3, sp
|
||||
bl TryGetFieldObjectIdByLocalIdAndMap
|
||||
mov r0, sp
|
||||
ldrb r0, [r0]
|
||||
lsls r2, r0, 3
|
||||
adds r2, r0
|
||||
lsls r2, 2
|
||||
ldr r4, =gMapObjects
|
||||
adds r2, r4
|
||||
ldr r3, =gSprites
|
||||
ldrb r1, [r2, 0x4]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r3
|
||||
ldrh r1, [r0, 0x26]
|
||||
adds r1, 0x4
|
||||
strh r1, [r0, 0x26]
|
||||
ldr r0, =gUnknown_02037590
|
||||
ldrb r0, [r0, 0x5]
|
||||
lsls r1, r0, 3
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
adds r1, r4
|
||||
ldrb r2, [r2, 0x4]
|
||||
lsls r0, r2, 4
|
||||
adds r0, r2
|
||||
lsls r0, 2
|
||||
adds r0, r3
|
||||
movs r4, 0x22
|
||||
ldrsh r2, [r0, r4]
|
||||
movs r4, 0x26
|
||||
ldrsh r0, [r0, r4]
|
||||
adds r2, r0
|
||||
ldrb r1, [r1, 0x4]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r3
|
||||
movs r3, 0x22
|
||||
ldrsh r1, [r0, r3]
|
||||
movs r4, 0x26
|
||||
ldrsh r0, [r0, r4]
|
||||
adds r1, r0
|
||||
cmp r2, r1
|
||||
blt _081BE882
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
bl EnableBothScriptContexts
|
||||
_081BE882:
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE808
|
||||
|
||||
thumb_func_start sp136_strengh_sound
|
||||
sp136_strengh_sound: @ 81BE89C
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
mov r8, r0
|
||||
adds r4, r1, 0
|
||||
adds r5, r2, 0
|
||||
adds r6, r3, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
ldr r0, =sub_81BE900
|
||||
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 r4, [r1, 0x8]
|
||||
strh r0, [r1, 0xA]
|
||||
strh r5, [r1, 0xC]
|
||||
strh r6, [r1, 0xE]
|
||||
mov r0, r8
|
||||
strh r0, [r1, 0x10]
|
||||
movs r0, 0
|
||||
bl SetCameraPanningCallback
|
||||
movs r0, 0xD6
|
||||
bl PlaySE
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sp136_strengh_sound
|
||||
|
||||
thumb_func_start sub_81BE900
|
||||
sub_81BE900: @ 81BE900
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
ldr r1, =gTasks + 0x8
|
||||
adds r4, r0, r1
|
||||
ldrh r0, [r4, 0x2]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x2]
|
||||
movs r1, 0x2
|
||||
ldrsh r0, [r4, r1]
|
||||
movs r2, 0x6
|
||||
ldrsh r1, [r4, r2]
|
||||
bl __modsi3
|
||||
cmp r0, 0
|
||||
bne _081BE95C
|
||||
strh r0, [r4, 0x2]
|
||||
ldrh r0, [r4, 0x4]
|
||||
subs r0, 0x1
|
||||
strh r0, [r4, 0x4]
|
||||
ldrh r0, [r4]
|
||||
negs r0, r0
|
||||
strh r0, [r4]
|
||||
ldrh r0, [r4, 0x8]
|
||||
negs r0, r0
|
||||
strh r0, [r4, 0x8]
|
||||
movs r1, 0
|
||||
ldrsh r0, [r4, r1]
|
||||
movs r2, 0x8
|
||||
ldrsh r1, [r4, r2]
|
||||
bl SetCameraPanning
|
||||
movs r1, 0x4
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
bne _081BE95C
|
||||
bl sub_81BE968
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
bl InstallCameraPanAheadCallback
|
||||
_081BE95C:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE900
|
||||
|
||||
thumb_func_start sub_81BE968
|
||||
sub_81BE968: @ 81BE968
|
||||
push {lr}
|
||||
ldr r0, =sub_81BE9C0
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0xFF
|
||||
beq _081BE988
|
||||
ldr r0, =gTasks
|
||||
lsls r1, r2, 2
|
||||
adds r1, r2
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
_081BE988:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE968
|
||||
|
||||
thumb_func_start sub_81BE994
|
||||
sub_81BE994: @ 81BE994
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_08617D94
|
||||
bl LoadSpriteSheets
|
||||
bl sub_81BEA20
|
||||
ldr r0, =sub_81BE9C0
|
||||
movs r1, 0x8
|
||||
bl CreateTask
|
||||
movs r0, 0x2
|
||||
movs r1, 0x1
|
||||
movs r2, 0x10
|
||||
movs r3, 0x3
|
||||
bl sp136_strengh_sound
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE994
|
||||
|
||||
thumb_func_start sub_81BE9C0
|
||||
sub_81BE9C0: @ 81BE9C0
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r3, r1, 3
|
||||
ldr r4, =gTasks + 0x8
|
||||
adds r2, r3, r4
|
||||
ldrh r0, [r2, 0x2]
|
||||
adds r0, 0x1
|
||||
strh r0, [r2, 0x2]
|
||||
lsls r0, 16
|
||||
movs r1, 0xFA
|
||||
lsls r1, 18
|
||||
cmp r0, r1
|
||||
beq _081BE9E6
|
||||
ldrh r0, [r2]
|
||||
cmp r0, 0x11
|
||||
bne _081BE9F0
|
||||
_081BE9E6:
|
||||
adds r0, r4, 0
|
||||
subs r0, 0x8
|
||||
adds r0, r3, r0
|
||||
ldr r1, =sub_81BEA00
|
||||
str r1, [r0]
|
||||
_081BE9F0:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BE9C0
|
||||
|
||||
thumb_func_start sub_81BEA00
|
||||
sub_81BEA00: @ 81BEA00
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0xFA
|
||||
lsls r0, 4
|
||||
bl FreeSpriteTilesByTag
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
bl EnableBothScriptContexts
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81BEA00
|
||||
|
||||
thumb_func_start sub_81BEA20
|
||||
sub_81BEA20: @ 81BEA20
|
||||
push {r4-r7,lr}
|
||||
movs r4, 0
|
||||
ldr r5, =gUnknown_08617D64
|
||||
adds r7, r5, 0x2
|
||||
ldr r6, =gSprites
|
||||
_081BEA2A:
|
||||
lsls r0, r4, 1
|
||||
adds r0, r4
|
||||
lsls r0, 1
|
||||
adds r1, r0, r5
|
||||
ldrh r1, [r1]
|
||||
adds r1, 0x78
|
||||
lsls r1, 16
|
||||
asrs r1, 16
|
||||
adds r0, r7
|
||||
movs r3, 0
|
||||
ldrsh r2, [r0, r3]
|
||||
ldr r0, =gUnknown_08617E60
|
||||
movs r3, 0x8
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r6
|
||||
ldrb r2, [r0, 0x5]
|
||||
movs r3, 0xD
|
||||
negs r3, r3
|
||||
adds r1, r3, 0
|
||||
ands r2, r1
|
||||
movs r1, 0xF
|
||||
ands r2, r1
|
||||
strb r2, [r0, 0x5]
|
||||
strh r4, [r0, 0x2E]
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x7
|
||||
bls _081BEA2A
|
||||
movs r4, 0
|
||||
ldr r5, =gUnknown_08617D64
|
||||
adds r7, r5, 0x2
|
||||
ldr r6, =gSprites
|
||||
_081BEA78:
|
||||
lsls r0, r4, 1
|
||||
adds r0, r4
|
||||
lsls r0, 1
|
||||
adds r1, r0, r5
|
||||
ldrh r1, [r1]
|
||||
adds r1, 0x73
|
||||
lsls r1, 16
|
||||
asrs r1, 16
|
||||
adds r0, r7
|
||||
ldrh r2, [r0]
|
||||
subs r2, 0x3
|
||||
lsls r2, 16
|
||||
asrs r2, 16
|
||||
ldr r0, =gUnknown_08617E34
|
||||
movs r3, 0x8
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r6
|
||||
ldrb r2, [r0, 0x5]
|
||||
movs r3, 0xD
|
||||
negs r3, r3
|
||||
adds r1, r3, 0
|
||||
ands r2, r1
|
||||
movs r1, 0xF
|
||||
ands r2, r1
|
||||
strb r2, [r0, 0x5]
|
||||
strh r4, [r0, 0x2E]
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x7
|
||||
bls _081BEA78
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BEA20
|
||||
|
||||
thumb_func_start sub_81BEAD8
|
||||
sub_81BEAD8: @ 81BEAD8
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldrh r0, [r4, 0x30]
|
||||
adds r0, 0x2
|
||||
strh r0, [r4, 0x30]
|
||||
movs r1, 0x30
|
||||
ldrsh r0, [r4, r1]
|
||||
lsrs r1, r0, 31
|
||||
adds r0, r1
|
||||
asrs r0, 1
|
||||
strh r0, [r4, 0x26]
|
||||
movs r0, 0x22
|
||||
ldrsh r3, [r4, r0]
|
||||
movs r1, 0x26
|
||||
ldrsh r0, [r4, r1]
|
||||
adds r3, r0
|
||||
ldr r2, =gUnknown_08617D64
|
||||
movs r0, 0x2E
|
||||
ldrsh r1, [r4, r0]
|
||||
lsls r0, r1, 1
|
||||
adds r0, r1
|
||||
lsls r0, 1
|
||||
adds r2, 0x4
|
||||
adds r0, r2
|
||||
movs r1, 0
|
||||
ldrsh r0, [r0, r1]
|
||||
cmp r3, r0
|
||||
ble _081BEB1A
|
||||
adds r0, r4, 0
|
||||
bl DestroySprite
|
||||
bl sub_81BE968
|
||||
_081BEB1A:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BEAD8
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
339
asm/fldeff_softboiled.s
Executable file
339
asm/fldeff_softboiled.s
Executable file
@ -0,0 +1,339 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start hm_prepare_dive_probably
|
||||
hm_prepare_dive_probably: @ 8161508
|
||||
push {r4-r6,lr}
|
||||
bl brm_get_pokemon_selection
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r6, 0x64
|
||||
muls r0, r6
|
||||
ldr r4, =gPlayerParty
|
||||
adds r0, r4
|
||||
movs r1, 0x3A
|
||||
bl GetMonData
|
||||
adds r5, r0, 0
|
||||
lsls r5, 16
|
||||
lsrs r5, 16
|
||||
bl brm_get_pokemon_selection
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
muls r0, r6
|
||||
adds r0, r4
|
||||
movs r1, 0x39
|
||||
bl GetMonData
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x5
|
||||
bl __udivsi3
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r4, r0
|
||||
bhi _08161558
|
||||
movs r0, 0
|
||||
b _0816155A
|
||||
.pool
|
||||
_08161558:
|
||||
movs r0, 0x1
|
||||
_0816155A:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end hm_prepare_dive_probably
|
||||
|
||||
thumb_func_start sub_8161560
|
||||
sub_8161560: @ 8161560
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
ldr r0, =gUnknown_0203CEC8
|
||||
movs r1, 0xA
|
||||
strb r1, [r0, 0xB]
|
||||
ldrb r1, [r0, 0x9]
|
||||
strb r1, [r0, 0xA]
|
||||
bl brm_get_pokemon_selection
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x1
|
||||
bl sub_81B0FCC
|
||||
movs r0, 0x5
|
||||
bl display_pokemon_menu_message
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_81B1370
|
||||
str r1, [r0]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8161560
|
||||
|
||||
thumb_func_start sub_81615A8
|
||||
sub_81615A8: @ 81615A8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x8
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
str r4, [sp, 0x4]
|
||||
ldr r1, =gUnknown_0203CEC8
|
||||
ldrb r7, [r1, 0x9]
|
||||
mov r8, r7
|
||||
ldrb r0, [r1, 0xA]
|
||||
adds r5, r0, 0
|
||||
cmp r5, 0x6
|
||||
bls _081615EC
|
||||
movs r0, 0
|
||||
strb r0, [r1, 0xB]
|
||||
bl display_pokemon_menu_message
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_81B1370
|
||||
str r1, [r0]
|
||||
b _08161658
|
||||
.pool
|
||||
_081615EC:
|
||||
movs r0, 0x64
|
||||
mov r10, r0
|
||||
mov r0, r10
|
||||
muls r0, r5
|
||||
ldr r1, =gPlayerParty
|
||||
mov r9, r1
|
||||
adds r6, r0, r1
|
||||
adds r0, r6, 0
|
||||
movs r1, 0x39
|
||||
bl GetMonData
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
cmp r4, 0
|
||||
beq _0816161A
|
||||
cmp r7, r5
|
||||
beq _0816161A
|
||||
adds r0, r6, 0
|
||||
movs r1, 0x3A
|
||||
bl GetMonData
|
||||
cmp r0, r4
|
||||
bne _08161628
|
||||
_0816161A:
|
||||
ldr r0, [sp, 0x4]
|
||||
bl sub_81617B8
|
||||
b _08161658
|
||||
.pool
|
||||
_08161628:
|
||||
movs r0, 0x1
|
||||
bl PlaySE
|
||||
mov r1, r10
|
||||
mov r0, r8
|
||||
muls r0, r1
|
||||
add r0, r9
|
||||
movs r1, 0x3A
|
||||
bl GetMonData
|
||||
movs r1, 0x5
|
||||
bl __udivsi3
|
||||
adds r3, r0, 0
|
||||
lsls r3, 16
|
||||
asrs r3, 16
|
||||
movs r2, 0x1
|
||||
negs r2, r2
|
||||
ldr r0, =sub_816166C
|
||||
str r0, [sp]
|
||||
ldr r0, [sp, 0x4]
|
||||
mov r1, r8
|
||||
bl sub_81B1F18
|
||||
_08161658:
|
||||
add sp, 0x8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81615A8
|
||||
|
||||
thumb_func_start sub_816166C
|
||||
sub_816166C: @ 816166C
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0x1
|
||||
bl PlaySE
|
||||
ldr r5, =gUnknown_0203CEC8
|
||||
movs r1, 0x9
|
||||
ldrsb r1, [r5, r1]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x3A
|
||||
bl GetMonData
|
||||
movs r1, 0x5
|
||||
bl __udivsi3
|
||||
adds r3, r0, 0
|
||||
lsls r3, 16
|
||||
asrs r3, 16
|
||||
ldrb r1, [r5, 0xA]
|
||||
ldr r0, =sub_81616C0
|
||||
str r0, [sp]
|
||||
adds r0, r4, 0
|
||||
movs r2, 0x1
|
||||
bl sub_81B1F18
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_816166C
|
||||
|
||||
thumb_func_start sub_81616C0
|
||||
sub_81616C0: @ 81616C0
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
ldr r0, =gUnknown_0203CEC8
|
||||
movs r1, 0xA
|
||||
ldrsb r1, [r0, r1]
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
ldr r1, =gStringVar1
|
||||
bl GetMonNickname
|
||||
ldr r4, =gStringVar4
|
||||
ldr r1, =gUnknown_085E9C17
|
||||
adds r0, r4, 0
|
||||
bl StringExpandPlaceholders
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl sub_81B1B5C
|
||||
movs r0, 0x2
|
||||
bl schedule_bg_copy_tilemap_to_vram
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_8161724
|
||||
str r1, [r0]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81616C0
|
||||
|
||||
thumb_func_start sub_8161724
|
||||
sub_8161724: @ 8161724
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
bl sub_81B1BD4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _08161772
|
||||
ldr r4, =gUnknown_0203CEC8
|
||||
movs r0, 0
|
||||
strb r0, [r4, 0xB]
|
||||
ldrb r0, [r4, 0x9]
|
||||
movs r1, 0
|
||||
bl sub_81B0FCC
|
||||
ldrb r0, [r4, 0xA]
|
||||
strb r0, [r4, 0x9]
|
||||
ldrb r0, [r4, 0xA]
|
||||
movs r1, 0x1
|
||||
bl sub_81B0FCC
|
||||
movs r0, 0x6
|
||||
movs r1, 0
|
||||
bl sub_8198070
|
||||
movs r0, 0x6
|
||||
bl ClearWindowTilemap
|
||||
movs r0, 0
|
||||
bl display_pokemon_menu_message
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_81B1370
|
||||
str r1, [r0]
|
||||
_08161772:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8161724
|
||||
|
||||
thumb_func_start sub_8161784
|
||||
sub_8161784: @ 8161784
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
bl sub_81B1BD4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _081617AA
|
||||
movs r0, 0x5
|
||||
bl display_pokemon_menu_message
|
||||
ldr r0, =gTasks
|
||||
lsls r1, r4, 2
|
||||
adds r1, r4
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldr r0, =sub_81B1370
|
||||
str r0, [r1]
|
||||
_081617AA:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8161784
|
||||
|
||||
thumb_func_start sub_81617B8
|
||||
sub_81617B8: @ 81617B8
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0x5
|
||||
bl PlaySE
|
||||
ldr r0, =gUnknown_085E9712
|
||||
movs r1, 0
|
||||
bl sub_81B1B5C
|
||||
movs r0, 0x2
|
||||
bl schedule_bg_copy_tilemap_to_vram
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_8161784
|
||||
str r1, [r0]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81617B8
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
998
asm/fossil_specials.s
Executable file
998
asm/fossil_specials.s
Executable file
@ -0,0 +1,998 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81BEB24
|
||||
sub_81BEB24: @ 81BEB24
|
||||
push {r4,r5,lr}
|
||||
movs r4, 0
|
||||
ldr r5, =gUnknown_08617DA4
|
||||
_081BEB2A:
|
||||
lsls r2, r4, 2
|
||||
adds r2, r5
|
||||
ldrb r0, [r2]
|
||||
adds r0, 0x7
|
||||
ldrb r1, [r2, 0x1]
|
||||
adds r1, 0x7
|
||||
ldrh r2, [r2, 0x2]
|
||||
bl MapGridSetMetatileIdAt
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x11
|
||||
bls _081BEB2A
|
||||
bl DrawWholeMapView
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BEB24
|
||||
|
||||
thumb_func_start sub_81BEB54
|
||||
sub_81BEB54: @ 81BEB54
|
||||
push {lr}
|
||||
ldr r0, =sub_81BED50
|
||||
movs r1, 0x9
|
||||
bl CreateTask
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BEB54
|
||||
|
||||
thumb_func_start sub_81BEB68
|
||||
sub_81BEB68: @ 81BEB68
|
||||
push {lr}
|
||||
ldr r0, =sub_81BEBF4
|
||||
movs r1, 0x9
|
||||
bl CreateTask
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BEB68
|
||||
|
||||
thumb_func_start sub_81BEB7C
|
||||
sub_81BEB7C: @ 81BEB7C
|
||||
push {lr}
|
||||
ldr r0, =sub_81BF028
|
||||
movs r1, 0x9
|
||||
bl CreateTask
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BEB7C
|
||||
|
||||
thumb_func_start sub_81BEB90
|
||||
sub_81BEB90: @ 81BEB90
|
||||
push {r4,lr}
|
||||
ldr r4, =gUnknown_0203CF14
|
||||
ldr r0, [r4]
|
||||
ldrh r1, [r0]
|
||||
movs r0, 0x10
|
||||
bl SetGpuReg
|
||||
ldr r0, [r4]
|
||||
ldrh r1, [r0, 0x2]
|
||||
movs r0, 0x12
|
||||
bl SetGpuReg
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BEB90
|
||||
|
||||
thumb_func_start sub_81BEBB4
|
||||
sub_81BEBB4: @ 81BEBB4
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r2, r1, r2
|
||||
ldrh r1, [r2, 0x8]
|
||||
movs r3, 0x8
|
||||
ldrsh r0, [r2, r3]
|
||||
cmp r0, 0
|
||||
bne _081BEBEC
|
||||
ldr r0, =gUnknown_0203CF14
|
||||
ldr r1, [r0]
|
||||
ldrh r0, [r1]
|
||||
negs r0, r0
|
||||
strh r0, [r1]
|
||||
movs r0, 0x2
|
||||
strh r0, [r2, 0x8]
|
||||
bl sub_81BEB90
|
||||
b _081BEBF0
|
||||
.pool
|
||||
_081BEBEC:
|
||||
subs r0, r1, 0x1
|
||||
strh r0, [r2, 0x8]
|
||||
_081BEBF0:
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81BEBB4
|
||||
|
||||
thumb_func_start sub_81BEBF4
|
||||
sub_81BEBF4: @ 81BEBF4
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0xC
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r0, r1]
|
||||
cmp r0, 0x6
|
||||
bls _081BEC10
|
||||
b _081BED40
|
||||
_081BEC10:
|
||||
lsls r0, 2
|
||||
ldr r1, =_081BEC24
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081BEC24:
|
||||
.4byte _081BEC40
|
||||
.4byte _081BEC50
|
||||
.4byte _081BEC88
|
||||
.4byte _081BECB0
|
||||
.4byte _081BECF8
|
||||
.4byte _081BED00
|
||||
.4byte _081BED1C
|
||||
_081BEC40:
|
||||
bl FreeAllWindowBuffers
|
||||
movs r0, 0
|
||||
movs r1, 0x7
|
||||
movs r2, 0x2
|
||||
bl SetBgAttribute
|
||||
b _081BED04
|
||||
_081BEC50:
|
||||
ldr r4, =gUnknown_0203CF04
|
||||
movs r0, 0x92
|
||||
lsls r0, 4
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
ldr r4, =gUnknown_0203CF08
|
||||
movs r0, 0x80
|
||||
lsls r0, 4
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
b _081BECD8
|
||||
.pool
|
||||
_081BEC88:
|
||||
ldr r0, =gUnknown_08617274
|
||||
ldr r4, =gUnknown_0203CF04
|
||||
ldr r1, [r4]
|
||||
movs r2, 0x92
|
||||
lsls r2, 3
|
||||
bl CpuSet
|
||||
ldr r1, [r4]
|
||||
movs r2, 0x92
|
||||
lsls r2, 4
|
||||
movs r0, 0
|
||||
movs r3, 0
|
||||
bl LoadBgTiles
|
||||
b _081BECD8
|
||||
.pool
|
||||
_081BECB0:
|
||||
ldr r0, =gUnknown_0203CF08
|
||||
ldr r1, [r0]
|
||||
movs r0, 0
|
||||
bl SetBgTilemapBuffer
|
||||
ldr r1, =gUnknown_08617B94
|
||||
movs r0, 0x6
|
||||
str r0, [sp]
|
||||
movs r0, 0xC
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0x11
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0
|
||||
movs r2, 0xC
|
||||
movs r3, 0x1D
|
||||
bl CopyToBgTilemapBufferRect_ChangePalette
|
||||
movs r0, 0
|
||||
bl CopyBgTilemapBufferToVram
|
||||
_081BECD8:
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldrh r1, [r0, 0x8]
|
||||
adds r1, 0x1
|
||||
strh r1, [r0, 0x8]
|
||||
b _081BED40
|
||||
.pool
|
||||
_081BECF8:
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
b _081BED04
|
||||
_081BED00:
|
||||
bl sub_81BEB24
|
||||
_081BED04:
|
||||
ldr r0, =gTasks
|
||||
lsls r1, r5, 2
|
||||
adds r1, r5
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
b _081BED40
|
||||
.pool
|
||||
_081BED1C:
|
||||
ldr r4, =gUnknown_0203CF14
|
||||
movs r0, 0x4
|
||||
bl Alloc
|
||||
str r0, [r4]
|
||||
movs r2, 0
|
||||
movs r1, 0x2
|
||||
strh r1, [r0]
|
||||
strh r2, [r0, 0x2]
|
||||
ldr r0, =sub_81BEBB4
|
||||
movs r1, 0xA
|
||||
bl CreateTask
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
bl EnableBothScriptContexts
|
||||
_081BED40:
|
||||
add sp, 0xC
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BEBF4
|
||||
|
||||
thumb_func_start sub_81BED50
|
||||
sub_81BED50: @ 81BED50
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x10
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r10, r0
|
||||
ldr r1, =gTasks
|
||||
lsls r0, 2
|
||||
add r0, r10
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldrh r0, [r0, 0x8]
|
||||
subs r0, 0x1
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
adds r6, r1, 0
|
||||
cmp r0, 0x7
|
||||
bls _081BED7C
|
||||
b _081BF002
|
||||
_081BED7C:
|
||||
lsls r0, 2
|
||||
ldr r1, =_081BED90
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081BED90:
|
||||
.4byte _081BEDB0
|
||||
.4byte _081BF002
|
||||
.4byte _081BEDC4
|
||||
.4byte _081BEF64
|
||||
.4byte _081BEF94
|
||||
.4byte _081BEFD0
|
||||
.4byte _081BEFF0
|
||||
.4byte _081BEFF8
|
||||
_081BEDB0:
|
||||
ldr r4, =gUnknown_0203CF10
|
||||
movs r0, 0xC0
|
||||
lsls r0, 2
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
b _081BF002
|
||||
.pool
|
||||
_081BEDC4:
|
||||
mov r1, r10
|
||||
lsls r0, r1, 2
|
||||
adds r1, r0, r1
|
||||
lsls r1, 3
|
||||
adds r2, r1, r6
|
||||
ldrh r3, [r2, 0xE]
|
||||
movs r4, 0xE
|
||||
ldrsh r1, [r2, r4]
|
||||
str r0, [sp, 0x8]
|
||||
cmp r1, 0x5F
|
||||
bgt _081BEE8A
|
||||
movs r1, 0xA
|
||||
ldrsh r0, [r2, r1]
|
||||
cmp r0, 0x1
|
||||
ble _081BEE7C
|
||||
lsls r0, r3, 24
|
||||
lsrs r4, r0, 24
|
||||
movs r0, 0x30
|
||||
bl Alloc
|
||||
ldr r3, =gUnknown_0203CF10
|
||||
ldr r1, [r3]
|
||||
lsls r2, r4, 3
|
||||
adds r1, r2, r1
|
||||
str r0, [r1]
|
||||
movs r5, 0
|
||||
adds r4, r2, 0
|
||||
_081BEDFA:
|
||||
ldr r0, [r3]
|
||||
adds r0, r4, r0
|
||||
ldr r0, [r0]
|
||||
adds r0, r5
|
||||
strb r5, [r0]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x2F
|
||||
bls _081BEDFA
|
||||
movs r5, 0
|
||||
ldr r7, =gUnknown_0203CF10
|
||||
adds r6, r2, 0
|
||||
_081BEE14:
|
||||
bl Random
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
movs r1, 0x30
|
||||
bl __umodsi3
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
bl Random
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
movs r1, 0x30
|
||||
bl __umodsi3
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, [r7]
|
||||
adds r1, r6, r1
|
||||
ldr r1, [r1]
|
||||
adds r0, r1, r0
|
||||
ldrb r2, [r0]
|
||||
adds r1, r4
|
||||
ldrb r1, [r1]
|
||||
strb r1, [r0]
|
||||
ldr r0, [r7]
|
||||
adds r0, r6, r0
|
||||
ldr r0, [r0]
|
||||
adds r0, r4
|
||||
strb r2, [r0]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0x2F
|
||||
bls _081BEE14
|
||||
ldr r0, =gTasks
|
||||
ldr r1, [sp, 0x8]
|
||||
add r1, r10
|
||||
lsls r1, 3
|
||||
adds r2, r1, r0
|
||||
ldrh r3, [r2, 0xE]
|
||||
movs r4, 0xE
|
||||
ldrsh r1, [r2, r4]
|
||||
adds r6, r0, 0
|
||||
cmp r1, 0x5F
|
||||
bgt _081BEE78
|
||||
adds r0, r3, 0x1
|
||||
strh r0, [r2, 0xE]
|
||||
_081BEE78:
|
||||
movs r0, 0
|
||||
strh r0, [r2, 0xA]
|
||||
_081BEE7C:
|
||||
ldr r1, [sp, 0x8]
|
||||
add r1, r10
|
||||
lsls r1, 3
|
||||
adds r1, r6
|
||||
ldrh r0, [r1, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0xA]
|
||||
_081BEE8A:
|
||||
ldr r0, [sp, 0x8]
|
||||
add r0, r10
|
||||
lsls r0, 3
|
||||
adds r0, r6
|
||||
ldrb r4, [r0, 0xE]
|
||||
ldrb r5, [r0, 0xC]
|
||||
lsls r0, r4, 16
|
||||
cmp r5, r4
|
||||
bcs _081BEF32
|
||||
str r0, [sp, 0xC]
|
||||
_081BEE9E:
|
||||
movs r6, 0
|
||||
adds r0, r5, 0x1
|
||||
str r0, [sp, 0x4]
|
||||
lsls r4, r5, 3
|
||||
movs r2, 0x5F
|
||||
subs r1, r2, r5
|
||||
lsls r0, r1, 1
|
||||
adds r0, r1
|
||||
lsls r0, 4
|
||||
mov r9, r0
|
||||
_081BEEB2:
|
||||
ldr r0, =gUnknown_0203CF04
|
||||
ldr r0, [r0]
|
||||
ldr r7, =gUnknown_0203CF10
|
||||
ldr r3, [r7]
|
||||
adds r3, r4, r3
|
||||
ldrb r2, [r3, 0x4]
|
||||
adds r1, r2, 0x1
|
||||
strb r1, [r3, 0x4]
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
ldr r1, [r3]
|
||||
adds r1, r2
|
||||
ldrb r1, [r1]
|
||||
add r1, r9
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
movs r2, 0x1
|
||||
mov r8, r2
|
||||
str r2, [sp]
|
||||
movs r2, 0
|
||||
movs r3, 0x30
|
||||
bl sub_81BF2B8
|
||||
adds r0, r6, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
cmp r6, 0
|
||||
beq _081BEEB2
|
||||
ldr r0, [r7]
|
||||
adds r1, r4, r0
|
||||
ldrb r0, [r1, 0x4]
|
||||
cmp r0, 0x2F
|
||||
bls _081BEF24
|
||||
ldr r0, [r1]
|
||||
bl Free
|
||||
ldr r0, [r7]
|
||||
adds r0, r4, r0
|
||||
movs r1, 0
|
||||
str r1, [r0]
|
||||
ldr r1, [sp, 0x8]
|
||||
add r1, r10
|
||||
lsls r1, 3
|
||||
ldr r4, =gTasks
|
||||
adds r1, r4
|
||||
ldrh r0, [r1, 0xC]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0xC]
|
||||
mov r0, r8
|
||||
ands r5, r0
|
||||
cmp r5, 0x1
|
||||
bne _081BEF24
|
||||
ldr r0, =gUnknown_0203CF14
|
||||
ldr r1, [r0]
|
||||
ldrh r0, [r1, 0x2]
|
||||
subs r0, 0x1
|
||||
strh r0, [r1, 0x2]
|
||||
_081BEF24:
|
||||
ldr r1, [sp, 0x4]
|
||||
lsls r0, r1, 16
|
||||
lsrs r5, r0, 16
|
||||
ldr r2, [sp, 0xC]
|
||||
lsrs r0, r2, 16
|
||||
cmp r5, r0
|
||||
bcc _081BEE9E
|
||||
_081BEF32:
|
||||
ldr r0, =gUnknown_0203CF04
|
||||
ldr r1, [r0]
|
||||
movs r2, 0x92
|
||||
lsls r2, 4
|
||||
movs r0, 0
|
||||
movs r3, 0
|
||||
bl LoadBgTiles
|
||||
ldr r0, =gUnknown_0203CF10
|
||||
ldr r0, [r0]
|
||||
movs r4, 0xBE
|
||||
lsls r4, 2
|
||||
adds r0, r4
|
||||
ldrb r0, [r0, 0x4]
|
||||
cmp r0, 0x2F
|
||||
bhi _081BF002
|
||||
b _081BF014
|
||||
.pool
|
||||
_081BEF64:
|
||||
movs r0, 0
|
||||
bl UnsetBgTilemapBuffer
|
||||
ldr r0, =sub_81BEBB4
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0xFF
|
||||
beq _081BEF7C
|
||||
bl DestroyTask
|
||||
_081BEF7C:
|
||||
ldr r0, =gUnknown_0203CF14
|
||||
ldr r1, [r0]
|
||||
movs r0, 0
|
||||
strh r0, [r1]
|
||||
strh r0, [r1, 0x2]
|
||||
bl sub_81BEB90
|
||||
b _081BF002
|
||||
.pool
|
||||
_081BEF94:
|
||||
ldr r4, =gUnknown_0203CF14
|
||||
ldr r0, [r4]
|
||||
bl Free
|
||||
movs r5, 0
|
||||
str r5, [r4]
|
||||
ldr r4, =gUnknown_0203CF10
|
||||
ldr r0, [r4]
|
||||
bl Free
|
||||
str r5, [r4]
|
||||
ldr r4, =gUnknown_0203CF04
|
||||
ldr r0, [r4]
|
||||
bl Free
|
||||
str r5, [r4]
|
||||
ldr r4, =gUnknown_0203CF08
|
||||
ldr r0, [r4]
|
||||
bl Free
|
||||
str r5, [r4]
|
||||
b _081BF002
|
||||
.pool
|
||||
_081BEFD0:
|
||||
movs r0, 0xC
|
||||
movs r1, 0x2
|
||||
bl SetGpuRegBits
|
||||
movs r0, 0x8
|
||||
movs r1, 0
|
||||
bl SetGpuRegBits
|
||||
movs r0, 0
|
||||
movs r1, 0x7
|
||||
movs r2, 0
|
||||
bl SetBgAttribute
|
||||
bl sub_81971D0
|
||||
b _081BF002
|
||||
_081BEFF0:
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
b _081BF002
|
||||
_081BEFF8:
|
||||
mov r0, r10
|
||||
bl DestroyTask
|
||||
bl EnableBothScriptContexts
|
||||
_081BF002:
|
||||
ldr r0, =gTasks
|
||||
mov r2, r10
|
||||
lsls r1, r2, 2
|
||||
add r1, r10
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
_081BF014:
|
||||
add sp, 0x10
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BED50
|
||||
|
||||
thumb_func_start sub_81BF028
|
||||
sub_81BF028: @ 81BF028
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x18
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r7, 2
|
||||
adds r0, r7
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldrh r0, [r0, 0x8]
|
||||
subs r0, 0x1
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
cmp r0, 0x7
|
||||
bls _081BF04C
|
||||
b _081BF228
|
||||
_081BF04C:
|
||||
lsls r0, 2
|
||||
ldr r1, =_081BF060
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081BF060:
|
||||
.4byte _081BF080
|
||||
.4byte _081BF0B4
|
||||
.4byte _081BF0DC
|
||||
.4byte _081BF0F0
|
||||
.4byte _081BF148
|
||||
.4byte _081BF170
|
||||
.4byte _081BF1CC
|
||||
.4byte _081BF224
|
||||
_081BF080:
|
||||
ldr r4, =gUnknown_0203CF0C
|
||||
movs r0, 0x14
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
movs r0, 0x80
|
||||
bl AllocZeroed
|
||||
ldr r1, [r4]
|
||||
str r0, [r1]
|
||||
movs r0, 0x8
|
||||
bl AllocZeroed
|
||||
ldr r1, [r4]
|
||||
str r0, [r1, 0x4]
|
||||
movs r0, 0x80
|
||||
lsls r0, 2
|
||||
bl AllocZeroed
|
||||
ldr r1, [r4]
|
||||
str r0, [r1, 0xC]
|
||||
movs r0, 0
|
||||
strh r0, [r1, 0x10]
|
||||
b _081BF228
|
||||
.pool
|
||||
_081BF0B4:
|
||||
ldr r0, =gUnknown_0203CF0C
|
||||
ldr r0, [r0]
|
||||
ldr r1, [r0]
|
||||
movs r5, 0
|
||||
ldr r2, =gUnknown_08617C44
|
||||
_081BF0BE:
|
||||
adds r0, r5, r2
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r1]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
adds r1, 0x1
|
||||
cmp r5, 0x7F
|
||||
bls _081BF0BE
|
||||
b _081BF228
|
||||
.pool
|
||||
_081BF0DC:
|
||||
ldr r0, =gUnknown_0203CF0C
|
||||
ldr r0, [r0]
|
||||
ldr r1, [r0, 0x4]
|
||||
ldr r0, [r0]
|
||||
str r0, [r1]
|
||||
movs r0, 0x80
|
||||
strh r0, [r1, 0x4]
|
||||
b _081BF228
|
||||
.pool
|
||||
_081BF0F0:
|
||||
mov r1, sp
|
||||
ldr r0, =gUnknown_08617E00
|
||||
ldm r0!, {r2-r4}
|
||||
stm r1!, {r2-r4}
|
||||
ldm r0!, {r2-r4}
|
||||
stm r1!, {r2-r4}
|
||||
ldr r4, =gUnknown_0203CF0C
|
||||
ldr r0, [r4]
|
||||
ldr r0, [r0, 0x4]
|
||||
str r0, [sp, 0xC]
|
||||
movs r2, 0x10
|
||||
negs r2, r2
|
||||
mov r0, sp
|
||||
movs r1, 0x80
|
||||
movs r3, 0x1
|
||||
bl CreateSprite
|
||||
ldr r1, [r4]
|
||||
movs r3, 0
|
||||
strb r0, [r1, 0x8]
|
||||
ldr r2, =gSprites
|
||||
ldr r0, [r4]
|
||||
ldrb r1, [r0, 0x8]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
adds r0, 0x28
|
||||
strb r3, [r0]
|
||||
ldr r3, [r4]
|
||||
ldrb r1, [r3, 0x8]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
ldrh r1, [r0, 0x20]
|
||||
strh r1, [r0, 0x2E]
|
||||
ldrb r1, [r3, 0x8]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
movs r1, 0x1
|
||||
strh r1, [r0, 0x30]
|
||||
_081BF148:
|
||||
movs r5, 0
|
||||
ldr r2, =gUnknown_0203CF0C
|
||||
_081BF14C:
|
||||
ldr r0, [r2]
|
||||
ldr r1, [r0, 0xC]
|
||||
lsls r0, r5, 1
|
||||
adds r0, r1
|
||||
strh r5, [r0]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, 0xFF
|
||||
bls _081BF14C
|
||||
b _081BF228
|
||||
.pool
|
||||
_081BF170:
|
||||
movs r5, 0
|
||||
movs r6, 0xFF
|
||||
ldr r0, =0x000001ff
|
||||
mov r8, r0
|
||||
_081BF178:
|
||||
bl Random
|
||||
adds r4, r6, 0
|
||||
ands r4, r0
|
||||
bl Random
|
||||
adds r1, r6, 0
|
||||
ands r1, r0
|
||||
ldr r0, =gUnknown_0203CF0C
|
||||
ldr r3, [r0]
|
||||
ldr r0, [r3, 0xC]
|
||||
lsls r1, 1
|
||||
adds r1, r0
|
||||
ldrh r2, [r1]
|
||||
lsls r4, 1
|
||||
adds r4, r0
|
||||
ldrh r0, [r4]
|
||||
strh r0, [r1]
|
||||
strh r2, [r4]
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r5, r0, 16
|
||||
cmp r5, r8
|
||||
bls _081BF178
|
||||
ldr r2, =gSprites
|
||||
ldrb r1, [r3, 0x8]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r2, 0x1C
|
||||
adds r0, r2
|
||||
ldr r1, =sub_81BF248
|
||||
str r1, [r0]
|
||||
b _081BF228
|
||||
.pool
|
||||
_081BF1CC:
|
||||
ldr r3, =gSprites
|
||||
ldr r5, =gUnknown_0203CF0C
|
||||
ldr r0, [r5]
|
||||
ldrb r1, [r0, 0x8]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r2, r0, 2
|
||||
adds r0, r3, 0
|
||||
adds r0, 0x1C
|
||||
adds r0, r2, r0
|
||||
ldr r1, [r0]
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
cmp r1, r0
|
||||
bne _081BF238
|
||||
adds r0, r2, r3
|
||||
bl DestroySprite
|
||||
ldr r0, [r5]
|
||||
ldr r0, [r0, 0xC]
|
||||
bl Free
|
||||
ldr r0, [r5]
|
||||
movs r4, 0
|
||||
str r4, [r0, 0xC]
|
||||
ldr r0, [r0, 0x4]
|
||||
bl Free
|
||||
ldr r0, [r5]
|
||||
str r4, [r0, 0x4]
|
||||
ldr r0, [r0]
|
||||
bl Free
|
||||
ldr r0, [r5]
|
||||
str r4, [r0]
|
||||
bl Free
|
||||
str r4, [r5]
|
||||
b _081BF228
|
||||
.pool
|
||||
_081BF224:
|
||||
bl EnableBothScriptContexts
|
||||
_081BF228:
|
||||
ldr r0, =gTasks
|
||||
lsls r1, r7, 2
|
||||
adds r1, r7
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
_081BF238:
|
||||
add sp, 0x18
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BF028
|
||||
|
||||
thumb_func_start sub_81BF248
|
||||
sub_81BF248: @ 81BF248
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x4
|
||||
adds r5, r0, 0
|
||||
ldr r0, =gUnknown_0203CF0C
|
||||
ldr r0, [r0]
|
||||
ldrh r0, [r0, 0x10]
|
||||
cmp r0, 0xFF
|
||||
bls _081BF268
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r5, 0x1C]
|
||||
b _081BF2B0
|
||||
.pool
|
||||
_081BF268:
|
||||
ldrh r1, [r5, 0x22]
|
||||
movs r2, 0x22
|
||||
ldrsh r0, [r5, r2]
|
||||
cmp r0, 0x5F
|
||||
ble _081BF2AC
|
||||
movs r4, 0
|
||||
_081BF274:
|
||||
ldr r0, =gUnknown_0203CF0C
|
||||
ldr r3, [r0]
|
||||
ldr r0, [r3]
|
||||
ldrh r1, [r3, 0x10]
|
||||
adds r2, r1, 0x1
|
||||
strh r2, [r3, 0x10]
|
||||
lsls r1, 16
|
||||
ldr r2, [r3, 0xC]
|
||||
lsrs r1, 15
|
||||
adds r1, r2
|
||||
ldrh r1, [r1]
|
||||
movs r2, 0
|
||||
str r2, [sp]
|
||||
movs r3, 0x10
|
||||
bl sub_81BF2B8
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x1
|
||||
bls _081BF274
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
bl StartSpriteAnim
|
||||
b _081BF2B0
|
||||
.pool
|
||||
_081BF2AC:
|
||||
adds r0, r1, 0x1
|
||||
strh r0, [r5, 0x22]
|
||||
_081BF2B0:
|
||||
add sp, 0x4
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81BF248
|
||||
|
||||
thumb_func_start sub_81BF2B8
|
||||
sub_81BF2B8: @ 81BF2B8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x8
|
||||
str r0, [sp]
|
||||
mov r10, r1
|
||||
adds r6, r2, 0
|
||||
mov r8, r3
|
||||
ldr r0, [sp, 0x28]
|
||||
mov r9, r0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
mov r10, r1
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
mov r0, r8
|
||||
lsls r0, 24
|
||||
mov r8, r0
|
||||
lsrs r7, r0, 24
|
||||
mov r1, r9
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r9, r1
|
||||
mov r0, r10
|
||||
adds r1, r7, 0
|
||||
bl __divsi3
|
||||
adds r5, r0, 0
|
||||
lsls r5, 24
|
||||
lsrs r4, r5, 24
|
||||
ldr r3, =gUnknown_030012A8
|
||||
strh r4, [r3]
|
||||
mov r0, r10
|
||||
adds r1, r7, 0
|
||||
str r3, [sp, 0x4]
|
||||
bl __modsi3
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r3, [sp, 0x4]
|
||||
strh r2, [r3, 0x2]
|
||||
movs r1, 0x7
|
||||
ands r4, r1
|
||||
ands r2, r1
|
||||
strh r4, [r3, 0x4]
|
||||
strh r2, [r3, 0x6]
|
||||
lsrs r0, 27
|
||||
lsrs r5, 27
|
||||
strh r0, [r3, 0x8]
|
||||
strh r5, [r3, 0xA]
|
||||
mov r1, r8
|
||||
lsrs r1, 27
|
||||
lsls r1, 6
|
||||
mov r8, r1
|
||||
mov r1, r8
|
||||
muls r1, r5
|
||||
lsls r0, 6
|
||||
adds r1, r0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
strh r1, [r3, 0xC]
|
||||
lsls r4, 3
|
||||
adds r4, r2
|
||||
adds r1, r4
|
||||
lsls r4, r1, 16
|
||||
lsrs r4, 17
|
||||
strh r1, [r3, 0xE]
|
||||
movs r1, 0x1
|
||||
mov r0, r10
|
||||
ands r1, r0
|
||||
movs r2, 0x1
|
||||
eors r1, r2
|
||||
lsls r0, r1, 2
|
||||
lsls r6, r0
|
||||
eors r1, r2
|
||||
lsls r1, 2
|
||||
movs r0, 0xF
|
||||
lsls r0, r1
|
||||
orrs r6, r0
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
mov r1, r9
|
||||
lsls r1, 5
|
||||
mov r9, r1
|
||||
add r9, r4
|
||||
ldr r1, [sp]
|
||||
add r1, r9
|
||||
ldrb r0, [r1]
|
||||
ands r6, r0
|
||||
strb r6, [r1]
|
||||
add sp, 0x8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81BF2B8
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
476
asm/international_string_util.s
Executable file
476
asm/international_string_util.s
Executable file
@ -0,0 +1,476 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start GetStringCenterAlignXOffset
|
||||
@ s32 GetStringCenterAlignXOffset(u8 fontId, u8 *str, s32 totalWidth)
|
||||
GetStringCenterAlignXOffset: @ 81DB35C
|
||||
push {lr}
|
||||
movs r3, 0
|
||||
bl GetStringCenterAlignXOffsetWithLetterSpacing
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end GetStringCenterAlignXOffset
|
||||
|
||||
thumb_func_start GetStringRightAlignXOffset
|
||||
@ s32 GetStringRightAlignXOffset(u8 fontId, u8 *str, s32 totalWidth)
|
||||
GetStringRightAlignXOffset: @ 81DB368
|
||||
push {lr}
|
||||
movs r3, 0
|
||||
bl GetStringWidthDifference
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end GetStringRightAlignXOffset
|
||||
|
||||
thumb_func_start GetStringCenterAlignXOffsetWithLetterSpacing
|
||||
@ s32 GetStringCenterAlignXOffsetWithLetterSpacing(u8 fontId, u8 *str, s32 totalWidth, s16 letterSpacing)
|
||||
GetStringCenterAlignXOffsetWithLetterSpacing: @ 81DB374
|
||||
push {lr}
|
||||
bl GetStringWidthDifference
|
||||
lsrs r1, r0, 31
|
||||
adds r0, r1
|
||||
asrs r0, 1
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end GetStringCenterAlignXOffsetWithLetterSpacing
|
||||
|
||||
thumb_func_start GetStringWidthDifference
|
||||
@ s32 GetStringWidthDifference(u8 fontId, u8 *str, s32 totalWidth, s16 letterSpacing)
|
||||
GetStringWidthDifference: @ 81DB384
|
||||
push {r4,lr}
|
||||
adds r4, r2, 0
|
||||
adds r2, r3, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r2, 16
|
||||
asrs r2, 16
|
||||
bl GetStringWidth
|
||||
cmp r4, r0
|
||||
bgt _081DB39E
|
||||
movs r0, 0
|
||||
b _081DB3A0
|
||||
_081DB39E:
|
||||
subs r0, r4, r0
|
||||
_081DB3A0:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end GetStringWidthDifference
|
||||
|
||||
thumb_func_start GetMaxWidthInMenuTable
|
||||
GetMaxWidthInMenuTable: @ 81DB3A8
|
||||
push {r4-r6,lr}
|
||||
movs r6, 0
|
||||
cmp r6, r1
|
||||
bge _081DB3CC
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
_081DB3B4:
|
||||
ldr r1, [r5]
|
||||
movs r0, 0x1
|
||||
movs r2, 0
|
||||
bl GetStringWidth
|
||||
cmp r0, r6
|
||||
ble _081DB3C4
|
||||
adds r6, r0, 0
|
||||
_081DB3C4:
|
||||
adds r5, 0x8
|
||||
subs r4, 0x1
|
||||
cmp r4, 0
|
||||
bne _081DB3B4
|
||||
_081DB3CC:
|
||||
adds r0, r6, 0
|
||||
bl convert_pixel_width_to_tile_width
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end GetMaxWidthInMenuTable
|
||||
|
||||
thumb_func_start sub_81DB3D8
|
||||
sub_81DB3D8: @ 81DB3D8
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
mov r8, r0
|
||||
adds r7, r1, 0
|
||||
adds r5, r2, 0
|
||||
movs r6, 0
|
||||
movs r4, 0
|
||||
cmp r6, r5
|
||||
bge _081DB40A
|
||||
_081DB3EC:
|
||||
adds r0, r7, r4
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 3
|
||||
add r0, r8
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x1
|
||||
movs r2, 0
|
||||
bl GetStringWidth
|
||||
cmp r0, r6
|
||||
ble _081DB404
|
||||
adds r6, r0, 0
|
||||
_081DB404:
|
||||
adds r4, 0x1
|
||||
cmp r4, r5
|
||||
blt _081DB3EC
|
||||
_081DB40A:
|
||||
adds r0, r6, 0
|
||||
bl convert_pixel_width_to_tile_width
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DB3D8
|
||||
|
||||
thumb_func_start sub_81DB41C
|
||||
sub_81DB41C: @ 81DB41C
|
||||
push {r4-r7,lr}
|
||||
adds r4, r0, 0
|
||||
ldr r1, [r4]
|
||||
movs r7, 0
|
||||
movs r6, 0
|
||||
ldrh r0, [r4, 0xC]
|
||||
cmp r7, r0
|
||||
bge _081DB44C
|
||||
adds r5, r1, 0
|
||||
_081DB42E:
|
||||
ldrb r0, [r4, 0x17]
|
||||
lsls r0, 26
|
||||
lsrs r0, 26
|
||||
ldr r1, [r5]
|
||||
movs r2, 0
|
||||
bl GetStringWidth
|
||||
cmp r0, r7
|
||||
ble _081DB442
|
||||
adds r7, r0, 0
|
||||
_081DB442:
|
||||
adds r5, 0x8
|
||||
adds r6, 0x1
|
||||
ldrh r0, [r4, 0xC]
|
||||
cmp r6, r0
|
||||
blt _081DB42E
|
||||
_081DB44C:
|
||||
ldrb r0, [r4, 0x12]
|
||||
adds r1, r7, r0
|
||||
adds r0, r1, 0
|
||||
adds r0, 0x9
|
||||
cmp r0, 0
|
||||
bge _081DB45A
|
||||
adds r0, 0x7
|
||||
_081DB45A:
|
||||
asrs r0, 3
|
||||
cmp r0, 0x1C
|
||||
ble _081DB462
|
||||
movs r0, 0x1C
|
||||
_081DB462:
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DB41C
|
||||
|
||||
thumb_func_start sub_81DB468
|
||||
sub_81DB468: @ 81DB468
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
adds r0, r1, 0
|
||||
lsls r2, 5
|
||||
ldr r1, =gPokedexEntries
|
||||
adds r2, r1
|
||||
adds r1, r2, 0
|
||||
bl StringCopy
|
||||
movs r1, 0
|
||||
strb r1, [r0]
|
||||
adds r0, 0x1
|
||||
ldr r1, =gText_Pokemon
|
||||
bl StringCopy
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DB468
|
||||
|
||||
thumb_func_start sub_81DB494
|
||||
sub_81DB494: @ 81DB494
|
||||
push {r4-r7,lr}
|
||||
adds r6, r1, 0
|
||||
adds r5, r2, 0
|
||||
adds r7, r3, 0
|
||||
cmp r5, 0
|
||||
beq _081DB4B6
|
||||
adds r1, r5, 0
|
||||
bl StringCopy
|
||||
adds r4, r0, 0
|
||||
lsls r0, r6, 24
|
||||
lsrs r0, 24
|
||||
adds r1, r5, 0
|
||||
movs r2, 0
|
||||
bl GetStringWidth
|
||||
b _081DB4BA
|
||||
_081DB4B6:
|
||||
adds r4, r0, 0
|
||||
movs r0, 0
|
||||
_081DB4BA:
|
||||
subs r3, r7, r0
|
||||
cmp r3, 0
|
||||
ble _081DB4D4
|
||||
movs r0, 0xFC
|
||||
strb r0, [r4]
|
||||
adds r4, 0x1
|
||||
movs r0, 0x11
|
||||
strb r0, [r4]
|
||||
adds r4, 0x1
|
||||
strb r3, [r4]
|
||||
adds r4, 0x1
|
||||
movs r0, 0xFF
|
||||
strb r0, [r4]
|
||||
_081DB4D4:
|
||||
adds r0, r4, 0
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DB494
|
||||
|
||||
thumb_func_start sub_81DB4DC
|
||||
sub_81DB4DC: @ 81DB4DC
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r5, r1, 24
|
||||
bl StripExtCtrlCodes
|
||||
adds r0, r4, 0
|
||||
bl StringLength
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r5, 0xFC
|
||||
bne _081DB51A
|
||||
cmp r1, 0x5
|
||||
bhi _081DB51E
|
||||
movs r3, 0xFC
|
||||
movs r2, 0x7
|
||||
_081DB4FE:
|
||||
adds r0, r4, r1
|
||||
strb r3, [r0]
|
||||
strb r2, [r0, 0x1]
|
||||
adds r0, r1, 0x2
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0x5
|
||||
bls _081DB4FE
|
||||
b _081DB51E
|
||||
_081DB510:
|
||||
adds r0, r4, r1
|
||||
strb r5, [r0]
|
||||
adds r0, r1, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
_081DB51A:
|
||||
cmp r1, 0x5
|
||||
bls _081DB510
|
||||
_081DB51E:
|
||||
adds r1, r4, r1
|
||||
movs r0, 0xFF
|
||||
strb r0, [r1]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81DB4DC
|
||||
|
||||
thumb_func_start sub_81DB52C
|
||||
sub_81DB52C: @ 81DB52C
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl StringLength
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0x5
|
||||
bhi _081DB546
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl ConvertInternationalString
|
||||
b _081DB54C
|
||||
_081DB546:
|
||||
adds r0, r4, 0
|
||||
bl StripExtCtrlCodes
|
||||
_081DB54C:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81DB52C
|
||||
|
||||
thumb_func_start sub_81DB554
|
||||
sub_81DB554: @ 81DB554
|
||||
push {r4,r5,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r5, r1, 24
|
||||
bl StringLength
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0x5
|
||||
bhi _081DB572
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl ConvertInternationalString
|
||||
b _081DB5A4
|
||||
_081DB572:
|
||||
cmp r5, 0xFC
|
||||
bne _081DB57E
|
||||
adds r0, r4, 0
|
||||
bl StripExtCtrlCodes
|
||||
b _081DB5A4
|
||||
_081DB57E:
|
||||
adds r1, r4, 0
|
||||
b _081DB584
|
||||
_081DB582:
|
||||
adds r1, 0x1
|
||||
_081DB584:
|
||||
ldrb r0, [r1, 0x1]
|
||||
cmp r0, 0xFF
|
||||
bne _081DB582
|
||||
cmp r1, r4
|
||||
bcc _081DB5A4
|
||||
ldrb r0, [r1]
|
||||
cmp r0, r5
|
||||
bne _081DB5A4
|
||||
movs r2, 0xFF
|
||||
_081DB596:
|
||||
strb r2, [r1]
|
||||
subs r1, 0x1
|
||||
cmp r1, r4
|
||||
bcc _081DB5A4
|
||||
ldrb r0, [r1]
|
||||
cmp r0, r5
|
||||
beq _081DB596
|
||||
_081DB5A4:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81DB554
|
||||
|
||||
thumb_func_start sub_81DB5AC
|
||||
sub_81DB5AC: @ 81DB5AC
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldrb r0, [r2]
|
||||
adds r2, 0x1
|
||||
cmp r0, 0xFC
|
||||
bne _081DB5E4
|
||||
ldrb r0, [r2]
|
||||
adds r2, 0x1
|
||||
cmp r0, 0x15
|
||||
bne _081DB5E4
|
||||
b _081DB5CE
|
||||
_081DB5C2:
|
||||
cmp r1, 0xFC
|
||||
bne _081DB5CC
|
||||
ldrb r0, [r2, 0x1]
|
||||
cmp r0, 0x16
|
||||
beq _081DB5E4
|
||||
_081DB5CC:
|
||||
adds r2, 0x1
|
||||
_081DB5CE:
|
||||
ldrb r1, [r2]
|
||||
adds r0, r1, 0
|
||||
cmp r0, 0xFF
|
||||
bne _081DB5C2
|
||||
movs r0, 0xFC
|
||||
strb r0, [r2]
|
||||
adds r2, 0x1
|
||||
movs r0, 0x16
|
||||
strb r0, [r2]
|
||||
movs r0, 0xFF
|
||||
strb r0, [r2, 0x1]
|
||||
_081DB5E4:
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81DB5AC
|
||||
|
||||
thumb_func_start sub_81DB5E8
|
||||
sub_81DB5E8: @ 81DB5E8
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r2, 0
|
||||
bl StringCopy
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl ConvertInternationalString
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81DB5E8
|
||||
|
||||
thumb_func_start sub_81DB604
|
||||
sub_81DB604: @ 81DB604
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldrb r0, [r1]
|
||||
cmp r0, 0xFC
|
||||
bne _081DB618
|
||||
ldrb r0, [r1, 0x1]
|
||||
cmp r0, 0x15
|
||||
bne _081DB618
|
||||
movs r0, 0x1
|
||||
b _081DB61A
|
||||
_081DB618:
|
||||
movs r0, 0x2
|
||||
_081DB61A:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DB604
|
||||
|
||||
thumb_func_start sub_81DB620
|
||||
sub_81DB620: @ 81DB620
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x4
|
||||
lsls r4, r0, 1
|
||||
adds r4, r0
|
||||
lsls r4, 2
|
||||
ldr r0, =gWindows
|
||||
adds r4, r0
|
||||
lsls r7, r3, 5
|
||||
ldrb r0, [r4, 0x3]
|
||||
lsls r6, r0, 5
|
||||
muls r2, r6
|
||||
ldr r0, [r4, 0x8]
|
||||
adds r0, r2
|
||||
lsls r1, 5
|
||||
adds r5, r0, r1
|
||||
ldr r0, [sp, 0x18]
|
||||
cmp r0, 0
|
||||
ble _081DB66C
|
||||
adds r4, r0, 0
|
||||
_081DB646:
|
||||
ldr r0, =0x11111111
|
||||
str r0, [sp]
|
||||
adds r2, r7, 0
|
||||
cmp r2, 0
|
||||
bge _081DB652
|
||||
adds r2, 0x3
|
||||
_081DB652:
|
||||
lsls r2, 9
|
||||
lsrs r2, 11
|
||||
movs r0, 0x80
|
||||
lsls r0, 17
|
||||
orrs r2, r0
|
||||
mov r0, sp
|
||||
adds r1, r5, 0
|
||||
bl CpuFastSet
|
||||
adds r5, r6
|
||||
subs r4, 0x1
|
||||
cmp r4, 0
|
||||
bne _081DB646
|
||||
_081DB66C:
|
||||
add sp, 0x4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DB620
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
468
asm/item_icon.s
Executable file
468
asm/item_icon.s
Executable file
@ -0,0 +1,468 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start AllocItemIconTemporaryBuffers
|
||||
@ bool8 AllocItemIconTemporaryBuffers()
|
||||
AllocItemIconTemporaryBuffers: @ 81AFDE4
|
||||
push {r4,r5,lr}
|
||||
ldr r5, =gUnknown_0203CEBC
|
||||
movs r0, 0x90
|
||||
lsls r0, 1
|
||||
bl Alloc
|
||||
str r0, [r5]
|
||||
cmp r0, 0
|
||||
beq _081AFE1A
|
||||
ldr r4, =gUnknown_0203CEC0
|
||||
movs r0, 0x80
|
||||
lsls r0, 2
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _081AFE14
|
||||
movs r0, 0x1
|
||||
b _081AFE1C
|
||||
.pool
|
||||
_081AFE14:
|
||||
ldr r0, [r5]
|
||||
bl Free
|
||||
_081AFE1A:
|
||||
movs r0, 0
|
||||
_081AFE1C:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end AllocItemIconTemporaryBuffers
|
||||
|
||||
thumb_func_start FreeItemIconTemporaryBuffers
|
||||
@ void FreeItemIconTemporaryBuffers()
|
||||
FreeItemIconTemporaryBuffers: @ 81AFE24
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_0203CEBC
|
||||
ldr r0, [r0]
|
||||
bl Free
|
||||
ldr r0, =gUnknown_0203CEC0
|
||||
ldr r0, [r0]
|
||||
bl Free
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end FreeItemIconTemporaryBuffers
|
||||
|
||||
thumb_func_start CopyItemIconPicTo4x4Buffer
|
||||
@ void CopyItemIconPicTo4x4Buffer(void *src, void *dest)
|
||||
CopyItemIconPicTo4x4Buffer: @ 81AFE44
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
adds r5, r1, 0
|
||||
movs r4, 0
|
||||
_081AFE4C:
|
||||
lsls r0, r4, 1
|
||||
adds r0, r4
|
||||
lsls r0, 5
|
||||
adds r0, r6, r0
|
||||
lsls r1, r4, 7
|
||||
adds r1, r5, r1
|
||||
movs r2, 0x30
|
||||
bl CpuSet
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x2
|
||||
bls _081AFE4C
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end CopyItemIconPicTo4x4Buffer
|
||||
|
||||
thumb_func_start AddItemIconObject
|
||||
@ u8 AddItemIconObject(u16 tilesTag, u16 paletteTag, u16 itemId)
|
||||
AddItemIconObject: @ 81AFE70
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x10
|
||||
lsls r0, 16
|
||||
lsrs r7, r0, 16
|
||||
lsls r1, 16
|
||||
lsrs r6, r1, 16
|
||||
lsls r2, 16
|
||||
lsrs r5, r2, 16
|
||||
bl AllocItemIconTemporaryBuffers
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081AFF28
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
bl GetItemIconPicOrPalette
|
||||
ldr r4, =gUnknown_0203CEBC
|
||||
ldr r1, [r4]
|
||||
bl LZDecompressWram
|
||||
ldr r0, [r4]
|
||||
ldr r4, =gUnknown_0203CEC0
|
||||
ldr r1, [r4]
|
||||
bl CopyItemIconPicTo4x4Buffer
|
||||
ldr r0, [r4]
|
||||
str r0, [sp]
|
||||
ldr r4, =0xffff0000
|
||||
ldr r0, [sp, 0x4]
|
||||
ands r0, r4
|
||||
movs r1, 0x80
|
||||
lsls r1, 2
|
||||
orrs r0, r1
|
||||
lsls r2, r7, 16
|
||||
ldr r1, =0x0000ffff
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
str r0, [sp, 0x4]
|
||||
mov r0, sp
|
||||
bl LoadSpriteSheet
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
bl GetItemIconPicOrPalette
|
||||
str r0, [sp, 0x8]
|
||||
add r0, sp, 0x8
|
||||
ldr r1, [r0, 0x4]
|
||||
ands r1, r4
|
||||
orrs r1, r6
|
||||
str r1, [r0, 0x4]
|
||||
bl LoadCompressedObjectPalette
|
||||
movs r0, 0x18
|
||||
bl Alloc
|
||||
adds r5, r0, 0
|
||||
ldr r0, =gUnknown_08614FF4
|
||||
adds r1, r5, 0
|
||||
movs r2, 0xC
|
||||
bl CpuSet
|
||||
strh r7, [r5]
|
||||
strh r6, [r5, 0x2]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
bl FreeItemIconTemporaryBuffers
|
||||
adds r0, r5, 0
|
||||
bl Free
|
||||
adds r0, r4, 0
|
||||
b _081AFF2A
|
||||
.pool
|
||||
_081AFF28:
|
||||
movs r0, 0x40
|
||||
_081AFF2A:
|
||||
add sp, 0x10
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end AddItemIconObject
|
||||
|
||||
thumb_func_start AddItemIconObjectWithCustomObjectTemplate
|
||||
@ u8 AddItemIconObjectWithCustomObjectTemplate(struct objtemplate *objectTemplate, u16 tilesTag, u16 paletteTag, u16 itemId)
|
||||
AddItemIconObjectWithCustomObjectTemplate: @ 81AFF34
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x10
|
||||
mov r8, r0
|
||||
lsls r1, 16
|
||||
lsrs r7, r1, 16
|
||||
lsls r2, 16
|
||||
lsrs r6, r2, 16
|
||||
lsls r3, 16
|
||||
lsrs r5, r3, 16
|
||||
bl AllocItemIconTemporaryBuffers
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081AFFEC
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
bl GetItemIconPicOrPalette
|
||||
ldr r4, =gUnknown_0203CEBC
|
||||
ldr r1, [r4]
|
||||
bl LZDecompressWram
|
||||
ldr r0, [r4]
|
||||
ldr r4, =gUnknown_0203CEC0
|
||||
ldr r1, [r4]
|
||||
bl CopyItemIconPicTo4x4Buffer
|
||||
ldr r0, [r4]
|
||||
str r0, [sp]
|
||||
ldr r4, =0xffff0000
|
||||
ldr r0, [sp, 0x4]
|
||||
ands r0, r4
|
||||
movs r1, 0x80
|
||||
lsls r1, 2
|
||||
orrs r0, r1
|
||||
lsls r2, r7, 16
|
||||
ldr r1, =0x0000ffff
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
str r0, [sp, 0x4]
|
||||
mov r0, sp
|
||||
bl LoadSpriteSheet
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
bl GetItemIconPicOrPalette
|
||||
str r0, [sp, 0x8]
|
||||
add r0, sp, 0x8
|
||||
ldr r1, [r0, 0x4]
|
||||
ands r1, r4
|
||||
orrs r1, r6
|
||||
str r1, [r0, 0x4]
|
||||
bl LoadCompressedObjectPalette
|
||||
movs r0, 0x18
|
||||
bl Alloc
|
||||
adds r5, r0, 0
|
||||
mov r0, r8
|
||||
adds r1, r5, 0
|
||||
movs r2, 0xC
|
||||
bl CpuSet
|
||||
strh r7, [r5]
|
||||
strh r6, [r5, 0x2]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
bl FreeItemIconTemporaryBuffers
|
||||
adds r0, r5, 0
|
||||
bl Free
|
||||
adds r0, r4, 0
|
||||
b _081AFFEE
|
||||
.pool
|
||||
_081AFFEC:
|
||||
movs r0, 0x40
|
||||
_081AFFEE:
|
||||
add sp, 0x10
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end AddItemIconObjectWithCustomObjectTemplate
|
||||
|
||||
thumb_func_start GetItemIconPicOrPalette
|
||||
@ u32 GetItemIconPicOrPalette(u16 itemId, u8 which)
|
||||
GetItemIconPicOrPalette: @ 81AFFFC
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
ldr r0, =0x0000ffff
|
||||
cmp r3, r0
|
||||
bne _081B0018
|
||||
ldr r3, =0x00000179
|
||||
b _081B0022
|
||||
.pool
|
||||
_081B0018:
|
||||
movs r0, 0xBC
|
||||
lsls r0, 1
|
||||
cmp r3, r0
|
||||
bls _081B0022
|
||||
movs r3, 0
|
||||
_081B0022:
|
||||
ldr r2, =gItemIconTable
|
||||
lsls r0, r1, 2
|
||||
lsls r1, r3, 3
|
||||
adds r0, r1
|
||||
adds r0, r2
|
||||
ldr r0, [r0]
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end GetItemIconPicOrPalette
|
||||
|
||||
thumb_func_start sub_81B0038
|
||||
sub_81B0038: @ 81B0038
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
ldr r4, [sp, 0x24]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r9, r1
|
||||
lsls r2, 24
|
||||
lsrs r7, r2, 24
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
str r3, [sp]
|
||||
lsls r4, 24
|
||||
lsrs r6, r4, 24
|
||||
bl reset_brm
|
||||
ldr r0, =gUnknown_0203CEC4
|
||||
mov r10, r0
|
||||
movs r0, 0x8E
|
||||
lsls r0, 2
|
||||
bl Alloc
|
||||
adds r5, r0, 0
|
||||
mov r1, r10
|
||||
str r5, [r1]
|
||||
cmp r5, 0
|
||||
bne _081B0088
|
||||
ldr r0, [sp, 0x2C]
|
||||
bl SetMainCallback2
|
||||
b _081B0194
|
||||
.pool
|
||||
_081B0088:
|
||||
ldr r3, =gUnknown_0203CEC8
|
||||
movs r1, 0xF
|
||||
mov r4, r8
|
||||
ands r1, r4
|
||||
ldrb r2, [r3, 0x8]
|
||||
movs r0, 0x10
|
||||
negs r0, r0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r3, 0x8]
|
||||
ldr r0, [sp, 0x2C]
|
||||
str r0, [r3]
|
||||
movs r4, 0
|
||||
strb r7, [r3, 0xB]
|
||||
lsls r2, r6, 2
|
||||
ldrh r1, [r5, 0xA]
|
||||
movs r0, 0x3
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
strh r0, [r5, 0xA]
|
||||
ldr r0, [sp, 0x28]
|
||||
str r0, [r5]
|
||||
str r4, [r5, 0x4]
|
||||
ldrb r1, [r5, 0x8]
|
||||
movs r0, 0xF
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r5, 0x8]
|
||||
mov r1, r10
|
||||
ldr r2, [r1]
|
||||
ldrh r0, [r2, 0x8]
|
||||
movs r4, 0xFE
|
||||
lsls r4, 3
|
||||
adds r1, r4, 0
|
||||
orrs r0, r1
|
||||
strh r0, [r2, 0x8]
|
||||
ldr r0, [r2, 0x8]
|
||||
movs r1, 0xFE
|
||||
lsls r1, 10
|
||||
orrs r0, r1
|
||||
str r0, [r2, 0x8]
|
||||
adds r6, r3, 0
|
||||
mov r5, r8
|
||||
cmp r5, 0x4
|
||||
bne _081B00F0
|
||||
ldrb r0, [r2, 0x8]
|
||||
movs r1, 0x1
|
||||
orrs r0, r1
|
||||
b _081B00F8
|
||||
.pool
|
||||
_081B00F0:
|
||||
ldrb r1, [r2, 0x8]
|
||||
movs r0, 0x2
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
_081B00F8:
|
||||
strb r0, [r2, 0x8]
|
||||
mov r0, r9
|
||||
cmp r0, 0xFF
|
||||
beq _081B0114
|
||||
movs r0, 0x3
|
||||
mov r1, r9
|
||||
ands r0, r1
|
||||
lsls r0, 4
|
||||
ldrb r2, [r6, 0x8]
|
||||
movs r1, 0x31
|
||||
negs r1, r1
|
||||
ands r1, r2
|
||||
orrs r1, r0
|
||||
strb r1, [r6, 0x8]
|
||||
_081B0114:
|
||||
movs r2, 0
|
||||
ldr r5, =gUnknown_0203CEC4
|
||||
movs r4, 0x86
|
||||
lsls r4, 2
|
||||
movs r3, 0
|
||||
_081B011E:
|
||||
ldr r0, [r5]
|
||||
lsls r1, r2, 1
|
||||
adds r0, r4
|
||||
adds r0, r1
|
||||
strh r3, [r0]
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
cmp r2, 0xF
|
||||
bls _081B011E
|
||||
movs r2, 0
|
||||
ldr r4, =gUnknown_0203CEC4
|
||||
movs r3, 0xFF
|
||||
_081B0138:
|
||||
ldr r0, [r4]
|
||||
adds r0, 0xC
|
||||
adds r0, r2
|
||||
ldrb r1, [r0]
|
||||
orrs r1, r3
|
||||
strb r1, [r0]
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
cmp r2, 0x2
|
||||
bls _081B0138
|
||||
ldr r4, [sp]
|
||||
cmp r4, 0
|
||||
bne _081B015C
|
||||
strb r4, [r6, 0x9]
|
||||
b _081B017E
|
||||
.pool
|
||||
_081B015C:
|
||||
adds r1, r6, 0
|
||||
movs r0, 0x9
|
||||
ldrsb r0, [r1, r0]
|
||||
cmp r0, 0x5
|
||||
bgt _081B017A
|
||||
adds r1, r0, 0
|
||||
movs r0, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0xB
|
||||
bl GetMonData
|
||||
cmp r0, 0
|
||||
bne _081B017E
|
||||
_081B017A:
|
||||
movs r0, 0
|
||||
strb r0, [r6, 0x9]
|
||||
_081B017E:
|
||||
ldr r2, =gTextFlags
|
||||
ldrb r1, [r2]
|
||||
movs r0, 0x5
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r2]
|
||||
bl CalculatePlayerPartyCount
|
||||
ldr r0, =c2_811EBD0
|
||||
bl SetMainCallback2
|
||||
_081B0194:
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81B0038
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
6452
asm/item_menu.s
Executable file
6452
asm/item_menu.s
Executable file
File diff suppressed because it is too large
Load Diff
637
asm/item_menu_icons.s
Executable file
637
asm/item_menu_icons.s
Executable file
@ -0,0 +1,637 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start RemoveBagObject
|
||||
@ void RemoveBagObject(u8 a1)
|
||||
RemoveBagObject: @ 80D4CA8
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r2, =0x00000804
|
||||
adds r1, r4, r2
|
||||
ldr r0, [r0]
|
||||
adds r5, r0, r1
|
||||
ldrb r0, [r5]
|
||||
cmp r0, 0xFF
|
||||
beq _080D4CEE
|
||||
adds r4, 0x64
|
||||
adds r0, r4, 0
|
||||
bl FreeSpriteTilesByTag
|
||||
adds r0, r4, 0
|
||||
bl FreeSpritePaletteByTag
|
||||
ldrb r1, [r5]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r4, =gSprites
|
||||
adds r0, r4
|
||||
bl FreeSpriteOamMatrix
|
||||
ldrb r1, [r5]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r4
|
||||
bl DestroySprite
|
||||
movs r0, 0xFF
|
||||
strb r0, [r5]
|
||||
_080D4CEE:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end RemoveBagObject
|
||||
|
||||
thumb_func_start AddBagVisualObject
|
||||
@ void AddBagVisualObject(u8 bagPocketId)
|
||||
AddBagVisualObject: @ 80D4D00
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r4, [r0]
|
||||
ldr r0, =0x00000804
|
||||
adds r4, r0
|
||||
ldr r0, =gUnknown_0857FB4C
|
||||
movs r1, 0x44
|
||||
movs r2, 0x42
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
strb r0, [r4]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
bl SetBagVisualPocketId
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end AddBagVisualObject
|
||||
|
||||
thumb_func_start SetBagVisualPocketId
|
||||
@ void SetBagVisualPocketId(u8 bagPocketId, bool8 isSwitchingPockets)
|
||||
SetBagVisualPocketId: @ 80D4D38
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r3, r0, 24
|
||||
lsls r1, 24
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r0, [r0]
|
||||
ldr r2, =0x00000804
|
||||
adds r0, r2
|
||||
ldrb r2, [r0]
|
||||
lsls r0, r2, 4
|
||||
adds r0, r2
|
||||
lsls r0, 2
|
||||
ldr r2, =gSprites
|
||||
adds r2, r0, r2
|
||||
cmp r1, 0
|
||||
beq _080D4D84
|
||||
ldr r0, =0x0000fffb
|
||||
strh r0, [r2, 0x26]
|
||||
ldr r0, =ObjectCB_BagVisualSwitchingPockets
|
||||
str r0, [r2, 0x1C]
|
||||
adds r0, r3, 0x1
|
||||
strh r0, [r2, 0x2E]
|
||||
adds r0, r2, 0
|
||||
movs r1, 0
|
||||
bl StartSpriteAnim
|
||||
b _080D4D90
|
||||
.pool
|
||||
_080D4D84:
|
||||
adds r1, r3, 0x1
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r2, 0
|
||||
bl StartSpriteAnim
|
||||
_080D4D90:
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end SetBagVisualPocketId
|
||||
|
||||
thumb_func_start ObjectCB_BagVisualSwitchingPockets
|
||||
@ void ObjectCB_BagVisualSwitchingPockets(struct obj *object)
|
||||
ObjectCB_BagVisualSwitchingPockets: @ 80D4D94
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldrh r1, [r4, 0x26]
|
||||
movs r2, 0x26
|
||||
ldrsh r0, [r4, r2]
|
||||
cmp r0, 0
|
||||
beq _080D4DA8
|
||||
adds r0, r1, 0x1
|
||||
strh r0, [r4, 0x26]
|
||||
b _080D4DB8
|
||||
_080D4DA8:
|
||||
ldrh r1, [r4, 0x2E]
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl StartSpriteAnim
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r4, 0x1C]
|
||||
_080D4DB8:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end ObjectCB_BagVisualSwitchingPockets
|
||||
|
||||
thumb_func_start ShakeBagVisual
|
||||
@ void ShakeBagVisual()
|
||||
ShakeBagVisual: @ 80D4DC4
|
||||
push {r4,lr}
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000804
|
||||
adds r0, r1
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gSprites
|
||||
adds r4, r0, r1
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x3F
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x20
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080D4DF4
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl StartSpriteAffineAnim
|
||||
ldr r0, =ObjectCB_ShakeBagVisual
|
||||
str r0, [r4, 0x1C]
|
||||
_080D4DF4:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end ShakeBagVisual
|
||||
|
||||
thumb_func_start ObjectCB_ShakeBagVisual
|
||||
@ void ObjectCB_ShakeBagVisual(struct obj *object)
|
||||
ObjectCB_ShakeBagVisual: @ 80D4E0C
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
adds r0, 0x3F
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x20
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080D4E28
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl StartSpriteAffineAnim
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r4, 0x1C]
|
||||
_080D4E28:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end ObjectCB_ShakeBagVisual
|
||||
|
||||
thumb_func_start AddSwitchPocketRotatingBallObject
|
||||
@ void AddSwitchPocketRotatingBallObject(u16 rotationDirection)
|
||||
AddSwitchPocketRotatingBallObject: @ 80D4E34
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
lsls r5, 16
|
||||
lsrs r5, 16
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r4, [r0]
|
||||
ldr r0, =0x00000805
|
||||
adds r4, r0
|
||||
ldr r0, =gUnknown_0857FBA0
|
||||
bl LoadSpriteSheet
|
||||
ldr r0, =gUnknown_0857FBA8
|
||||
bl LoadSpritePalette
|
||||
ldr r0, =gUnknown_0857FBB0
|
||||
movs r1, 0x10
|
||||
movs r2, 0x10
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
strb r0, [r4]
|
||||
ldr r2, =gSprites
|
||||
ldrb r1, [r4]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
strh r5, [r0, 0x2E]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end AddSwitchPocketRotatingBallObject
|
||||
|
||||
thumb_func_start update_switch_pocket_rotating_ball_coords
|
||||
@ void update_switch_pocket_rotating_ball_coords(struct obj *object)
|
||||
update_switch_pocket_rotating_ball_coords: @ 80D4E8C
|
||||
ldrh r2, [r0, 0x30]
|
||||
ldrh r1, [r0, 0x34]
|
||||
adds r1, 0x1
|
||||
movs r3, 0x1
|
||||
ands r1, r3
|
||||
subs r2, r1
|
||||
adds r1, r0, 0
|
||||
adds r1, 0x28
|
||||
strb r2, [r1]
|
||||
ldrh r2, [r0, 0x30]
|
||||
ldrh r1, [r0, 0x34]
|
||||
adds r1, 0x1
|
||||
ands r1, r3
|
||||
subs r2, r1
|
||||
adds r0, 0x29
|
||||
strb r2, [r0]
|
||||
bx lr
|
||||
thumb_func_end update_switch_pocket_rotating_ball_coords
|
||||
|
||||
thumb_func_start ObjectCB_SwitchPocketRotatingBallInit
|
||||
@ void ObjectCB_SwitchPocketRotatingBallInit(struct obj *object)
|
||||
ObjectCB_SwitchPocketRotatingBallInit: @ 80D4EB0
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldrb r1, [r4, 0x1]
|
||||
movs r0, 0x4
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
movs r1, 0x1
|
||||
orrs r0, r1
|
||||
strb r0, [r4, 0x1]
|
||||
movs r0, 0x2E
|
||||
ldrsh r1, [r4, r0]
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
cmp r1, r0
|
||||
bne _080D4ED8
|
||||
ldr r0, =gUnknown_0857FB98
|
||||
b _080D4EDA
|
||||
.pool
|
||||
_080D4ED8:
|
||||
ldr r0, =gUnknown_0857FB9C
|
||||
_080D4EDA:
|
||||
str r0, [r4, 0x10]
|
||||
adds r0, r4, 0
|
||||
bl InitSpriteAffineAnim
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x28
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
strh r0, [r4, 0x30]
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x29
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
strh r0, [r4, 0x30]
|
||||
adds r0, r4, 0
|
||||
bl update_switch_pocket_rotating_ball_coords
|
||||
ldr r0, =ObjectCB_SwitchPocketRotatingBallContinue
|
||||
str r0, [r4, 0x1C]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end ObjectCB_SwitchPocketRotatingBallInit
|
||||
|
||||
thumb_func_start ObjectCB_SwitchPocketRotatingBallContinue
|
||||
@ void ObjectCB_SwitchPocketRotatingBallContinue(struct obj *object)
|
||||
ObjectCB_SwitchPocketRotatingBallContinue: @ 80D4F14
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldrh r0, [r4, 0x34]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x34]
|
||||
adds r0, r4, 0
|
||||
bl update_switch_pocket_rotating_ball_coords
|
||||
movs r1, 0x34
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0x10
|
||||
bne _080D4F32
|
||||
movs r0, 0x1
|
||||
bl RemoveBagObject
|
||||
_080D4F32:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end ObjectCB_SwitchPocketRotatingBallContinue
|
||||
|
||||
thumb_func_start AddBagItemIconObject
|
||||
@ void AddBagItemIconObject(u16 itemId, u8 a2)
|
||||
AddBagItemIconObject: @ 80D4F38
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
lsls r1, 24
|
||||
lsrs r4, r1, 24
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r2, =0x00000806
|
||||
adds r1, r4, r2
|
||||
ldr r0, [r0]
|
||||
adds r5, r0, r1
|
||||
ldrb r0, [r5]
|
||||
cmp r0, 0xFF
|
||||
bne _080D4F86
|
||||
adds r4, 0x66
|
||||
adds r0, r4, 0
|
||||
bl FreeSpriteTilesByTag
|
||||
adds r0, r4, 0
|
||||
bl FreeSpritePaletteByTag
|
||||
adds r0, r4, 0
|
||||
adds r1, r4, 0
|
||||
adds r2, r6, 0
|
||||
bl AddItemIconObject
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0x40
|
||||
beq _080D4F86
|
||||
strb r2, [r5]
|
||||
ldr r1, =gSprites
|
||||
lsls r0, r2, 4
|
||||
adds r0, r2
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
movs r1, 0x18
|
||||
strh r1, [r0, 0x24]
|
||||
movs r1, 0x58
|
||||
strh r1, [r0, 0x26]
|
||||
_080D4F86:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end AddBagItemIconObject
|
||||
|
||||
thumb_func_start RemoveBagItemIconObject
|
||||
@ void RemoveBagItemIconObject(u8 a1)
|
||||
RemoveBagItemIconObject: @ 80D4F98
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
movs r1, 0x80
|
||||
lsls r1, 18
|
||||
adds r0, r1
|
||||
lsrs r0, 24
|
||||
bl RemoveBagObject
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end RemoveBagItemIconObject
|
||||
|
||||
thumb_func_start sub_80D4FAC
|
||||
sub_80D4FAC: @ 80D4FAC
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000808
|
||||
adds r0, r1
|
||||
movs r1, 0x8
|
||||
bl sub_8122344
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D4FAC
|
||||
|
||||
thumb_func_start sub_80D4FC8
|
||||
sub_80D4FC8: @ 80D4FC8
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000808
|
||||
adds r0, r1
|
||||
movs r1, 0x8
|
||||
bl sub_81223FC
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D4FC8
|
||||
|
||||
thumb_func_start sub_80D4FEC
|
||||
sub_80D4FEC: @ 80D4FEC
|
||||
push {lr}
|
||||
adds r3, r0, 0
|
||||
lsls r3, 24
|
||||
ldr r0, =gUnknown_0203CE54
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000808
|
||||
adds r0, r1
|
||||
lsrs r3, 4
|
||||
movs r1, 0x80
|
||||
lsls r1, 13
|
||||
adds r3, r1
|
||||
lsrs r3, 16
|
||||
movs r1, 0x88
|
||||
movs r2, 0x78
|
||||
bl sub_8122448
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D4FEC
|
||||
|
||||
thumb_func_start sub_80D5018
|
||||
sub_80D5018: @ 80D5018
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
adds r6, r0, 0
|
||||
adds r4, r1, 0
|
||||
movs r2, 0x80
|
||||
lsls r2, 4
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl memset
|
||||
movs r0, 0x80
|
||||
lsls r0, 1
|
||||
adds r4, r0
|
||||
movs r7, 0
|
||||
_080D5036:
|
||||
adds r4, 0x20
|
||||
movs r5, 0
|
||||
adds r1, r7, 0x1
|
||||
mov r8, r1
|
||||
_080D503E:
|
||||
adds r0, r4, 0
|
||||
adds r1, r6, 0
|
||||
movs r2, 0x20
|
||||
bl memcpy
|
||||
adds r4, 0x20
|
||||
adds r6, 0x20
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
cmp r5, 0x5
|
||||
bls _080D503E
|
||||
cmp r7, 0x5
|
||||
beq _080D505C
|
||||
adds r4, 0x20
|
||||
_080D505C:
|
||||
mov r1, r8
|
||||
lsls r0, r1, 24
|
||||
lsrs r7, r0, 24
|
||||
cmp r7, 0x5
|
||||
bls _080D5036
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D5018
|
||||
|
||||
thumb_func_start sub_80D5070
|
||||
sub_80D5070: @ 80D5070
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x8
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
adds r4, r0, 0
|
||||
cmp r4, 0x2A
|
||||
bne _080D5082
|
||||
bl IsEnigmaBerryValid
|
||||
_080D5082:
|
||||
ldr r5, =gBerryPicTable
|
||||
lsls r4, 3
|
||||
adds r0, r5, 0x4
|
||||
adds r0, r4, r0
|
||||
ldr r0, [r0]
|
||||
str r0, [sp]
|
||||
ldr r1, =0xffff0000
|
||||
ldr r0, [sp, 0x4]
|
||||
ands r0, r1
|
||||
ldr r1, =0x00007544
|
||||
orrs r0, r1
|
||||
str r0, [sp, 0x4]
|
||||
mov r0, sp
|
||||
bl LoadCompressedObjectPalette
|
||||
adds r4, r5
|
||||
ldr r0, [r4]
|
||||
ldr r4, =0x0201d000
|
||||
adds r1, r4, 0
|
||||
bl LZDecompressWram
|
||||
ldr r0, =0xfffff000
|
||||
adds r1, r4, r0
|
||||
adds r0, r4, 0
|
||||
bl sub_80D5018
|
||||
add sp, 0x8
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D5070
|
||||
|
||||
thumb_func_start sub_80D50D4
|
||||
sub_80D50D4: @ 80D50D4
|
||||
push {r4,r5,lr}
|
||||
adds r4, r1, 0
|
||||
adds r5, r2, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
lsls r5, 16
|
||||
lsrs r5, 16
|
||||
bl sub_80D5070
|
||||
ldr r0, =gUnknown_0857FBEC
|
||||
lsls r4, 16
|
||||
asrs r4, 16
|
||||
lsls r5, 16
|
||||
asrs r5, 16
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D50D4
|
||||
|
||||
thumb_func_start sub_80D510C
|
||||
sub_80D510C: @ 80D510C
|
||||
push {lr}
|
||||
ldr r0, =0x00007544
|
||||
bl FreeSpritePaletteByTag
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D510C
|
||||
|
||||
thumb_func_start sub_80D511C
|
||||
sub_80D511C: @ 80D511C
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r6, r2, 0
|
||||
mov r8, r3
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
mov r0, r8
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
ldr r0, =0x00007544
|
||||
bl FreeSpritePaletteByTag
|
||||
adds r0, r4, 0
|
||||
bl sub_80D5070
|
||||
ldr r0, =gUnknown_0857FC7C
|
||||
adds r1, r5, 0
|
||||
adds r2, r6, 0
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
adds r4, r1, 0
|
||||
mov r0, r8
|
||||
cmp r0, 0x1
|
||||
bne _080D5172
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gSprites
|
||||
adds r0, r1
|
||||
movs r1, 0x1
|
||||
bl StartSpriteAffineAnim
|
||||
_080D5172:
|
||||
adds r0, r4, 0
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D511C
|
||||
|
||||
thumb_func_start sub_80D518C
|
||||
sub_80D518C: @ 80D518C
|
||||
push {lr}
|
||||
adds r1, r0, 0
|
||||
ldr r0, =gUnknown_0857FE10
|
||||
lsls r1, 16
|
||||
asrs r1, 16
|
||||
movs r2, 0x74
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D518C
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
1646
asm/learn_move.s
Executable file
1646
asm/learn_move.s
Executable file
File diff suppressed because it is too large
Load Diff
1643
asm/list_menu.s
Executable file
1643
asm/list_menu.s
Executable file
File diff suppressed because it is too large
Load Diff
589
asm/mail_data.s
Executable file
589
asm/mail_data.s
Executable file
@ -0,0 +1,589 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start ClearMailData
|
||||
ClearMailData: @ 80D436C
|
||||
push {r4,r5,lr}
|
||||
movs r4, 0
|
||||
ldr r5, =gSaveBlock1Ptr
|
||||
_080D4372:
|
||||
lsls r1, r4, 3
|
||||
adds r1, r4
|
||||
lsls r1, 2
|
||||
ldr r0, =0x00002be0
|
||||
adds r1, r0
|
||||
ldr r0, [r5]
|
||||
adds r0, r1
|
||||
bl sub_80D439C
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0xF
|
||||
bls _080D4372
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end ClearMailData
|
||||
|
||||
thumb_func_start sub_80D439C
|
||||
sub_80D439C: @ 80D439C
|
||||
push {r4-r6,lr}
|
||||
adds r3, r0, 0
|
||||
ldr r0, =0x0000ffff
|
||||
adds r4, r0, 0
|
||||
adds r1, r3, 0
|
||||
movs r2, 0x8
|
||||
_080D43A8:
|
||||
ldrh r0, [r1]
|
||||
orrs r0, r4
|
||||
strh r0, [r1]
|
||||
adds r1, 0x2
|
||||
subs r2, 0x1
|
||||
cmp r2, 0
|
||||
bge _080D43A8
|
||||
movs r2, 0
|
||||
adds r6, r3, 0
|
||||
adds r6, 0x1A
|
||||
adds r4, r3, 0
|
||||
adds r4, 0x12
|
||||
movs r5, 0xFF
|
||||
_080D43C2:
|
||||
adds r1, r4, r2
|
||||
ldrb r0, [r1]
|
||||
orrs r0, r5
|
||||
strb r0, [r1]
|
||||
adds r2, 0x1
|
||||
cmp r2, 0x7
|
||||
ble _080D43C2
|
||||
adds r1, r6, 0
|
||||
movs r2, 0
|
||||
adds r0, r1, 0x3
|
||||
_080D43D6:
|
||||
strb r2, [r0]
|
||||
subs r0, 0x1
|
||||
cmp r0, r1
|
||||
bge _080D43D6
|
||||
movs r1, 0
|
||||
movs r0, 0x1
|
||||
strh r0, [r3, 0x1E]
|
||||
strh r1, [r3, 0x20]
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D439C
|
||||
|
||||
thumb_func_start sub_80D43F0
|
||||
sub_80D43F0: @ 80D43F0
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
movs r1, 0xC
|
||||
bl GetMonData
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl itemid_is_mail
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080D4418
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x40
|
||||
bl GetMonData
|
||||
cmp r0, 0xFF
|
||||
beq _080D4418
|
||||
movs r0, 0x1
|
||||
b _080D441A
|
||||
_080D4418:
|
||||
movs r0, 0
|
||||
_080D441A:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D43F0
|
||||
|
||||
thumb_func_start sub_80D4420
|
||||
sub_80D4420: @ 80D4420
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0xC
|
||||
mov r8, r0
|
||||
lsls r1, 16
|
||||
lsrs r0, r1, 16
|
||||
str r0, [sp, 0x8]
|
||||
mov r0, sp
|
||||
movs r2, 0
|
||||
ldrb r3, [r0, 0x8]
|
||||
strb r3, [r0]
|
||||
lsrs r1, 24
|
||||
strb r1, [r0, 0x1]
|
||||
add r3, sp, 0x4
|
||||
strb r2, [r3]
|
||||
ldr r4, =gSaveBlock1Ptr
|
||||
mov r10, r4
|
||||
mov r9, r3
|
||||
adds r4, r3, 0
|
||||
_080D444C:
|
||||
mov r1, r10
|
||||
ldr r0, [r1]
|
||||
ldrb r2, [r4]
|
||||
lsls r1, r2, 3
|
||||
adds r1, r2
|
||||
lsls r1, 2
|
||||
adds r0, r1
|
||||
movs r1, 0xB0
|
||||
lsls r1, 6
|
||||
adds r0, r1
|
||||
ldrh r0, [r0]
|
||||
cmp r0, 0
|
||||
beq _080D4468
|
||||
b _080D45A8
|
||||
_080D4468:
|
||||
movs r4, 0
|
||||
ldr r2, =gSaveBlock2Ptr
|
||||
mov r12, r2
|
||||
ldr r7, =gSaveBlock1Ptr
|
||||
add r5, sp, 0x4
|
||||
ldr r3, =0x0000ffff
|
||||
adds r6, r3, 0
|
||||
_080D4476:
|
||||
ldr r2, [r7]
|
||||
lsls r3, r4, 1
|
||||
ldrb r1, [r5]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r3, r0
|
||||
ldr r0, =0x00002be0
|
||||
adds r2, r0
|
||||
adds r2, r3
|
||||
ldrh r0, [r2]
|
||||
orrs r0, r6
|
||||
strh r0, [r2]
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x8
|
||||
bls _080D4476
|
||||
movs r4, 0
|
||||
ldr r5, =gSaveBlock1Ptr
|
||||
add r3, sp, 0x4
|
||||
_080D44A0:
|
||||
ldr r2, [r5]
|
||||
ldrb r1, [r3]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r4, r0
|
||||
ldr r1, =0x00002bf2
|
||||
adds r2, r1
|
||||
adds r2, r0
|
||||
mov r1, r12
|
||||
ldr r0, [r1]
|
||||
adds r0, r4
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r2]
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x6
|
||||
bls _080D44A0
|
||||
mov r3, r10
|
||||
ldr r2, [r3]
|
||||
mov r0, r9
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r4, r0
|
||||
ldr r1, =0x00002bf2
|
||||
adds r2, r1
|
||||
adds r2, r0
|
||||
movs r0, 0xFF
|
||||
strb r0, [r2]
|
||||
mov r2, r9
|
||||
ldrb r1, [r2]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, [r3]
|
||||
adds r0, r1
|
||||
ldr r3, =0x00002bf2
|
||||
adds r0, r3
|
||||
movs r1, 0
|
||||
bl sub_81DB4DC
|
||||
movs r4, 0
|
||||
ldr r6, =gSaveBlock1Ptr
|
||||
add r3, sp, 0x4
|
||||
ldr r5, =gSaveBlock2Ptr
|
||||
_080D4500:
|
||||
ldr r2, [r6]
|
||||
ldrb r1, [r3]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r4, r0
|
||||
ldr r1, =0x00002bfa
|
||||
adds r2, r1
|
||||
adds r2, r0
|
||||
ldr r0, [r5]
|
||||
adds r0, 0xA
|
||||
adds r0, r4
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r2]
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x3
|
||||
bls _080D4500
|
||||
mov r0, r8
|
||||
movs r1, 0xB
|
||||
bl GetBoxMonData
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
mov r0, r8
|
||||
movs r1, 0
|
||||
bl GetBoxMonData
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
bl sub_80D45C8
|
||||
mov r2, r10
|
||||
ldr r3, [r2]
|
||||
mov r4, r9
|
||||
ldrb r2, [r4]
|
||||
lsls r1, r2, 3
|
||||
adds r1, r2
|
||||
lsls r1, 2
|
||||
adds r1, r3, r1
|
||||
ldr r2, =0x00002bfe
|
||||
adds r1, r2
|
||||
strh r0, [r1]
|
||||
ldrb r1, [r4]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r3, r0
|
||||
movs r4, 0xB0
|
||||
lsls r4, 6
|
||||
adds r3, r4
|
||||
mov r0, sp
|
||||
ldrh r0, [r0, 0x8]
|
||||
strh r0, [r3]
|
||||
mov r0, r8
|
||||
movs r1, 0x40
|
||||
mov r2, r9
|
||||
bl SetMonData
|
||||
mov r0, r8
|
||||
movs r1, 0xC
|
||||
mov r2, sp
|
||||
bl SetMonData
|
||||
mov r1, r9
|
||||
ldrb r0, [r1]
|
||||
b _080D45B6
|
||||
.pool
|
||||
_080D45A8:
|
||||
adds r0, r2, 0x1
|
||||
strb r0, [r3]
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0x5
|
||||
bhi _080D45B4
|
||||
b _080D444C
|
||||
_080D45B4:
|
||||
movs r0, 0xFF
|
||||
_080D45B6:
|
||||
add sp, 0xC
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D4420
|
||||
|
||||
thumb_func_start sub_80D45C8
|
||||
sub_80D45C8: @ 80D45C8
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0xC9
|
||||
bne _080D45E0
|
||||
adds r0, r1, 0
|
||||
bl mon_icon_personality_to_unown_id
|
||||
lsls r0, 16
|
||||
ldr r1, =0x75300000
|
||||
adds r0, r1
|
||||
lsrs r0, 16
|
||||
_080D45E0:
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D45C8
|
||||
|
||||
thumb_func_start sub_80D45E8
|
||||
sub_80D45E8: @ 80D45E8
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
ldr r0, =0xffff8ad0
|
||||
adds r2, r3, r0
|
||||
lsls r0, r2, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0x1B
|
||||
bhi _080D4604
|
||||
movs r0, 0xC9
|
||||
strh r2, [r1]
|
||||
b _080D4606
|
||||
.pool
|
||||
_080D4604:
|
||||
adds r0, r3, 0
|
||||
_080D4606:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D45E8
|
||||
|
||||
thumb_func_start sub_80D460C
|
||||
sub_80D460C: @ 80D460C
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x8
|
||||
adds r6, r0, 0
|
||||
adds r7, r1, 0
|
||||
ldrh r5, [r7, 0x20]
|
||||
adds r1, r5, 0
|
||||
bl sub_80D4420
|
||||
add r4, sp, 0x4
|
||||
strb r0, [r4]
|
||||
ldrb r2, [r4]
|
||||
cmp r2, 0xFF
|
||||
beq _080D4670
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r1, [r0]
|
||||
lsls r0, r2, 3
|
||||
adds r0, r2
|
||||
lsls r0, 2
|
||||
adds r1, r0
|
||||
ldr r0, =0x00002be0
|
||||
adds r1, r0
|
||||
adds r0, r7, 0
|
||||
ldm r0!, {r2,r3,r7}
|
||||
stm r1!, {r2,r3,r7}
|
||||
ldm r0!, {r2,r3,r7}
|
||||
stm r1!, {r2,r3,r7}
|
||||
ldm r0!, {r2,r3,r7}
|
||||
stm r1!, {r2,r3,r7}
|
||||
adds r0, r6, 0
|
||||
movs r1, 0x40
|
||||
adds r2, r4, 0
|
||||
bl SetMonData
|
||||
mov r0, sp
|
||||
strb r5, [r0]
|
||||
mov r1, sp
|
||||
lsrs r0, r5, 8
|
||||
strb r0, [r1, 0x1]
|
||||
adds r0, r6, 0
|
||||
movs r1, 0xC
|
||||
mov r2, sp
|
||||
bl SetMonData
|
||||
ldrb r0, [r4]
|
||||
b _080D4672
|
||||
.pool
|
||||
_080D4670:
|
||||
movs r0, 0xFF
|
||||
_080D4672:
|
||||
add sp, 0x8
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D460C
|
||||
|
||||
thumb_func_start sub_80D467C
|
||||
sub_80D467C: @ 80D467C
|
||||
movs r0, 0
|
||||
bx lr
|
||||
thumb_func_end sub_80D467C
|
||||
|
||||
thumb_func_start sub_80D4680
|
||||
sub_80D4680: @ 80D4680
|
||||
push {r4,lr}
|
||||
sub sp, 0x8
|
||||
adds r4, r0, 0
|
||||
bl sub_80D43F0
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080D46D2
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x40
|
||||
bl GetMonData
|
||||
add r2, sp, 0x4
|
||||
strb r0, [r2]
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r3, [r0]
|
||||
ldrb r1, [r2]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r3, r0
|
||||
movs r0, 0xB0
|
||||
lsls r0, 6
|
||||
adds r3, r0
|
||||
movs r1, 0
|
||||
movs r0, 0
|
||||
strh r0, [r3]
|
||||
movs r0, 0xFF
|
||||
strb r0, [r2]
|
||||
mov r0, sp
|
||||
strb r1, [r0]
|
||||
strb r1, [r0, 0x1]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x40
|
||||
bl SetMonData
|
||||
adds r0, r4, 0
|
||||
movs r1, 0xC
|
||||
mov r2, sp
|
||||
bl SetMonData
|
||||
_080D46D2:
|
||||
add sp, 0x8
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D4680
|
||||
|
||||
thumb_func_start sub_80D46E0
|
||||
sub_80D46E0: @ 80D46E0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =gSaveBlock1Ptr
|
||||
ldr r2, [r1]
|
||||
lsls r1, r0, 3
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
adds r2, r1
|
||||
movs r0, 0xB0
|
||||
lsls r0, 6
|
||||
adds r2, r0
|
||||
movs r0, 0
|
||||
strh r0, [r2]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_80D46E0
|
||||
|
||||
thumb_func_start sub_80D4700
|
||||
sub_80D4700: @ 80D4700
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
sub sp, 0xC
|
||||
adds r5, r0, 0
|
||||
mov r0, sp
|
||||
movs r1, 0
|
||||
strb r1, [r0]
|
||||
strb r1, [r0, 0x1]
|
||||
add r1, sp, 0x4
|
||||
movs r0, 0xFF
|
||||
strb r0, [r1]
|
||||
movs r7, 0x6
|
||||
mov r9, r1
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
mov r8, r0
|
||||
ldr r3, =0x00002be0
|
||||
_080D4724:
|
||||
mov r1, r8
|
||||
ldr r0, [r1]
|
||||
lsls r1, r7, 3
|
||||
adds r1, r7
|
||||
lsls r1, 2
|
||||
adds r4, r0, r1
|
||||
movs r2, 0xB0
|
||||
lsls r2, 6
|
||||
adds r0, r4, r2
|
||||
ldrh r6, [r0]
|
||||
cmp r6, 0
|
||||
bne _080D47A0
|
||||
adds r4, r3
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x40
|
||||
str r3, [sp, 0x8]
|
||||
bl GetMonData
|
||||
mov r1, r8
|
||||
ldr r2, [r1]
|
||||
lsls r1, r0, 3
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
adds r1, r2
|
||||
ldr r3, [sp, 0x8]
|
||||
adds r1, r3
|
||||
ldm r1!, {r0,r2,r3}
|
||||
stm r4!, {r0,r2,r3}
|
||||
ldm r1!, {r0,r2,r3}
|
||||
stm r4!, {r0,r2,r3}
|
||||
ldm r1!, {r0,r2,r3}
|
||||
stm r4!, {r0,r2,r3}
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x40
|
||||
bl GetMonData
|
||||
mov r1, r8
|
||||
ldr r2, [r1]
|
||||
lsls r1, r0, 3
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
adds r2, r1
|
||||
movs r3, 0xB0
|
||||
lsls r3, 6
|
||||
adds r2, r3
|
||||
strh r6, [r2]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x40
|
||||
mov r2, r9
|
||||
bl SetMonData
|
||||
adds r0, r5, 0
|
||||
movs r1, 0xC
|
||||
mov r2, sp
|
||||
bl SetMonData
|
||||
adds r0, r7, 0
|
||||
b _080D47AC
|
||||
.pool
|
||||
_080D47A0:
|
||||
adds r0, r7, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
cmp r7, 0xF
|
||||
bls _080D4724
|
||||
movs r0, 0xFF
|
||||
_080D47AC:
|
||||
add sp, 0xC
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D4700
|
||||
|
||||
thumb_func_start itemid_is_mail
|
||||
itemid_is_mail: @ 80D47BC
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0x84
|
||||
bgt _080D47CE
|
||||
cmp r0, 0x79
|
||||
blt _080D47CE
|
||||
movs r0, 0x1
|
||||
b _080D47D0
|
||||
_080D47CE:
|
||||
movs r0, 0
|
||||
_080D47D0:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end itemid_is_mail
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
570
asm/map_name_popup.s
Executable file
570
asm/map_name_popup.s
Executable file
@ -0,0 +1,570 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80D47D4
|
||||
sub_80D47D4: @ 80D47D4
|
||||
push {lr}
|
||||
bl sub_80A0934
|
||||
bl AddMapNamePopUpWindowTask
|
||||
movs r0, 0x1
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D47D4
|
||||
|
||||
thumb_func_start AddMapNamePopUpWindowTask
|
||||
AddMapNamePopUpWindowTask: @ 80D47E4
|
||||
push {r4,lr}
|
||||
movs r0, 0x80
|
||||
lsls r0, 7
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _080D486C
|
||||
ldr r4, =Task_MapNamePopUpWindow
|
||||
adds r0, r4, 0
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080D4844
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x5A
|
||||
bl CreateTask
|
||||
ldr r4, =gUnknown_02039DD4
|
||||
strb r0, [r4]
|
||||
movs r0, 0x12
|
||||
movs r1, 0x28
|
||||
bl SetGpuReg
|
||||
ldr r2, =gTasks
|
||||
ldrb r1, [r4]
|
||||
lsls r0, r1, 2
|
||||
adds r0, r1
|
||||
lsls r0, 3
|
||||
adds r0, r2
|
||||
movs r1, 0x6
|
||||
strh r1, [r0, 0x8]
|
||||
ldrb r1, [r4]
|
||||
lsls r0, r1, 2
|
||||
adds r0, r1
|
||||
lsls r0, 3
|
||||
adds r0, r2
|
||||
movs r1, 0x28
|
||||
strh r1, [r0, 0xC]
|
||||
b _080D486C
|
||||
.pool
|
||||
_080D4844:
|
||||
ldr r3, =gTasks
|
||||
ldr r2, =gUnknown_02039DD4
|
||||
ldrb r0, [r2]
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r1, r3
|
||||
movs r4, 0x8
|
||||
ldrsh r0, [r1, r4]
|
||||
cmp r0, 0x2
|
||||
beq _080D485E
|
||||
movs r0, 0x2
|
||||
strh r0, [r1, 0x8]
|
||||
_080D485E:
|
||||
ldrb r0, [r2]
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r1, r3
|
||||
movs r0, 0x1
|
||||
strh r0, [r1, 0xE]
|
||||
_080D486C:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end AddMapNamePopUpWindowTask
|
||||
|
||||
thumb_func_start Task_MapNamePopUpWindow
|
||||
Task_MapNamePopUpWindow: @ 80D487C
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
ldr r0, =gTasks
|
||||
adds r4, r1, r0
|
||||
movs r2, 0x8
|
||||
ldrsh r1, [r4, r2]
|
||||
adds r3, r0, 0
|
||||
cmp r1, 0x6
|
||||
bhi _080D4966
|
||||
lsls r0, r1, 2
|
||||
ldr r1, =_080D48A8
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_080D48A8:
|
||||
.4byte _080D48DE
|
||||
.4byte _080D4908
|
||||
.4byte _080D4920
|
||||
.4byte _080D4966
|
||||
.4byte _080D494C
|
||||
.4byte _080D4960
|
||||
.4byte _080D48C4
|
||||
_080D48C4:
|
||||
ldrh r0, [r4, 0x10]
|
||||
adds r0, 0x1
|
||||
movs r1, 0
|
||||
strh r0, [r4, 0x10]
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
cmp r0, 0x1E
|
||||
ble _080D4966
|
||||
strh r1, [r4, 0x8]
|
||||
strh r1, [r4, 0x10]
|
||||
bl ShowMapNamePopUpWindow
|
||||
b _080D4966
|
||||
_080D48DE:
|
||||
ldrh r0, [r4, 0xC]
|
||||
subs r0, 0x2
|
||||
movs r2, 0
|
||||
strh r0, [r4, 0xC]
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
bgt _080D4966
|
||||
strh r2, [r4, 0xC]
|
||||
movs r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
ldr r0, =gUnknown_02039DD4
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 2
|
||||
adds r0, r1
|
||||
lsls r0, 3
|
||||
adds r0, r3
|
||||
strh r2, [r0, 0xA]
|
||||
b _080D4966
|
||||
.pool
|
||||
_080D4908:
|
||||
ldrh r0, [r4, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0xA]
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
cmp r0, 0x78
|
||||
ble _080D4966
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0xA]
|
||||
movs r0, 0x2
|
||||
strh r0, [r4, 0x8]
|
||||
b _080D4966
|
||||
_080D4920:
|
||||
ldrh r0, [r4, 0xC]
|
||||
adds r0, 0x2
|
||||
movs r1, 0
|
||||
strh r0, [r4, 0xC]
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
cmp r0, 0x27
|
||||
ble _080D4966
|
||||
movs r0, 0x28
|
||||
strh r0, [r4, 0xC]
|
||||
movs r2, 0xE
|
||||
ldrsh r0, [r4, r2]
|
||||
cmp r0, 0
|
||||
beq _080D4946
|
||||
movs r0, 0x6
|
||||
strh r0, [r4, 0x8]
|
||||
strh r1, [r4, 0x10]
|
||||
strh r1, [r4, 0xE]
|
||||
b _080D4966
|
||||
_080D4946:
|
||||
movs r0, 0x4
|
||||
strh r0, [r4, 0x8]
|
||||
b _080D496E
|
||||
_080D494C:
|
||||
bl GetMapNamePopUpWindowId
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x1
|
||||
bl sub_819746C
|
||||
movs r0, 0x5
|
||||
strh r0, [r4, 0x8]
|
||||
b _080D4966
|
||||
_080D4960:
|
||||
bl HideMapNamePopUpWindow
|
||||
b _080D496E
|
||||
_080D4966:
|
||||
ldrh r1, [r4, 0xC]
|
||||
movs r0, 0x12
|
||||
bl SetGpuReg
|
||||
_080D496E:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end Task_MapNamePopUpWindow
|
||||
|
||||
thumb_func_start HideMapNamePopUpWindow
|
||||
HideMapNamePopUpWindow: @ 80D4974
|
||||
push {lr}
|
||||
ldr r0, =Task_MapNamePopUpWindow
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080D49A4
|
||||
bl GetMapNamePopUpWindowId
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x1
|
||||
bl sub_819746C
|
||||
bl RemoveMapNamePopUpWindow
|
||||
movs r0, 0x12
|
||||
movs r1, 0
|
||||
bl SetGpuReg_ForcedBlank
|
||||
ldr r0, =gUnknown_02039DD4
|
||||
ldrb r0, [r0]
|
||||
bl DestroyTask
|
||||
_080D49A4:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end HideMapNamePopUpWindow
|
||||
|
||||
thumb_func_start ShowMapNamePopUpWindow
|
||||
ShowMapNamePopUpWindow: @ 80D49B0
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x24
|
||||
bl InBattlePyramid
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080D4A08
|
||||
ldr r0, =gMapHeader
|
||||
ldrh r1, [r0, 0x12]
|
||||
movs r0, 0xBD
|
||||
lsls r0, 1
|
||||
cmp r1, r0
|
||||
bne _080D49DC
|
||||
mov r4, sp
|
||||
adds r4, 0xF
|
||||
ldr r0, =gUnknown_0857F544
|
||||
ldr r1, [r0, 0x1C]
|
||||
b _080D49F2
|
||||
.pool
|
||||
_080D49DC:
|
||||
mov r4, sp
|
||||
adds r4, 0xF
|
||||
ldr r1, =gUnknown_0857F544
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r0, [r0]
|
||||
ldr r2, =0x00000cb2
|
||||
adds r0, r2
|
||||
ldrh r0, [r0]
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
ldr r1, [r0]
|
||||
_080D49F2:
|
||||
adds r0, r4, 0
|
||||
bl StringCopy
|
||||
b _080D4A18
|
||||
.pool
|
||||
_080D4A08:
|
||||
mov r4, sp
|
||||
adds r4, 0xF
|
||||
ldr r0, =gMapHeader
|
||||
ldrb r1, [r0, 0x14]
|
||||
adds r0, r4, 0
|
||||
movs r2, 0
|
||||
bl GetMapName
|
||||
_080D4A18:
|
||||
bl AddMapNamePopUpWindow
|
||||
bl LoadMapNamePopUpWindowBg
|
||||
movs r0, 0x7
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x50
|
||||
bl GetStringCenterAlignXOffset
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
add r1, sp, 0xC
|
||||
movs r5, 0
|
||||
movs r0, 0xFC
|
||||
strb r0, [r1]
|
||||
movs r0, 0x2
|
||||
strb r0, [r1, 0x1]
|
||||
adds r0, r1, 0
|
||||
strb r5, [r0, 0x2]
|
||||
bl GetMapNamePopUpWindowId
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x3
|
||||
str r1, [sp]
|
||||
movs r1, 0xFF
|
||||
str r1, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r1, 0x7
|
||||
add r2, sp, 0xC
|
||||
adds r3, r4, 0
|
||||
bl PrintTextOnWindow
|
||||
bl GetMapNamePopUpWindowId
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x3
|
||||
bl CopyWindowToVram
|
||||
add sp, 0x24
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end ShowMapNamePopUpWindow
|
||||
|
||||
thumb_func_start sub_80D4A78
|
||||
sub_80D4A78: @ 80D4A78
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x1C
|
||||
ldr r4, [sp, 0x3C]
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r10, r1
|
||||
lsls r2, 24
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
str r3, [sp, 0x10]
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
str r4, [sp, 0x14]
|
||||
movs r5, 0
|
||||
lsls r0, r1, 24
|
||||
asrs r1, r0, 24
|
||||
lsrs r3, r2, 24
|
||||
str r3, [sp, 0xC]
|
||||
movs r6, 0xFF
|
||||
lsls r6, 24
|
||||
adds r6, r2
|
||||
mov r8, r6
|
||||
str r0, [sp, 0x18]
|
||||
subs r4, r1, 0x1
|
||||
_080D4AB4:
|
||||
ldr r0, =0x0000021d
|
||||
adds r1, r5, r0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
lsls r2, r4, 24
|
||||
lsrs r2, 24
|
||||
movs r3, 0x1
|
||||
str r3, [sp]
|
||||
str r3, [sp, 0x4]
|
||||
movs r6, 0xE
|
||||
mov r9, r6
|
||||
str r6, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
mov r6, r8
|
||||
lsrs r3, r6, 24
|
||||
bl FillBgTilemapBufferRect
|
||||
adds r4, 0x1
|
||||
adds r5, 0x1
|
||||
cmp r5, 0xB
|
||||
ble _080D4AB4
|
||||
ldr r1, =0x00000229
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
add r0, r10
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
movs r5, 0x1
|
||||
str r5, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
mov r2, r9
|
||||
str r2, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
mov r2, r8
|
||||
ldr r3, [sp, 0xC]
|
||||
bl FillBgTilemapBufferRect
|
||||
ldr r1, =0x0000022a
|
||||
ldr r6, [sp, 0x10]
|
||||
add r6, r10
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
str r5, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
mov r3, r9
|
||||
str r3, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
adds r2, r6, 0
|
||||
ldr r3, [sp, 0xC]
|
||||
bl FillBgTilemapBufferRect
|
||||
ldr r1, =0x0000022b
|
||||
ldr r4, [sp, 0xC]
|
||||
adds r4, 0x1
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
str r5, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
mov r0, r9
|
||||
str r0, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
mov r2, r8
|
||||
adds r3, r4, 0
|
||||
bl FillBgTilemapBufferRect
|
||||
movs r1, 0x8B
|
||||
lsls r1, 2
|
||||
str r5, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
mov r2, r9
|
||||
str r2, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
adds r2, r6, 0
|
||||
adds r3, r4, 0
|
||||
bl FillBgTilemapBufferRect
|
||||
ldr r1, =0x0000022d
|
||||
ldr r4, [sp, 0xC]
|
||||
adds r4, 0x2
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
str r5, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
mov r3, r9
|
||||
str r3, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
mov r2, r8
|
||||
adds r3, r4, 0
|
||||
bl FillBgTilemapBufferRect
|
||||
ldr r1, =0x0000022e
|
||||
str r5, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
mov r0, r9
|
||||
str r0, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
adds r2, r6, 0
|
||||
adds r3, r4, 0
|
||||
bl FillBgTilemapBufferRect
|
||||
movs r5, 0
|
||||
ldr r1, [sp, 0xC]
|
||||
ldr r2, [sp, 0x14]
|
||||
adds r0, r1, r2
|
||||
lsls r4, r0, 24
|
||||
movs r6, 0x1
|
||||
_080D4B8A:
|
||||
ldr r3, =0x0000022f
|
||||
adds r1, r5, r3
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
subs r0, r5, 0x1
|
||||
ldr r3, [sp, 0x18]
|
||||
asrs r2, r3, 24
|
||||
adds r2, r0
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
str r6, [sp]
|
||||
str r6, [sp, 0x4]
|
||||
movs r0, 0xE
|
||||
str r0, [sp, 0x8]
|
||||
adds r0, r7, 0
|
||||
lsrs r3, r4, 24
|
||||
bl FillBgTilemapBufferRect
|
||||
adds r5, 0x1
|
||||
cmp r5, 0xB
|
||||
ble _080D4B8A
|
||||
add sp, 0x1C
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D4A78
|
||||
|
||||
thumb_func_start LoadMapNamePopUpWindowBg
|
||||
LoadMapNamePopUpWindowBg: @ 80D4BE0
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0x8
|
||||
bl GetMapNamePopUpWindowId
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
ldr r0, =gMapHeader
|
||||
ldrb r1, [r0, 0x14]
|
||||
cmp r1, 0x57
|
||||
bls _080D4C0A
|
||||
cmp r1, 0xC4
|
||||
bls _080D4C08
|
||||
adds r0, r1, 0
|
||||
subs r0, 0x6D
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
b _080D4C0A
|
||||
.pool
|
||||
_080D4C08:
|
||||
movs r1, 0
|
||||
_080D4C0A:
|
||||
ldr r0, =gUnknown_0857F464
|
||||
adds r0, r1, r0
|
||||
ldrb r4, [r0]
|
||||
adds r0, r5, 0
|
||||
movs r1, 0
|
||||
bl GetWindowAttribute
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r4, 4
|
||||
subs r1, r4
|
||||
lsls r1, 6
|
||||
ldr r2, =gUnknown_0857DD04
|
||||
adds r1, r2
|
||||
movs r2, 0x80
|
||||
lsls r2, 3
|
||||
ldr r3, =0x0000021d
|
||||
bl LoadBgTiles
|
||||
ldr r1, =sub_80D4A78
|
||||
adds r0, r5, 0
|
||||
bl CallWindowFunction
|
||||
adds r0, r5, 0
|
||||
bl PutWindowTilemap
|
||||
ldr r0, =gMapHeader
|
||||
ldrb r0, [r0, 0x16]
|
||||
cmp r0, 0xE
|
||||
bne _080D4C6C
|
||||
ldr r0, =gUnknown_0857F444
|
||||
movs r1, 0xE0
|
||||
movs r2, 0x20
|
||||
bl LoadPalette
|
||||
b _080D4C7A
|
||||
.pool
|
||||
_080D4C6C:
|
||||
lsls r0, r4, 5
|
||||
ldr r1, =gUnknown_0857F384
|
||||
adds r0, r1
|
||||
movs r1, 0xE0
|
||||
movs r2, 0x20
|
||||
bl LoadPalette
|
||||
_080D4C7A:
|
||||
lsls r1, r4, 4
|
||||
subs r1, r4
|
||||
lsls r1, 6
|
||||
ldr r0, =gUnknown_0857C684
|
||||
adds r1, r0
|
||||
movs r0, 0x50
|
||||
str r0, [sp]
|
||||
movs r0, 0x18
|
||||
str r0, [sp, 0x4]
|
||||
adds r0, r5, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl BlitBitmapToWindow
|
||||
add sp, 0x8
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end LoadMapNamePopUpWindowBg
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
5505
asm/menu.s
Executable file
5505
asm/menu.s
Executable file
File diff suppressed because it is too large
Load Diff
1442
asm/menu_indicators.s
Executable file
1442
asm/menu_indicators.s
Executable file
File diff suppressed because it is too large
Load Diff
1178
asm/new_menu_helpers.s
Executable file
1178
asm/new_menu_helpers.s
Executable file
File diff suppressed because it is too large
Load Diff
17828
asm/party_menu.s
Executable file
17828
asm/party_menu.s
Executable file
File diff suppressed because it is too large
Load Diff
2861
asm/pokeball.s
Executable file
2861
asm/pokeball.s
Executable file
File diff suppressed because it is too large
Load Diff
822
asm/pokemon_icon.s
Executable file
822
asm/pokemon_icon.s
Executable file
@ -0,0 +1,822 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_80D2CC4
|
||||
@ int sub_80D2CC4(u16 speciesId, int a2, u16 a3, u16 a4, u8 a5, u32 personality, int a7)
|
||||
sub_80D2CC4: @ 80D2CC4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
sub sp, 0x30
|
||||
adds r4, r0, 0
|
||||
adds r6, r1, 0
|
||||
ldr r0, [sp, 0x4C]
|
||||
ldr r1, [sp, 0x50]
|
||||
ldr r5, [sp, 0x54]
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
mov r8, r2
|
||||
lsls r3, 16
|
||||
lsrs r7, r3, 16
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r9, r0
|
||||
ldr r0, =gUnknown_0857C570
|
||||
str r0, [sp, 0x18]
|
||||
adds r0, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl sub_80D2EDC
|
||||
str r0, [sp, 0x1C]
|
||||
ldr r0, =gUnknown_0857C5B4
|
||||
str r0, [sp, 0x20]
|
||||
ldr r0, =gUnknown_0857C5E8
|
||||
str r0, [sp, 0x24]
|
||||
str r6, [sp, 0x28]
|
||||
ldr r0, =gMonIconPaletteIndices
|
||||
adds r0, r4, r0
|
||||
ldr r1, =0x0000dac0
|
||||
adds r5, r1, 0
|
||||
ldrb r0, [r0]
|
||||
adds r1, r5, r0
|
||||
add r0, sp, 0x2C
|
||||
strh r1, [r0]
|
||||
add r1, sp, 0x18
|
||||
mov r0, sp
|
||||
movs r2, 0x18
|
||||
bl memcpy
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r4, r0
|
||||
bls _080D2D2A
|
||||
mov r0, sp
|
||||
strh r5, [r0, 0x14]
|
||||
_080D2D2A:
|
||||
mov r0, r8
|
||||
lsls r1, r0, 16
|
||||
asrs r1, 16
|
||||
lsls r2, r7, 16
|
||||
asrs r2, 16
|
||||
mov r0, sp
|
||||
mov r3, r9
|
||||
bl sub_80D31B4
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r0, r4, 4
|
||||
adds r0, r4
|
||||
lsls r0, 2
|
||||
ldr r1, =gSprites
|
||||
adds r0, r1
|
||||
bl sub_80D30DC
|
||||
adds r0, r4, 0
|
||||
add sp, 0x30
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D2CC4
|
||||
|
||||
thumb_func_start sub_80D2D78
|
||||
sub_80D2D78: @ 80D2D78
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x18
|
||||
adds r4, r2, 0
|
||||
adds r5, r3, 0
|
||||
ldr r6, [sp, 0x2C]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
lsls r5, 16
|
||||
lsrs r5, 16
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
mov r3, sp
|
||||
ldr r2, =gUnknown_0857C570
|
||||
str r2, [sp]
|
||||
movs r2, 0
|
||||
str r2, [sp, 0x4]
|
||||
ldr r2, =gUnknown_0857C5B4
|
||||
str r2, [sp, 0x8]
|
||||
ldr r2, =gUnknown_0857C5E8
|
||||
str r2, [sp, 0xC]
|
||||
str r1, [sp, 0x10]
|
||||
ldr r2, =gMonIconPaletteIndices
|
||||
adds r2, r0, r2
|
||||
ldr r7, =0x0000dac0
|
||||
adds r1, r7, 0
|
||||
ldrb r2, [r2]
|
||||
adds r1, r2
|
||||
strh r1, [r3, 0x14]
|
||||
ldr r1, [sp, 0x30]
|
||||
bl GetMonIconTiles
|
||||
str r0, [sp, 0x4]
|
||||
lsls r4, 16
|
||||
asrs r4, 16
|
||||
lsls r5, 16
|
||||
asrs r5, 16
|
||||
mov r0, sp
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
adds r3, r6, 0
|
||||
bl sub_80D31B4
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r0, r4, 4
|
||||
adds r0, r4
|
||||
lsls r0, 2
|
||||
ldr r1, =gSprites
|
||||
adds r0, r1
|
||||
bl sub_80D30DC
|
||||
adds r0, r4, 0
|
||||
add sp, 0x18
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D2D78
|
||||
|
||||
thumb_func_start mon_icon_convert_unown_species_id
|
||||
@ u16 mon_icon_convert_unown_species_id(u16 speciesId, u32 personality)
|
||||
mon_icon_convert_unown_species_id: @ 80D2E08
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
cmp r2, 0xC9
|
||||
bne _080D2E32
|
||||
adds r0, r1, 0
|
||||
bl mon_icon_personality_to_unown_id
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0
|
||||
bne _080D2E24
|
||||
movs r0, 0xC9
|
||||
b _080D2E2E
|
||||
_080D2E24:
|
||||
movs r1, 0xCE
|
||||
lsls r1, 1
|
||||
adds r0, r1
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
_080D2E2E:
|
||||
adds r1, r0, 0
|
||||
b _080D2E40
|
||||
_080D2E32:
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
adds r1, r2, 0
|
||||
cmp r1, r0
|
||||
bls _080D2E40
|
||||
movs r1, 0x82
|
||||
lsls r1, 1
|
||||
_080D2E40:
|
||||
adds r0, r1, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end mon_icon_convert_unown_species_id
|
||||
|
||||
thumb_func_start mon_icon_personality_to_unown_id
|
||||
mon_icon_personality_to_unown_id: @ 80D2E48
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
cmp r2, 0
|
||||
beq _080D2E7E
|
||||
movs r0, 0xC0
|
||||
lsls r0, 18
|
||||
ands r0, r2
|
||||
lsrs r0, 18
|
||||
movs r1, 0xC0
|
||||
lsls r1, 10
|
||||
ands r1, r2
|
||||
lsrs r1, 12
|
||||
orrs r0, r1
|
||||
movs r1, 0xC0
|
||||
lsls r1, 2
|
||||
ands r1, r2
|
||||
lsrs r1, 6
|
||||
orrs r0, r1
|
||||
movs r1, 0x3
|
||||
ands r1, r2
|
||||
orrs r0, r1
|
||||
movs r1, 0x1C
|
||||
bl __umodsi3
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
b _080D2E80
|
||||
_080D2E7E:
|
||||
movs r0, 0
|
||||
_080D2E80:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end mon_icon_personality_to_unown_id
|
||||
|
||||
thumb_func_start sub_80D2E84
|
||||
sub_80D2E84: @ 80D2E84
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
adds r0, r4, 0
|
||||
mov r1, sp
|
||||
bl sub_80D45E8
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0xC9
|
||||
bne _080D2EBA
|
||||
mov r0, sp
|
||||
ldrh r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _080D2EAA
|
||||
mov r1, sp
|
||||
adds r0, 0xC9
|
||||
b _080D2EB2
|
||||
_080D2EAA:
|
||||
mov r1, sp
|
||||
movs r2, 0xCE
|
||||
lsls r2, 1
|
||||
adds r0, r2
|
||||
_080D2EB2:
|
||||
strh r0, [r1]
|
||||
mov r0, sp
|
||||
ldrh r0, [r0]
|
||||
b _080D2ED2
|
||||
_080D2EBA:
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r4, r0
|
||||
bls _080D2EC6
|
||||
movs r4, 0x82
|
||||
lsls r4, 1
|
||||
_080D2EC6:
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl mon_icon_convert_unown_species_id
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
_080D2ED2:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D2E84
|
||||
|
||||
thumb_func_start sub_80D2EDC
|
||||
@ void *sub_80D2EDC(u16 speciesId, u32 personality, bool32)
|
||||
sub_80D2EDC: @ 80D2EDC
|
||||
push {r4,lr}
|
||||
adds r4, r2, 0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
bl mon_icon_convert_unown_species_id
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
adds r1, r4, 0
|
||||
bl GetMonIconTiles
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D2EDC
|
||||
|
||||
thumb_func_start sub_80D2EF8
|
||||
sub_80D2EF8: @ 80D2EF8
|
||||
push {lr}
|
||||
bl sub_80D328C
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D2EF8
|
||||
|
||||
thumb_func_start sub_80D2F04
|
||||
sub_80D2F04: @ 80D2F04
|
||||
push {r4,r5,lr}
|
||||
movs r4, 0
|
||||
ldr r5, =gMonIconPaletteTable
|
||||
_080D2F0A:
|
||||
lsls r0, r4, 3
|
||||
adds r0, r5
|
||||
bl LoadSpritePalette
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x5
|
||||
bls _080D2F0A
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D2F04
|
||||
|
||||
thumb_func_start sub_80D2F28
|
||||
sub_80D2F28: @ 80D2F28
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r1, r0
|
||||
bls _080D2F3A
|
||||
movs r1, 0x82
|
||||
lsls r1, 1
|
||||
_080D2F3A:
|
||||
ldr r0, =gMonIconPaletteIndices
|
||||
adds r0, r1, r0
|
||||
ldrb r0, [r0]
|
||||
ldr r1, =gMonIconPaletteTable
|
||||
lsls r0, 3
|
||||
adds r4, r0, r1
|
||||
ldrh r0, [r4, 0x4]
|
||||
bl IndexOfSpritePaletteTag
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0xFF
|
||||
bne _080D2F5A
|
||||
adds r0, r4, 0
|
||||
bl LoadSpritePalette
|
||||
_080D2F5A:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D2F28
|
||||
|
||||
thumb_func_start sub_80D2F68
|
||||
sub_80D2F68: @ 80D2F68
|
||||
push {r4,lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =gMonIconPaletteIndices
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
ldr r1, =gMonIconPaletteTable
|
||||
lsls r0, 3
|
||||
adds r4, r0, r1
|
||||
ldrh r0, [r4, 0x4]
|
||||
bl IndexOfSpritePaletteTag
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0xFF
|
||||
bne _080D2F8E
|
||||
adds r0, r4, 0
|
||||
bl LoadSpritePalette
|
||||
_080D2F8E:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D2F68
|
||||
|
||||
thumb_func_start sub_80D2F9C
|
||||
sub_80D2F9C: @ 80D2F9C
|
||||
push {r4,r5,lr}
|
||||
movs r4, 0
|
||||
ldr r5, =gMonIconPaletteTable
|
||||
_080D2FA2:
|
||||
lsls r0, r4, 3
|
||||
adds r0, r5
|
||||
ldrh r0, [r0, 0x4]
|
||||
bl FreeSpritePaletteByTag
|
||||
adds r0, r4, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x5
|
||||
bls _080D2FA2
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D2F9C
|
||||
|
||||
thumb_func_start sub_80D2FC0
|
||||
sub_80D2FC0: @ 80D2FC0
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r1, r0
|
||||
bls _080D2FD2
|
||||
movs r1, 0x82
|
||||
lsls r1, 1
|
||||
_080D2FD2:
|
||||
ldr r0, =gMonIconPaletteIndices
|
||||
adds r0, r1, r0
|
||||
ldrb r0, [r0]
|
||||
ldr r1, =gMonIconPaletteTable
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldrh r0, [r0, 0x4]
|
||||
bl FreeSpritePaletteByTag
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D2FC0
|
||||
|
||||
thumb_func_start sub_80D2FF0
|
||||
sub_80D2FF0: @ 80D2FF0
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =gMonIconPaletteIndices
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
ldr r1, =gMonIconPaletteTable
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldrh r0, [r0, 0x4]
|
||||
bl FreeSpritePaletteByTag
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D2FF0
|
||||
|
||||
thumb_func_start sub_80D3014
|
||||
sub_80D3014: @ 80D3014
|
||||
push {lr}
|
||||
bl sub_80D30DC
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D3014
|
||||
|
||||
thumb_func_start GetMonIconTiles
|
||||
@ void *GetMonIconTiles(u16 speciesId, bool32)
|
||||
GetMonIconTiles: @ 80D3020
|
||||
push {lr}
|
||||
adds r3, r1, 0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r2, =gMonIconTable
|
||||
lsls r1, r0, 2
|
||||
adds r1, r2
|
||||
ldr r2, [r1]
|
||||
movs r1, 0xCD
|
||||
lsls r1, 1
|
||||
cmp r0, r1
|
||||
bne _080D3042
|
||||
cmp r3, 0x1
|
||||
bne _080D3042
|
||||
movs r0, 0x80
|
||||
lsls r0, 3
|
||||
adds r2, r0
|
||||
_080D3042:
|
||||
adds r0, r2, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end GetMonIconTiles
|
||||
|
||||
thumb_func_start sub_80D304C
|
||||
sub_80D304C: @ 80D304C
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
cmp r4, 0xA0
|
||||
bhi _080D3074
|
||||
ldr r6, =gMonIconPaletteTable
|
||||
movs r5, 0x5
|
||||
_080D305A:
|
||||
ldr r0, [r6]
|
||||
adds r1, r4, 0
|
||||
movs r2, 0x20
|
||||
bl LoadPalette
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x10
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
adds r6, 0x8
|
||||
subs r5, 0x1
|
||||
cmp r5, 0
|
||||
bge _080D305A
|
||||
_080D3074:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D304C
|
||||
|
||||
thumb_func_start sub_80D3080
|
||||
sub_80D3080: @ 80D3080
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r1, r0, 16
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r1, r0
|
||||
bls _080D3092
|
||||
movs r1, 0x82
|
||||
lsls r1, 1
|
||||
_080D3092:
|
||||
ldr r0, =gMonIconPaletteIndices
|
||||
adds r0, r1, r0
|
||||
ldrb r0, [r0]
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D3080
|
||||
|
||||
thumb_func_start sub_80D30A0
|
||||
sub_80D30A0: @ 80D30A0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
ldr r1, =gMonIconPaletteIndices
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_80D30A0
|
||||
|
||||
thumb_func_start sub_80D30B0
|
||||
sub_80D30B0: @ 80D30B0
|
||||
push {lr}
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 16
|
||||
movs r0, 0xCE
|
||||
lsls r0, 1
|
||||
cmp r2, r0
|
||||
bls _080D30C2
|
||||
movs r2, 0x82
|
||||
lsls r2, 1
|
||||
_080D30C2:
|
||||
ldr r1, =gMonIconPaletteTable
|
||||
ldr r0, =gMonIconPaletteIndices
|
||||
adds r0, r2, r0
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D30B0
|
||||
|
||||
thumb_func_start sub_80D30DC
|
||||
sub_80D30DC: @ 80D30DC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
adds r4, r0, 0
|
||||
movs r7, 0
|
||||
adds r6, r4, 0
|
||||
adds r6, 0x2C
|
||||
ldrb r2, [r6]
|
||||
movs r0, 0x3F
|
||||
mov r9, r0
|
||||
ands r0, r2
|
||||
cmp r0, 0
|
||||
bne _080D3190
|
||||
movs r1, 0x2A
|
||||
adds r1, r4
|
||||
mov r8, r1
|
||||
ldrb r1, [r1]
|
||||
ldr r0, [r4, 0x8]
|
||||
lsls r1, 2
|
||||
adds r1, r0
|
||||
adds r5, r4, 0
|
||||
adds r5, 0x2B
|
||||
ldrb r0, [r5]
|
||||
ldr r1, [r1]
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
ldrsh r3, [r0, r1]
|
||||
movs r0, 0x2
|
||||
negs r0, r0
|
||||
cmp r3, r0
|
||||
beq _080D3126
|
||||
adds r0, 0x1
|
||||
cmp r3, r0
|
||||
bne _080D312A
|
||||
b _080D31A4
|
||||
_080D3126:
|
||||
strb r7, [r5]
|
||||
b _080D31A4
|
||||
_080D312A:
|
||||
ldr r2, =gUnknown_0857C5F0
|
||||
ldrb r1, [r4, 0x3]
|
||||
lsrs r1, 6
|
||||
lsls r1, 1
|
||||
ldrb r0, [r4, 0x1]
|
||||
lsrs r0, 6
|
||||
lsls r0, 3
|
||||
adds r1, r0
|
||||
adds r1, r2
|
||||
ldrh r2, [r1]
|
||||
adds r1, r2, 0
|
||||
muls r1, r3
|
||||
ldr r0, [r4, 0xC]
|
||||
adds r0, r1
|
||||
ldrh r1, [r4, 0x4]
|
||||
lsls r1, 22
|
||||
lsrs r1, 17
|
||||
ldr r3, =0x06010000
|
||||
adds r1, r3
|
||||
bl RequestSpriteCopy
|
||||
mov r0, r8
|
||||
ldrb r1, [r0]
|
||||
ldr r0, [r4, 0x8]
|
||||
lsls r1, 2
|
||||
adds r1, r0
|
||||
ldrb r0, [r5]
|
||||
ldr r1, [r1]
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
lsls r0, 10
|
||||
lsrs r0, 26
|
||||
mov r1, r9
|
||||
ands r1, r0
|
||||
ldrb r2, [r6]
|
||||
movs r0, 0x40
|
||||
negs r0, r0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r6]
|
||||
ldrb r0, [r5]
|
||||
adds r0, 0x1
|
||||
strb r0, [r5]
|
||||
ldrb r7, [r5]
|
||||
b _080D31A4
|
||||
.pool
|
||||
_080D3190:
|
||||
lsls r0, r2, 26
|
||||
lsrs r0, 26
|
||||
subs r0, 0x1
|
||||
movs r1, 0x3F
|
||||
ands r0, r1
|
||||
movs r1, 0x40
|
||||
negs r1, r1
|
||||
ands r1, r2
|
||||
orrs r1, r0
|
||||
strb r1, [r6]
|
||||
_080D31A4:
|
||||
adds r0, r7, 0
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D30DC
|
||||
|
||||
thumb_func_start sub_80D31B4
|
||||
sub_80D31B4: @ 80D31B4
|
||||
push {r4-r6,lr}
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5,r6}
|
||||
sub sp, 0x38
|
||||
mov r9, r0
|
||||
adds r4, r1, 0
|
||||
adds r5, r2, 0
|
||||
mov r8, r3
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
lsls r5, 16
|
||||
lsrs r5, 16
|
||||
mov r0, r8
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x30]
|
||||
ldr r2, =gUnknown_0857C5F0
|
||||
mov r0, r9
|
||||
ldr r6, [r0]
|
||||
ldrb r1, [r6, 0x3]
|
||||
lsrs r1, 6
|
||||
lsls r1, 1
|
||||
ldrb r0, [r6, 0x1]
|
||||
lsrs r0, 6
|
||||
lsls r0, 3
|
||||
adds r1, r0
|
||||
adds r1, r2
|
||||
ldrh r2, [r1]
|
||||
ldr r1, =0xffff0000
|
||||
add r3, sp, 0x30
|
||||
ldr r0, [r3, 0x4]
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
str r0, [r3, 0x4]
|
||||
add r1, sp, 0x18
|
||||
ldr r0, =0x0000ffff
|
||||
strh r0, [r1]
|
||||
mov r0, r9
|
||||
ldrh r2, [r0, 0x14]
|
||||
mov r0, sp
|
||||
adds r0, 0x1A
|
||||
strh r2, [r0]
|
||||
str r6, [sp, 0x1C]
|
||||
mov r2, r9
|
||||
ldr r0, [r2, 0x8]
|
||||
str r0, [sp, 0x20]
|
||||
str r3, [sp, 0x24]
|
||||
ldr r0, [r2, 0xC]
|
||||
str r0, [sp, 0x28]
|
||||
ldr r0, [r2, 0x10]
|
||||
str r0, [sp, 0x2C]
|
||||
mov r0, sp
|
||||
movs r2, 0x18
|
||||
bl memcpy
|
||||
lsls r4, 16
|
||||
asrs r4, 16
|
||||
lsls r5, 16
|
||||
asrs r5, 16
|
||||
mov r0, sp
|
||||
adds r1, r4, 0
|
||||
adds r2, r5, 0
|
||||
mov r3, r8
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r6, =gSprites
|
||||
lsls r3, r0, 4
|
||||
adds r3, r0
|
||||
lsls r3, 2
|
||||
adds r4, r3, r6
|
||||
adds r5, r4, 0
|
||||
adds r5, 0x2C
|
||||
ldrb r1, [r5]
|
||||
movs r2, 0x40
|
||||
orrs r1, r2
|
||||
strb r1, [r5]
|
||||
adds r4, 0x3F
|
||||
ldrb r2, [r4]
|
||||
movs r1, 0x5
|
||||
negs r1, r1
|
||||
ands r1, r2
|
||||
strb r1, [r4]
|
||||
adds r6, 0xC
|
||||
adds r3, r6
|
||||
mov r2, r9
|
||||
ldr r1, [r2, 0x4]
|
||||
str r1, [r3]
|
||||
add sp, 0x38
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D31B4
|
||||
|
||||
thumb_func_start sub_80D328C
|
||||
sub_80D328C: @ 80D328C
|
||||
push {lr}
|
||||
sub sp, 0x8
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
ldr r3, =gUnknown_0857C5F0
|
||||
ldrb r2, [r0, 0x3]
|
||||
lsrs r2, 6
|
||||
lsls r2, 1
|
||||
ldrb r1, [r0, 0x1]
|
||||
lsrs r1, 6
|
||||
lsls r1, 3
|
||||
adds r2, r1
|
||||
adds r2, r3
|
||||
ldrh r3, [r2]
|
||||
ldr r2, =0xffff0000
|
||||
ldr r1, [sp, 0x4]
|
||||
ands r1, r2
|
||||
orrs r1, r3
|
||||
str r1, [sp, 0x4]
|
||||
mov r1, sp
|
||||
str r1, [r0, 0xC]
|
||||
bl DestroySprite
|
||||
add sp, 0x8
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D328C
|
||||
|
||||
thumb_func_start sub_80D32C8
|
||||
sub_80D32C8: @ 80D32C8
|
||||
mov r12, r0
|
||||
adds r0, 0x2A
|
||||
movs r3, 0
|
||||
strb r1, [r0]
|
||||
mov r2, r12
|
||||
adds r2, 0x2C
|
||||
ldrb r1, [r2]
|
||||
movs r0, 0x40
|
||||
negs r0, r0
|
||||
ands r0, r1
|
||||
strb r0, [r2]
|
||||
mov r0, r12
|
||||
adds r0, 0x2B
|
||||
strb r3, [r0]
|
||||
bx lr
|
||||
thumb_func_end sub_80D32C8
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
7071
asm/rom_80C6FA0.s → asm/pokemon_storage_system.s
Normal file → Executable file
7071
asm/rom_80C6FA0.s → asm/pokemon_storage_system.s
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
13904
asm/pokemon_summary_screen.s
Executable file
13904
asm/pokemon_summary_screen.s
Executable file
File diff suppressed because it is too large
Load Diff
25705
asm/rom_81BE66C.s → asm/pokenav.s
Normal file → Executable file
25705
asm/rom_81BE66C.s → asm/pokenav.s
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
5993
asm/rayquaza_scene.s
Executable file
5993
asm/rayquaza_scene.s
Executable file
File diff suppressed because it is too large
Load Diff
2698
asm/rom_80AEFFC.s
2698
asm/rom_80AEFFC.s
File diff suppressed because it is too large
Load Diff
@ -1,530 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_813C5BC
|
||||
sub_813C5BC: @ 813C5BC
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0813C5DC
|
||||
ldr r0, =gTasks
|
||||
lsls r1, r2, 2
|
||||
adds r1, r2
|
||||
lsls r1, 3
|
||||
adds r1, r0
|
||||
ldr r0, =sub_813C5EC
|
||||
str r0, [r1]
|
||||
_0813C5DC:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C5BC
|
||||
|
||||
thumb_func_start sub_813C5EC
|
||||
sub_813C5EC: @ 813C5EC
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
ldr r0, =gTasks
|
||||
adds r4, r1, r0
|
||||
ldr r0, =gMain
|
||||
ldrh r1, [r0, 0x2E]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0813C610
|
||||
movs r0, 0x2
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _0813C61A
|
||||
_0813C610:
|
||||
movs r0, 0x5
|
||||
bl PlaySE
|
||||
ldr r0, =sub_813C62C
|
||||
str r0, [r4]
|
||||
_0813C61A:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C5EC
|
||||
|
||||
thumb_func_start sub_813C62C
|
||||
sub_813C62C: @ 813C62C
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0
|
||||
movs r3, 0x10
|
||||
bl BeginNormalPaletteFade
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r1, =sub_813C664
|
||||
str r1, [r0]
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C62C
|
||||
|
||||
thumb_func_start sub_813C664
|
||||
sub_813C664: @ 813C664
|
||||
push {r4,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0813C694
|
||||
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
|
||||
bl SetMainCallback2
|
||||
ldr r0, =gUnknown_0203AB78
|
||||
ldr r0, [r0]
|
||||
bl Free
|
||||
movs r0, 0
|
||||
bl sub_813C6A8
|
||||
bl FreeAllWindowBuffers
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
_0813C694:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C664
|
||||
|
||||
thumb_func_start sub_813C6A8
|
||||
sub_813C6A8: @ 813C6A8
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl FillWindowPixelBuffer
|
||||
adds r0, r4, 0
|
||||
bl ClearWindowTilemap
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
adds r0, r4, 0
|
||||
bl RemoveWindow
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C6A8
|
||||
|
||||
thumb_func_start sub_813C6D4
|
||||
sub_813C6D4: @ 813C6D4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x8
|
||||
movs r3, 0xC0
|
||||
lsls r3, 19
|
||||
movs r4, 0xC0
|
||||
lsls r4, 9
|
||||
add r0, sp, 0x4
|
||||
mov r8, r0
|
||||
mov r2, sp
|
||||
movs r6, 0
|
||||
ldr r1, =0x040000d4
|
||||
movs r5, 0x80
|
||||
lsls r5, 5
|
||||
ldr r7, =0x81000800
|
||||
movs r0, 0x81
|
||||
lsls r0, 24
|
||||
mov r12, r0
|
||||
_0813C6FA:
|
||||
strh r6, [r2]
|
||||
mov r0, sp
|
||||
str r0, [r1]
|
||||
str r3, [r1, 0x4]
|
||||
str r7, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
adds r3, r5
|
||||
subs r4, r5
|
||||
cmp r4, r5
|
||||
bhi _0813C6FA
|
||||
strh r6, [r2]
|
||||
mov r2, sp
|
||||
str r2, [r1]
|
||||
str r3, [r1, 0x4]
|
||||
lsrs r0, r4, 1
|
||||
mov r2, r12
|
||||
orrs r0, r2
|
||||
str r0, [r1, 0x8]
|
||||
ldr r0, [r1, 0x8]
|
||||
movs r0, 0xE0
|
||||
lsls r0, 19
|
||||
movs r3, 0x80
|
||||
lsls r3, 3
|
||||
movs r4, 0
|
||||
str r4, [sp, 0x4]
|
||||
ldr r2, =0x040000d4
|
||||
mov r1, r8
|
||||
str r1, [r2]
|
||||
str r0, [r2, 0x4]
|
||||
lsrs r0, r3, 2
|
||||
movs r1, 0x85
|
||||
lsls r1, 24
|
||||
orrs r0, r1
|
||||
str r0, [r2, 0x8]
|
||||
ldr r0, [r2, 0x8]
|
||||
movs r1, 0xA0
|
||||
lsls r1, 19
|
||||
mov r0, sp
|
||||
strh r4, [r0]
|
||||
str r0, [r2]
|
||||
str r1, [r2, 0x4]
|
||||
lsrs r3, 1
|
||||
movs r0, 0x81
|
||||
lsls r0, 24
|
||||
orrs r3, r0
|
||||
str r3, [r2, 0x8]
|
||||
ldr r0, [r2, 0x8]
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x8
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x10
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x12
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xA
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x14
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x16
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xC
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x18
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1A
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0xE
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1C
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x1E
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x40
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x44
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x48
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x4A
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x50
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x52
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
movs r0, 0x54
|
||||
movs r1, 0
|
||||
bl SetGpuReg
|
||||
add sp, 0x8
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C6D4
|
||||
|
||||
thumb_func_start sub_813C80C
|
||||
sub_813C80C: @ 813C80C
|
||||
push {lr}
|
||||
bl remove_some_task
|
||||
bl ResetTasks
|
||||
bl ResetSpriteData
|
||||
bl ResetPaletteFade
|
||||
bl FreeAllSpritePalettes
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C80C
|
||||
|
||||
thumb_func_start sub_813C828
|
||||
sub_813C828: @ 813C828
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x1
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0x3
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C828
|
||||
|
||||
thumb_func_start sub_813C880
|
||||
sub_813C880: @ 813C880
|
||||
push {lr}
|
||||
movs r1, 0x94
|
||||
lsls r1, 4
|
||||
movs r0, 0
|
||||
bl SetGpuReg
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C880
|
||||
|
||||
thumb_func_start sub_813C890
|
||||
sub_813C890: @ 813C890
|
||||
push {r4,lr}
|
||||
sub sp, 0x8
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
ldr r1, =gUnknown_085B3484
|
||||
adds r0, r4, 0
|
||||
movs r2, 0xC0
|
||||
movs r3, 0
|
||||
bl LoadBgTiles
|
||||
ldr r1, =gUnknown_085B3564
|
||||
movs r0, 0x20
|
||||
str r0, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
adds r0, r4, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl CopyToBgTilemapBufferRect
|
||||
ldr r0, =gUnknown_085B3544
|
||||
movs r1, 0
|
||||
movs r2, 0x20
|
||||
bl LoadPalette
|
||||
add sp, 0x8
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C890
|
||||
|
||||
thumb_func_start sub_813C8D8
|
||||
sub_813C8D8: @ 813C8D8
|
||||
push {lr}
|
||||
bl LoadOam
|
||||
bl ProcessSpriteCopyRequests
|
||||
bl TransferPlttBuffer
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C8D8
|
||||
|
||||
thumb_func_start sub_813C8EC
|
||||
sub_813C8EC: @ 813C8EC
|
||||
push {lr}
|
||||
bl RunTasks
|
||||
bl AnimateSprites
|
||||
bl BuildOamBuffer
|
||||
bl UpdatePaletteFade
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_813C8EC
|
||||
|
||||
thumb_func_start sub_813C904
|
||||
sub_813C904: @ 813C904
|
||||
push {lr}
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
ldr r0, =sub_813C91C
|
||||
bl SetMainCallback2
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C904
|
||||
|
||||
thumb_func_start sub_813C91C
|
||||
sub_813C91C: @ 813C91C
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
ldr r0, =gMain
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0x7
|
||||
bls _0813C930
|
||||
b _0813CA3C
|
||||
_0813C930:
|
||||
lsls r0, 2
|
||||
ldr r1, =_0813C944
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_0813C944:
|
||||
.4byte _0813C964
|
||||
.4byte _0813C970
|
||||
.4byte _0813C976
|
||||
.4byte _0813C9A8
|
||||
.4byte _0813C9BE
|
||||
.4byte _0813C9DE
|
||||
.4byte _0813C9F0
|
||||
.4byte _0813CA14
|
||||
_0813C964:
|
||||
movs r0, 0
|
||||
bl SetVBlankCallback
|
||||
bl sub_813C6D4
|
||||
b _0813CA00
|
||||
_0813C970:
|
||||
bl sub_813C80C
|
||||
b _0813CA00
|
||||
_0813C976:
|
||||
ldr r4, =gUnknown_0203AB78
|
||||
movs r0, 0x80
|
||||
lsls r0, 4
|
||||
bl AllocZeroed
|
||||
str r0, [r4]
|
||||
movs r0, 0
|
||||
bl ResetBgsAndClearDma3BusyFlags
|
||||
ldr r1, =gUnknown_085B3D64
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl InitBgsFromTemplates
|
||||
ldr r1, [r4]
|
||||
movs r0, 0x3
|
||||
bl SetBgTilemapBuffer
|
||||
bl sub_813C828
|
||||
b _0813CA00
|
||||
.pool
|
||||
_0813C9A8:
|
||||
movs r0, 0x3
|
||||
bl sub_813C890
|
||||
movs r0, 0
|
||||
bl stdpal_get
|
||||
movs r1, 0xF0
|
||||
movs r2, 0x20
|
||||
bl LoadPalette
|
||||
b _0813CA00
|
||||
_0813C9BE:
|
||||
bl IsDma3ManagerBusyWithBgCopy
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
beq _0813CA3C
|
||||
movs r0, 0
|
||||
bl ShowBg
|
||||
movs r0, 0x3
|
||||
bl ShowBg
|
||||
movs r0, 0x3
|
||||
bl CopyBgTilemapBufferToVram
|
||||
b _0813CA00
|
||||
_0813C9DE:
|
||||
ldr r0, =gUnknown_085B3D6C
|
||||
bl InitWindows
|
||||
bl DeactivateAllTextPrinters
|
||||
b _0813CA00
|
||||
.pool
|
||||
_0813C9F0:
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0x10
|
||||
movs r3, 0
|
||||
bl BeginNormalPaletteFade
|
||||
_0813CA00:
|
||||
ldr r1, =gMain
|
||||
movs r0, 0x87
|
||||
lsls r0, 3
|
||||
adds r1, r0
|
||||
ldrb r0, [r1]
|
||||
adds r0, 0x1
|
||||
strb r0, [r1]
|
||||
b _0813CA3C
|
||||
.pool
|
||||
_0813CA14:
|
||||
bl sub_813C880
|
||||
ldr r0, =sub_813C8D8
|
||||
bl SetVBlankCallback
|
||||
bl sub_81D5C8C
|
||||
ldr r0, =sub_813C5BC
|
||||
movs r1, 0x8
|
||||
bl CreateTask
|
||||
ldr r0, =sub_813C8EC
|
||||
bl SetMainCallback2
|
||||
ldr r0, =gMain
|
||||
movs r1, 0x87
|
||||
lsls r1, 3
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
strb r1, [r0]
|
||||
_0813CA3C:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_813C91C
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
83686
asm/rom_818E9AC.s
83686
asm/rom_818E9AC.s
File diff suppressed because it is too large
Load Diff
205
asm/save_location.s
Executable file
205
asm/save_location.s
Executable file
@ -0,0 +1,205 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sav1_are_mapnumbers_in_given_list
|
||||
sav1_are_mapnumbers_in_given_list: @ 81AFC84
|
||||
push {r4,lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
movs r1, 0x4
|
||||
ldrsb r1, [r0, r1]
|
||||
lsls r1, 8
|
||||
ldrb r0, [r0, 0x5]
|
||||
lsls r0, 24
|
||||
asrs r0, 24
|
||||
adds r0, r1
|
||||
lsls r0, 16
|
||||
lsrs r3, r0, 16
|
||||
ldrh r0, [r2]
|
||||
ldr r1, =0x0000ffff
|
||||
cmp r0, r1
|
||||
beq _081AFCC4
|
||||
adds r4, r1, 0
|
||||
adds r1, r2, 0
|
||||
_081AFCAA:
|
||||
ldrh r0, [r1]
|
||||
cmp r0, r3
|
||||
bne _081AFCBC
|
||||
movs r0, 0x1
|
||||
b _081AFCC6
|
||||
.pool
|
||||
_081AFCBC:
|
||||
adds r1, 0x2
|
||||
ldrh r0, [r1]
|
||||
cmp r0, r4
|
||||
bne _081AFCAA
|
||||
_081AFCC4:
|
||||
movs r0, 0
|
||||
_081AFCC6:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sav1_are_mapnumbers_in_given_list
|
||||
|
||||
thumb_func_start sav1_is_in_pokecenter
|
||||
sav1_is_in_pokecenter: @ 81AFCCC
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_086143BC
|
||||
bl sav1_are_mapnumbers_in_given_list
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sav1_is_in_pokecenter
|
||||
|
||||
thumb_func_start sub_81AFCDC
|
||||
sub_81AFCDC: @ 81AFCDC
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_0861440A
|
||||
bl sav1_are_mapnumbers_in_given_list
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81AFCDC
|
||||
|
||||
thumb_func_start sub_81AFCEC
|
||||
sub_81AFCEC: @ 81AFCEC
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_0861440E
|
||||
bl sav1_are_mapnumbers_in_given_list
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81AFCEC
|
||||
|
||||
thumb_func_start sav2_set_x9_bit3_when_sav1_in_pokecenter
|
||||
sav2_set_x9_bit3_when_sav1_in_pokecenter: @ 81AFCFC
|
||||
push {lr}
|
||||
bl sav1_is_in_pokecenter
|
||||
cmp r0, 0
|
||||
bne _081AFD18
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0xFD
|
||||
ands r0, r1
|
||||
b _081AFD22
|
||||
.pool
|
||||
_081AFD18:
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0x2
|
||||
orrs r0, r1
|
||||
_081AFD22:
|
||||
strb r0, [r2, 0x9]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sav2_set_x9_bit3_when_sav1_in_pokecenter
|
||||
|
||||
thumb_func_start sub_81AFD2C
|
||||
sub_81AFD2C: @ 81AFD2C
|
||||
push {lr}
|
||||
bl sub_81AFCDC
|
||||
cmp r0, 0
|
||||
bne _081AFD48
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0xFB
|
||||
ands r0, r1
|
||||
b _081AFD52
|
||||
.pool
|
||||
_081AFD48:
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0x4
|
||||
orrs r0, r1
|
||||
_081AFD52:
|
||||
strb r0, [r2, 0x9]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81AFD2C
|
||||
|
||||
thumb_func_start sub_81AFD5C
|
||||
sub_81AFD5C: @ 81AFD5C
|
||||
push {lr}
|
||||
bl sub_81AFCEC
|
||||
cmp r0, 0
|
||||
bne _081AFD78
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0xF7
|
||||
ands r0, r1
|
||||
b _081AFD82
|
||||
.pool
|
||||
_081AFD78:
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0x8
|
||||
orrs r0, r1
|
||||
_081AFD82:
|
||||
strb r0, [r2, 0x9]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81AFD5C
|
||||
|
||||
thumb_func_start sav2_set_x9_depending_on_sav1_map
|
||||
sav2_set_x9_depending_on_sav1_map: @ 81AFD8C
|
||||
push {lr}
|
||||
bl sav2_set_x9_bit3_when_sav1_in_pokecenter
|
||||
bl sub_81AFD2C
|
||||
bl sub_81AFD5C
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sav2_set_x9_depending_on_sav1_map
|
||||
|
||||
thumb_func_start sub_81AFDA0
|
||||
sub_81AFDA0: @ 81AFDA0
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r2, [r0]
|
||||
adds r2, 0xA8
|
||||
ldr r0, [r2]
|
||||
movs r1, 0x80
|
||||
lsls r1, 8
|
||||
orrs r0, r1
|
||||
movs r1, 0x1
|
||||
orrs r0, r1
|
||||
movs r1, 0x2
|
||||
orrs r0, r1
|
||||
movs r1, 0x4
|
||||
orrs r0, r1
|
||||
movs r1, 0x10
|
||||
orrs r0, r1
|
||||
movs r1, 0x20
|
||||
orrs r0, r1
|
||||
movs r1, 0x8
|
||||
orrs r0, r1
|
||||
str r0, [r2]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_81AFDA0
|
||||
|
||||
thumb_func_start sub_81AFDD0
|
||||
sub_81AFDD0: @ 81AFDD0
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r2, [r0]
|
||||
ldrb r1, [r2, 0x9]
|
||||
movs r0, 0x80
|
||||
orrs r0, r1
|
||||
strb r0, [r2, 0x9]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_81AFDD0
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
577
asm/script_movement.s
Executable file
577
asm/script_movement.s
Executable file
@ -0,0 +1,577 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start exec_movement
|
||||
exec_movement: @ 80D32E8
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r3, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
mov r3, sp
|
||||
bl TryGetFieldObjectIdByLocalIdAndMap
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080D330A
|
||||
movs r0, 0x1
|
||||
b _080D3332
|
||||
_080D330A:
|
||||
ldr r0, =sub_80D3660
|
||||
bl FuncIsActiveTask
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080D331C
|
||||
movs r0, 0x32
|
||||
bl sub_80D33AC
|
||||
_080D331C:
|
||||
bl sub_80D33F4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r1, sp
|
||||
ldrb r1, [r1]
|
||||
adds r2, r4, 0
|
||||
bl sub_80D3408
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
_080D3332:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end exec_movement
|
||||
|
||||
thumb_func_start sub_80D3340
|
||||
sub_80D3340: @ 80D3340
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
mov r3, sp
|
||||
bl TryGetFieldObjectIdByLocalIdAndMap
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080D3382
|
||||
bl sub_80D33F4
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
mov r0, sp
|
||||
ldrb r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl sub_80D3474
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
cmp r1, 0x10
|
||||
beq _080D3382
|
||||
adds r0, r4, 0
|
||||
bl sub_80D3584
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
b _080D3384
|
||||
_080D3382:
|
||||
movs r0, 0x1
|
||||
_080D3384:
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D3340
|
||||
|
||||
thumb_func_start sub_80D338C
|
||||
sub_80D338C: @ 80D338C
|
||||
push {r4,lr}
|
||||
bl sub_80D33F4
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0xFF
|
||||
beq _080D33A6
|
||||
adds r0, r4, 0
|
||||
bl sub_80D361C
|
||||
adds r0, r4, 0
|
||||
bl DestroyTask
|
||||
_080D33A6:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D338C
|
||||
|
||||
thumb_func_start sub_80D33AC
|
||||
sub_80D33AC: @ 80D33AC
|
||||
push {r4,r5,lr}
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
ldr r0, =sub_80D3660
|
||||
bl CreateTask
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r2, 0x1
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r3, r1, 3
|
||||
ldr r5, =gTasks + 0x8
|
||||
ldr r0, =0x0000ffff
|
||||
adds r4, r0, 0
|
||||
_080D33CC:
|
||||
lsls r0, r2, 1
|
||||
adds r0, r3
|
||||
adds r0, r5
|
||||
ldrh r1, [r0]
|
||||
orrs r1, r4
|
||||
strh r1, [r0]
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0xF
|
||||
bls _080D33CC
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D33AC
|
||||
|
||||
thumb_func_start sub_80D33F4
|
||||
sub_80D33F4: @ 80D33F4
|
||||
push {lr}
|
||||
ldr r0, =sub_80D3660
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_80D33F4
|
||||
|
||||
thumb_func_start sub_80D3408
|
||||
sub_80D3408: @ 80D3408
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
mov r9, r2
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
adds r7, r5, 0
|
||||
lsls r1, 24
|
||||
lsrs r6, r1, 24
|
||||
mov r8, r6
|
||||
adds r0, r5, 0
|
||||
adds r1, r6, 0
|
||||
bl sub_80D3474
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x10
|
||||
beq _080D3444
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl sub_80D3584
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080D3464
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
adds r2, r6, 0
|
||||
b _080D345A
|
||||
_080D3444:
|
||||
adds r0, r7, 0
|
||||
movs r1, 0xFF
|
||||
bl sub_80D3474
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
cmp r4, 0x10
|
||||
beq _080D3464
|
||||
adds r0, r7, 0
|
||||
adds r1, r4, 0
|
||||
mov r2, r8
|
||||
_080D345A:
|
||||
mov r3, r9
|
||||
bl sub_80D35DC
|
||||
movs r0, 0
|
||||
b _080D3466
|
||||
_080D3464:
|
||||
movs r0, 0x1
|
||||
_080D3466:
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D3408
|
||||
|
||||
thumb_func_start sub_80D3474
|
||||
sub_80D3474: @ 80D3474
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r3, r1, 24
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
ldr r0, =gTasks + 0x8
|
||||
adds r1, r0
|
||||
adds r1, 0x2
|
||||
movs r2, 0
|
||||
_080D348C:
|
||||
ldrb r0, [r1]
|
||||
cmp r0, r3
|
||||
bne _080D349C
|
||||
adds r0, r2, 0
|
||||
b _080D34AA
|
||||
.pool
|
||||
_080D349C:
|
||||
adds r0, r2, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
adds r1, 0x1
|
||||
cmp r2, 0xF
|
||||
bls _080D348C
|
||||
movs r0, 0x10
|
||||
_080D34AA:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D3474
|
||||
|
||||
thumb_func_start sub_80D34B0
|
||||
sub_80D34B0: @ 80D34B0
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r3, r1, 24
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
ldr r0, =gTasks + 0x8
|
||||
adds r1, r0
|
||||
adds r1, 0x2
|
||||
str r1, [r2]
|
||||
movs r0, 0
|
||||
cmp r0, r3
|
||||
bcs _080D34DC
|
||||
_080D34CE:
|
||||
adds r0, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
adds r1, 0x1
|
||||
cmp r0, r3
|
||||
bcc _080D34CE
|
||||
str r1, [r2]
|
||||
_080D34DC:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D34B0
|
||||
|
||||
thumb_func_start sub_80D34E4
|
||||
sub_80D34E4: @ 80D34E4
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r2, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
mov r2, sp
|
||||
bl sub_80D34B0
|
||||
ldr r0, [sp]
|
||||
strb r4, [r0]
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D34E4
|
||||
|
||||
thumb_func_start sub_80D3508
|
||||
sub_80D3508: @ 80D3508
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r2, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r2, sp
|
||||
bl sub_80D34B0
|
||||
ldr r0, [sp]
|
||||
ldrb r0, [r0]
|
||||
strb r0, [r4]
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D3508
|
||||
|
||||
thumb_func_start sub_80D352C
|
||||
sub_80D352C: @ 80D352C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
ldr r2, =gBitTable
|
||||
lsrs r1, 22
|
||||
adds r1, r2
|
||||
ldr r2, [r1]
|
||||
mvns r2, r2
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
ldr r3, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r1, r3
|
||||
ldrh r0, [r1, 0x8]
|
||||
ands r2, r0
|
||||
strh r2, [r1, 0x8]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_80D352C
|
||||
|
||||
thumb_func_start sub_80D355C
|
||||
sub_80D355C: @ 80D355C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
ldr r3, =gTasks
|
||||
lsls r2, r0, 2
|
||||
adds r2, r0
|
||||
lsls r2, 3
|
||||
adds r2, r3
|
||||
ldr r0, =gBitTable
|
||||
lsrs r1, 22
|
||||
adds r1, r0
|
||||
ldr r0, [r1]
|
||||
ldrh r1, [r2, 0x8]
|
||||
orrs r0, r1
|
||||
strh r0, [r2, 0x8]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_80D355C
|
||||
|
||||
thumb_func_start sub_80D3584
|
||||
sub_80D3584: @ 80D3584
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, 24
|
||||
ldr r3, =gTasks
|
||||
lsls r2, r0, 2
|
||||
adds r2, r0
|
||||
lsls r2, 3
|
||||
adds r2, r3
|
||||
ldr r0, =gBitTable
|
||||
lsrs r1, 22
|
||||
adds r1, r0
|
||||
ldr r0, [r1]
|
||||
ldrh r1, [r2, 0x8]
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _080D35B4
|
||||
movs r0, 0
|
||||
b _080D35B6
|
||||
.pool
|
||||
_080D35B4:
|
||||
movs r0, 0x1
|
||||
_080D35B6:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80D3584
|
||||
|
||||
thumb_func_start npc_obj_offscreen_culling_and_flag_update
|
||||
npc_obj_offscreen_culling_and_flag_update: @ 80D35BC
|
||||
lsls r0, 24
|
||||
ldr r2, =gUnknown_02039D90
|
||||
lsrs r0, 22
|
||||
adds r0, r2
|
||||
str r1, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end npc_obj_offscreen_culling_and_flag_update
|
||||
|
||||
thumb_func_start sub_80D35CC
|
||||
sub_80D35CC: @ 80D35CC
|
||||
lsls r0, 24
|
||||
ldr r1, =gUnknown_02039D90
|
||||
lsrs r0, 22
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_80D35CC
|
||||
|
||||
thumb_func_start sub_80D35DC
|
||||
sub_80D35DC: @ 80D35DC
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
adds r6, r2, 0
|
||||
mov r8, r3
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
lsls r6, 24
|
||||
lsrs r6, 24
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl sub_80D352C
|
||||
adds r0, r4, 0
|
||||
mov r1, r8
|
||||
bl npc_obj_offscreen_culling_and_flag_update
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
adds r2, r6, 0
|
||||
bl sub_80D34E4
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D35DC
|
||||
|
||||
thumb_func_start sub_80D361C
|
||||
sub_80D361C: @ 80D361C
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
ldr r0, =gTasks + 0x8
|
||||
adds r1, r0
|
||||
adds r4, r1, 0x2
|
||||
movs r5, 0
|
||||
_080D3630:
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0xFF
|
||||
beq _080D3646
|
||||
adds r1, r0, 0
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gMapObjects
|
||||
adds r0, r1
|
||||
bl npc_sync_anim_pause_bits
|
||||
_080D3646:
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
adds r4, 0x1
|
||||
cmp r5, 0xF
|
||||
bls _080D3630
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80D361C
|
||||
|
||||
thumb_func_start sub_80D3660
|
||||
sub_80D3660: @ 80D3660
|
||||
push {r4-r7,lr}
|
||||
sub sp, 0x4
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
movs r5, 0
|
||||
mov r6, sp
|
||||
_080D366C:
|
||||
adds r0, r7, 0
|
||||
adds r1, r5, 0
|
||||
mov r2, sp
|
||||
bl sub_80D3508
|
||||
ldrb r0, [r6]
|
||||
cmp r0, 0xFF
|
||||
beq _080D3690
|
||||
adds r4, r0, 0
|
||||
adds r0, r5, 0
|
||||
bl sub_80D35CC
|
||||
adds r3, r0, 0
|
||||
adds r0, r7, 0
|
||||
adds r1, r5, 0
|
||||
adds r2, r4, 0
|
||||
bl sub_80D36A4
|
||||
_080D3690:
|
||||
adds r0, r5, 0x1
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
cmp r5, 0xF
|
||||
bls _080D366C
|
||||
add sp, 0x4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D3660
|
||||
|
||||
thumb_func_start sub_80D36A4
|
||||
sub_80D36A4: @ 80D36A4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
adds r5, r3, 0
|
||||
lsls r0, 24
|
||||
lsrs r7, r0, 24
|
||||
lsls r1, 24
|
||||
lsrs r6, r1, 24
|
||||
mov r8, r6
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
lsls r0, r2, 3
|
||||
adds r0, r2
|
||||
lsls r0, 2
|
||||
ldr r1, =gMapObjects
|
||||
adds r4, r0, r1
|
||||
adds r0, r4, 0
|
||||
bl FieldObjectIsSpecialAnimActive
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080D36DC
|
||||
adds r0, r4, 0
|
||||
bl FieldObjectClearAnimIfSpecialAnimFinished
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _080D370E
|
||||
_080D36DC:
|
||||
ldrb r1, [r5]
|
||||
cmp r1, 0xFE
|
||||
bne _080D36F8
|
||||
adds r0, r7, 0
|
||||
adds r1, r6, 0
|
||||
bl sub_80D355C
|
||||
adds r0, r4, 0
|
||||
bl sub_8097404
|
||||
b _080D370E
|
||||
.pool
|
||||
_080D36F8:
|
||||
adds r0, r4, 0
|
||||
bl FieldObjectSetSpecialAnim
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _080D370E
|
||||
adds r5, 0x1
|
||||
mov r0, r8
|
||||
adds r1, r5, 0
|
||||
bl npc_obj_offscreen_culling_and_flag_update
|
||||
_080D370E:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_80D36A4
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
214
asm/smokescreen.s
Executable file
214
asm/smokescreen.s
Executable file
@ -0,0 +1,214 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_807521C
|
||||
sub_807521C: @ 807521C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
lsls r1, 16
|
||||
lsrs r7, r1, 16
|
||||
lsls r2, 24
|
||||
lsrs r4, r2, 24
|
||||
ldr r5, =gUnknown_0831C620
|
||||
ldrh r0, [r5, 0x6]
|
||||
bl GetSpriteTileStartByTag
|
||||
lsls r0, 16
|
||||
ldr r1, =0xffff0000
|
||||
cmp r0, r1
|
||||
bne _0807524E
|
||||
adds r0, r5, 0
|
||||
bl LoadCompressedObjectPicUsingHeap
|
||||
ldr r0, =gUnknown_0831C628
|
||||
bl LoadCompressedObjectPaletteUsingHeap
|
||||
_0807524E:
|
||||
ldr r0, =sub_8075370
|
||||
bl CreateInvisibleSpriteWithCallback
|
||||
mov r8, r0
|
||||
mov r0, r8
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
lsls r5, r0, 4
|
||||
add r5, r8
|
||||
lsls r5, 2
|
||||
ldr r0, =gSprites
|
||||
adds r5, r0
|
||||
strh r4, [r5, 0x30]
|
||||
ldr r0, =gUnknown_0831C688
|
||||
mov r9, r0
|
||||
lsls r6, 16
|
||||
asrs r0, r6, 16
|
||||
mov r10, r0
|
||||
ldr r0, =0xfff00000
|
||||
adds r6, r0
|
||||
asrs r6, 16
|
||||
lsls r4, r7, 16
|
||||
asrs r7, r4, 16
|
||||
adds r4, r0
|
||||
asrs r4, 16
|
||||
mov r0, r9
|
||||
adds r1, r6, 0
|
||||
adds r2, r4, 0
|
||||
movs r3, 0x2
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r1, r0, 4
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
ldr r0, =gSprites
|
||||
adds r1, r0
|
||||
mov r0, r8
|
||||
strh r0, [r1, 0x2E]
|
||||
ldrh r0, [r5, 0x2E]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5, 0x2E]
|
||||
adds r0, r1, 0
|
||||
bl AnimateSprite
|
||||
mov r0, r9
|
||||
mov r1, r10
|
||||
adds r2, r4, 0
|
||||
movs r3, 0x2
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r4, r0, 4
|
||||
adds r4, r0
|
||||
lsls r4, 2
|
||||
ldr r0, =gSprites
|
||||
adds r4, r0
|
||||
mov r0, r8
|
||||
strh r0, [r4, 0x2E]
|
||||
ldrh r0, [r5, 0x2E]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5, 0x2E]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl StartSpriteAnim
|
||||
adds r0, r4, 0
|
||||
bl AnimateSprite
|
||||
mov r0, r9
|
||||
adds r1, r6, 0
|
||||
adds r2, r7, 0
|
||||
movs r3, 0x2
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r4, r0, 4
|
||||
adds r4, r0
|
||||
lsls r4, 2
|
||||
ldr r0, =gSprites
|
||||
adds r4, r0
|
||||
mov r0, r8
|
||||
strh r0, [r4, 0x2E]
|
||||
ldrh r0, [r5, 0x2E]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5, 0x2E]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2
|
||||
bl StartSpriteAnim
|
||||
adds r0, r4, 0
|
||||
bl AnimateSprite
|
||||
mov r0, r9
|
||||
mov r1, r10
|
||||
adds r2, r7, 0
|
||||
movs r3, 0x2
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
lsls r4, r0, 4
|
||||
adds r4, r0
|
||||
lsls r4, 2
|
||||
ldr r0, =gSprites
|
||||
adds r4, r0
|
||||
mov r0, r8
|
||||
strh r0, [r4, 0x2E]
|
||||
ldrh r0, [r5, 0x2E]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5, 0x2E]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x3
|
||||
bl StartSpriteAnim
|
||||
adds r0, r4, 0
|
||||
bl AnimateSprite
|
||||
mov r0, r8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_807521C
|
||||
|
||||
thumb_func_start sub_8075370
|
||||
sub_8075370: @ 8075370
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
movs r1, 0x2E
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
bne _080753A8
|
||||
ldr r0, =gUnknown_0831C620
|
||||
ldrh r0, [r0, 0x6]
|
||||
bl FreeSpriteTilesByTag
|
||||
ldr r0, =gUnknown_0831C628
|
||||
ldrh r0, [r0, 0x4]
|
||||
bl FreeSpritePaletteByTag
|
||||
movs r1, 0x30
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
bne _080753A4
|
||||
adds r0, r4, 0
|
||||
bl DestroySprite
|
||||
b _080753A8
|
||||
.pool
|
||||
_080753A4:
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r4, 0x1C]
|
||||
_080753A8:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_8075370
|
||||
|
||||
thumb_func_start sub_80753B4
|
||||
sub_80753B4: @ 80753B4
|
||||
push {lr}
|
||||
adds r3, r0, 0
|
||||
adds r0, 0x3F
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x10
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _080753DE
|
||||
ldr r2, =gSprites
|
||||
movs r0, 0x2E
|
||||
ldrsh r1, [r3, r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
ldrh r1, [r0, 0x2E]
|
||||
subs r1, 0x1
|
||||
strh r1, [r0, 0x2E]
|
||||
adds r0, r3, 0
|
||||
bl DestroySprite
|
||||
_080753DE:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_80753B4
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
206
asm/trainer_rematch.s
Executable file
206
asm/trainer_rematch.s
Executable file
@ -0,0 +1,206 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81DA57C
|
||||
sub_81DA57C: @ 81DA57C
|
||||
push {lr}
|
||||
ldr r0, =0x00000864
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA5CA
|
||||
bl Random
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
movs r1, 0x64
|
||||
bl __umodsi3
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0x1E
|
||||
bhi _081DA5CA
|
||||
movs r0, 0x5B
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081DA5C0
|
||||
ldr r0, =gUnknown_0862AD34
|
||||
movs r1, 0x8
|
||||
movs r2, 0x5
|
||||
bl sub_81DA5D4
|
||||
b _081DA5CA
|
||||
.pool
|
||||
_081DA5C0:
|
||||
ldr r0, =gUnknown_0862AD44
|
||||
movs r1, 0x7
|
||||
movs r2, 0x1
|
||||
bl sub_81DA5D4
|
||||
_081DA5CA:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA57C
|
||||
|
||||
thumb_func_start sub_81DA5D4
|
||||
sub_81DA5D4: @ 81DA5D4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x8
|
||||
mov r9, r0
|
||||
adds r7, r1, 0
|
||||
mov r10, r2
|
||||
movs r6, 0
|
||||
movs r0, 0x5
|
||||
mov r8, r0
|
||||
movs r5, 0
|
||||
cmp r5, r7
|
||||
bcs _081DA61C
|
||||
mov r4, r9
|
||||
_081DA5F4:
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r4]
|
||||
ldr r2, =0x000009ca
|
||||
adds r0, r2
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _081DA614
|
||||
adds r0, r1, 0
|
||||
bl sub_81DA6CC
|
||||
cmp r8, r0
|
||||
ble _081DA612
|
||||
mov r8, r0
|
||||
_081DA612:
|
||||
adds r6, 0x1
|
||||
_081DA614:
|
||||
adds r4, 0x2
|
||||
adds r5, 0x1
|
||||
cmp r5, r7
|
||||
bcc _081DA5F4
|
||||
_081DA61C:
|
||||
cmp r6, 0
|
||||
beq _081DA6BA
|
||||
cmp r8, r10
|
||||
bhi _081DA6BA
|
||||
movs r6, 0
|
||||
movs r5, 0
|
||||
cmp r5, r7
|
||||
bcs _081DA654
|
||||
mov r4, r9
|
||||
_081DA62E:
|
||||
ldr r0, =gSaveBlock1Ptr
|
||||
ldr r0, [r0]
|
||||
ldrh r1, [r4]
|
||||
ldr r2, =0x000009ca
|
||||
adds r0, r2
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _081DA64C
|
||||
adds r0, r1, 0
|
||||
bl sub_81DA6CC
|
||||
cmp r0, r8
|
||||
bne _081DA64C
|
||||
adds r6, 0x1
|
||||
_081DA64C:
|
||||
adds r4, 0x2
|
||||
adds r5, 0x1
|
||||
cmp r5, r7
|
||||
bcc _081DA62E
|
||||
_081DA654:
|
||||
cmp r6, 0
|
||||
beq _081DA6BA
|
||||
bl Random
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
adds r1, r6, 0
|
||||
bl __modsi3
|
||||
adds r6, r0, 0
|
||||
movs r5, 0
|
||||
cmp r5, r7
|
||||
bcs _081DA6BA
|
||||
ldr r2, =gSaveBlock1Ptr
|
||||
ldr r3, =0x000009ca
|
||||
mov r4, r9
|
||||
_081DA674:
|
||||
ldr r0, [r2]
|
||||
ldrh r1, [r4]
|
||||
adds r0, r3
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _081DA6B2
|
||||
adds r0, r1, 0
|
||||
str r2, [sp]
|
||||
str r3, [sp, 0x4]
|
||||
bl sub_81DA6CC
|
||||
ldr r2, [sp]
|
||||
ldr r3, [sp, 0x4]
|
||||
cmp r0, r8
|
||||
bne _081DA6B2
|
||||
cmp r6, 0
|
||||
bne _081DA6B0
|
||||
ldr r0, [r2]
|
||||
adds r0, r3
|
||||
ldrh r4, [r4]
|
||||
adds r0, r4
|
||||
mov r1, r8
|
||||
strb r1, [r0]
|
||||
b _081DA6BA
|
||||
.pool
|
||||
_081DA6B0:
|
||||
subs r6, 0x1
|
||||
_081DA6B2:
|
||||
adds r4, 0x2
|
||||
adds r5, 0x1
|
||||
cmp r5, r7
|
||||
bcc _081DA674
|
||||
_081DA6BA:
|
||||
add sp, 0x8
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81DA5D4
|
||||
|
||||
thumb_func_start sub_81DA6CC
|
||||
sub_81DA6CC: @ 81DA6CC
|
||||
push {r4-r6,lr}
|
||||
adds r5, r0, 0
|
||||
movs r4, 0
|
||||
ldr r6, =gUnknown_085500A4
|
||||
_081DA6D4:
|
||||
lsls r0, r4, 1
|
||||
lsls r1, r5, 4
|
||||
adds r0, r1
|
||||
adds r0, r6
|
||||
ldrh r0, [r0]
|
||||
bl trainer_flag_check
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DA6F0
|
||||
adds r0, r4, 0
|
||||
b _081DA6F8
|
||||
.pool
|
||||
_081DA6F0:
|
||||
adds r4, 0x1
|
||||
cmp r4, 0x4
|
||||
ble _081DA6D4
|
||||
movs r0, 0x5
|
||||
_081DA6F8:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DA6CC
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
607
asm/unk_sprite_file.s
Executable file
607
asm/unk_sprite_file.s
Executable file
@ -0,0 +1,607 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81DA700
|
||||
sub_81DA700: @ 81DA700
|
||||
push {lr}
|
||||
sub sp, 0x8
|
||||
add r1, sp, 0x4
|
||||
mov r0, sp
|
||||
bl sub_8149F58
|
||||
ldr r0, =gUnknown_0862AD54
|
||||
ldr r1, [sp, 0x4]
|
||||
bl LZ77UnCompVram
|
||||
ldr r0, =gUnknown_0862AF30
|
||||
ldr r1, [sp]
|
||||
bl LZ77UnCompVram
|
||||
ldr r0, =gUnknown_0862B53C
|
||||
movs r1, 0xF0
|
||||
movs r2, 0x20
|
||||
bl LoadPalette
|
||||
ldr r0, =gUnknown_0862B724
|
||||
bl LoadCompressedObjectPic
|
||||
ldr r0, =gUnknown_0862B72C
|
||||
bl LoadSpritePalette
|
||||
add sp, 0x8
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA700
|
||||
|
||||
thumb_func_start sub_81DA74C
|
||||
sub_81DA74C: @ 81DA74C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
adds r5, r0, 0
|
||||
adds r6, r1, 0
|
||||
ldr r0, [sp, 0x24]
|
||||
ldr r1, [sp, 0x28]
|
||||
ldr r4, [sp, 0x2C]
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
str r2, [sp]
|
||||
lsls r3, 24
|
||||
lsrs r3, 24
|
||||
mov r10, r3
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r8, r0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r9, r1
|
||||
lsls r4, 24
|
||||
lsrs r7, r4, 24
|
||||
ldr r0, =gUnknown_0862B758
|
||||
lsls r5, 16
|
||||
asrs r5, 16
|
||||
lsls r6, 16
|
||||
asrs r6, 16
|
||||
adds r1, r5, 0
|
||||
adds r2, r6, 0
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
cmp r7, 0x1
|
||||
beq _081DA7D0
|
||||
cmp r7, 0x1
|
||||
bgt _081DA7A8
|
||||
cmp r7, 0
|
||||
beq _081DA7B8
|
||||
b _081DA7AC
|
||||
.pool
|
||||
_081DA7A8:
|
||||
cmp r7, 0x2
|
||||
beq _081DA7E4
|
||||
_081DA7AC:
|
||||
ldr r6, =gSprites
|
||||
lsls r3, r5, 4
|
||||
b _081DA7F8
|
||||
.pool
|
||||
_081DA7B8:
|
||||
ldr r2, =gSprites
|
||||
lsls r3, r5, 4
|
||||
adds r0, r3, r5
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
movs r1, 0x78
|
||||
strh r1, [r0, 0x2E]
|
||||
movs r1, 0x2D
|
||||
b _081DA7F4
|
||||
.pool
|
||||
_081DA7D0:
|
||||
ldr r2, =gSprites
|
||||
lsls r3, r5, 4
|
||||
adds r0, r3, r5
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
movs r1, 0x59
|
||||
b _081DA7F0
|
||||
.pool
|
||||
_081DA7E4:
|
||||
ldr r2, =gSprites
|
||||
lsls r3, r5, 4
|
||||
adds r0, r3, r5
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
movs r1, 0x97
|
||||
_081DA7F0:
|
||||
strh r1, [r0, 0x2E]
|
||||
movs r1, 0x61
|
||||
_081DA7F4:
|
||||
strh r1, [r0, 0x30]
|
||||
adds r6, r2, 0
|
||||
_081DA7F8:
|
||||
adds r4, r3, r5
|
||||
lsls r4, 2
|
||||
adds r0, r4, r6
|
||||
mov r2, r8
|
||||
lsls r1, r2, 24
|
||||
asrs r1, 24
|
||||
movs r2, 0
|
||||
strh r1, [r0, 0x32]
|
||||
mov r3, r9
|
||||
lsls r1, r3, 24
|
||||
asrs r1, 24
|
||||
strh r1, [r0, 0x34]
|
||||
mov r1, sp
|
||||
ldrh r1, [r1]
|
||||
strh r1, [r0, 0x3A]
|
||||
mov r3, r10
|
||||
strh r3, [r0, 0x3C]
|
||||
strh r2, [r0, 0x36]
|
||||
strh r2, [r0, 0x38]
|
||||
adds r1, r7, 0
|
||||
bl StartSpriteAnim
|
||||
adds r0, r6, 0
|
||||
adds r0, 0x1C
|
||||
adds r4, r0
|
||||
ldr r0, =sub_81DA848
|
||||
str r0, [r4]
|
||||
adds r0, r5, 0
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DA74C
|
||||
|
||||
thumb_func_start sub_81DA848
|
||||
sub_81DA848: @ 81DA848
|
||||
push {r4,r5,lr}
|
||||
adds r3, r0, 0
|
||||
adds r2, r3, 0
|
||||
adds r2, 0x2E
|
||||
movs r0, 0x20
|
||||
ldrsh r1, [r3, r0]
|
||||
movs r4, 0x2E
|
||||
ldrsh r0, [r3, r4]
|
||||
cmp r1, r0
|
||||
bne _081DA874
|
||||
movs r5, 0x22
|
||||
ldrsh r1, [r3, r5]
|
||||
movs r4, 0x2
|
||||
ldrsh r0, [r2, r4]
|
||||
cmp r1, r0
|
||||
bne _081DA874
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r3, 0x1C]
|
||||
b _081DA8B4
|
||||
.pool
|
||||
_081DA874:
|
||||
ldrh r4, [r2, 0x8]
|
||||
movs r5, 0x8
|
||||
ldrsh r1, [r2, r5]
|
||||
movs r5, 0xC
|
||||
ldrsh r0, [r2, r5]
|
||||
cmp r1, r0
|
||||
bne _081DA890
|
||||
ldrh r0, [r2, 0x4]
|
||||
ldrh r1, [r3, 0x20]
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
strh r0, [r3, 0x20]
|
||||
strh r1, [r2, 0x8]
|
||||
b _081DA894
|
||||
_081DA890:
|
||||
adds r0, r4, 0x1
|
||||
strh r0, [r2, 0x8]
|
||||
_081DA894:
|
||||
ldrh r4, [r2, 0xA]
|
||||
movs r5, 0xA
|
||||
ldrsh r1, [r2, r5]
|
||||
movs r5, 0xE
|
||||
ldrsh r0, [r2, r5]
|
||||
cmp r1, r0
|
||||
bne _081DA8B0
|
||||
ldrh r0, [r2, 0x6]
|
||||
ldrh r1, [r3, 0x22]
|
||||
adds r0, r1
|
||||
movs r1, 0
|
||||
strh r0, [r3, 0x22]
|
||||
strh r1, [r2, 0xA]
|
||||
b _081DA8B4
|
||||
_081DA8B0:
|
||||
adds r0, r4, 0x1
|
||||
strh r0, [r2, 0xA]
|
||||
_081DA8B4:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81DA848
|
||||
|
||||
thumb_func_start sub_81DA8BC
|
||||
sub_81DA8BC: @ 81DA8BC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0xC
|
||||
adds r6, r0, 0
|
||||
mov r8, r1
|
||||
ldr r0, [sp, 0x2C]
|
||||
ldr r1, [sp, 0x30]
|
||||
ldr r4, [sp, 0x34]
|
||||
ldr r5, [sp, 0x38]
|
||||
lsls r2, 16
|
||||
lsrs r2, 16
|
||||
str r2, [sp]
|
||||
lsls r3, 16
|
||||
lsrs r3, 16
|
||||
str r3, [sp, 0x4]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
mov r10, r0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
mov r9, r1
|
||||
lsls r4, 16
|
||||
lsrs r7, r4, 16
|
||||
lsls r5, 24
|
||||
lsrs r5, 24
|
||||
ldr r0, =gUnknown_0862B758
|
||||
lsls r6, 16
|
||||
asrs r6, 16
|
||||
mov r1, r8
|
||||
lsls r1, 16
|
||||
asrs r1, 16
|
||||
mov r8, r1
|
||||
adds r1, r6, 0
|
||||
mov r2, r8
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
lsls r0, 24
|
||||
lsrs r6, r0, 24
|
||||
cmp r5, 0x1
|
||||
beq _081DA94C
|
||||
cmp r5, 0x1
|
||||
bgt _081DA924
|
||||
cmp r5, 0
|
||||
beq _081DA934
|
||||
b _081DA928
|
||||
.pool
|
||||
_081DA924:
|
||||
cmp r5, 0x2
|
||||
beq _081DA960
|
||||
_081DA928:
|
||||
ldr r2, =gSprites
|
||||
lsls r3, r6, 4
|
||||
b _081DA972
|
||||
.pool
|
||||
_081DA934:
|
||||
ldr r2, =gSprites
|
||||
lsls r3, r6, 4
|
||||
adds r0, r3, r6
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
movs r1, 0x78
|
||||
strh r1, [r0, 0x2E]
|
||||
movs r1, 0x2D
|
||||
b _081DA970
|
||||
.pool
|
||||
_081DA94C:
|
||||
ldr r2, =gSprites
|
||||
lsls r3, r6, 4
|
||||
adds r0, r3, r6
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
movs r1, 0x59
|
||||
b _081DA96C
|
||||
.pool
|
||||
_081DA960:
|
||||
ldr r2, =gSprites
|
||||
lsls r3, r6, 4
|
||||
adds r0, r3, r6
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
movs r1, 0x97
|
||||
_081DA96C:
|
||||
strh r1, [r0, 0x2E]
|
||||
movs r1, 0x61
|
||||
_081DA970:
|
||||
strh r1, [r0, 0x30]
|
||||
_081DA972:
|
||||
adds r4, r3, r6
|
||||
lsls r4, 2
|
||||
adds r0, r4, r2
|
||||
mov r3, sp
|
||||
ldrh r3, [r3]
|
||||
strh r3, [r0, 0x32]
|
||||
mov r1, sp
|
||||
ldrh r1, [r1, 0x4]
|
||||
strh r1, [r0, 0x34]
|
||||
mov r3, r10
|
||||
strh r3, [r0, 0x36]
|
||||
mov r1, r9
|
||||
strh r1, [r0, 0x38]
|
||||
strh r7, [r0, 0x3A]
|
||||
adds r1, r5, 0
|
||||
str r2, [sp, 0x8]
|
||||
bl StartSpriteAnim
|
||||
ldr r2, [sp, 0x8]
|
||||
adds r0, r2, 0
|
||||
adds r0, 0x1C
|
||||
adds r4, r0
|
||||
ldr r0, =sub_81DA9BC
|
||||
str r0, [r4]
|
||||
adds r0, r6, 0
|
||||
add sp, 0xC
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DA8BC
|
||||
|
||||
thumb_func_start sub_81DA9BC
|
||||
sub_81DA9BC: @ 81DA9BC
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldrh r0, [r4, 0x32]
|
||||
bl Sin2
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
movs r2, 0x36
|
||||
ldrsh r1, [r4, r2]
|
||||
muls r0, r1
|
||||
asrs r0, 12
|
||||
strh r0, [r4, 0x24]
|
||||
ldrh r0, [r4, 0x32]
|
||||
bl Cos2
|
||||
lsls r0, 16
|
||||
asrs r0, 16
|
||||
movs r3, 0x36
|
||||
ldrsh r1, [r4, r3]
|
||||
muls r0, r1
|
||||
asrs r0, 12
|
||||
strh r0, [r4, 0x26]
|
||||
movs r1, 0x32
|
||||
ldrsh r0, [r4, r1]
|
||||
movs r2, 0x34
|
||||
ldrsh r1, [r4, r2]
|
||||
adds r0, r1
|
||||
movs r1, 0xB4
|
||||
lsls r1, 1
|
||||
bl __modsi3
|
||||
strh r0, [r4, 0x32]
|
||||
ldrh r2, [r4, 0x36]
|
||||
movs r3, 0x36
|
||||
ldrsh r1, [r4, r3]
|
||||
movs r3, 0x38
|
||||
ldrsh r0, [r4, r3]
|
||||
cmp r1, r0
|
||||
beq _081DAA12
|
||||
ldrh r0, [r4, 0x3A]
|
||||
adds r0, r2, r0
|
||||
strh r0, [r4, 0x36]
|
||||
b _081DAA16
|
||||
_081DAA12:
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r4, 0x1C]
|
||||
_081DAA16:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DA9BC
|
||||
|
||||
thumb_func_start sub_81DAA20
|
||||
sub_81DAA20: @ 81DAA20
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
ldr r4, =0x00002e90
|
||||
adds r0, r4, 0
|
||||
bl FreeSpriteTilesByTag
|
||||
adds r0, r4, 0
|
||||
bl FreeSpritePaletteByTag
|
||||
movs r0, 0x10
|
||||
ldrsh r1, [r5, r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r4, =gSprites
|
||||
adds r0, r4
|
||||
bl DestroySprite
|
||||
movs r0, 0x12
|
||||
ldrsh r1, [r5, r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r4
|
||||
bl DestroySprite
|
||||
movs r0, 0x14
|
||||
ldrsh r1, [r5, r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r4
|
||||
bl DestroySprite
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DAA20
|
||||
|
||||
thumb_func_start sub_81DAA74
|
||||
sub_81DAA74: @ 81DAA74
|
||||
push {r4,r5,lr}
|
||||
adds r3, r0, 0
|
||||
ldr r2, =gSprites
|
||||
movs r0, 0x10
|
||||
ldrsh r1, [r3, r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r5, r2, 0
|
||||
adds r5, 0x1C
|
||||
adds r0, r5
|
||||
ldr r4, [r0]
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
cmp r4, r0
|
||||
bne _081DAAC4
|
||||
movs r0, 0x12
|
||||
ldrsh r1, [r3, r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r2, [r0]
|
||||
cmp r2, r4
|
||||
bne _081DAAC4
|
||||
movs r1, 0x14
|
||||
ldrsh r0, [r3, r1]
|
||||
lsls r1, r0, 4
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
adds r1, r5
|
||||
ldr r0, [r1]
|
||||
cmp r0, r2
|
||||
bne _081DAAC4
|
||||
movs r0, 0x1
|
||||
b _081DAAC6
|
||||
.pool
|
||||
_081DAAC4:
|
||||
movs r0, 0
|
||||
_081DAAC6:
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DAA74
|
||||
|
||||
thumb_func_start sub_81DAACC
|
||||
sub_81DAACC: @ 81DAACC
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
movs r1, 0xA
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
beq _081DAB20
|
||||
bl sub_81DA700
|
||||
ldr r1, =0x00003f41
|
||||
movs r0, 0x50
|
||||
bl SetGpuReg
|
||||
movs r1, 0x80
|
||||
lsls r1, 5
|
||||
movs r0, 0x52
|
||||
bl SetGpuReg
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgX
|
||||
movs r0, 0
|
||||
movs r1, 0
|
||||
movs r2, 0
|
||||
bl ChangeBgY
|
||||
movs r1, 0xA0
|
||||
lsls r1, 3
|
||||
movs r0, 0
|
||||
movs r2, 0x2
|
||||
bl ChangeBgY
|
||||
movs r0, 0
|
||||
strh r0, [r4, 0xA]
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
movs r0, 0x1
|
||||
b _081DAB46
|
||||
.pool
|
||||
_081DAB20:
|
||||
movs r1, 0x80
|
||||
lsls r1, 6
|
||||
movs r0, 0
|
||||
bl ClearGpuRegBits
|
||||
movs r1, 0x80
|
||||
lsls r1, 7
|
||||
movs r0, 0
|
||||
bl ClearGpuRegBits
|
||||
movs r1, 0x80
|
||||
lsls r1, 1
|
||||
movs r0, 0
|
||||
bl ClearGpuRegBits
|
||||
ldrh r0, [r4, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0xA]
|
||||
movs r0, 0
|
||||
_081DAB46:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DAACC
|
||||
|
||||
thumb_func_start sub_81DAB4C
|
||||
sub_81DAB4C: @ 81DAB4C
|
||||
push {r4,lr}
|
||||
sub sp, 0x4
|
||||
adds r4, r0, 0
|
||||
movs r1, 0xC
|
||||
ldrsh r0, [r4, r1]
|
||||
cmp r0, 0
|
||||
bne _081DAB64
|
||||
movs r1, 0x80
|
||||
lsls r1, 1
|
||||
movs r0, 0
|
||||
bl SetGpuRegBits
|
||||
_081DAB64:
|
||||
ldrh r1, [r4, 0xC]
|
||||
movs r2, 0xC
|
||||
ldrsh r0, [r4, r2]
|
||||
cmp r0, 0x10
|
||||
bne _081DAB98
|
||||
ldrh r1, [r4, 0xE]
|
||||
movs r2, 0xE
|
||||
ldrsh r0, [r4, r2]
|
||||
cmp r0, 0x1F
|
||||
bne _081DAB92
|
||||
movs r1, 0x1
|
||||
negs r1, r1
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
adds r0, r1, 0
|
||||
movs r2, 0
|
||||
movs r3, 0x10
|
||||
bl BeginNormalPaletteFade
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
b _081DABB0
|
||||
_081DAB92:
|
||||
adds r0, r1, 0x1
|
||||
strh r0, [r4, 0xE]
|
||||
b _081DABB0
|
||||
_081DAB98:
|
||||
adds r0, r1, 0x1
|
||||
strh r0, [r4, 0xC]
|
||||
ldrh r1, [r4, 0xC]
|
||||
movs r0, 0x10
|
||||
subs r0, r1
|
||||
lsls r0, 8
|
||||
orrs r1, r0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
movs r0, 0x52
|
||||
bl SetGpuReg
|
||||
_081DABB0:
|
||||
movs r0, 0
|
||||
add sp, 0x4
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DAB4C
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
99
asm/unk_text_util.s
Executable file
99
asm/unk_text_util.s
Executable file
@ -0,0 +1,99 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81AFBF0
|
||||
sub_81AFBF0: @ 81AFBF0
|
||||
push {lr}
|
||||
ldr r1, =gUnknown_0203CE9C
|
||||
movs r2, 0
|
||||
adds r0, r1, 0
|
||||
adds r0, 0x1C
|
||||
_081AFBFA:
|
||||
str r2, [r0]
|
||||
subs r0, 0x4
|
||||
cmp r0, r1
|
||||
bge _081AFBFA
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81AFBF0
|
||||
|
||||
thumb_func_start sub_81AFC0C
|
||||
sub_81AFC0C: @ 81AFC0C
|
||||
push {lr}
|
||||
adds r2, r1, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x7
|
||||
bhi _081AFC20
|
||||
ldr r1, =gUnknown_0203CE9C
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
str r2, [r0]
|
||||
_081AFC20:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81AFC0C
|
||||
|
||||
thumb_func_start sub_81AFC28
|
||||
sub_81AFC28: @ 81AFC28
|
||||
push {r4,r5,lr}
|
||||
adds r2, r0, 0
|
||||
adds r4, r1, 0
|
||||
ldrb r1, [r4]
|
||||
adds r0, r1, 0
|
||||
cmp r0, 0xFF
|
||||
beq _081AFC68
|
||||
ldr r5, =gUnknown_0203CE9C
|
||||
_081AFC38:
|
||||
cmp r1, 0xF7
|
||||
beq _081AFC48
|
||||
strb r1, [r2]
|
||||
adds r4, 0x1
|
||||
adds r2, 0x1
|
||||
b _081AFC60
|
||||
.pool
|
||||
_081AFC48:
|
||||
adds r4, 0x1
|
||||
ldrb r0, [r4]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
cmp r1, 0
|
||||
beq _081AFC5E
|
||||
adds r0, r2, 0
|
||||
bl StringCopy
|
||||
adds r2, r0, 0
|
||||
_081AFC5E:
|
||||
adds r4, 0x1
|
||||
_081AFC60:
|
||||
ldrb r1, [r4]
|
||||
adds r0, r1, 0
|
||||
cmp r0, 0xFF
|
||||
bne _081AFC38
|
||||
_081AFC68:
|
||||
movs r0, 0xFF
|
||||
strb r0, [r2]
|
||||
adds r0, r2, 0
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81AFC28
|
||||
|
||||
thumb_func_start sub_81AFC74
|
||||
sub_81AFC74: @ 81AFC74
|
||||
lsls r0, 24
|
||||
ldr r1, =gUnknown_0203CE9C
|
||||
lsrs r0, 22
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
bx lr
|
||||
.pool
|
||||
thumb_func_end sub_81AFC74
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
583
asm/unk_text_util_2.s
Executable file
583
asm/unk_text_util_2.s
Executable file
@ -0,0 +1,583 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start Font6Func
|
||||
@ int Font6Func(struct TextPrinter *x)
|
||||
Font6Func: @ 81BA250
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
adds r4, r6, 0
|
||||
adds r4, 0x14
|
||||
ldrb r0, [r6, 0x1C]
|
||||
cmp r0, 0x6
|
||||
bls _081BA260
|
||||
b _081BA660
|
||||
_081BA260:
|
||||
lsls r0, 2
|
||||
ldr r1, =_081BA270
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081BA270:
|
||||
.4byte _081BA28C
|
||||
.4byte _081BA554
|
||||
.4byte _081BA566
|
||||
.4byte _081BA590
|
||||
.4byte _081BA5C8
|
||||
.4byte _081BA63C
|
||||
.4byte _081BA64E
|
||||
_081BA28C:
|
||||
ldr r2, =gMain
|
||||
ldrh r1, [r2, 0x2C]
|
||||
movs r0, 0x3
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081BA2A6
|
||||
ldrb r1, [r4]
|
||||
movs r0, 0x10
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081BA2A6
|
||||
movs r0, 0
|
||||
strb r0, [r6, 0x1E]
|
||||
_081BA2A6:
|
||||
ldrb r1, [r6, 0x1E]
|
||||
cmp r1, 0
|
||||
beq _081BA2E8
|
||||
ldrb r0, [r6, 0x1D]
|
||||
cmp r0, 0
|
||||
beq _081BA2E8
|
||||
subs r0, r1, 0x1
|
||||
strb r0, [r6, 0x1E]
|
||||
ldr r0, =gTextFlags
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x1
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081BA2C4
|
||||
b _081BA50E
|
||||
_081BA2C4:
|
||||
ldrh r1, [r2, 0x2E]
|
||||
movs r0, 0x3
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081BA2D0
|
||||
b _081BA50E
|
||||
_081BA2D0:
|
||||
ldrb r0, [r4]
|
||||
movs r1, 0x10
|
||||
orrs r0, r1
|
||||
strb r0, [r4]
|
||||
movs r0, 0
|
||||
strb r0, [r6, 0x1E]
|
||||
b _081BA50E
|
||||
.pool
|
||||
_081BA2E8:
|
||||
ldr r2, =gTextFlags
|
||||
ldrb r1, [r2]
|
||||
movs r0, 0x4
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081BA2FC
|
||||
movs r0, 0x3
|
||||
b _081BA2FE
|
||||
.pool
|
||||
_081BA2FC:
|
||||
ldrb r0, [r6, 0x1D]
|
||||
_081BA2FE:
|
||||
strb r0, [r6, 0x1E]
|
||||
ldr r0, [r6]
|
||||
ldrb r3, [r0]
|
||||
adds r0, 0x1
|
||||
str r0, [r6]
|
||||
adds r0, r3, 0
|
||||
subs r0, 0xF8
|
||||
cmp r0, 0x7
|
||||
bls _081BA312
|
||||
b _081BA52E
|
||||
_081BA312:
|
||||
lsls r0, 2
|
||||
ldr r1, =_081BA320
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081BA320:
|
||||
.4byte _081BA524
|
||||
.4byte _081BA512
|
||||
.4byte _081BA504
|
||||
.4byte _081BA500
|
||||
.4byte _081BA36E
|
||||
.4byte _081BA368
|
||||
.4byte _081BA340
|
||||
.4byte _081BA660
|
||||
_081BA340:
|
||||
ldrb r0, [r6, 0x6]
|
||||
strb r0, [r6, 0x8]
|
||||
ldrb r1, [r6, 0x5]
|
||||
ldr r0, =gFonts
|
||||
ldr r2, [r0]
|
||||
lsls r0, r1, 1
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
ldrb r1, [r6, 0xB]
|
||||
ldrb r0, [r0, 0x5]
|
||||
adds r1, r0
|
||||
ldrb r0, [r6, 0x9]
|
||||
adds r0, r1
|
||||
strb r0, [r6, 0x9]
|
||||
_081BA35E:
|
||||
movs r0, 0x2
|
||||
b _081BA662
|
||||
.pool
|
||||
_081BA368:
|
||||
ldr r0, [r6]
|
||||
adds r0, 0x1
|
||||
b _081BA4C4
|
||||
_081BA36E:
|
||||
ldr r0, [r6]
|
||||
ldrb r3, [r0]
|
||||
adds r0, 0x1
|
||||
str r0, [r6]
|
||||
subs r0, r3, 0x1
|
||||
cmp r0, 0xF
|
||||
bls _081BA37E
|
||||
b _081BA52E
|
||||
_081BA37E:
|
||||
lsls r0, 2
|
||||
ldr r1, =_081BA38C
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081BA38C:
|
||||
.4byte _081BA3CC
|
||||
.4byte _081BA3EE
|
||||
.4byte _081BA412
|
||||
.4byte _081BA42C
|
||||
.4byte _081BA478
|
||||
.4byte _081BA47E
|
||||
.4byte _081BA35E
|
||||
.4byte _081BA498
|
||||
.4byte _081BA4A8
|
||||
.4byte _081BA4BC
|
||||
.4byte _081BA4C0
|
||||
.4byte _081BA4C8
|
||||
.4byte _081BA4D2
|
||||
.4byte _081BA4DE
|
||||
.4byte _081BA4EE
|
||||
.4byte _081BA4C0
|
||||
_081BA3CC:
|
||||
ldr r2, [r6]
|
||||
ldrb r1, [r2]
|
||||
lsls r1, 4
|
||||
ldrb r3, [r6, 0xC]
|
||||
movs r0, 0xF
|
||||
ands r0, r3
|
||||
orrs r0, r1
|
||||
strb r0, [r6, 0xC]
|
||||
adds r2, 0x1
|
||||
str r2, [r6]
|
||||
lsls r0, 24
|
||||
lsrs r0, 28
|
||||
ldrb r2, [r6, 0xD]
|
||||
lsls r1, r2, 28
|
||||
lsrs r1, 28
|
||||
lsrs r2, 4
|
||||
b _081BA472
|
||||
_081BA3EE:
|
||||
ldr r1, [r6]
|
||||
ldrb r2, [r1]
|
||||
movs r0, 0xF
|
||||
ands r0, r2
|
||||
ldrb r3, [r6, 0xD]
|
||||
movs r2, 0x10
|
||||
negs r2, r2
|
||||
ands r2, r3
|
||||
orrs r2, r0
|
||||
strb r2, [r6, 0xD]
|
||||
adds r1, 0x1
|
||||
str r1, [r6]
|
||||
ldrb r0, [r6, 0xC]
|
||||
lsrs r0, 4
|
||||
lsls r1, r2, 28
|
||||
lsrs r1, 28
|
||||
lsrs r2, 4
|
||||
b _081BA472
|
||||
_081BA412:
|
||||
ldr r1, [r6]
|
||||
ldrb r0, [r1]
|
||||
lsls r0, 4
|
||||
ldrb r3, [r6, 0xD]
|
||||
movs r2, 0xF
|
||||
ands r2, r3
|
||||
orrs r2, r0
|
||||
strb r2, [r6, 0xD]
|
||||
adds r1, 0x1
|
||||
str r1, [r6]
|
||||
ldrb r0, [r6, 0xC]
|
||||
lsrs r0, 4
|
||||
b _081BA46A
|
||||
_081BA42C:
|
||||
ldr r3, [r6]
|
||||
ldrb r1, [r3]
|
||||
lsls r1, 4
|
||||
ldrb r4, [r6, 0xC]
|
||||
movs r2, 0xF
|
||||
adds r0, r2, 0
|
||||
ands r0, r4
|
||||
orrs r0, r1
|
||||
strb r0, [r6, 0xC]
|
||||
adds r5, r3, 0x1
|
||||
str r5, [r6]
|
||||
ldrb r3, [r3, 0x1]
|
||||
adds r1, r2, 0
|
||||
ands r1, r3
|
||||
ldrb r4, [r6, 0xD]
|
||||
movs r3, 0x10
|
||||
negs r3, r3
|
||||
ands r3, r4
|
||||
orrs r3, r1
|
||||
strb r3, [r6, 0xD]
|
||||
adds r4, r5, 0x1
|
||||
str r4, [r6]
|
||||
ldrb r1, [r5, 0x1]
|
||||
lsls r1, 4
|
||||
ands r2, r3
|
||||
orrs r2, r1
|
||||
strb r2, [r6, 0xD]
|
||||
adds r4, 0x1
|
||||
str r4, [r6]
|
||||
lsls r0, 24
|
||||
lsrs r0, 28
|
||||
_081BA46A:
|
||||
lsls r1, r2, 28
|
||||
lsrs r1, 28
|
||||
lsls r2, 24
|
||||
lsrs r2, 28
|
||||
_081BA472:
|
||||
bl GenerateFontHalfRowLookupTable
|
||||
b _081BA35E
|
||||
_081BA478:
|
||||
ldr r0, [r6]
|
||||
adds r0, 0x1
|
||||
b _081BA4C4
|
||||
_081BA47E:
|
||||
ldr r0, [r6]
|
||||
ldrb r0, [r0]
|
||||
movs r1, 0xF
|
||||
ands r1, r0
|
||||
ldrb r2, [r4]
|
||||
movs r0, 0x10
|
||||
negs r0, r0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r4]
|
||||
ldr r0, [r6]
|
||||
adds r0, 0x1
|
||||
b _081BA4C4
|
||||
_081BA498:
|
||||
ldr r0, [r6]
|
||||
ldrb r1, [r0]
|
||||
strb r1, [r6, 0x1E]
|
||||
adds r0, 0x1
|
||||
str r0, [r6]
|
||||
movs r0, 0x6
|
||||
strb r0, [r6, 0x1C]
|
||||
b _081BA35E
|
||||
_081BA4A8:
|
||||
movs r0, 0x1
|
||||
strb r0, [r6, 0x1C]
|
||||
ldrb r1, [r2]
|
||||
movs r0, 0x4
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081BA50E
|
||||
movs r0, 0
|
||||
strb r0, [r4, 0x2]
|
||||
b _081BA50E
|
||||
_081BA4BC:
|
||||
movs r0, 0x5
|
||||
b _081BA64A
|
||||
_081BA4C0:
|
||||
ldr r0, [r6]
|
||||
adds r0, 0x2
|
||||
_081BA4C4:
|
||||
str r0, [r6]
|
||||
b _081BA35E
|
||||
_081BA4C8:
|
||||
ldr r1, [r6]
|
||||
adds r0, r1, 0x1
|
||||
str r0, [r6]
|
||||
ldrb r3, [r1, 0x1]
|
||||
b _081BA52E
|
||||
_081BA4D2:
|
||||
ldr r1, [r6]
|
||||
ldrb r0, [r1]
|
||||
ldrb r2, [r6, 0x6]
|
||||
adds r0, r2
|
||||
strb r0, [r6, 0x8]
|
||||
b _081BA4E8
|
||||
_081BA4DE:
|
||||
ldr r1, [r6]
|
||||
ldrb r0, [r1]
|
||||
ldrb r2, [r6, 0x7]
|
||||
adds r0, r2
|
||||
strb r0, [r6, 0x9]
|
||||
_081BA4E8:
|
||||
adds r1, 0x1
|
||||
str r1, [r6]
|
||||
b _081BA35E
|
||||
_081BA4EE:
|
||||
ldrb r0, [r6, 0x4]
|
||||
ldrb r2, [r6, 0xD]
|
||||
lsls r2, 28
|
||||
lsrs r1, r2, 4
|
||||
orrs r1, r2
|
||||
lsrs r1, 24
|
||||
bl FillWindowPixelBuffer
|
||||
b _081BA35E
|
||||
_081BA500:
|
||||
movs r0, 0x2
|
||||
b _081BA506
|
||||
_081BA504:
|
||||
movs r0, 0x3
|
||||
_081BA506:
|
||||
strb r0, [r6, 0x1C]
|
||||
adds r0, r6, 0
|
||||
bl TextPrinterInitDownArrowCounters
|
||||
_081BA50E:
|
||||
movs r0, 0x3
|
||||
b _081BA662
|
||||
_081BA512:
|
||||
ldr r0, [r6]
|
||||
ldrb r3, [r0]
|
||||
movs r2, 0x80
|
||||
lsls r2, 1
|
||||
adds r1, r2, 0
|
||||
orrs r3, r1
|
||||
adds r0, 0x1
|
||||
str r0, [r6]
|
||||
b _081BA52E
|
||||
_081BA524:
|
||||
ldr r0, [r6]
|
||||
adds r0, 0x1
|
||||
str r0, [r6]
|
||||
movs r0, 0
|
||||
b _081BA662
|
||||
_081BA52E:
|
||||
adds r0, r3, 0
|
||||
bl DecompressGlyphFont6
|
||||
adds r0, r6, 0
|
||||
bl CopyGlyphToWindow
|
||||
ldr r0, =gUnknown_03002F90
|
||||
adds r0, 0x80
|
||||
ldrb r1, [r6, 0xA]
|
||||
ldrb r0, [r0]
|
||||
adds r1, r0
|
||||
ldrb r0, [r6, 0x8]
|
||||
adds r0, r1
|
||||
strb r0, [r6, 0x8]
|
||||
movs r0, 0
|
||||
b _081BA662
|
||||
.pool
|
||||
_081BA554:
|
||||
adds r0, r6, 0
|
||||
bl TextPrinterWait
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _081BA50E
|
||||
movs r0, 0
|
||||
strb r0, [r6, 0x1C]
|
||||
b _081BA50E
|
||||
_081BA566:
|
||||
adds r0, r6, 0
|
||||
bl TextPrinterWaitWithDownArrow
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _081BA50E
|
||||
ldrb r0, [r6, 0x4]
|
||||
ldrb r2, [r6, 0xD]
|
||||
lsls r2, 28
|
||||
lsrs r1, r2, 4
|
||||
orrs r1, r2
|
||||
lsrs r1, 24
|
||||
bl FillWindowPixelBuffer
|
||||
ldrb r0, [r6, 0x6]
|
||||
movs r1, 0
|
||||
strb r0, [r6, 0x8]
|
||||
ldrb r0, [r6, 0x7]
|
||||
strb r0, [r6, 0x9]
|
||||
strb r1, [r6, 0x1C]
|
||||
b _081BA50E
|
||||
_081BA590:
|
||||
adds r0, r6, 0
|
||||
bl TextPrinterWaitWithDownArrow
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _081BA50E
|
||||
adds r0, r6, 0
|
||||
bl TextPrinterClearDownArrow
|
||||
ldrb r1, [r6, 0x5]
|
||||
ldr r0, =gFonts
|
||||
ldr r2, [r0]
|
||||
lsls r0, r1, 1
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r2
|
||||
ldrb r1, [r6, 0xB]
|
||||
ldrb r0, [r0, 0x5]
|
||||
adds r1, r0
|
||||
strb r1, [r6, 0x1F]
|
||||
ldrb r0, [r6, 0x6]
|
||||
strb r0, [r6, 0x8]
|
||||
movs r0, 0x4
|
||||
strb r0, [r6, 0x1C]
|
||||
b _081BA50E
|
||||
.pool
|
||||
_081BA5C8:
|
||||
ldrb r2, [r6, 0x1F]
|
||||
cmp r2, 0
|
||||
beq _081BA638
|
||||
ldr r4, =gUnknown_08616124
|
||||
ldr r5, =gSaveBlock2Ptr
|
||||
ldr r0, [r5]
|
||||
ldrb r0, [r0, 0x14]
|
||||
lsls r1, r0, 29
|
||||
lsrs r0, r1, 29
|
||||
adds r0, r4
|
||||
ldrb r0, [r0]
|
||||
cmp r2, r0
|
||||
bcs _081BA604
|
||||
ldrb r0, [r6, 0x4]
|
||||
ldrb r1, [r6, 0xD]
|
||||
lsls r1, 28
|
||||
lsrs r3, r1, 4
|
||||
orrs r3, r1
|
||||
lsrs r3, 24
|
||||
movs r1, 0
|
||||
bl ScrollWindow
|
||||
movs r0, 0
|
||||
strb r0, [r6, 0x1F]
|
||||
b _081BA62E
|
||||
.pool
|
||||
_081BA604:
|
||||
ldrb r0, [r6, 0x4]
|
||||
lsrs r1, 29
|
||||
adds r1, r4
|
||||
ldrb r2, [r1]
|
||||
ldrb r1, [r6, 0xD]
|
||||
lsls r1, 28
|
||||
lsrs r3, r1, 4
|
||||
orrs r3, r1
|
||||
lsrs r3, 24
|
||||
movs r1, 0
|
||||
bl ScrollWindow
|
||||
ldr r0, [r5]
|
||||
ldrb r0, [r0, 0x14]
|
||||
lsls r0, 29
|
||||
lsrs r0, 29
|
||||
adds r0, r4
|
||||
ldrb r1, [r6, 0x1F]
|
||||
ldrb r0, [r0]
|
||||
subs r1, r0
|
||||
strb r1, [r6, 0x1F]
|
||||
_081BA62E:
|
||||
ldrb r0, [r6, 0x4]
|
||||
movs r1, 0x2
|
||||
bl CopyWindowToVram
|
||||
b _081BA50E
|
||||
_081BA638:
|
||||
strb r2, [r6, 0x1C]
|
||||
b _081BA50E
|
||||
_081BA63C:
|
||||
bl IsSEPlaying
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0
|
||||
beq _081BA64A
|
||||
b _081BA50E
|
||||
_081BA64A:
|
||||
strb r0, [r6, 0x1C]
|
||||
b _081BA50E
|
||||
_081BA64E:
|
||||
ldrb r0, [r6, 0x1E]
|
||||
adds r1, r0, 0
|
||||
cmp r1, 0
|
||||
beq _081BA65C
|
||||
subs r0, 0x1
|
||||
strb r0, [r6, 0x1E]
|
||||
b _081BA50E
|
||||
_081BA65C:
|
||||
strb r1, [r6, 0x1C]
|
||||
b _081BA50E
|
||||
_081BA660:
|
||||
movs r0, 0x1
|
||||
_081BA662:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end Font6Func
|
||||
|
||||
thumb_func_start DecompressGlyphFont6
|
||||
DecompressGlyphFont6: @ 81BA668
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 16
|
||||
lsrs r2, r0, 19
|
||||
lsls r2, 9
|
||||
movs r1, 0xE0
|
||||
lsls r1, 11
|
||||
ands r1, r0
|
||||
lsrs r1, 11
|
||||
ldr r0, =gFont6BrailleGlyphs
|
||||
adds r1, r0
|
||||
adds r5, r2, r1
|
||||
ldr r4, =gUnknown_03002F90
|
||||
adds r0, r5, 0
|
||||
adds r1, r4, 0
|
||||
bl DecompressGlyphTile
|
||||
adds r0, r5, 0
|
||||
adds r0, 0x10
|
||||
adds r1, r4, 0
|
||||
adds r1, 0x20
|
||||
bl DecompressGlyphTile
|
||||
movs r1, 0x80
|
||||
lsls r1, 1
|
||||
adds r0, r5, r1
|
||||
adds r1, r4, 0
|
||||
adds r1, 0x40
|
||||
bl DecompressGlyphTile
|
||||
movs r1, 0x88
|
||||
lsls r1, 1
|
||||
adds r0, r5, r1
|
||||
adds r1, r4, 0
|
||||
adds r1, 0x60
|
||||
bl DecompressGlyphTile
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x80
|
||||
movs r1, 0x10
|
||||
strb r1, [r0]
|
||||
adds r0, 0x1
|
||||
strb r1, [r0]
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end DecompressGlyphFont6
|
||||
|
||||
thumb_func_start GetGlyphWidthFont6
|
||||
GetGlyphWidthFont6: @ 81BA6CC
|
||||
movs r0, 0x10
|
||||
bx lr
|
||||
thumb_func_end GetGlyphWidthFont6
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
725
asm/unk_transition.s
Executable file
725
asm/unk_transition.s
Executable file
@ -0,0 +1,725 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81DABBC
|
||||
sub_81DABBC: @ 81DABBC
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
bl sub_81DAA74
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x1
|
||||
bne _081DABD2
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
_081DABD2:
|
||||
movs r0, 0
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DABBC
|
||||
|
||||
thumb_func_start sub_81DABDC
|
||||
sub_81DABDC: @ 81DABDC
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =gUnknown_0862B770
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r4, r1, r2
|
||||
_081DABEE:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DABEE
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DABDC
|
||||
|
||||
thumb_func_start sub_81DAC14
|
||||
sub_81DAC14: @ 81DAC14
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0xC
|
||||
adds r6, r0, 0
|
||||
movs r1, 0x33
|
||||
negs r1, r1
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
movs r5, 0x2
|
||||
str r5, [sp, 0x4]
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x78
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r6, 0x10]
|
||||
movs r0, 0x7
|
||||
negs r0, r0
|
||||
str r5, [sp]
|
||||
movs r4, 0x2
|
||||
negs r4, r4
|
||||
str r4, [sp, 0x4]
|
||||
movs r1, 0x1
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0xC1
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r6, 0x12]
|
||||
str r4, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r0, 0xF7
|
||||
movs r1, 0xC1
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r6, 0x14]
|
||||
ldrh r0, [r6, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r6, 0x8]
|
||||
movs r0, 0
|
||||
add sp, 0xC
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DAC14
|
||||
|
||||
thumb_func_start sub_81DAC80
|
||||
sub_81DAC80: @ 81DAC80
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081DACA4
|
||||
adds r0, r2, 0
|
||||
bl sub_81DAA20
|
||||
ldr r0, =sub_81DABDC
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl DestroyTask
|
||||
_081DACA4:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DAC80
|
||||
|
||||
thumb_func_start sub_81DACB4
|
||||
sub_81DACB4: @ 81DACB4
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =gUnknown_0862B784
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r4, r1, r2
|
||||
_081DACC6:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DACC6
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DACB4
|
||||
|
||||
thumb_func_start sub_81DACEC
|
||||
sub_81DACEC: @ 81DACEC
|
||||
push {r4,r5,lr}
|
||||
sub sp, 0xC
|
||||
adds r5, r0, 0
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
movs r4, 0x4
|
||||
negs r4, r4
|
||||
str r4, [sp, 0x4]
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x78
|
||||
movs r1, 0xC5
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r5, 0x10]
|
||||
str r4, [sp]
|
||||
movs r4, 0x2
|
||||
str r4, [sp, 0x4]
|
||||
movs r0, 0x1
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0xF1
|
||||
movs r1, 0x3B
|
||||
movs r2, 0
|
||||
movs r3, 0x1
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r5, 0x12]
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0x4
|
||||
str r1, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
str r4, [sp, 0x8]
|
||||
movs r1, 0x3B
|
||||
movs r2, 0
|
||||
movs r3, 0x1
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r5, 0x14]
|
||||
ldrh r0, [r5, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5, 0x8]
|
||||
movs r0, 0
|
||||
add sp, 0xC
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DACEC
|
||||
|
||||
thumb_func_start sub_81DAD58
|
||||
sub_81DAD58: @ 81DAD58
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081DAD7C
|
||||
adds r0, r2, 0
|
||||
bl sub_81DAA20
|
||||
ldr r0, =sub_81DACB4
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl DestroyTask
|
||||
_081DAD7C:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DAD58
|
||||
|
||||
thumb_func_start sub_81DAD8C
|
||||
sub_81DAD8C: @ 81DAD8C
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =gUnknown_0862B798
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r4, r1, r2
|
||||
_081DAD9E:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DAD9E
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DAD8C
|
||||
|
||||
thumb_func_start sub_81DADC4
|
||||
sub_81DADC4: @ 81DADC4
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0x10
|
||||
mov r8, r0
|
||||
movs r6, 0x80
|
||||
str r6, [sp]
|
||||
movs r4, 0
|
||||
str r4, [sp, 0x4]
|
||||
movs r5, 0x4
|
||||
negs r5, r5
|
||||
str r5, [sp, 0x8]
|
||||
str r4, [sp, 0xC]
|
||||
movs r0, 0x78
|
||||
movs r1, 0x2D
|
||||
movs r2, 0xC
|
||||
movs r3, 0x4
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r1, r8
|
||||
strh r0, [r1, 0x10]
|
||||
str r6, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r0, 0x1
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x59
|
||||
movs r1, 0x61
|
||||
movs r2, 0xFC
|
||||
movs r3, 0x4
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r1, r8
|
||||
strh r0, [r1, 0x12]
|
||||
str r6, [sp]
|
||||
str r4, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
movs r0, 0x2
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x97
|
||||
movs r1, 0x61
|
||||
movs r2, 0x84
|
||||
movs r3, 0x4
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r1, r8
|
||||
strh r0, [r1, 0x14]
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
movs r0, 0
|
||||
add sp, 0x10
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DADC4
|
||||
|
||||
thumb_func_start sub_81DAE44
|
||||
sub_81DAE44: @ 81DAE44
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081DAE68
|
||||
adds r0, r2, 0
|
||||
bl sub_81DAA20
|
||||
ldr r0, =sub_81DAD8C
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl DestroyTask
|
||||
_081DAE68:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DAE44
|
||||
|
||||
thumb_func_start sub_81DAE78
|
||||
sub_81DAE78: @ 81DAE78
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =gUnknown_0862B7AC
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r4, r1, r2
|
||||
_081DAE8A:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DAE8A
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DAE78
|
||||
|
||||
thumb_func_start sub_81DAEB0
|
||||
sub_81DAEB0: @ 81DAEB0
|
||||
push {r4-r6,lr}
|
||||
mov r6, r8
|
||||
push {r6}
|
||||
sub sp, 0x10
|
||||
mov r8, r0
|
||||
movs r2, 0x8E
|
||||
lsls r2, 1
|
||||
movs r6, 0x83
|
||||
str r6, [sp]
|
||||
movs r5, 0x23
|
||||
str r5, [sp, 0x4]
|
||||
movs r4, 0x3
|
||||
negs r4, r4
|
||||
str r4, [sp, 0x8]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x78
|
||||
movs r1, 0x50
|
||||
movs r3, 0x8
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r1, r8
|
||||
strh r0, [r1, 0x10]
|
||||
str r6, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
str r4, [sp, 0x8]
|
||||
movs r0, 0x1
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x78
|
||||
movs r1, 0x50
|
||||
movs r2, 0x2C
|
||||
movs r3, 0x8
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r1, r8
|
||||
strh r0, [r1, 0x12]
|
||||
str r6, [sp]
|
||||
str r5, [sp, 0x4]
|
||||
str r4, [sp, 0x8]
|
||||
movs r0, 0x2
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x79
|
||||
movs r1, 0x50
|
||||
movs r2, 0xA4
|
||||
movs r3, 0x8
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
mov r1, r8
|
||||
strh r0, [r1, 0x14]
|
||||
ldrh r0, [r1, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r1, 0x8]
|
||||
movs r0, 0
|
||||
add sp, 0x10
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DAEB0
|
||||
|
||||
thumb_func_start sub_81DAF34
|
||||
sub_81DAF34: @ 81DAF34
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081DAF58
|
||||
adds r0, r2, 0
|
||||
bl sub_81DAA20
|
||||
ldr r0, =sub_81DAE78
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl DestroyTask
|
||||
_081DAF58:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DAF34
|
||||
|
||||
thumb_func_start sub_81DAF68
|
||||
sub_81DAF68: @ 81DAF68
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =gUnknown_0862B7C0
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r4, r1, r2
|
||||
_081DAF7A:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DAF7A
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DAF68
|
||||
|
||||
thumb_func_start sub_81DAFA0
|
||||
sub_81DAFA0: @ 81DAFA0
|
||||
push {r4,lr}
|
||||
sub sp, 0xC
|
||||
adds r4, r0, 0
|
||||
movs r0, 0xA
|
||||
ldrsh r2, [r4, r0]
|
||||
cmp r2, 0
|
||||
bne _081DAFCC
|
||||
movs r1, 0x33
|
||||
negs r1, r1
|
||||
str r2, [sp]
|
||||
movs r0, 0x4
|
||||
str r0, [sp, 0x4]
|
||||
str r2, [sp, 0x8]
|
||||
movs r0, 0x78
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x10]
|
||||
b _081DB01A
|
||||
_081DAFCC:
|
||||
cmp r2, 0x10
|
||||
bne _081DAFF2
|
||||
movs r0, 0x7
|
||||
negs r0, r0
|
||||
movs r1, 0x4
|
||||
str r1, [sp]
|
||||
subs r1, 0x8
|
||||
str r1, [sp, 0x4]
|
||||
movs r1, 0x1
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0xC1
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x12]
|
||||
b _081DB01A
|
||||
_081DAFF2:
|
||||
cmp r2, 0x20
|
||||
bne _081DB01A
|
||||
movs r0, 0x4
|
||||
negs r0, r0
|
||||
str r0, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0x2
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0xF7
|
||||
movs r1, 0xC1
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x14]
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
_081DB01A:
|
||||
ldrh r0, [r4, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0xA]
|
||||
movs r0, 0
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DAFA0
|
||||
|
||||
thumb_func_start sub_81DB02C
|
||||
sub_81DB02C: @ 81DB02C
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081DB050
|
||||
adds r0, r2, 0
|
||||
bl sub_81DAA20
|
||||
ldr r0, =sub_81DAF68
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl DestroyTask
|
||||
_081DB050:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DB02C
|
||||
|
||||
thumb_func_start sub_81DB060
|
||||
sub_81DB060: @ 81DB060
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =gUnknown_0862B7D4
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r4, r1, r2
|
||||
_081DB072:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DB072
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DB060
|
||||
|
||||
thumb_func_start sub_81DB098
|
||||
sub_81DB098: @ 81DB098
|
||||
push {r4,lr}
|
||||
sub sp, 0xC
|
||||
adds r4, r0, 0
|
||||
movs r0, 0xA
|
||||
ldrsh r1, [r4, r0]
|
||||
cmp r1, 0
|
||||
bne _081DB0C4
|
||||
str r1, [sp]
|
||||
movs r0, 0x8
|
||||
negs r0, r0
|
||||
str r0, [sp, 0x4]
|
||||
str r1, [sp, 0x8]
|
||||
movs r0, 0x78
|
||||
movs r1, 0xC5
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x10]
|
||||
b _081DB112
|
||||
_081DB0C4:
|
||||
cmp r1, 0x10
|
||||
bne _081DB0E8
|
||||
movs r0, 0x8
|
||||
negs r0, r0
|
||||
str r0, [sp]
|
||||
movs r0, 0x1
|
||||
str r0, [sp, 0x4]
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0xF1
|
||||
movs r1, 0x4E
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x12]
|
||||
b _081DB112
|
||||
_081DB0E8:
|
||||
cmp r1, 0x20
|
||||
bne _081DB112
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0x8
|
||||
str r1, [sp]
|
||||
movs r1, 0x1
|
||||
str r1, [sp, 0x4]
|
||||
movs r1, 0x2
|
||||
str r1, [sp, 0x8]
|
||||
movs r1, 0x4E
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl sub_81DA74C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x14]
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
_081DB112:
|
||||
ldrh r0, [r4, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0xA]
|
||||
movs r0, 0
|
||||
add sp, 0xC
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DB098
|
||||
|
||||
thumb_func_start sub_81DB124
|
||||
sub_81DB124: @ 81DB124
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081DB148
|
||||
adds r0, r2, 0
|
||||
bl sub_81DAA20
|
||||
ldr r0, =sub_81DB060
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl DestroyTask
|
||||
_081DB148:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DB124
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
268
asm/unk_transition_2.s
Executable file
268
asm/unk_transition_2.s
Executable file
@ -0,0 +1,268 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_81DB158
|
||||
sub_81DB158: @ 81DB158
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =gUnknown_0862B7E8
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r4, r1, r2
|
||||
_081DB16A:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DB16A
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DB158
|
||||
|
||||
thumb_func_start sub_81DB190
|
||||
sub_81DB190: @ 81DB190
|
||||
push {r4,lr}
|
||||
sub sp, 0x10
|
||||
adds r4, r0, 0
|
||||
movs r0, 0xA
|
||||
ldrsh r1, [r4, r0]
|
||||
cmp r1, 0
|
||||
bne _081DB1BE
|
||||
movs r0, 0x80
|
||||
str r0, [sp]
|
||||
str r1, [sp, 0x4]
|
||||
subs r0, 0x84
|
||||
str r0, [sp, 0x8]
|
||||
str r1, [sp, 0xC]
|
||||
movs r0, 0x78
|
||||
movs r1, 0x2D
|
||||
movs r2, 0xC
|
||||
movs r3, 0x4
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x10]
|
||||
b _081DB212
|
||||
_081DB1BE:
|
||||
cmp r1, 0x10
|
||||
bne _081DB1E6
|
||||
movs r0, 0x80
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x4]
|
||||
subs r0, 0x4
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x1
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x59
|
||||
movs r1, 0x61
|
||||
movs r2, 0xFC
|
||||
movs r3, 0x4
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x12]
|
||||
b _081DB212
|
||||
_081DB1E6:
|
||||
cmp r1, 0x20
|
||||
bne _081DB212
|
||||
movs r0, 0x80
|
||||
str r0, [sp]
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x4]
|
||||
subs r0, 0x4
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x2
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x97
|
||||
movs r1, 0x61
|
||||
movs r2, 0x84
|
||||
movs r3, 0x4
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x14]
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
_081DB212:
|
||||
ldrh r0, [r4, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0xA]
|
||||
movs r0, 0
|
||||
add sp, 0x10
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DB190
|
||||
|
||||
thumb_func_start sub_81DB224
|
||||
sub_81DB224: @ 81DB224
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081DB248
|
||||
adds r0, r2, 0
|
||||
bl sub_81DAA20
|
||||
ldr r0, =sub_81DB158
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl DestroyTask
|
||||
_081DB248:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DB224
|
||||
|
||||
thumb_func_start sub_81DB258
|
||||
sub_81DB258: @ 81DB258
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r5, =gUnknown_0862B7FC
|
||||
ldr r2, =gTasks
|
||||
lsls r1, r0, 2
|
||||
adds r1, r0
|
||||
lsls r1, 3
|
||||
adds r4, r1, r2
|
||||
_081DB26A:
|
||||
movs r1, 0x8
|
||||
ldrsh r0, [r4, r1]
|
||||
lsls r0, 2
|
||||
adds r0, r5
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, 0
|
||||
bl _call_via_r1
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _081DB26A
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81DB258
|
||||
|
||||
thumb_func_start sub_81DB290
|
||||
sub_81DB290: @ 81DB290
|
||||
push {r4,lr}
|
||||
sub sp, 0x10
|
||||
adds r4, r0, 0
|
||||
movs r0, 0xA
|
||||
ldrsh r1, [r4, r0]
|
||||
cmp r1, 0
|
||||
bne _081DB2C2
|
||||
movs r2, 0x8E
|
||||
lsls r2, 1
|
||||
movs r0, 0x83
|
||||
str r0, [sp]
|
||||
movs r0, 0x23
|
||||
str r0, [sp, 0x4]
|
||||
subs r0, 0x26
|
||||
str r0, [sp, 0x8]
|
||||
str r1, [sp, 0xC]
|
||||
movs r0, 0x78
|
||||
movs r1, 0x50
|
||||
movs r3, 0x8
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x10]
|
||||
b _081DB316
|
||||
_081DB2C2:
|
||||
cmp r1, 0x10
|
||||
bne _081DB2EA
|
||||
movs r0, 0x83
|
||||
str r0, [sp]
|
||||
movs r0, 0x23
|
||||
str r0, [sp, 0x4]
|
||||
subs r0, 0x26
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x1
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x78
|
||||
movs r1, 0x50
|
||||
movs r2, 0x2C
|
||||
movs r3, 0x8
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x12]
|
||||
b _081DB316
|
||||
_081DB2EA:
|
||||
cmp r1, 0x20
|
||||
bne _081DB316
|
||||
movs r0, 0x83
|
||||
str r0, [sp]
|
||||
movs r0, 0x23
|
||||
str r0, [sp, 0x4]
|
||||
subs r0, 0x26
|
||||
str r0, [sp, 0x8]
|
||||
movs r0, 0x2
|
||||
str r0, [sp, 0xC]
|
||||
movs r0, 0x79
|
||||
movs r1, 0x50
|
||||
movs r2, 0xA4
|
||||
movs r3, 0x8
|
||||
bl sub_81DA8BC
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
strh r0, [r4, 0x14]
|
||||
ldrh r0, [r4, 0x8]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0x8]
|
||||
_081DB316:
|
||||
ldrh r0, [r4, 0xA]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4, 0xA]
|
||||
movs r0, 0
|
||||
add sp, 0x10
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81DB290
|
||||
|
||||
thumb_func_start sub_81DB328
|
||||
sub_81DB328: @ 81DB328
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
ldr r0, =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _081DB34C
|
||||
adds r0, r2, 0
|
||||
bl sub_81DAA20
|
||||
ldr r0, =sub_81DB258
|
||||
bl FindTaskIdByFunc
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl DestroyTask
|
||||
_081DB34C:
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81DB328
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
3771
asm/use_pokeblock.s
Executable file
3771
asm/use_pokeblock.s
Executable file
File diff suppressed because it is too large
Load Diff
543
asm/walda_phrase.s
Executable file
543
asm/walda_phrase.s
Executable file
@ -0,0 +1,543 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start walda_maybe
|
||||
walda_maybe: @ 81D99E4
|
||||
push {r4,lr}
|
||||
sub sp, 0x8
|
||||
ldr r4, =gStringVar2
|
||||
bl sub_80D2548
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
bl StringCopy
|
||||
movs r0, 0
|
||||
str r0, [sp]
|
||||
ldr r0, =sub_81D9A1C
|
||||
str r0, [sp, 0x4]
|
||||
movs r0, 0x4
|
||||
adds r1, r4, 0
|
||||
movs r2, 0
|
||||
movs r3, 0
|
||||
bl do_choose_name_or_words_screen
|
||||
add sp, 0x8
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end walda_maybe
|
||||
|
||||
thumb_func_start sub_81D9A1C
|
||||
sub_81D9A1C: @ 81D9A1C
|
||||
push {r4,r5,lr}
|
||||
ldr r4, =gSpecialVar_0x8004
|
||||
ldr r5, =gStringVar2
|
||||
adds r0, r5, 0
|
||||
bl sub_81D9A98
|
||||
strh r0, [r4]
|
||||
ldrh r0, [r4]
|
||||
cmp r0, 0x1
|
||||
beq _081D9A68
|
||||
cmp r0, 0x1
|
||||
bgt _081D9A44
|
||||
cmp r0, 0
|
||||
beq _081D9A62
|
||||
b _081D9A68
|
||||
.pool
|
||||
_081D9A44:
|
||||
cmp r0, 0x2
|
||||
bne _081D9A68
|
||||
bl sub_80D2578
|
||||
cmp r0, 0
|
||||
beq _081D9A5C
|
||||
ldr r0, =gUnknown_085EE49A
|
||||
bl sub_80D255C
|
||||
b _081D9A68
|
||||
.pool
|
||||
_081D9A5C:
|
||||
movs r0, 0x1
|
||||
strh r0, [r4]
|
||||
b _081D9A68
|
||||
_081D9A62:
|
||||
adds r0, r5, 0
|
||||
bl sub_80D255C
|
||||
_081D9A68:
|
||||
ldr r4, =gStringVar1
|
||||
bl sub_80D2548
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
bl StringCopy
|
||||
ldr r1, =gUnknown_03005DAC
|
||||
ldr r0, =sub_80AF168
|
||||
str r0, [r1]
|
||||
ldr r0, =c2_exit_to_overworld_2_switch
|
||||
bl SetMainCallback2
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81D9A1C
|
||||
|
||||
thumb_func_start sub_81D9A98
|
||||
sub_81D9A98: @ 81D9A98
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
ldrb r0, [r4]
|
||||
cmp r0, 0xFF
|
||||
bne _081D9AA6
|
||||
movs r0, 0x2
|
||||
b _081D9ABC
|
||||
_081D9AA6:
|
||||
bl sub_80D2548
|
||||
adds r1, r0, 0
|
||||
adds r0, r4, 0
|
||||
bl StringCompare
|
||||
cmp r0, 0
|
||||
beq _081D9ABA
|
||||
movs r0, 0
|
||||
b _081D9ABC
|
||||
_081D9ABA:
|
||||
movs r0, 0x1
|
||||
_081D9ABC:
|
||||
pop {r4}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81D9A98
|
||||
|
||||
thumb_func_start sub_81D9AC4
|
||||
sub_81D9AC4: @ 81D9AC4
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
sub sp, 0x10
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r0, [r0]
|
||||
adds r0, 0xA
|
||||
bl ReadUnalignedWord
|
||||
adds r4, r0, 0
|
||||
lsls r4, 16
|
||||
lsrs r4, 16
|
||||
ldr r0, =gScriptResult
|
||||
mov r8, r0
|
||||
bl sub_80D2548
|
||||
mov r7, sp
|
||||
adds r7, 0xA
|
||||
add r6, sp, 0xC
|
||||
mov r5, sp
|
||||
adds r5, 0xD
|
||||
str r4, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
add r0, sp, 0x8
|
||||
adds r1, r7, 0
|
||||
adds r2, r6, 0
|
||||
adds r3, r5, 0
|
||||
bl sub_81D9B68
|
||||
mov r1, r8
|
||||
strh r0, [r1]
|
||||
lsls r0, 16
|
||||
cmp r0, 0
|
||||
beq _081D9B1E
|
||||
ldrb r0, [r5]
|
||||
bl sub_80D24BC
|
||||
ldrb r0, [r6]
|
||||
bl sub_80D24F0
|
||||
add r0, sp, 0x8
|
||||
ldrh r0, [r0]
|
||||
ldrh r1, [r7]
|
||||
bl sub_80D2524
|
||||
_081D9B1E:
|
||||
mov r1, r8
|
||||
ldrh r0, [r1]
|
||||
bl sub_80D2480
|
||||
mov r1, r8
|
||||
ldrb r0, [r1]
|
||||
add sp, 0x10
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81D9AC4
|
||||
|
||||
thumb_func_start sub_81D9B40
|
||||
sub_81D9B40: @ 81D9B40
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
movs r1, 0
|
||||
ldr r3, =gUnknown_0862AD14
|
||||
_081D9B4A:
|
||||
adds r0, r1, r3
|
||||
ldrb r0, [r0]
|
||||
cmp r0, r2
|
||||
bne _081D9B5C
|
||||
lsls r0, r1, 24
|
||||
lsrs r0, 24
|
||||
b _081D9B64
|
||||
.pool
|
||||
_081D9B5C:
|
||||
adds r1, 0x1
|
||||
cmp r1, 0x1F
|
||||
bls _081D9B4A
|
||||
movs r0, 0x20
|
||||
_081D9B64:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81D9B40
|
||||
|
||||
thumb_func_start sub_81D9B68
|
||||
sub_81D9B68: @ 81D9B68
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x2C
|
||||
mov r10, r0
|
||||
str r1, [sp, 0x20]
|
||||
str r2, [sp, 0x24]
|
||||
str r3, [sp, 0x28]
|
||||
ldr r0, [sp, 0x4C]
|
||||
ldr r5, [sp, 0x50]
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
mov r9, r0
|
||||
adds r0, r5, 0
|
||||
bl StringLength
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
cmp r0, 0xF
|
||||
bne _081D9C7E
|
||||
movs r4, 0
|
||||
add r7, sp, 0x10
|
||||
_081D9B98:
|
||||
adds r0, r5, r4
|
||||
ldrb r0, [r0]
|
||||
bl sub_81D9B40
|
||||
adds r1, r7, r4
|
||||
strb r0, [r1]
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
cmp r0, 0x20
|
||||
beq _081D9C7E
|
||||
adds r4, 0x1
|
||||
cmp r4, 0xE
|
||||
ble _081D9B98
|
||||
movs r6, 0x3
|
||||
movs r5, 0
|
||||
movs r0, 0x5
|
||||
mov r8, r0
|
||||
movs r4, 0xD
|
||||
_081D9BBC:
|
||||
mov r1, r8
|
||||
str r1, [sp]
|
||||
add r0, sp, 0x4
|
||||
adds r1, r7, 0
|
||||
adds r2, r5, 0
|
||||
adds r3, r6, 0
|
||||
bl sub_81D9D5C
|
||||
adds r6, 0x8
|
||||
adds r5, 0x5
|
||||
subs r4, 0x1
|
||||
cmp r4, 0
|
||||
bge _081D9BBC
|
||||
movs r0, 0x2
|
||||
str r0, [sp]
|
||||
add r0, sp, 0x4
|
||||
adds r1, r7, 0
|
||||
movs r2, 0x46
|
||||
movs r3, 0x73
|
||||
bl sub_81D9D5C
|
||||
add r0, sp, 0x4
|
||||
movs r1, 0
|
||||
movs r2, 0x3
|
||||
bl sub_81D9DAC
|
||||
adds r4, r0, 0
|
||||
adds r0, r7, 0
|
||||
movs r1, 0x75
|
||||
movs r2, 0x3
|
||||
bl sub_81D9DAC
|
||||
cmp r4, r0
|
||||
bne _081D9C7E
|
||||
add r0, sp, 0x4
|
||||
movs r1, 0x9
|
||||
movs r2, 0x15
|
||||
bl sub_81D9C90
|
||||
add r0, sp, 0x4
|
||||
ldrb r0, [r0, 0x8]
|
||||
movs r2, 0xF
|
||||
ands r2, r0
|
||||
add r0, sp, 0x4
|
||||
movs r1, 0x8
|
||||
bl sub_81D9C90
|
||||
add r0, sp, 0x4
|
||||
ldrb r2, [r0, 0x8]
|
||||
lsrs r2, 4
|
||||
movs r1, 0x8
|
||||
bl sub_81D9CDC
|
||||
add r0, sp, 0x4
|
||||
ldrb r2, [r0, 0x6]
|
||||
adds r1, r0, 0
|
||||
ldrb r0, [r0]
|
||||
ldrb r1, [r1, 0x2]
|
||||
eors r0, r1
|
||||
add r1, sp, 0x4
|
||||
ldrb r4, [r1, 0x4]
|
||||
eors r0, r4
|
||||
mov r3, r9
|
||||
lsrs r1, r3, 8
|
||||
eors r0, r1
|
||||
cmp r2, r0
|
||||
bne _081D9C7E
|
||||
add r0, sp, 0x4
|
||||
ldrb r3, [r0, 0x7]
|
||||
adds r2, r0, 0
|
||||
ldrb r1, [r0, 0x1]
|
||||
ldrb r0, [r2, 0x3]
|
||||
eors r1, r0
|
||||
adds r0, r2, 0
|
||||
ldrb r2, [r0, 0x5]
|
||||
eors r1, r2
|
||||
movs r0, 0xFF
|
||||
mov r5, r9
|
||||
ands r0, r5
|
||||
eors r1, r0
|
||||
cmp r3, r1
|
||||
bne _081D9C7E
|
||||
add r0, sp, 0x4
|
||||
ldrh r0, [r0]
|
||||
mov r1, r10
|
||||
strh r0, [r1]
|
||||
mov r0, sp
|
||||
adds r0, 0x6
|
||||
ldrh r0, [r0]
|
||||
ldr r3, [sp, 0x20]
|
||||
strh r0, [r3]
|
||||
ldr r5, [sp, 0x24]
|
||||
strb r4, [r5]
|
||||
ldr r0, [sp, 0x28]
|
||||
strb r2, [r0]
|
||||
movs r0, 0x1
|
||||
b _081D9C80
|
||||
_081D9C7E:
|
||||
movs r0, 0
|
||||
_081D9C80:
|
||||
add sp, 0x2C
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81D9B68
|
||||
|
||||
thumb_func_start sub_81D9C90
|
||||
sub_81D9C90: @ 81D9C90
|
||||
push {r4-r7,lr}
|
||||
adds r7, r0, 0
|
||||
mov r12, r1
|
||||
subs r3, r2, 0x1
|
||||
cmp r2, 0
|
||||
beq _081D9CD6
|
||||
_081D9C9C:
|
||||
ldrb r1, [r7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 31
|
||||
mov r2, r12
|
||||
subs r2, 0x1
|
||||
subs r5, r3, 0x1
|
||||
cmp r2, 0
|
||||
blt _081D9CCC
|
||||
movs r6, 0x80
|
||||
adds r3, r2, r7
|
||||
_081D9CB4:
|
||||
ldrb r1, [r3]
|
||||
adds r0, r6, 0
|
||||
ands r0, r1
|
||||
lsls r0, 24
|
||||
lsls r1, 1
|
||||
orrs r4, r1
|
||||
strb r4, [r3]
|
||||
lsrs r4, r0, 31
|
||||
subs r3, 0x1
|
||||
subs r2, 0x1
|
||||
cmp r2, 0
|
||||
bge _081D9CB4
|
||||
_081D9CCC:
|
||||
adds r3, r5, 0
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
cmp r3, r0
|
||||
bne _081D9C9C
|
||||
_081D9CD6:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81D9C90
|
||||
|
||||
thumb_func_start sub_81D9CDC
|
||||
sub_81D9CDC: @ 81D9CDC
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
adds r5, r1, 0
|
||||
lsls r2, 24
|
||||
lsrs r3, r2, 24
|
||||
lsls r0, r3, 4
|
||||
orrs r3, r0
|
||||
lsls r0, r3, 24
|
||||
lsrs r3, r0, 24
|
||||
movs r4, 0
|
||||
cmp r4, r5
|
||||
bcs _081D9D04
|
||||
_081D9CF4:
|
||||
adds r2, r6, r4
|
||||
ldrb r1, [r2]
|
||||
adds r0, r3, 0
|
||||
eors r0, r1
|
||||
strb r0, [r2]
|
||||
adds r4, 0x1
|
||||
cmp r4, r5
|
||||
bcc _081D9CF4
|
||||
_081D9D04:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81D9CDC
|
||||
|
||||
thumb_func_start sub_81D9D0C
|
||||
sub_81D9D0C: @ 81D9D0C
|
||||
push {lr}
|
||||
lsrs r3, r1, 3
|
||||
movs r2, 0x7
|
||||
ands r2, r1
|
||||
movs r1, 0x80
|
||||
asrs r1, r2
|
||||
adds r0, r3
|
||||
ldrb r0, [r0]
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081D9D24
|
||||
movs r0, 0x1
|
||||
_081D9D24:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81D9D0C
|
||||
|
||||
thumb_func_start sub_81D9D28
|
||||
sub_81D9D28: @ 81D9D28
|
||||
lsrs r3, r1, 3
|
||||
movs r2, 0x7
|
||||
ands r2, r1
|
||||
movs r1, 0x80
|
||||
asrs r1, r2
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r3
|
||||
ldrb r2, [r0]
|
||||
orrs r1, r2
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
thumb_func_end sub_81D9D28
|
||||
|
||||
thumb_func_start sub_81D9D40
|
||||
sub_81D9D40: @ 81D9D40
|
||||
lsrs r3, r1, 3
|
||||
movs r2, 0x7
|
||||
ands r2, r1
|
||||
movs r1, 0x80
|
||||
asrs r1, r2
|
||||
mvns r1, r1
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r3
|
||||
ldrb r2, [r0]
|
||||
ands r1, r2
|
||||
strb r1, [r0]
|
||||
bx lr
|
||||
thumb_func_end sub_81D9D40
|
||||
|
||||
thumb_func_start sub_81D9D5C
|
||||
sub_81D9D5C: @ 81D9D5C
|
||||
push {r4-r7,lr}
|
||||
mov r7, r9
|
||||
mov r6, r8
|
||||
push {r6,r7}
|
||||
adds r6, r0, 0
|
||||
mov r9, r1
|
||||
adds r1, r2, 0
|
||||
mov r8, r3
|
||||
ldr r7, [sp, 0x1C]
|
||||
movs r5, 0
|
||||
cmp r5, r7
|
||||
bcs _081D9DA0
|
||||
adds r4, r1, 0
|
||||
_081D9D76:
|
||||
mov r0, r8
|
||||
adds r1, r0, r5
|
||||
mov r0, r9
|
||||
bl sub_81D9D0C
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _081D9D90
|
||||
adds r0, r6, 0
|
||||
adds r1, r4, 0
|
||||
bl sub_81D9D28
|
||||
b _081D9D98
|
||||
_081D9D90:
|
||||
adds r0, r6, 0
|
||||
adds r1, r4, 0
|
||||
bl sub_81D9D40
|
||||
_081D9D98:
|
||||
adds r4, 0x1
|
||||
adds r5, 0x1
|
||||
cmp r5, r7
|
||||
bcc _081D9D76
|
||||
_081D9DA0:
|
||||
pop {r3,r4}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81D9D5C
|
||||
|
||||
thumb_func_start sub_81D9DAC
|
||||
sub_81D9DAC: @ 81D9DAC
|
||||
push {r4-r7,lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
mov r8, r0
|
||||
adds r7, r1, 0
|
||||
adds r6, r2, 0
|
||||
movs r4, 0
|
||||
movs r5, 0
|
||||
cmp r4, r6
|
||||
bcs _081D9DD6
|
||||
_081D9DC0:
|
||||
lsls r4, 1
|
||||
adds r1, r7, r5
|
||||
mov r0, r8
|
||||
bl sub_81D9D0C
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
orrs r4, r0
|
||||
adds r5, 0x1
|
||||
cmp r5, r6
|
||||
bcc _081D9DC0
|
||||
_081D9DD6:
|
||||
adds r0, r4, 0
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4-r7}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81D9DAC
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
@ -56,7 +56,7 @@ SECTIONS {
|
||||
asm/main_menu.o(.text);
|
||||
asm/rom3.o(.text);
|
||||
src/decompress.o(.text);
|
||||
asm/rom_8034C54.o(.text);
|
||||
asm/battle_1.o(.text);
|
||||
asm/battle_2.o(.text);
|
||||
asm/battle_3.o(.text);
|
||||
src/battle_4.o(.text);
|
||||
@ -81,7 +81,9 @@ SECTIONS {
|
||||
src/blend_palette.o(.text);
|
||||
asm/daycare.o(.text);
|
||||
asm/egg_hatch.o(.text);
|
||||
asm/rom_8072304.o(.text);
|
||||
asm/battle_interface.o(.text);
|
||||
asm/smokescreen.o(.text);
|
||||
asm/pokeball.o(.text);
|
||||
src/load_save.o(.text);
|
||||
asm/load_save.o(.text);
|
||||
asm/trade.o(.text);
|
||||
@ -119,8 +121,7 @@ SECTIONS {
|
||||
asm/reshow_battle_screen.o(.text);
|
||||
asm/battle_anim_80A9C70.o(.text);
|
||||
asm/title_screen.o(.text);
|
||||
asm/weather.o(.text);
|
||||
asm/rom_80AEFFC.o(.text);
|
||||
asm/field_screen.o(.text);
|
||||
asm/battle_setup.o(.text);
|
||||
asm/cable_club.o(.text);
|
||||
asm/trainer_see.o(.text);
|
||||
@ -131,7 +132,14 @@ SECTIONS {
|
||||
asm/option_menu.o(.text);
|
||||
asm/pokedex.o(.text);
|
||||
asm/trainer_card.o(.text);
|
||||
asm/rom_80C6FA0.o(.text);
|
||||
asm/pokemon_storage_system.o(.text);
|
||||
asm/pokemon_icon.o(.text);
|
||||
asm/script_movement.o(.text);
|
||||
asm/fldeff_cut.o(.text);
|
||||
asm/mail_data.o(.text);
|
||||
asm/map_name_popup.o(.text);
|
||||
asm/item_menu_icons.o(.text);
|
||||
asm/battle_anim_80D51AC.o(.text);
|
||||
src/item.o(.text);
|
||||
asm/item.o(.text);
|
||||
asm/contest.o(.text);
|
||||
@ -176,7 +184,6 @@ SECTIONS {
|
||||
asm/wallclock.o(.text);
|
||||
asm/rom6.o(.text);
|
||||
asm/battle_records.o(.text);
|
||||
asm/rom_813C5BC.o(.text);
|
||||
asm/pokedex_area_screen.o(.text);
|
||||
asm/evolution_scene.o(.text);
|
||||
asm/roulette.o(.text);
|
||||
@ -189,7 +196,7 @@ SECTIONS {
|
||||
asm/battle_controller_linkpartner.o(.text);
|
||||
asm/battle_message.o(.text);
|
||||
asm/cable_car.o(.text);
|
||||
asm/rom_8151534.o(.text);
|
||||
asm/math_util.o(.text);
|
||||
asm/roulette_util.o(.text);
|
||||
asm/cable_car_util.o(.text);
|
||||
src/save.o(.text);
|
||||
@ -200,14 +207,17 @@ SECTIONS {
|
||||
asm/battle_anim_sound_tasks.o(.text);
|
||||
asm/battle_controller_safari.o(.text);
|
||||
asm/fldeff_sweetscent.o(.text);
|
||||
asm/rom_815A0D4.o(.text);
|
||||
asm/battle_anim_815A0D4.o(.text);
|
||||
asm/learn_move.o(.text);
|
||||
asm/fldeff_softboiled.o(.text);
|
||||
asm/decoration_inventory.o(.text);
|
||||
asm/roamer.o(.text);
|
||||
asm/rom_8161F74.o(.text);
|
||||
asm/battle_tower.o(.text);
|
||||
asm/use_pokeblock.o(.text);
|
||||
asm/battle_controller_wally.o(.text);
|
||||
asm/player_pc.o(.text);
|
||||
asm/intro.o(.text);
|
||||
asm/rom_81700F8.o(.text);
|
||||
asm/reset_save_heap.o(.text);
|
||||
asm/field_region_map.o(.text);
|
||||
asm/battle_anim_8170478.o(.text);
|
||||
asm/hall_of_fame.o(.text);
|
||||
@ -224,18 +234,42 @@ SECTIONS {
|
||||
asm/evolution_graphics.o(.text);
|
||||
asm/bard_music.o(.text);
|
||||
asm/fldeff_teleport.o(.text);
|
||||
asm/rom_817C95C.o(.text);
|
||||
asm/battle_link_817C95C.o(.text);
|
||||
asm/pokemon_animation.o(.text);
|
||||
asm/recorded_battle.o(.text);
|
||||
asm/battle_controller_recorded_opponent.o(.text);
|
||||
asm/battle_controller_recorded_player.o(.text);
|
||||
asm/rom_818CFC8.o(.text);
|
||||
asm/battle_dome_cards.o(.text);
|
||||
asm/lilycove_lady.o(.text);
|
||||
asm/rom_818E9AC.o(.text);
|
||||
asm/battle_frontier_1.o(.text);
|
||||
asm/new_menu_helpers.o(.text);
|
||||
asm/menu.o(.text);
|
||||
asm/battle_frontier_2.o(.text);
|
||||
asm/item_menu.o(.text);
|
||||
asm/list_menu.o(.text);
|
||||
asm/menu_indicators.o(.text);
|
||||
asm/unk_text_util.o(.text);
|
||||
asm/save_location.o(.text);
|
||||
asm/item_icon.o(.text);
|
||||
asm/party_menu.o(.text);
|
||||
asm/battle_tent.o(.text);
|
||||
asm/unk_text_util_2.o(.text);
|
||||
src/multiboot.o(.text);
|
||||
asm/rom_81BAD84.o(.text);
|
||||
asm/unk_81BAD84.o(.text);
|
||||
asm/battle_controller_player_partner.o(.text);
|
||||
asm/rom_81BE66C.o(.text);
|
||||
asm/fldeff_groundshake.o(.text);
|
||||
asm/fossil_specials.o(.text);
|
||||
asm/berry_fix_program.o(.text);
|
||||
asm/pokemon_summary_screen.o(.text);
|
||||
asm/pokenav.o(.text);
|
||||
asm/rayquaza_scene.o(.text);
|
||||
asm/walda_phrase.o(.text);
|
||||
asm/contest_link_81D9DE4.o(.text);
|
||||
asm/trainer_rematch.o(.text);
|
||||
asm/unk_sprite_file.o(.text);
|
||||
asm/unk_transition.o(.text);
|
||||
asm/unk_transition_2.o(.text);
|
||||
asm/international_string_util.o(.text);
|
||||
} =0
|
||||
|
||||
script_data :
|
||||
|
Loading…
Reference in New Issue
Block a user