Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .type sub_8049ED4,function
- .thumb_func
- sub_8049ED4:
- push {r4, r5, r6, r7, lr}
- mov r7, sl
- mov r6, r9
- mov r5, r8
- push {r5, r6, r7}
- add sp, sp, #0xffffff80
- lsl r0, r0, #0x18
- lsr r7, r0, #0x18
- mov r0, #0x1
- str r0, [sp, #0x6c]
- ldr r1, .L649
- ldr r5, [r1]
- add r0, r5, #0
- add r0, r0, #0x82
- add r0, r0, r7
- ldrb r0, [r0]
- cmp r0, #0x5
- bhi .L632 @cond_branch
- mov r2, #0x0
- str r2, [sp, #0x6c]
- .L632:
- mov r1, #0x6
- bl __umodsi3
- lsl r0, r0, #0x18
- lsr r0, r0, #0x18
- str r0, [sp, #0x70]
- add r0, r5, #0
- add r0, r0, #0x80
- add r3, r0, r7
- ldrb r0, [r3]
- cmp r0, #0x2
- bne .LCB5359
- b .L641 @long jump
- .LCB5359:
- cmp r0, #0x2
- bgt .L647 @cond_branch
- cmp r0, #0x1
- beq .L634 @cond_branch
- b .L633
- .L650:
- .align 2, 0
- .L649:
- .word gUnknown_03004824
- .L647:
- cmp r0, #0x3
- bne .LCB5374
- b .L643 @long jump
- .LCB5374:
- cmp r0, #0x4
- bne .LCB5376
- b .L644 @long jump
- .LCB5376:
- b .L633
- .L634:
- mov r4, #0x0
- add r0, r5, #0
- add r0, r0, #0x42
- add r0, r0, r7
- ldr r6, .L651
- ldr r3, [sp, #0x6c]
- lsl r3, r3, #0x1
- mov r8, r3
- ldr r5, .L651+0x4
- mov sl, r5
- ldr r1, .L651+0x8
- mov ip, r1
- lsl r2, r7, #0x4
- str r2, [sp, #0x7c]
- ldrb r0, [r0]
- cmp r4, r0
- bcs .L636 @cond_branch
- mov r9, r6
- ldr r2, .L651+0xc
- ldr r0, [sp, #0x6c]
- add r0, r0, r8
- lsl r3, r0, #0x1
- mov r5, #0x4
- .L638:
- ldr r0, [r2]
- add r1, r4, r3
- add r0, r0, #0x34
- add r0, r0, r1
- ldrb r1, [r0]
- lsl r0, r1, #0x4
- add r0, r0, r1
- lsl r0, r0, #0x2
- add r0, r0, r9
- add r0, r0, #0x3e
- ldrb r1, [r0]
- orr r1, r1, r5
- strb r1, [r0]
- add r0, r4, #0x1
- lsl r0, r0, #0x18
- lsr r4, r0, #0x18
- ldr r0, [r2]
- add r0, r0, #0x42
- add r0, r0, r7
- ldrb r0, [r0]
- cmp r4, r0
- bcc .L638 @cond_branch
- .L636:
- ldr r3, .L651+0xc
- ldr r0, [r3]
- ldr r5, [sp, #0x6c]
- add r5, r5, r8
- lsl r5, r5, #0x1
- ldr r1, [sp, #0x70]
- add r5, r1, r5
- add r0, r0, #0x34
- add r0, r0, r5
- ldrb r1, [r0]
- lsl r0, r1, #0x4
- add r0, r0, r1
- lsl r0, r0, #0x2
- add r0, r0, r6
- add r0, r0, #0x3e
- ldrb r2, [r0]
- mov r1, #0x5
- neg r1, r1
- and r1, r1, r2
- strb r1, [r0]
- ldr r3, [r3]
- add r3, r3, #0x34
- add r3, r3, r5
- ldrb r1, [r3]
- lsl r0, r1, #0x4
- add r0, r0, r1
- lsl r0, r0, #0x2
- add r0, r0, r6
- mov r2, #0x0
- mov r9, r2
- mov r1, #0x14
- strh r1, [r0, #0x2e]
- ldrb r0, [r3]
- lsl r2, r0, #0x4
- add r2, r2, r0
- lsl r2, r2, #0x2
- add r2, r2, r6
- lsl r4, r5, #0x1
- mov r1, sl
- add r0, r4, r1
- ldrb r1, [r0]
- add r0, r5, #0x1
- lsl r0, r0, #0x1
- add r0, r0, sl
- ldrb r0, [r0]
- add r1, r1, r0
- asr r1, r1, #0x1
- lsl r1, r1, #0x3
- add r1, r1, #0xe
- strh r1, [r2, #0x32]
- ldrb r0, [r3]
- lsl r1, r0, #0x4
- add r1, r1, r0
- lsl r1, r1, #0x2
- add r1, r1, r6
- mov r0, sl
- add r0, r0, #0x1
- add r4, r4, r0
- ldrb r0, [r4]
- lsl r0, r0, #0x3
- sub r0, r0, #0xc
- strh r0, [r1, #0x36]
- ldrb r1, [r3]
- lsl r0, r1, #0x4
- add r0, r0, r1
- lsl r0, r0, #0x2
- add r0, r0, r6
- mov r1, ip
- bl oamt_set_x3A_32
- ldr r2, .L651+0xc
- ldr r1, [r2]
- add r1, r1, #0x80
- add r1, r1, r7
- ldrb r0, [r1]
- add r0, r0, #0x1
- strb r0, [r1]
- ldr r0, [r2]
- add r0, r0, #0x34
- add r0, r0, r5
- ldrb r1, [r0]
- lsl r0, r1, #0x4
- add r0, r0, r1
- lsl r0, r0, #0x2
- add r0, r0, r6
- bl sub_8078A34
- bl HandleDestroyMenuCursors
- ldr r3, .L651+0xc
- ldr r0, [r3]
- add r0, r0, #0x4
- ldr r1, .L651+0x10
- mov r5, r8
- add r2, r5, r1
- ldrb r2, [r2]
- add r1, r1, #0x1
- add r1, r1, r8
- ldrb r1, [r1]
- str r1, [sp]
- mov r1, #0x13
- str r1, [sp, #0x4]
- mov r1, #0x0
- mov r3, #0x0
- bl FillWindowRect_DefaultPalette
- ldr r1, .L651+0xc
- ldr r0, [r1]
- add r0, r0, #0xc8
- ldr r2, [sp, #0x7c]
- sub r1, r2, r7
- lsl r1, r1, #0x18
- lsr r1, r1, #0x18
- ldr r3, .L651+0x14
- mov r2, #0xf
- str r2, [sp]
- mov r2, #0x11
- str r2, [sp, #0x4]
- mov r5, r9
- str r5, [sp, #0x8]
- mov r2, #0x0
- bl sub_804A96C
- ldr r0, [sp, #0x6c]
- cmp r0, #0
- beq .LCB5578
- b .L633 @long jump
- .LCB5578:
- bl sub_804A80C
- b .L633
- .L652:
- .align 2, 0
- .L651:
- .word gSprites
- .word gTradeMonSpriteCoords
- .word sub_809D62C
- .word gUnknown_03004824
- .word gUnknown_0820C330
- .word gTradePartyBoxTilemap
- .L641:
- ldr r2, .L653
- ldr r1, [sp, #0x6c]
- lsl r0, r1, #0x1
- add r0, r0, r1
- lsl r0, r0, #0x1
- ldr r1, [sp, #0x70]
- add r0, r1, r0
- add r1, r5, #0
- add r1, r1, #0x34
- add r1, r1, r0
- ldrb r1, [r1]
- lsl r0, r1, #0x4
- add r0, r0, r1
- lsl r0, r0, #0x2
- add r2, r2, #0x1c
- add r0, r0, r2
- ldr r1, [r0]
- ldr r0, .L653+0x4
- cmp r1, r0
- beq .LCB5614
- b .L633 @long jump
- .LCB5614:
- mov r0, #0x3
- strb r0, [r3]
- b .L633
- .L654:
- .align 2, 0
- .L653:
- .word gSprites
- .word sub_809D62C
- .L643:
- add r0, r5, #0
- add r0, r0, #0xc8
- ldr r2, [sp, #0x6c]
- lsl r1, r2, #0x4
- sub r1, r1, r2
- lsl r1, r1, #0x18
- lsr r1, r1, #0x18
- ldr r3, .L655
- mov r2, #0xf
- str r2, [sp]
- mov r5, #0x11
- str r5, [sp, #0x4]
- mov r2, #0x0
- mov r8, r2
- str r2, [sp, #0x8]
- bl sub_804A96C
- ldr r3, .L655+0x4
- mov ip, r3
- ldr r5, .L655+0x8
- ldr r3, [r5]
- ldr r0, [sp, #0x6c]
- lsl r0, r0, #0x1
- mov r9, r0
- ldr r1, [sp, #0x6c]
- add r1, r1, r9
- str r1, [sp, #0x74]
- lsl r1, r1, #0x1
- ldr r2, [sp, #0x70]
- add r1, r2, r1
- add r3, r3, #0x34
- add r3, r3, r1
- ldrb r0, [r3]
- lsl r2, r0, #0x4
- add r2, r2, r0
- lsl r2, r2, #0x2
- add r2, r2, ip
- ldr r4, .L655+0xc
- lsl r5, r1, #0x1
- add r0, r5, r4
- ldrb r0, [r0]
- add r1, r1, #0x1
- lsl r1, r1, #0x1
- add r1, r1, r4
- ldrb r1, [r1]
- add r0, r0, r1
- asr r0, r0, #0x1
- lsl r0, r0, #0x3
- add r0, r0, #0xe
- strh r0, [r2, #0x20]
- ldrb r0, [r3]
- lsl r1, r0, #0x4
- add r1, r1, r0
- lsl r1, r1, #0x2
- add r1, r1, ip
- add r4, r4, #0x1
- add r5, r5, r4
- ldrb r0, [r5]
- lsl r0, r0, #0x3
- sub r0, r0, #0xc
- strh r0, [r1, #0x22]
- ldrb r1, [r3]
- lsl r0, r1, #0x4
- add r0, r0, r1
- lsl r0, r0, #0x2
- add r0, r0, ip
- mov r5, r8
- strh r5, [r0, #0x24]
- ldrb r1, [r3]
- lsl r0, r1, #0x4
- add r0, r0, r1
- lsl r0, r0, #0x2
- add r0, r0, ip
- strh r5, [r0, #0x26]
- mov r0, sp
- add r0, r0, #0x12
- ldr r1, [sp, #0x6c]
- ldr r2, [sp, #0x70]
- bl sub_804A2B4
- add r1, sp, #0xc
- mov r3, #0xfc
- strb r3, [r1]
- add r2, r1, #0
- mov r1, #0x6
- strb r1, [r2, #0x1]
- mov r1, #0x4
- strb r1, [r2, #0x2]
- add r1, r2, #0
- strb r3, [r1, #0x3]
- mov r2, #0x11
- strb r2, [r1, #0x4]
- add r2, r1, #0
- lsl r0, r0, #0x18
- asr r0, r0, #0x18
- mov r1, #0x40
- sub r1, r1, r0
- lsr r0, r1, #0x1f
- add r1, r1, r0
- asr r1, r1, #0x1
- strb r1, [r2, #0x5]
- ldr r3, .L655+0x8
- ldr r1, [r3]
- add r0, r1, #0x4
- add r1, r1, #0x7a
- ldrb r2, [r1]
- ldr r5, [sp, #0x74]
- lsl r5, r5, #0x6
- str r5, [sp, #0x78]
- add r2, r2, r5
- ldr r4, .L655+0x10
- mov r3, r9
- add r1, r3, r4
- ldrb r3, [r1]
- add r5, r4, #0x1
- mov sl, r5
- add r9, r9, sl
- mov r5, r9
- ldrb r1, [r5]
- str r1, [sp]
- add r1, sp, #0xc
- bl sub_8003460
- add r0, sp, #0x34
- mov r8, r0
- ldr r1, [sp, #0x6c]
- ldr r2, [sp, #0x70]
- bl sub_804A33C
- ldr r1, .L655+0x8
- ldr r2, [r1]
- add r0, r2, #0x4
- ldr r1, .L655+0x14
- add r2, r2, #0x7a
- ldrb r2, [r2]
- ldr r3, [sp, #0x78]
- add r2, r2, r3
- add r2, r2, #0x20
- ldr r3, [sp, #0x6c]
- add r3, r3, #0x1
- lsl r3, r3, #0x1
- add r4, r3, r4
- ldrb r5, [r4]
- add r3, r3, sl
- ldrb r4, [r3]
- add r4, r4, #0x1
- lsl r4, r4, #0x18
- lsr r4, r4, #0x18
- str r4, [sp]
- add r3, r5, #0
- bl sub_8003460
- ldr r0, .L655+0x8
- ldr r1, [r0]
- add r0, r1, #0x4
- add r1, r1, #0x7a
- ldrb r2, [r1]
- ldr r1, [sp, #0x78]
- add r2, r2, r1
- add r2, r2, #0x26
- str r4, [sp]
- mov r1, r8
- add r3, r5, #0
- bl sub_8003460
- ldr r2, .L655+0x8
- ldr r1, [r2]
- b .L648
- .L656:
- .align 2, 0
- .L655:
- .word gTradePartyBoxTilemap
- .word gSprites
- .word gUnknown_03004824
- .word gTradeMonSpriteCoords
- .word gUnknown_0820C334
- .word gOtherText_Terminator2
- .L644:
- ldr r0, .L657
- ldr r0, [r0, #0x14]
- add r1, r5, #0
- add r1, r1, #0x7e
- ldrh r1, [r1]
- lsl r1, r1, #0x5
- ldr r3, .L657+0x4
- add r1, r1, r3
- mov r2, #0x14
- bl sub_804ACD8
- ldr r0, .L657+0x8
- lsl r1, r7, #0x1
- add r4, r1, r0
- ldrb r2, [r4]
- add r2, r2, #0x4
- lsl r2, r2, #0x18
- lsr r2, r2, #0x18
- add r0, r0, #0x1
- add r1, r1, r0
- ldrb r3, [r1]
- add r3, r3, #0x1
- lsl r3, r3, #0x18
- lsr r3, r3, #0x18
- ldrb r0, [r4]
- str r0, [sp]
- ldrb r0, [r1]
- str r0, [sp, #0x4]
- add r0, r7, #0
- ldr r1, [sp, #0x70]
- bl sub_804A51C
- ldr r5, .L657+0xc
- ldr r1, [r5]
- .L648:
- add r1, r1, #0x80
- add r1, r1, r7
- ldrb r0, [r1]
- add r0, r0, #0x1
- strb r0, [r1]
- .L633:
- add sp, sp, #0x80
- pop {r3, r4, r5}
- mov r8, r3
- mov r9, r4
- mov sl, r5
- pop {r4, r5, r6, r7}
- pop {r0}
- bx r0
- .L658:
- .align 2, 0
- .L657:
- .word gUnknown_0820C14C
- .word 0x6010000
- .word gUnknown_0820C3D1
- .word gUnknown_03004824
- .Lfe42:
- .size sub_8049ED4,.Lfe42-sub_8049ED4
- .align 2, 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement