Skip to content

Commit

Permalink
Merge pull request #235 from deppong/sub_8099360-809965C
Browse files Browse the repository at this point in the history
Decomp and integrate sub_8099360 - sub_809965C.
  • Loading branch information
SethBarberee authored Oct 22, 2024
2 parents 9e49584 + c1e2d21 commit e3e15a3
Show file tree
Hide file tree
Showing 8 changed files with 372 additions and 396 deletions.
386 changes: 0 additions & 386 deletions asm/code_8099360.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,392 +5,6 @@

.text

thumb_func_start sub_8099360
sub_8099360:
push {r4,lr}
adds r4, r0, 0
movs r0, 0
movs r1, 0x13
bl GetScriptVarValue
lsls r0, 16
asrs r0, 16
cmp r0, 0x52
beq _08099378
movs r0, 0
b _0809938E
_08099378:
movs r0, 0
movs r1, 0x14
bl GetScriptVarValue
lsls r0, 16
asrs r0, 16
bl GetDungeonInfo_80A2608
ldrb r0, [r0, 0xC]
strb r0, [r4]
movs r0, 0x1
_0809938E:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8099360

thumb_func_start sub_8099394
sub_8099394:
push {r4,lr}
adds r4, r0, 0
movs r0, 0
movs r1, 0x13
bl GetScriptVarValue
lsls r0, 16
asrs r0, 16
cmp r0, 0x50
beq _080993AC
movs r0, 0
b _080993B8
_080993AC:
movs r0, 0
movs r1, 0x14
bl GetScriptVarValue
strb r0, [r4]
movs r0, 0x1
_080993B8:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8099394

thumb_func_start sub_80993C0
sub_80993C0:
push {lr}
lsls r0, 24
ldr r2, _080993D4
movs r1, 0
cmp r0, 0
bne _080993CE
movs r1, 0x1
_080993CE:
strb r1, [r2]
pop {r0}
bx r0
.align 2, 0
_080993D4: .4byte gUnknown_20398B8
thumb_func_end sub_80993C0

thumb_func_start sub_80993D8
sub_80993D8:
push {lr}
bl sub_80A4B38
pop {r0}
bx r0
thumb_func_end sub_80993D8

thumb_func_start sub_80993E4
sub_80993E4:
push {lr}
bl sub_80A4B54
pop {r0}
bx r0
thumb_func_end sub_80993E4

thumb_func_start sub_80993F0
sub_80993F0:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x28
movs r0, 0
mov r10, r0
bl sub_801180C
movs r0, 0x10
bl FadeOutAllMusic
ldr r1, _0809948C
ldr r2, _08099490
adds r0, r2, 0
strh r0, [r1]
movs r0, 0
bl UpdateFadeInTile
movs r0, 0
movs r1, 0x14
bl sub_80095CC
movs r0, 0
movs r1, 0x1
movs r2, 0x1
bl xxx_call_save_unk_text_struct_800641C
movs r0, 0
movs r1, 0x14
bl sub_8009408
bl sub_8099648
bl sub_809975C
bl sub_809D0AC
bl sub_8014144
movs r0, 0
movs r1, 0
bl sub_8005838
bl AllocGroundMapAction
mov r7, sp
add r0, sp, 0x8
mov r8, r0
_08099454:
bl sub_801D9E4
lsls r0, 24
cmp r0, 0
beq _0809949C
mov r0, r10
bl sub_801DA58
_08099464:
movs r0, 0
movs r1, 0
bl sub_8005838
movs r0, 0
bl sub_8012A18
bl sub_801DA78
cmp r0, 0x2
beq _08099494
cmp r0, 0x3
bne _08099464
bl sub_801DAC0
lsls r0, 16
asrs r0, 16
mov r10, r0
b _080994A2
.align 2, 0
_0809948C: .4byte gUnknown_2026E4E
_08099490: .4byte 0x00000808
_08099494:
movs r1, 0x1
negs r1, r1
mov r10, r1
b _080994A2
_0809949C:
movs r2, 0x1
negs r2, r2
mov r10, r2
_080994A2:
bl sub_801DB0C
movs r0, 0x1
negs r0, r0
cmp r10, r0
bne _080994B0
b _08099624
_080994B0:
movs r0, 0
movs r1, 0x1
movs r2, 0x1
bl xxx_call_save_unk_text_struct_800641C
bl GroundMap_Reset
bl sub_809D0BC
mov r0, r10
bl GroundMap_Select
mov r0, sp
mov r1, r8
bl sub_80A579C
ldr r0, [r7, 0x4]
movs r1, 0xC0
lsls r1, 4
adds r0, r1
str r0, [r7, 0x4]
mov r2, r8
ldr r0, [r2, 0x4]
adds r0, r1
str r0, [r2, 0x4]
ldr r0, [sp]
ldr r1, _08099520
adds r0, r1
str r0, [sp]
ldr r0, [r7, 0x4]
adds r0, r1
str r0, [r7, 0x4]
ldr r0, [sp, 0x8]
movs r2, 0x80
lsls r2, 3
adds r0, r2
str r0, [sp, 0x8]
mov r0, r8
ldr r1, [r0, 0x4]
adds r1, r2
str r1, [r0, 0x4]
ldr r2, [sp, 0x8]
ldr r0, [sp]
subs r0, r2, r0
str r0, [sp, 0x20]
ldr r0, [r7, 0x4]
subs r0, r1, r0
str r0, [sp, 0x24]
movs r4, 0
movs r5, 0
movs r0, 0x4
bl sub_80999E8
mov r9, r5
b _08099604
.align 2, 0
_08099520: .4byte 0xfffffc00
_08099524:
ldr r0, _0809953C
ldrh r1, [r0, 0x2]
ldrh r6, [r0]
movs r0, 0x4
ands r1, r0
cmp r1, 0
beq _08099540
bl sub_80999FC
movs r1, 0x1
mov r9, r1
b _080995AE
.align 2, 0
_0809953C: .4byte gRealInputs
_08099540:
adds r0, r6, 0
bl sub_809CFE8
lsls r0, 24
asrs r1, r0, 24
movs r2, 0x1
negs r2, r2
cmp r1, r2
beq _0809959A
add r0, sp, 0x10
movs r2, 0x80
lsls r2, 1
bl SetVecFromDirectionSpeed
ldr r2, [sp, 0x10]
ldr r3, [sp, 0x14]
movs r0, 0x2
ands r6, r0
cmp r6, 0
beq _0809956A
movs r0, 0x4
_0809956A:
adds r1, r0, 0
muls r1, r2
adds r1, r4
adds r4, r1, 0
muls r0, r3
adds r5, r0
cmp r1, 0
bge _0809957E
movs r4, 0
b _08099588
_0809957E:
ldr r0, [sp, 0x20]
cmp r4, r0
blt _08099588
adds r4, r0, 0
subs r4, 0x1
_08099588:
cmp r5, 0
bge _08099590
movs r5, 0
b _0809959A
_08099590:
ldr r1, [sp, 0x24]
cmp r5, r1
blt _0809959A
adds r5, r1, 0
subs r5, 0x1
_0809959A:
ldr r0, [sp]
adds r0, r4
str r0, [sp, 0x18]
ldr r0, [r7, 0x4]
adds r0, r5
add r1, sp, 0x18
str r0, [r1, 0x4]
movs r0, 0
bl sub_809D158
_080995AE:
bl sub_809D25C
bl sub_80A59DC
bl xxx_draw_string_80144C4
movs r0, 0
movs r1, 0
bl sub_8005838
bl sub_80060EC
ldr r0, _08099620
ldr r0, [r0]
ldrb r0, [r0, 0xA]
bl nullsub_8
bl sub_8005180
bl sub_8099BE4
bl sub_8099744
bl sub_8011860
bl sub_800CB20
bl LoadBufferedInputs
bl nullsub_120
bl sub_80A5E70
bl xxx_call_update_bg_vram
bl CopySpritesToOam
bl sub_8005304
bl sub_8099750
bl sub_8009908
_08099604:
bl xxx_call_update_bg_sound_input
movs r0, 0
bl ResetSprites
mov r2, r9
cmp r2, 0
beq _08099524
bl sub_8099B94
lsls r0, 24
cmp r0, 0
bne _080995AE
b _08099454
.align 2, 0
_08099620: .4byte gGameOptionsRef
_08099624:
movs r0, 0x10
bl FadeOutAllMusic
bl FreeGroundMapAction
bl sub_8099768
bl nullsub_103
add sp, 0x28
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_80993F0

thumb_func_start sub_8099648
sub_8099648:
push {lr}
bl sub_8003600
bl sub_809965C
pop {r0}
bx r0
thumb_func_end sub_8099648

thumb_func_start nullsub_103
nullsub_103:
bx lr
thumb_func_end nullsub_103

thumb_func_start sub_809965C
sub_809965C:
push {r4,lr}
movs r0, 0
bl sub_8099690
ldr r0, _08099688
ldr r1, _0809968C
bl OpenFileAndGetFileDataPtr
adds r4, r0, 0
movs r0, 0xF8
lsls r0, 1
ldr r1, [r4, 0x4]
movs r2, 0x10
bl sub_800388C
adds r0, r4, 0
bl CloseFile
pop {r4}
pop {r0}
bx r0
.align 2, 0
_08099688: .4byte gUnknown_811601C
_0809968C: .4byte gSystemFileArchive
thumb_func_end sub_809965C

thumb_func_start sub_8099690
sub_8099690:
push {r4-r6,lr}
Expand Down
Loading

0 comments on commit e3e15a3

Please sign in to comment.