Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- thumb_func_start sub_8049ED4
- sub_8049ED4: @ 8049ED4
- push {r4-r7,lr}
- mov r7, r10
- mov r6, r9
- mov r5, r8
- push {r5-r7}
- sub sp, 0x74
- lsls r0, 24
- lsrs r0, 24
- mov r10, r0
- ldr r0, _08049F24 @ =gUnknown_03004824
- ldr r5, [r0]
- adds r0, r5, 0
- adds r0, 0x82
- add r0, r10
- ldrb r0, [r0]
- movs r1, 0x1
- str r1, [sp, 0x6C]
- cmp r0, 0x5
- bhi _08049EFE
- movs r2, 0
- str r2, [sp, 0x6C]
- _08049EFE:
- movs r1, 0x6
- bl __umodsi3
- lsls r0, 24
- lsrs r0, 24
- mov r8, r0
- adds r0, r5, 0
- adds r0, 0x80
- mov r1, r10
- adds r3, r0, r1
- ldrb r0, [r3]
- cmp r0, 0x2
- bne _08049F1A
- b _0804A0AC
- _08049F1A:
- cmp r0, 0x2
- bgt _08049F28
- cmp r0, 0x1
- beq _08049F36
- b _0804A294
- .align 2, 0
- _08049F24: .4byte gUnknown_03004824
- _08049F28:
- cmp r0, 0x3
- bne _08049F2E
- b _0804A0E4
- _08049F2E:
- cmp r0, 0x4
- bne _08049F34
- b _0804A244
- _08049F34:
- b _0804A294
- _08049F36:
- movs r4, 0
- adds r0, r5, 0
- adds r0, 0x42
- add r0, r10
- ldr r7, _0804A094 @ =gSprites
- ldr r2, [sp, 0x6C]
- lsls r2, 1
- mov r9, r2
- ldr r3, _0804A098 @ =gTradeMonSpriteCoords
- mov r12, r3
- mov r5, r10
- lsls r5, 4
- str r5, [sp, 0x70]
- ldrb r0, [r0]
- cmp r4, r0
- bcs _08049F8E
- adds r6, r7, 0
- ldr r2, _0804A09C @ =gUnknown_03004824
- ldr r0, [sp, 0x6C]
- add r0, r9
- lsls r3, r0, 1
- movs r5, 0x4
- _08049F62:
- ldr r0, [r2]
- adds r1, r4, r3
- adds r0, 0x34
- adds r0, r1
- ldrb r1, [r0]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r6
- adds r0, 0x3E
- ldrb r1, [r0]
- orrs r1, r5
- strb r1, [r0]
- adds r0, r4, 0x1
- lsls r0, 24
- lsrs r4, r0, 24
- ldr r0, [r2]
- adds r0, 0x42
- add r0, r10
- ldrb r0, [r0]
- cmp r4, r0
- bcc _08049F62
- _08049F8E:
- ldr r1, _0804A09C @ =gUnknown_03004824
- ldr r0, [r1]
- ldr r5, [sp, 0x6C]
- add r5, r9
- lsls r3, r5, 1
- mov r2, r8
- adds r6, r2, r3
- adds r0, 0x34
- adds r0, r6
- ldrb r1, [r0]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r7
- adds r0, 0x3E
- ldrb r2, [r0]
- movs r1, 0x5
- negs r1, r1
- ands r1, r2
- strb r1, [r0]
- ldr r0, _0804A09C @ =gUnknown_03004824
- ldr r4, [r0]
- adds r4, 0x34
- adds r4, r6
- ldrb r1, [r4]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r7
- movs r1, 0x14
- strh r1, [r0, 0x2E]
- ldrb r0, [r4]
- lsls r2, r0, 4
- adds r2, r0
- lsls r2, 2
- adds r2, r7
- lsls r5, 2
- mov r1, r12
- adds r0, r5, r1
- ldrb r0, [r0]
- adds r3, 0x1
- lsls r3, 1
- add r3, r12
- ldrb r1, [r3]
- adds r0, r1
- asrs r0, 1
- lsls r0, 3
- adds r0, 0xE
- strh r0, [r2, 0x32]
- ldrb r0, [r4]
- lsls r1, r0, 4
- adds r1, r0
- lsls r1, 2
- adds r1, r7
- mov r0, r12
- adds r0, 0x1
- adds r5, r0
- ldrb r0, [r5]
- lsls r0, 3
- subs r0, 0xC
- strh r0, [r1, 0x36]
- ldrb r1, [r4]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r7
- ldr r1, _0804A0A0 @ =sub_809D62C
- bl oamt_set_x3A_32
- ldr r2, _0804A09C @ =gUnknown_03004824
- ldr r1, [r2]
- adds r1, 0x80
- add r1, r10
- ldrb r0, [r1]
- adds r0, 0x1
- strb r0, [r1]
- ldr r0, [r2]
- adds r0, 0x34
- adds r0, r6
- ldrb r1, [r0]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r7
- bl sub_8078A34
- bl HandleDestroyMenuCursors
- ldr r3, _0804A09C @ =gUnknown_03004824
- ldr r0, [r3]
- adds r0, 0x4
- ldr r1, _0804A0A4 @ =gUnknown_0820C330
- mov r5, r9
- adds r2, r5, r1
- ldrb r2, [r2]
- adds r1, 0x1
- add r1, r9
- ldrb r1, [r1]
- str r1, [sp]
- movs r1, 0x13
- str r1, [sp, 0x4]
- movs r1, 0
- movs r3, 0
- bl FillWindowRect_DefaultPalette
- ldr r1, _0804A09C @ =gUnknown_03004824
- ldr r0, [r1]
- adds r0, 0xC8
- ldr r2, [sp, 0x70]
- mov r3, r10
- subs r1, r2, r3
- lsls r1, 24
- lsrs r1, 24
- ldr r3, _0804A0A8 @ =gTradePartyBoxTilemap
- movs r2, 0xF
- str r2, [sp]
- movs r2, 0x11
- str r2, [sp, 0x4]
- movs r5, 0
- str r5, [sp, 0x8]
- movs r2, 0
- bl sub_804A96C_alt
- ldr r0, [sp, 0x6C]
- cmp r0, 0
- beq _0804A08C
- b _0804A294
- _0804A08C:
- bl sub_804A80C
- b _0804A294
- .align 2, 0
- _0804A094: .4byte gSprites
- _0804A098: .4byte gTradeMonSpriteCoords
- _0804A09C: .4byte gUnknown_03004824
- _0804A0A0: .4byte sub_809D62C
- _0804A0A4: .4byte gUnknown_0820C330
- _0804A0A8: .4byte gTradePartyBoxTilemap
- _0804A0AC:
- ldr r2, _0804A0DC @ =gSprites
- ldr r1, [sp, 0x6C]
- lsls r0, r1, 1
- adds r0, r1
- lsls r0, 1
- add r0, r8
- adds r1, r5, 0
- adds r1, 0x34
- adds r1, r0
- ldrb r1, [r1]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r2, 0x1C
- adds r0, r2
- ldr r1, [r0]
- ldr r0, _0804A0E0 @ =sub_809D62C
- cmp r1, r0
- beq _0804A0D4
- b _0804A294
- _0804A0D4:
- movs r0, 0x3
- strb r0, [r3]
- b _0804A294
- .align 2, 0
- _0804A0DC: .4byte gSprites
- _0804A0E0: .4byte sub_809D62C
- _0804A0E4:
- adds r0, r5, 0
- adds r0, 0xC8
- ldr r2, [sp, 0x6C]
- lsls r1, r2, 4
- subs r1, r2
- lsls r1, 24
- lsrs r1, 24
- ldr r3, _0804A228 @ =gTradeMovesBoxTilemap
- movs r2, 0xF
- str r2, [sp]
- movs r7, 0x11
- str r7, [sp, 0x4]
- movs r5, 0
- str r5, [sp, 0x8]
- movs r2, 0
- bl sub_804A96C_alt
- ldr r0, _0804A22C @ =gUnknown_03004824
- ldr r3, [r0]
- ldr r1, [sp, 0x6C]
- lsls r6, r1, 1
- adds r1, r6
- mov r9, r1
- lsls r1, 1
- mov r2, r8
- adds r0, r2, r1
- adds r3, 0x34
- adds r3, r0
- ldrb r0, [r3]
- lsls r2, r0, 4
- adds r2, r0
- lsls r2, 2
- ldr r5, _0804A230 @ =gSprites
- adds r2, r5
- ldr r4, _0804A234 @ =gTradeMonSpriteCoords
- mov r0, r9
- lsls r5, r0, 2
- adds r0, r5, r4
- ldrb r0, [r0]
- adds r1, 0x1
- lsls r1, 1
- adds r1, r4
- ldrb r1, [r1]
- adds r0, r1
- asrs r0, 1
- lsls r0, 3
- adds r0, 0xE
- strh r0, [r2, 0x20]
- ldrb r0, [r3]
- lsls r1, r0, 4
- adds r1, r0
- lsls r1, 2
- ldr r2, _0804A230 @ =gSprites
- adds r1, r2
- adds r4, 0x1
- adds r5, r4
- ldrb r0, [r5]
- lsls r0, 3
- subs r0, 0xC
- strh r0, [r1, 0x22]
- ldrb r1, [r3]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r2
- movs r5, 0
- strh r5, [r0, 0x24]
- ldrb r1, [r3]
- lsls r0, r1, 4
- adds r0, r1
- lsls r0, 2
- adds r0, r2
- strh r5, [r0, 0x26]
- mov r0, sp
- adds r0, 0x12
- ldr r1, [sp, 0x6C]
- mov r2, r8
- bl sub_804A2B4
- add r1, sp, 0xC
- movs r3, 0xFC
- strb r3, [r1]
- adds r2, r1, 0
- movs r1, 0x6
- strb r1, [r2, 0x1]
- movs r1, 0x4
- strb r1, [r2, 0x2]
- adds r1, r2, 0
- strb r3, [r1, 0x3]
- strb r7, [r1, 0x4]
- lsls r0, 24
- asrs r0, 24
- movs r1, 0x40
- subs r1, r0
- lsrs r0, r1, 31
- adds r1, r0
- asrs r1, 1
- strb r1, [r2, 0x5]
- ldr r0, _0804A22C @ =gUnknown_03004824
- ldr r1, [r0]
- adds r0, r1, 0x4
- adds r1, 0x7A
- ldrb r2, [r1]
- mov r1, r9
- lsls r1, 6
- mov r9, r1
- add r2, r9
- ldr r4, _0804A238 @ =gUnknown_0820C334
- ldr r3, [sp, 0x6C]
- lsls r1, r3, 2
- adds r3, r1, r4
- ldrb r3, [r3]
- ldr r5, _0804A23C @ =gUnknown_0820C334 + 0x1
- adds r1, r5
- ldrb r1, [r1]
- str r1, [sp]
- add r1, sp, 0xC
- bl sub_8003460
- add r7, sp, 0x34
- adds r0, r7, 0
- ldr r1, [sp, 0x6C]
- mov r2, r8
- bl sub_804A33C
- ldr r0, _0804A22C @ =gUnknown_03004824
- ldr r2, [r0]
- adds r0, r2, 0x4
- ldr r1, _0804A240 @ =gOtherText_Terminator2
- adds r2, 0x7A
- ldrb r2, [r2]
- add r2, r9
- adds r2, 0x20
- adds r6, 0x1
- lsls r6, 1
- adds r4, r6, r4
- ldrb r5, [r4]
- ldr r3, _0804A23C @ =gUnknown_0820C334 + 0x1
- adds r6, r3
- ldrb r4, [r6]
- adds r4, 0x1
- lsls r4, 24
- lsrs r4, 24
- str r4, [sp]
- adds r3, r5, 0
- bl sub_8003460
- ldr r0, _0804A22C @ =gUnknown_03004824
- ldr r1, [r0]
- adds r0, r1, 0x4
- adds r1, 0x7A
- ldrb r2, [r1]
- add r2, r9
- adds r2, 0x26
- str r4, [sp]
- adds r1, r7, 0
- adds r3, r5, 0
- bl sub_8003460
- ldr r2, _0804A22C @ =gUnknown_03004824
- ldr r1, [r2]
- b _0804A28A
- .align 2, 0
- _0804A228: .4byte gTradeMovesBoxTilemap
- _0804A22C: .4byte gUnknown_03004824
- _0804A230: .4byte gSprites
- _0804A234: .4byte gTradeMonSpriteCoords
- _0804A238: .4byte gUnknown_0820C334
- _0804A23C: .4byte gUnknown_0820C334 + 0x1
- _0804A240: .4byte gOtherText_Terminator2
- _0804A244:
- ldr r0, _0804A2A4 @ =gUnknown_0820C14C
- ldr r0, [r0, 0x14]
- adds r1, r5, 0
- adds r1, 0x7E
- ldrh r1, [r1]
- lsls r1, 5
- ldr r3, _0804A2A8 @ =0x06010000
- adds r1, r3
- movs r2, 0x14
- bl sub_804ACD8
- ldr r0, _0804A2AC @ =gUnknown_0820C3D1
- mov r5, r10
- lsls r1, r5, 1
- adds r4, r1, r0
- ldrb r2, [r4]
- adds r2, 0x4
- lsls r2, 24
- lsrs r2, 24
- adds r0, 0x1
- adds r1, r0
- ldrb r3, [r1]
- adds r3, 0x1
- lsls r3, 24
- lsrs r3, 24
- ldrb r0, [r4]
- str r0, [sp]
- ldrb r0, [r1]
- str r0, [sp, 0x4]
- mov r0, r10
- mov r1, r8
- bl sub_804A51C
- ldr r0, _0804A2B0 @ =gUnknown_03004824
- ldr r1, [r0]
- _0804A28A:
- adds r1, 0x80
- add r1, r10
- ldrb r0, [r1]
- adds r0, 0x1
- strb r0, [r1]
- _0804A294:
- add sp, 0x74
- pop {r3-r5}
- mov r8, r3
- mov r9, r4
- mov r10, r5
- pop {r4-r7}
- pop {r0}
- bx r0
- .align 2, 0
- _0804A2A4: .4byte gUnknown_0820C14C
- _0804A2A8: .4byte 0x06010000
- _0804A2AC: .4byte gUnknown_0820C3D1
- _0804A2B0: .4byte gUnknown_03004824
- thumb_func_end sub_8049ED4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement